meson-gxm-khadas-vim2.dts 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2017 Martin Blumenstingl <[email protected]>.
  4. * Copyright (c) 2017 BayLibre, SAS
  5. * Author: Neil Armstrong <[email protected]>
  6. */
  7. /dts-v1/;
  8. #include "meson-gxm.dtsi"
  9. #include <dt-bindings/input/input.h>
  10. #include <dt-bindings/sound/meson-aiu.h>
  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. led-controller {
  70. compatible = "pwm-leds";
  71. led-1 {
  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. hdmi_5v: regulator-hdmi-5v {
  85. compatible = "regulator-fixed";
  86. regulator-name = "HDMI_5V";
  87. regulator-min-microvolt = <5000000>;
  88. regulator-max-microvolt = <5000000>;
  89. gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
  90. enable-active-high;
  91. regulator-always-on;
  92. };
  93. vcc_3v3: regulator-vcc_3v3 {
  94. compatible = "regulator-fixed";
  95. regulator-name = "VCC_3V3";
  96. regulator-min-microvolt = <3300000>;
  97. regulator-max-microvolt = <3300000>;
  98. };
  99. vddio_ao18: regulator-vddio_ao18 {
  100. compatible = "regulator-fixed";
  101. regulator-name = "VDDIO_AO18";
  102. regulator-min-microvolt = <1800000>;
  103. regulator-max-microvolt = <1800000>;
  104. };
  105. vddio_boot: regulator-vddio_boot {
  106. compatible = "regulator-fixed";
  107. regulator-name = "VDDIO_BOOT";
  108. regulator-min-microvolt = <1800000>;
  109. regulator-max-microvolt = <1800000>;
  110. };
  111. vddao_3v3: regulator-vddao_3v3 {
  112. compatible = "regulator-fixed";
  113. regulator-name = "VDDAO_3V3";
  114. regulator-min-microvolt = <3300000>;
  115. regulator-max-microvolt = <3300000>;
  116. };
  117. wifi32k: wifi32k {
  118. compatible = "pwm-clock";
  119. #clock-cells = <0>;
  120. clock-frequency = <32768>;
  121. pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
  122. };
  123. sound {
  124. compatible = "amlogic,gx-sound-card";
  125. model = "KHADAS-VIM2";
  126. assigned-clocks = <&clkc CLKID_MPLL0>,
  127. <&clkc CLKID_MPLL1>,
  128. <&clkc CLKID_MPLL2>;
  129. assigned-clock-parents = <0>, <0>, <0>;
  130. assigned-clock-rates = <294912000>,
  131. <270950400>,
  132. <393216000>;
  133. status = "okay";
  134. dai-link-0 {
  135. sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
  136. };
  137. dai-link-1 {
  138. sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
  139. dai-format = "i2s";
  140. mclk-fs = <256>;
  141. codec-0 {
  142. sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
  143. };
  144. };
  145. dai-link-2 {
  146. sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
  147. codec-0 {
  148. sound-dai = <&hdmi_tx>;
  149. };
  150. };
  151. };
  152. };
  153. &aiu {
  154. status = "okay";
  155. };
  156. &cec_AO {
  157. status = "okay";
  158. pinctrl-0 = <&ao_cec_pins>;
  159. pinctrl-names = "default";
  160. hdmi-phandle = <&hdmi_tx>;
  161. };
  162. &cpu_cooling_maps {
  163. map0 {
  164. cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
  165. };
  166. map1 {
  167. cooling-device = <&gpio_fan 2 THERMAL_NO_LIMIT>,
  168. <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
  169. <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
  170. <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
  171. <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
  172. <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
  173. <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
  174. <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
  175. <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
  176. };
  177. };
  178. &ethmac {
  179. pinctrl-0 = <&eth_pins>;
  180. pinctrl-names = "default";
  181. /* Select external PHY by default */
  182. phy-handle = <&external_phy>;
  183. amlogic,tx-delay-ns = <2>;
  184. /* External PHY is in RGMII */
  185. phy-mode = "rgmii";
  186. status = "okay";
  187. };
  188. &external_mdio {
  189. external_phy: ethernet-phy@0 {
  190. /* Realtek RTL8211F (0x001cc916) */
  191. reg = <0>;
  192. reset-assert-us = <10000>;
  193. reset-deassert-us = <80000>;
  194. reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
  195. interrupt-parent = <&gpio_intc>;
  196. /* MAC_INTR on GPIOZ_15 */
  197. interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
  198. };
  199. };
  200. &hdmi_tx {
  201. status = "okay";
  202. pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
  203. pinctrl-names = "default";
  204. hdmi-supply = <&hdmi_5v>;
  205. };
  206. &hdmi_tx_tmds_port {
  207. hdmi_tx_tmds_out: endpoint {
  208. remote-endpoint = <&hdmi_connector_in>;
  209. };
  210. };
  211. &i2c_A {
  212. status = "okay";
  213. pinctrl-0 = <&i2c_a_pins>;
  214. pinctrl-names = "default";
  215. };
  216. &i2c_B {
  217. status = "okay";
  218. pinctrl-0 = <&i2c_b_pins>;
  219. pinctrl-names = "default";
  220. rtc: rtc@51 {
  221. status = "okay";
  222. compatible = "haoyu,hym8563";
  223. reg = <0x51>;
  224. #clock-cells = <0>;
  225. clock-frequency = <32768>;
  226. clock-output-names = "xin32k";
  227. };
  228. };
  229. &ir {
  230. status = "okay";
  231. pinctrl-0 = <&remote_input_ao_pins>;
  232. pinctrl-names = "default";
  233. linux,rc-map-name = "rc-khadas";
  234. };
  235. &pwm_AO_ab {
  236. status = "okay";
  237. pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>;
  238. pinctrl-names = "default";
  239. clocks = <&clkc CLKID_FCLK_DIV4>;
  240. clock-names = "clkin0";
  241. };
  242. &pwm_ef {
  243. status = "okay";
  244. pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>;
  245. pinctrl-names = "default";
  246. clocks = <&clkc CLKID_FCLK_DIV4>;
  247. clock-names = "clkin0";
  248. };
  249. &sd_emmc_a {
  250. status = "okay";
  251. pinctrl-0 = <&sdio_pins>;
  252. pinctrl-1 = <&sdio_clk_gate_pins>;
  253. pinctrl-names = "default", "clk-gate";
  254. #address-cells = <1>;
  255. #size-cells = <0>;
  256. bus-width = <4>;
  257. cap-sd-highspeed;
  258. max-frequency = <100000000>;
  259. non-removable;
  260. disable-wp;
  261. /* WiFi firmware requires power to be kept while in suspend */
  262. keep-power-in-suspend;
  263. mmc-pwrseq = <&sdio_pwrseq>;
  264. vmmc-supply = <&vddao_3v3>;
  265. vqmmc-supply = <&vddio_boot>;
  266. brcmf: wifi@1 {
  267. reg = <1>;
  268. compatible = "brcm,bcm4329-fmac";
  269. };
  270. };
  271. /* SD card */
  272. &sd_emmc_b {
  273. status = "okay";
  274. pinctrl-0 = <&sdcard_pins>;
  275. pinctrl-1 = <&sdcard_clk_gate_pins>;
  276. pinctrl-names = "default", "clk-gate";
  277. bus-width = <4>;
  278. cap-sd-highspeed;
  279. max-frequency = <50000000>;
  280. disable-wp;
  281. cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
  282. vmmc-supply = <&vddao_3v3>;
  283. vqmmc-supply = <&vddio_boot>;
  284. };
  285. /* eMMC */
  286. &sd_emmc_c {
  287. status = "okay";
  288. pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
  289. pinctrl-1 = <&emmc_clk_gate_pins>;
  290. pinctrl-names = "default", "clk-gate";
  291. bus-width = <8>;
  292. cap-mmc-highspeed;
  293. max-frequency = <200000000>;
  294. non-removable;
  295. disable-wp;
  296. mmc-ddr-1_8v;
  297. mmc-hs200-1_8v;
  298. mmc-pwrseq = <&emmc_pwrseq>;
  299. vmmc-supply = <&vcc_3v3>;
  300. vqmmc-supply = <&vddio_boot>;
  301. };
  302. /*
  303. * EMMC_DS pin is shared between SPI NOR CS and eMMC Data Strobe
  304. * Remove emmc_ds_pins from sd_emmc_c pinctrl-0 then spifc can be enabled
  305. */
  306. &spifc {
  307. status = "disabled";
  308. pinctrl-0 = <&nor_pins>;
  309. pinctrl-names = "default";
  310. w25q32: flash@0 {
  311. #address-cells = <1>;
  312. #size-cells = <1>;
  313. compatible = "winbond,w25q16", "jedec,spi-nor";
  314. reg = <0>;
  315. spi-max-frequency = <104000000>;
  316. };
  317. };
  318. /* This one is connected to the Bluetooth module */
  319. &uart_A {
  320. status = "okay";
  321. pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
  322. pinctrl-names = "default";
  323. uart-has-rtscts;
  324. bluetooth {
  325. compatible = "brcm,bcm43438-bt";
  326. shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
  327. max-speed = <2000000>;
  328. clocks = <&wifi32k>;
  329. clock-names = "lpo";
  330. };
  331. };
  332. /* This is brought out on the Linux_RX (18) and Linux_TX (19) pins: */
  333. &uart_AO {
  334. status = "okay";
  335. pinctrl-0 = <&uart_ao_a_pins>;
  336. pinctrl-names = "default";
  337. };
  338. /* This is brought out on the UART_RX_AO_B (15) and UART_TX_AO_B (16) pins: */
  339. &uart_AO_B {
  340. status = "okay";
  341. pinctrl-0 = <&uart_ao_b_pins>;
  342. pinctrl-names = "default";
  343. };
  344. &saradc {
  345. status = "okay";
  346. vref-supply = <&vddio_ao18>;
  347. };
  348. &usb {
  349. status = "okay";
  350. dr_mode = "peripheral";
  351. };