meson-gxm-khadas-vim2.dts 8.3 KB

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