meson-khadas-vim3.dtsi 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  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. led-white {
  35. label = "vim3:white:sys";
  36. gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
  37. linux,default-trigger = "heartbeat";
  38. };
  39. led-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. &cpu_thermal {
  158. trips {
  159. cpu_active: cpu-active {
  160. temperature = <80000>; /* millicelsius */
  161. hysteresis = <2000>; /* millicelsius */
  162. type = "active";
  163. };
  164. };
  165. cooling-maps {
  166. map {
  167. trip = <&cpu_active>;
  168. cooling-device = <&khadas_mcu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
  169. };
  170. };
  171. };
  172. &ext_mdio {
  173. external_phy: ethernet-phy@0 {
  174. /* Realtek RTL8211F (0x001cc916) */
  175. reg = <0>;
  176. max-speed = <1000>;
  177. interrupt-parent = <&gpio_intc>;
  178. /* MAC_INTR on GPIOZ_14 */
  179. interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
  180. };
  181. };
  182. &ethmac {
  183. pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
  184. pinctrl-names = "default";
  185. status = "okay";
  186. phy-mode = "rgmii";
  187. phy-handle = <&external_phy>;
  188. amlogic,tx-delay-ns = <2>;
  189. };
  190. &hdmi_tx {
  191. status = "okay";
  192. pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
  193. pinctrl-names = "default";
  194. hdmi-supply = <&vcc_5v>;
  195. };
  196. &hdmi_tx_tmds_port {
  197. hdmi_tx_tmds_out: endpoint {
  198. remote-endpoint = <&hdmi_connector_in>;
  199. };
  200. };
  201. &i2c_AO {
  202. status = "okay";
  203. pinctrl-0 = <&i2c_ao_sck_pins>, <&i2c_ao_sda_pins>;
  204. pinctrl-names = "default";
  205. khadas_mcu: system-controller@18 {
  206. compatible = "khadas,mcu";
  207. reg = <0x18>;
  208. #cooling-cells = <2>;
  209. };
  210. gpio_expander: gpio-controller@20 {
  211. compatible = "ti,tca6408";
  212. reg = <0x20>;
  213. vcc-supply = <&vcc_3v3>;
  214. gpio-controller;
  215. #gpio-cells = <2>;
  216. };
  217. rtc@51 {
  218. compatible = "haoyu,hym8563";
  219. reg = <0x51>;
  220. #clock-cells = <0>;
  221. };
  222. };
  223. &ir {
  224. status = "okay";
  225. pinctrl-0 = <&remote_input_ao_pins>;
  226. pinctrl-names = "default";
  227. linux,rc-map-name = "rc-khadas";
  228. };
  229. &pcie {
  230. reset-gpios = <&gpio GPIOA_8 GPIO_ACTIVE_LOW>;
  231. };
  232. &pwm_ef {
  233. status = "okay";
  234. pinctrl-0 = <&pwm_e_pins>;
  235. pinctrl-names = "default";
  236. };
  237. &saradc {
  238. status = "okay";
  239. vref-supply = <&vddao_1v8>;
  240. };
  241. /* SDIO */
  242. &sd_emmc_a {
  243. status = "okay";
  244. pinctrl-0 = <&sdio_pins>;
  245. pinctrl-1 = <&sdio_clk_gate_pins>;
  246. pinctrl-names = "default", "clk-gate";
  247. #address-cells = <1>;
  248. #size-cells = <0>;
  249. bus-width = <4>;
  250. cap-sd-highspeed;
  251. max-frequency = <100000000>;
  252. non-removable;
  253. disable-wp;
  254. /* WiFi firmware requires power to be kept while in suspend */
  255. keep-power-in-suspend;
  256. mmc-pwrseq = <&sdio_pwrseq>;
  257. vmmc-supply = <&vsys_3v3>;
  258. vqmmc-supply = <&vddao_1v8>;
  259. brcmf: wifi@1 {
  260. reg = <1>;
  261. compatible = "brcm,bcm4329-fmac";
  262. };
  263. };
  264. /* SD card */
  265. &sd_emmc_b {
  266. status = "okay";
  267. pinctrl-0 = <&sdcard_c_pins>;
  268. pinctrl-1 = <&sdcard_clk_gate_c_pins>;
  269. pinctrl-names = "default", "clk-gate";
  270. bus-width = <4>;
  271. cap-sd-highspeed;
  272. max-frequency = <50000000>;
  273. disable-wp;
  274. cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
  275. vmmc-supply = <&vsys_3v3>;
  276. vqmmc-supply = <&vsys_3v3>;
  277. };
  278. /* eMMC */
  279. &sd_emmc_c {
  280. status = "okay";
  281. pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
  282. pinctrl-1 = <&emmc_clk_gate_pins>;
  283. pinctrl-names = "default", "clk-gate";
  284. bus-width = <8>;
  285. cap-mmc-highspeed;
  286. mmc-ddr-1_8v;
  287. mmc-hs200-1_8v;
  288. max-frequency = <200000000>;
  289. disable-wp;
  290. mmc-pwrseq = <&emmc_pwrseq>;
  291. vmmc-supply = <&vcc_3v3>;
  292. vqmmc-supply = <&emmc_1v8>;
  293. };
  294. /*
  295. * EMMC_D4, EMMC_D5, EMMC_D6 and EMMC_D7 pins are shared between SPI NOR CS
  296. * and eMMC Data 4 to 7 pins.
  297. * Replace emmc_data_8b_pins to emmc_data_4b_pins from sd_emmc_c pinctrl-0,
  298. * and change bus-width to 4 then spifc can be enabled.
  299. */
  300. &spifc {
  301. status = "disabled";
  302. pinctrl-0 = <&nor_pins>;
  303. pinctrl-names = "default";
  304. w25q128: spi-flash@0 {
  305. #address-cells = <1>;
  306. #size-cells = <1>;
  307. compatible = "winbond,w25q128fw", "jedec,spi-nor";
  308. reg = <0>;
  309. spi-max-frequency = <104000000>;
  310. };
  311. };
  312. &uart_A {
  313. status = "okay";
  314. pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
  315. pinctrl-names = "default";
  316. uart-has-rtscts;
  317. bluetooth {
  318. compatible = "brcm,bcm43438-bt";
  319. shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
  320. max-speed = <2000000>;
  321. clocks = <&wifi32k>;
  322. clock-names = "lpo";
  323. };
  324. };
  325. &uart_AO {
  326. status = "okay";
  327. pinctrl-0 = <&uart_ao_a_pins>;
  328. pinctrl-names = "default";
  329. };
  330. &usb2_phy0 {
  331. phy-supply = <&dc_in>;
  332. };
  333. &usb2_phy1 {
  334. phy-supply = <&usb_pwr>;
  335. };
  336. &usb3_pcie_phy {
  337. phy-supply = <&usb_pwr>;
  338. };
  339. &usb {
  340. status = "okay";
  341. dr_mode = "peripheral";
  342. };