meson-gxm-khadas-vim2.dts 7.7 KB

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