meson-khadas-vim3.dtsi 7.6 KB

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