meson-khadas-vim3.dtsi 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2019 BayLibre, SAS
  4. * Author: Neil Armstrong <narmstrong@baylibre.com>
  5. * Copyright (c) 2019 Christian Hewitt <christianshewitt@gmail.com>
  6. */
  7. #include <dt-bindings/input/input.h>
  8. #include <dt-bindings/gpio/meson-g12a-gpio.h>
  9. / {
  10. model = "Khadas VIM3";
  11. aliases {
  12. serial0 = &uart_AO;
  13. ethernet0 = &ethmac;
  14. };
  15. chosen {
  16. stdout-path = "serial0:115200n8";
  17. };
  18. memory@0 {
  19. device_type = "memory";
  20. reg = <0x0 0x0 0x0 0x80000000>;
  21. };
  22. adc-keys {
  23. compatible = "adc-keys";
  24. io-channels = <&saradc 2>;
  25. io-channel-names = "buttons";
  26. keyup-threshold-microvolt = <1710000>;
  27. button-function {
  28. label = "Function";
  29. linux,code = <KEY_FN>;
  30. press-threshold-microvolt = <10000>;
  31. };
  32. };
  33. leds {
  34. compatible = "gpio-leds";
  35. white {
  36. label = "vim3:white:sys";
  37. gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
  38. linux,default-trigger = "heartbeat";
  39. };
  40. red {
  41. label = "vim3:red";
  42. gpios = <&gpio_expander 5 GPIO_ACTIVE_LOW>;
  43. };
  44. };
  45. emmc_pwrseq: emmc-pwrseq {
  46. compatible = "mmc-pwrseq-emmc";
  47. reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
  48. };
  49. gpio-keys-polled {
  50. compatible = "gpio-keys-polled";
  51. poll-interval = <100>;
  52. power-button {
  53. label = "power";
  54. linux,code = <KEY_POWER>;
  55. gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_LOW>;
  56. };
  57. };
  58. sdio_pwrseq: sdio-pwrseq {
  59. compatible = "mmc-pwrseq-simple";
  60. reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
  61. clocks = <&wifi32k>;
  62. clock-names = "ext_clock";
  63. };
  64. dc_in: regulator-dc_in {
  65. compatible = "regulator-fixed";
  66. regulator-name = "DC_IN";
  67. regulator-min-microvolt = <5000000>;
  68. regulator-max-microvolt = <5000000>;
  69. regulator-always-on;
  70. };
  71. vcc_5v: regulator-vcc_5v {
  72. compatible = "regulator-fixed";
  73. regulator-name = "VCC_5V";
  74. regulator-min-microvolt = <5000000>;
  75. regulator-max-microvolt = <5000000>;
  76. vin-supply = <&dc_in>;
  77. gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
  78. enable-active-high;
  79. };
  80. vcc_1v8: regulator-vcc_1v8 {
  81. compatible = "regulator-fixed";
  82. regulator-name = "VCC_1V8";
  83. regulator-min-microvolt = <1800000>;
  84. regulator-max-microvolt = <1800000>;
  85. vin-supply = <&vcc_3v3>;
  86. regulator-always-on;
  87. };
  88. vcc_3v3: regulator-vcc_3v3 {
  89. compatible = "regulator-fixed";
  90. regulator-name = "VCC_3V3";
  91. regulator-min-microvolt = <3300000>;
  92. regulator-max-microvolt = <3300000>;
  93. vin-supply = <&vsys_3v3>;
  94. regulator-always-on;
  95. /* FIXME: actually controlled by VDDCPU_B_EN */
  96. };
  97. vddao_1v8: regulator-vddao_1v8 {
  98. compatible = "regulator-fixed";
  99. regulator-name = "VDDIO_AO1V8";
  100. regulator-min-microvolt = <1800000>;
  101. regulator-max-microvolt = <1800000>;
  102. vin-supply = <&vsys_3v3>;
  103. regulator-always-on;
  104. };
  105. emmc_1v8: regulator-emmc_1v8 {
  106. compatible = "regulator-fixed";
  107. regulator-name = "EMMC_AO1V8";
  108. regulator-min-microvolt = <1800000>;
  109. regulator-max-microvolt = <1800000>;
  110. vin-supply = <&vcc_3v3>;
  111. regulator-always-on;
  112. };
  113. vsys_3v3: regulator-vsys_3v3 {
  114. compatible = "regulator-fixed";
  115. regulator-name = "VSYS_3V3";
  116. regulator-min-microvolt = <3300000>;
  117. regulator-max-microvolt = <3300000>;
  118. vin-supply = <&dc_in>;
  119. regulator-always-on;
  120. };
  121. usb_pwr: regulator-usb_pwr {
  122. compatible = "regulator-fixed";
  123. regulator-name = "USB_PWR";
  124. regulator-min-microvolt = <5000000>;
  125. regulator-max-microvolt = <5000000>;
  126. vin-supply = <&vcc_5v>;
  127. gpio = <&gpio GPIOA_6 GPIO_ACTIVE_HIGH>;
  128. enable-active-high;
  129. };
  130. hdmi-connector {
  131. compatible = "hdmi-connector";
  132. type = "a";
  133. port {
  134. hdmi_connector_in: endpoint {
  135. remote-endpoint = <&hdmi_tx_tmds_out>;
  136. };
  137. };
  138. };
  139. wifi32k: wifi32k {
  140. compatible = "pwm-clock";
  141. #clock-cells = <0>;
  142. clock-frequency = <32768>;
  143. pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
  144. };
  145. };
  146. &cec_AO {
  147. pinctrl-0 = <&cec_ao_a_h_pins>;
  148. pinctrl-names = "default";
  149. status = "disabled";
  150. hdmi-phandle = <&hdmi_tx>;
  151. };
  152. &cecb_AO {
  153. pinctrl-0 = <&cec_ao_b_h_pins>;
  154. pinctrl-names = "default";
  155. status = "okay";
  156. hdmi-phandle = <&hdmi_tx>;
  157. };
  158. &ext_mdio {
  159. external_phy: ethernet-phy@0 {
  160. /* Realtek RTL8211F (0x001cc916) */
  161. reg = <0>;
  162. max-speed = <1000>;
  163. interrupt-parent = <&gpio_intc>;
  164. /* MAC_INTR on GPIOZ_14 */
  165. interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
  166. };
  167. };
  168. &ethmac {
  169. pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
  170. pinctrl-names = "default";
  171. status = "okay";
  172. phy-mode = "rgmii";
  173. phy-handle = <&external_phy>;
  174. amlogic,tx-delay-ns = <2>;
  175. };
  176. &hdmi_tx {
  177. status = "okay";
  178. pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
  179. pinctrl-names = "default";
  180. hdmi-supply = <&vcc_5v>;
  181. };
  182. &hdmi_tx_tmds_port {
  183. hdmi_tx_tmds_out: endpoint {
  184. remote-endpoint = <&hdmi_connector_in>;
  185. };
  186. };
  187. &i2c_AO {
  188. status = "okay";
  189. pinctrl-0 = <&i2c_ao_sck_pins>, <&i2c_ao_sda_pins>;
  190. pinctrl-names = "default";
  191. gpio_expander: gpio-controller@20 {
  192. compatible = "ti,tca6408";
  193. reg = <0x20>;
  194. vcc-supply = <&vcc_3v3>;
  195. gpio-controller;
  196. #gpio-cells = <2>;
  197. };
  198. rtc@51 {
  199. compatible = "haoyu,hym8563";
  200. reg = <0x51>;
  201. #clock-cells = <0>;
  202. };
  203. };
  204. &ir {
  205. status = "okay";
  206. pinctrl-0 = <&remote_input_ao_pins>;
  207. pinctrl-names = "default";
  208. linux,rc-map-name = "rc-khadas";
  209. };
  210. &pcie {
  211. reset-gpios = <&gpio GPIOA_8 GPIO_ACTIVE_LOW>;
  212. };
  213. &pwm_ef {
  214. status = "okay";
  215. pinctrl-0 = <&pwm_e_pins>;
  216. pinctrl-names = "default";
  217. };
  218. &saradc {
  219. status = "okay";
  220. vref-supply = <&vddao_1v8>;
  221. };
  222. /* SDIO */
  223. &sd_emmc_a {
  224. status = "okay";
  225. pinctrl-0 = <&sdio_pins>;
  226. pinctrl-1 = <&sdio_clk_gate_pins>;
  227. pinctrl-names = "default", "clk-gate";
  228. #address-cells = <1>;
  229. #size-cells = <0>;
  230. bus-width = <4>;
  231. cap-sd-highspeed;
  232. sd-uhs-sdr50;
  233. max-frequency = <100000000>;
  234. non-removable;
  235. disable-wp;
  236. /* WiFi firmware requires power to be kept while in suspend */
  237. keep-power-in-suspend;
  238. mmc-pwrseq = <&sdio_pwrseq>;
  239. vmmc-supply = <&vsys_3v3>;
  240. vqmmc-supply = <&vddao_1v8>;
  241. brcmf: wifi@1 {
  242. reg = <1>;
  243. compatible = "brcm,bcm4329-fmac";
  244. };
  245. };
  246. /* SD card */
  247. &sd_emmc_b {
  248. status = "okay";
  249. pinctrl-0 = <&sdcard_c_pins>;
  250. pinctrl-1 = <&sdcard_clk_gate_c_pins>;
  251. pinctrl-names = "default", "clk-gate";
  252. bus-width = <4>;
  253. cap-sd-highspeed;
  254. max-frequency = <50000000>;
  255. disable-wp;
  256. cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
  257. vmmc-supply = <&vsys_3v3>;
  258. vqmmc-supply = <&vsys_3v3>;
  259. };
  260. /* eMMC */
  261. &sd_emmc_c {
  262. status = "okay";
  263. pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
  264. pinctrl-1 = <&emmc_clk_gate_pins>;
  265. pinctrl-names = "default", "clk-gate";
  266. bus-width = <8>;
  267. cap-mmc-highspeed;
  268. mmc-ddr-1_8v;
  269. mmc-hs200-1_8v;
  270. max-frequency = <200000000>;
  271. disable-wp;
  272. mmc-pwrseq = <&emmc_pwrseq>;
  273. vmmc-supply = <&vcc_3v3>;
  274. vqmmc-supply = <&emmc_1v8>;
  275. };
  276. &uart_A {
  277. status = "okay";
  278. pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
  279. pinctrl-names = "default";
  280. uart-has-rtscts;
  281. bluetooth {
  282. compatible = "brcm,bcm43438-bt";
  283. shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
  284. max-speed = <2000000>;
  285. clocks = <&wifi32k>;
  286. clock-names = "lpo";
  287. };
  288. };
  289. &uart_AO {
  290. status = "okay";
  291. pinctrl-0 = <&uart_ao_a_pins>;
  292. pinctrl-names = "default";
  293. };
  294. &usb2_phy0 {
  295. phy-supply = <&dc_in>;
  296. };
  297. &usb2_phy1 {
  298. phy-supply = <&usb_pwr>;
  299. };
  300. &usb3_pcie_phy {
  301. phy-supply = <&usb_pwr>;
  302. };
  303. &usb {
  304. status = "okay";
  305. dr_mode = "peripheral";
  306. };