meson-gxm-khadas-vim2.dts 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
  4. * Copyright (c) 2017 BayLibre, SAS
  5. * Author: Neil Armstrong <narmstrong@baylibre.com>
  6. */
  7. /dts-v1/;
  8. #include <dt-bindings/input/input.h>
  9. #include <dt-bindings/thermal/thermal.h>
  10. #include "meson-gxm.dtsi"
  11. / {
  12. compatible = "khadas,vim2", "amlogic,s912", "amlogic,meson-gxm";
  13. model = "Khadas VIM2";
  14. aliases {
  15. serial0 = &uart_AO;
  16. serial1 = &uart_A;
  17. serial2 = &uart_AO_B;
  18. };
  19. chosen {
  20. stdout-path = "serial0:115200n8";
  21. };
  22. memory@0 {
  23. device_type = "memory";
  24. reg = <0x0 0x0 0x0 0x80000000>;
  25. };
  26. adc-keys {
  27. compatible = "adc-keys";
  28. io-channels = <&saradc 0>;
  29. io-channel-names = "buttons";
  30. keyup-threshold-microvolt = <1710000>;
  31. button-function {
  32. label = "Function";
  33. linux,code = <KEY_FN>;
  34. press-threshold-microvolt = <10000>;
  35. };
  36. };
  37. emmc_pwrseq: emmc-pwrseq {
  38. compatible = "mmc-pwrseq-emmc";
  39. reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
  40. };
  41. gpio_fan: gpio-fan {
  42. compatible = "gpio-fan";
  43. gpios = <&gpio GPIODV_14 GPIO_ACTIVE_HIGH
  44. &gpio GPIODV_15 GPIO_ACTIVE_HIGH>;
  45. /* Dummy RPM values since fan is optional */
  46. gpio-fan,speed-map = <0 0
  47. 1 1
  48. 2 2
  49. 3 3>;
  50. #cooling-cells = <2>;
  51. };
  52. gpio-keys-polled {
  53. compatible = "gpio-keys-polled";
  54. #address-cells = <1>;
  55. #size-cells = <0>;
  56. poll-interval = <100>;
  57. button@0 {
  58. label = "power";
  59. linux,code = <KEY_POWER>;
  60. gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
  61. };
  62. };
  63. hdmi-connector {
  64. compatible = "hdmi-connector";
  65. type = "a";
  66. port {
  67. hdmi_connector_in: endpoint {
  68. remote-endpoint = <&hdmi_tx_tmds_out>;
  69. };
  70. };
  71. };
  72. pwmleds {
  73. compatible = "pwm-leds";
  74. power {
  75. label = "vim:red:power";
  76. pwms = <&pwm_AO_ab 1 7812500 0>;
  77. max-brightness = <255>;
  78. linux,default-trigger = "default-on";
  79. };
  80. };
  81. sdio_pwrseq: sdio-pwrseq {
  82. compatible = "mmc-pwrseq-simple";
  83. reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
  84. clocks = <&wifi32k>;
  85. clock-names = "ext_clock";
  86. };
  87. thermal-zones {
  88. cpu-thermal {
  89. polling-delay-passive = <250>; /* milliseconds */
  90. polling-delay = <1000>; /* milliseconds */
  91. thermal-sensors = <&scpi_sensors 0>;
  92. trips {
  93. cpu_alert0: cpu-alert0 {
  94. temperature = <70000>; /* millicelsius */
  95. hysteresis = <2000>; /* millicelsius */
  96. type = "active";
  97. };
  98. cpu_alert1: cpu-alert1 {
  99. temperature = <80000>; /* millicelsius */
  100. hysteresis = <2000>; /* millicelsius */
  101. type = "passive";
  102. };
  103. };
  104. cooling-maps {
  105. map0 {
  106. trip = <&cpu_alert0>;
  107. cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
  108. };
  109. map1 {
  110. trip = <&cpu_alert1>;
  111. cooling-device = <&gpio_fan 2 THERMAL_NO_LIMIT>;
  112. };
  113. map2 {
  114. trip = <&cpu_alert1>;
  115. cooling-device =
  116. <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
  117. };
  118. map3 {
  119. trip = <&cpu_alert1>;
  120. cooling-device =
  121. <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
  122. };
  123. };
  124. };
  125. };
  126. hdmi_5v: regulator-hdmi-5v {
  127. compatible = "regulator-fixed";
  128. regulator-name = "HDMI_5V";
  129. regulator-min-microvolt = <5000000>;
  130. regulator-max-microvolt = <5000000>;
  131. gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
  132. enable-active-high;
  133. regulator-always-on;
  134. };
  135. vcc_3v3: regulator-vcc_3v3 {
  136. compatible = "regulator-fixed";
  137. regulator-name = "VCC_3V3";
  138. regulator-min-microvolt = <3300000>;
  139. regulator-max-microvolt = <3300000>;
  140. };
  141. vddio_ao18: regulator-vddio_ao18 {
  142. compatible = "regulator-fixed";
  143. regulator-name = "VDDIO_AO18";
  144. regulator-min-microvolt = <1800000>;
  145. regulator-max-microvolt = <1800000>;
  146. };
  147. vddio_boot: regulator-vddio_boot {
  148. compatible = "regulator-fixed";
  149. regulator-name = "VDDIO_BOOT";
  150. regulator-min-microvolt = <1800000>;
  151. regulator-max-microvolt = <1800000>;
  152. };
  153. vddao_3v3: regulator-vddao_3v3 {
  154. compatible = "regulator-fixed";
  155. regulator-name = "VDDAO_3V3";
  156. regulator-min-microvolt = <3300000>;
  157. regulator-max-microvolt = <3300000>;
  158. };
  159. wifi32k: wifi32k {
  160. compatible = "pwm-clock";
  161. #clock-cells = <0>;
  162. clock-frequency = <32768>;
  163. pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
  164. };
  165. };
  166. &cec_AO {
  167. status = "okay";
  168. pinctrl-0 = <&ao_cec_pins>;
  169. pinctrl-names = "default";
  170. hdmi-phandle = <&hdmi_tx>;
  171. };
  172. &cpu0 {
  173. #cooling-cells = <2>;
  174. };
  175. &cpu1 {
  176. #cooling-cells = <2>;
  177. };
  178. &cpu2 {
  179. #cooling-cells = <2>;
  180. };
  181. &cpu3 {
  182. #cooling-cells = <2>;
  183. };
  184. &cpu4 {
  185. #cooling-cells = <2>;
  186. };
  187. &cpu5 {
  188. #cooling-cells = <2>;
  189. };
  190. &cpu6 {
  191. #cooling-cells = <2>;
  192. };
  193. &cpu7 {
  194. #cooling-cells = <2>;
  195. };
  196. &ethmac {
  197. pinctrl-0 = <&eth_pins>;
  198. pinctrl-names = "default";
  199. /* Select external PHY by default */
  200. phy-handle = <&external_phy>;
  201. amlogic,tx-delay-ns = <2>;
  202. /* External PHY reset is shared with internal PHY Led signals */
  203. snps,reset-gpio = <&gpio GPIOZ_14 0>;
  204. snps,reset-delays-us = <0 10000 1000000>;
  205. snps,reset-active-low;
  206. /* External PHY is in RGMII */
  207. phy-mode = "rgmii";
  208. status = "okay";
  209. };
  210. &external_mdio {
  211. external_phy: ethernet-phy@0 {
  212. /* Realtek RTL8211F (0x001cc916) */
  213. reg = <0>;
  214. interrupt-parent = <&gpio_intc>;
  215. /* MAC_INTR on GPIOZ_15 */
  216. interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
  217. };
  218. };
  219. &hdmi_tx {
  220. status = "okay";
  221. pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
  222. pinctrl-names = "default";
  223. };
  224. &hdmi_tx_tmds_port {
  225. hdmi_tx_tmds_out: endpoint {
  226. remote-endpoint = <&hdmi_connector_in>;
  227. };
  228. };
  229. &i2c_A {
  230. status = "okay";
  231. pinctrl-0 = <&i2c_a_pins>;
  232. pinctrl-names = "default";
  233. };
  234. &i2c_B {
  235. status = "okay";
  236. pinctrl-0 = <&i2c_b_pins>;
  237. pinctrl-names = "default";
  238. rtc: rtc@51 {
  239. /* has to be enabled manually when a battery is connected: */
  240. status = "disabled";
  241. compatible = "haoyu,hym8563";
  242. reg = <0x51>;
  243. #clock-cells = <0>;
  244. clock-frequency = <32768>;
  245. clock-output-names = "xin32k";
  246. };
  247. };
  248. &ir {
  249. status = "okay";
  250. pinctrl-0 = <&remote_input_ao_pins>;
  251. pinctrl-names = "default";
  252. linux,rc-map-name = "rc-geekbox";
  253. };
  254. &pwm_AO_ab {
  255. status = "okay";
  256. pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>;
  257. pinctrl-names = "default";
  258. clocks = <&clkc CLKID_FCLK_DIV4>;
  259. clock-names = "clkin0";
  260. };
  261. &pwm_ef {
  262. status = "okay";
  263. pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>;
  264. pinctrl-names = "default";
  265. clocks = <&clkc CLKID_FCLK_DIV4>;
  266. clock-names = "clkin0";
  267. };
  268. &sd_emmc_a {
  269. status = "okay";
  270. pinctrl-0 = <&sdio_pins>;
  271. pinctrl-names = "default";
  272. #address-cells = <1>;
  273. #size-cells = <0>;
  274. bus-width = <4>;
  275. max-frequency = <100000000>;
  276. non-removable;
  277. disable-wp;
  278. mmc-pwrseq = <&sdio_pwrseq>;
  279. vmmc-supply = <&vddao_3v3>;
  280. vqmmc-supply = <&vddio_boot>;
  281. brcmf: wifi@1 {
  282. reg = <1>;
  283. compatible = "brcm,bcm4329-fmac";
  284. };
  285. };
  286. /* SD card */
  287. &sd_emmc_b {
  288. status = "okay";
  289. pinctrl-0 = <&sdcard_pins>;
  290. pinctrl-names = "default";
  291. bus-width = <4>;
  292. cap-sd-highspeed;
  293. max-frequency = <100000000>;
  294. disable-wp;
  295. cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
  296. cd-inverted;
  297. vmmc-supply = <&vddao_3v3>;
  298. vqmmc-supply = <&vddio_boot>;
  299. };
  300. /* eMMC */
  301. &sd_emmc_c {
  302. status = "okay";
  303. pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
  304. pinctrl-names = "default";
  305. bus-width = <8>;
  306. cap-sd-highspeed;
  307. cap-mmc-highspeed;
  308. max-frequency = <200000000>;
  309. non-removable;
  310. disable-wp;
  311. mmc-ddr-1_8v;
  312. mmc-hs200-1_8v;
  313. mmc-hs400-1_8v;
  314. mmc-pwrseq = <&emmc_pwrseq>;
  315. vmmc-supply = <&vcc_3v3>;
  316. vqmmc-supply = <&vddio_boot>;
  317. };
  318. /*
  319. * EMMC_DS pin is shared between SPI NOR CS and eMMC Data Strobe
  320. * Remove emmc_ds_pins from sd_emmc_c pinctrl-0 then spifc can be enabled
  321. */
  322. &spifc {
  323. status = "disabled";
  324. pinctrl-0 = <&nor_pins>;
  325. pinctrl-names = "default";
  326. w25q32: spi-flash@0 {
  327. #address-cells = <1>;
  328. #size-cells = <1>;
  329. compatible = "winbond,w25q16", "jedec,spi-nor";
  330. reg = <0>;
  331. spi-max-frequency = <3000000>;
  332. };
  333. };
  334. /* This one is connected to the Bluetooth module */
  335. &uart_A {
  336. status = "okay";
  337. pinctrl-0 = <&uart_a_pins>;
  338. pinctrl-names = "default";
  339. };
  340. /* This is brought out on the Linux_RX (18) and Linux_TX (19) pins: */
  341. &uart_AO {
  342. status = "okay";
  343. pinctrl-0 = <&uart_ao_a_pins>;
  344. pinctrl-names = "default";
  345. };
  346. /* This is brought out on the UART_RX_AO_B (15) and UART_TX_AO_B (16) pins: */
  347. &uart_AO_B {
  348. status = "okay";
  349. pinctrl-0 = <&uart_ao_b_pins>;
  350. pinctrl-names = "default";
  351. };
  352. &saradc {
  353. status = "okay";
  354. vref-supply = <&vddio_ao18>;
  355. };
  356. &usb0 {
  357. status = "okay";
  358. };