meson-g12a-x96-max.dts 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2018 BayLibre SAS. All rights reserved.
  4. */
  5. /dts-v1/;
  6. #include "meson-g12a.dtsi"
  7. #include <dt-bindings/gpio/gpio.h>
  8. #include <dt-bindings/gpio/meson-g12a-gpio.h>
  9. #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
  10. / {
  11. compatible = "amediatech,x96-max", "amlogic,g12a";
  12. model = "Shenzhen Amediatech Technology Co., Ltd X96 Max";
  13. aliases {
  14. serial0 = &uart_AO;
  15. ethernet0 = &ethmac;
  16. };
  17. spdif_dit: audio-codec-1 {
  18. #sound-dai-cells = <0>;
  19. compatible = "linux,spdif-dit";
  20. status = "okay";
  21. sound-name-prefix = "DIT";
  22. };
  23. chosen {
  24. stdout-path = "serial0:115200n8";
  25. };
  26. memory@0 {
  27. device_type = "memory";
  28. reg = <0x0 0x0 0x0 0x40000000>;
  29. };
  30. cvbs-connector {
  31. compatible = "composite-video-connector";
  32. port {
  33. cvbs_connector_in: endpoint {
  34. remote-endpoint = <&cvbs_vdac_out>;
  35. };
  36. };
  37. };
  38. hdmi-connector {
  39. compatible = "hdmi-connector";
  40. type = "a";
  41. port {
  42. hdmi_connector_in: endpoint {
  43. remote-endpoint = <&hdmi_tx_tmds_out>;
  44. };
  45. };
  46. };
  47. emmc_pwrseq: emmc-pwrseq {
  48. compatible = "mmc-pwrseq-emmc";
  49. reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
  50. };
  51. sdio_pwrseq: sdio-pwrseq {
  52. compatible = "mmc-pwrseq-simple";
  53. reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
  54. clocks = <&wifi32k>;
  55. clock-names = "ext_clock";
  56. };
  57. flash_1v8: regulator-flash_1v8 {
  58. compatible = "regulator-fixed";
  59. regulator-name = "FLASH_1V8";
  60. regulator-min-microvolt = <1800000>;
  61. regulator-max-microvolt = <1800000>;
  62. vin-supply = <&vcc_3v3>;
  63. regulator-always-on;
  64. };
  65. dc_in: regulator-dc_in {
  66. compatible = "regulator-fixed";
  67. regulator-name = "DC_IN";
  68. regulator-min-microvolt = <5000000>;
  69. regulator-max-microvolt = <5000000>;
  70. regulator-always-on;
  71. };
  72. vcc_1v8: regulator-vcc_1v8 {
  73. compatible = "regulator-fixed";
  74. regulator-name = "VCC_1V8";
  75. regulator-min-microvolt = <1800000>;
  76. regulator-max-microvolt = <1800000>;
  77. vin-supply = <&vcc_3v3>;
  78. regulator-always-on;
  79. };
  80. vcc_3v3: regulator-vcc_3v3 {
  81. compatible = "regulator-fixed";
  82. regulator-name = "VCC_3V3";
  83. regulator-min-microvolt = <3300000>;
  84. regulator-max-microvolt = <3300000>;
  85. vin-supply = <&vddao_3v3>;
  86. regulator-always-on;
  87. /* FIXME: actually controlled by VDDCPU_B_EN */
  88. };
  89. vcc_5v: regulator-vcc_5v {
  90. compatible = "regulator-fixed";
  91. regulator-name = "VCC_5V";
  92. regulator-min-microvolt = <5000000>;
  93. regulator-max-microvolt = <5000000>;
  94. vin-supply = <&dc_in>;
  95. gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
  96. };
  97. vddao_1v8: regulator-vddao_1v8 {
  98. compatible = "regulator-fixed";
  99. regulator-name = "VDDAO_1V8";
  100. regulator-min-microvolt = <1800000>;
  101. regulator-max-microvolt = <1800000>;
  102. vin-supply = <&vddao_3v3>;
  103. regulator-always-on;
  104. };
  105. vddao_3v3: regulator-vddao_3v3 {
  106. compatible = "regulator-fixed";
  107. regulator-name = "VDDAO_3V3";
  108. regulator-min-microvolt = <3300000>;
  109. regulator-max-microvolt = <3300000>;
  110. vin-supply = <&dc_in>;
  111. regulator-always-on;
  112. };
  113. vddcpu: regulator-vddcpu {
  114. compatible = "pwm-regulator";
  115. regulator-name = "VDDCPU";
  116. regulator-min-microvolt = <721000>;
  117. regulator-max-microvolt = <1022000>;
  118. pwm-supply = <&dc_in>;
  119. pwms = <&pwm_AO_cd 1 1250 0>;
  120. pwm-dutycycle-range = <100 0>;
  121. regulator-boot-on;
  122. regulator-always-on;
  123. };
  124. sound {
  125. compatible = "amlogic,axg-sound-card";
  126. model = "X96-MAX";
  127. audio-aux-devs = <&tdmout_b>;
  128. audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
  129. "TDMOUT_B IN 1", "FRDDR_B OUT 1",
  130. "TDMOUT_B IN 2", "FRDDR_C OUT 1",
  131. "TDM_B Playback", "TDMOUT_B OUT",
  132. "SPDIFOUT IN 0", "FRDDR_A OUT 3",
  133. "SPDIFOUT IN 1", "FRDDR_B OUT 3",
  134. "SPDIFOUT IN 2", "FRDDR_C OUT 3";
  135. assigned-clocks = <&clkc CLKID_MPLL2>,
  136. <&clkc CLKID_MPLL0>,
  137. <&clkc CLKID_MPLL1>;
  138. assigned-clock-parents = <0>, <0>, <0>;
  139. assigned-clock-rates = <294912000>,
  140. <270950400>,
  141. <393216000>;
  142. status = "okay";
  143. dai-link-0 {
  144. sound-dai = <&frddr_a>;
  145. };
  146. dai-link-1 {
  147. sound-dai = <&frddr_b>;
  148. };
  149. dai-link-2 {
  150. sound-dai = <&frddr_c>;
  151. };
  152. /* 8ch hdmi interface */
  153. dai-link-3 {
  154. sound-dai = <&tdmif_b>;
  155. dai-format = "i2s";
  156. dai-tdm-slot-tx-mask-0 = <1 1>;
  157. dai-tdm-slot-tx-mask-1 = <1 1>;
  158. dai-tdm-slot-tx-mask-2 = <1 1>;
  159. dai-tdm-slot-tx-mask-3 = <1 1>;
  160. mclk-fs = <256>;
  161. codec {
  162. sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
  163. };
  164. };
  165. /* spdif hdmi or toslink interface */
  166. dai-link-4 {
  167. sound-dai = <&spdifout>;
  168. codec-0 {
  169. sound-dai = <&spdif_dit>;
  170. };
  171. codec-1 {
  172. sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_A>;
  173. };
  174. };
  175. /* spdif hdmi interface */
  176. dai-link-5 {
  177. sound-dai = <&spdifout_b>;
  178. codec {
  179. sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_B>;
  180. };
  181. };
  182. /* hdmi glue */
  183. dai-link-6 {
  184. sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
  185. codec {
  186. sound-dai = <&hdmi_tx>;
  187. };
  188. };
  189. };
  190. wifi32k: wifi32k {
  191. compatible = "pwm-clock";
  192. #clock-cells = <0>;
  193. clock-frequency = <32768>;
  194. pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
  195. };
  196. };
  197. &arb {
  198. status = "okay";
  199. };
  200. &cec_AO {
  201. pinctrl-0 = <&cec_ao_a_h_pins>;
  202. pinctrl-names = "default";
  203. status = "disabled";
  204. hdmi-phandle = <&hdmi_tx>;
  205. };
  206. &cecb_AO {
  207. pinctrl-0 = <&cec_ao_b_h_pins>;
  208. pinctrl-names = "default";
  209. status = "okay";
  210. hdmi-phandle = <&hdmi_tx>;
  211. };
  212. &clkc_audio {
  213. status = "okay";
  214. };
  215. &cpu0 {
  216. cpu-supply = <&vddcpu>;
  217. operating-points-v2 = <&cpu_opp_table>;
  218. clocks = <&clkc CLKID_CPU_CLK>;
  219. clock-latency = <50000>;
  220. };
  221. &cpu1 {
  222. cpu-supply = <&vddcpu>;
  223. operating-points-v2 = <&cpu_opp_table>;
  224. clocks = <&clkc CLKID_CPU_CLK>;
  225. clock-latency = <50000>;
  226. };
  227. &cpu2 {
  228. cpu-supply = <&vddcpu>;
  229. operating-points-v2 = <&cpu_opp_table>;
  230. clocks = <&clkc CLKID_CPU_CLK>;
  231. clock-latency = <50000>;
  232. };
  233. &cpu3 {
  234. cpu-supply = <&vddcpu>;
  235. operating-points-v2 = <&cpu_opp_table>;
  236. clocks = <&clkc CLKID_CPU_CLK>;
  237. clock-latency = <50000>;
  238. };
  239. &cvbs_vdac_port {
  240. cvbs_vdac_out: endpoint {
  241. remote-endpoint = <&cvbs_connector_in>;
  242. };
  243. };
  244. &frddr_a {
  245. status = "okay";
  246. };
  247. &frddr_b {
  248. status = "okay";
  249. };
  250. &frddr_c {
  251. status = "okay";
  252. };
  253. &hdmi_tx {
  254. status = "okay";
  255. pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
  256. pinctrl-names = "default";
  257. hdmi-supply = <&vcc_5v>;
  258. };
  259. &hdmi_tx_tmds_port {
  260. hdmi_tx_tmds_out: endpoint {
  261. remote-endpoint = <&hdmi_connector_in>;
  262. };
  263. };
  264. &ir {
  265. status = "okay";
  266. pinctrl-0 = <&remote_input_ao_pins>;
  267. pinctrl-names = "default";
  268. linux,rc-map-name = "rc-x96max";
  269. };
  270. &pwm_AO_cd {
  271. pinctrl-0 = <&pwm_ao_d_e_pins>;
  272. pinctrl-names = "default";
  273. clocks = <&xtal>;
  274. clock-names = "clkin1";
  275. status = "okay";
  276. };
  277. &ext_mdio {
  278. external_phy: ethernet-phy@0 {
  279. /* Realtek RTL8211F (0x001cc916) */
  280. reg = <0>;
  281. max-speed = <1000>;
  282. eee-broken-1000t;
  283. reset-assert-us = <10000>;
  284. reset-deassert-us = <80000>;
  285. reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
  286. interrupt-parent = <&gpio_intc>;
  287. /* MAC_INTR on GPIOZ_14 */
  288. interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
  289. };
  290. };
  291. &ethmac {
  292. pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
  293. pinctrl-names = "default";
  294. status = "okay";
  295. phy-mode = "rgmii";
  296. phy-handle = <&external_phy>;
  297. amlogic,tx-delay-ns = <2>;
  298. };
  299. &pwm_ef {
  300. status = "okay";
  301. pinctrl-0 = <&pwm_e_pins>;
  302. pinctrl-names = "default";
  303. clocks = <&xtal>;
  304. clock-names = "clkin0";
  305. };
  306. &uart_A {
  307. status = "okay";
  308. pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
  309. pinctrl-names = "default";
  310. uart-has-rtscts;
  311. bluetooth {
  312. compatible = "brcm,bcm43438-bt";
  313. shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
  314. max-speed = <2000000>;
  315. clocks = <&wifi32k>;
  316. clock-names = "lpo";
  317. };
  318. };
  319. &uart_AO {
  320. status = "okay";
  321. pinctrl-0 = <&uart_ao_a_pins>;
  322. pinctrl-names = "default";
  323. };
  324. &usb {
  325. status = "okay";
  326. dr_mode = "host";
  327. };
  328. /* SDIO */
  329. &sd_emmc_a {
  330. status = "okay";
  331. pinctrl-0 = <&sdio_pins>;
  332. pinctrl-1 = <&sdio_clk_gate_pins>;
  333. pinctrl-names = "default", "clk-gate";
  334. #address-cells = <1>;
  335. #size-cells = <0>;
  336. bus-width = <4>;
  337. cap-sd-highspeed;
  338. sd-uhs-sdr50;
  339. max-frequency = <100000000>;
  340. non-removable;
  341. disable-wp;
  342. /* WiFi firmware requires power to be kept while in suspend */
  343. keep-power-in-suspend;
  344. mmc-pwrseq = <&sdio_pwrseq>;
  345. vmmc-supply = <&vddao_3v3>;
  346. vqmmc-supply = <&vddao_1v8>;
  347. brcmf: wifi@1 {
  348. reg = <1>;
  349. compatible = "brcm,bcm4329-fmac";
  350. };
  351. };
  352. /* SD card */
  353. &sd_emmc_b {
  354. status = "okay";
  355. pinctrl-0 = <&sdcard_c_pins>;
  356. pinctrl-1 = <&sdcard_clk_gate_c_pins>;
  357. pinctrl-names = "default", "clk-gate";
  358. bus-width = <4>;
  359. cap-sd-highspeed;
  360. max-frequency = <100000000>;
  361. disable-wp;
  362. cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
  363. vmmc-supply = <&vddao_3v3>;
  364. vqmmc-supply = <&vddao_3v3>;
  365. };
  366. /* eMMC */
  367. &sd_emmc_c {
  368. status = "okay";
  369. pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
  370. pinctrl-1 = <&emmc_clk_gate_pins>;
  371. pinctrl-names = "default", "clk-gate";
  372. bus-width = <8>;
  373. cap-mmc-highspeed;
  374. max-frequency = <100000000>;
  375. non-removable;
  376. disable-wp;
  377. mmc-pwrseq = <&emmc_pwrseq>;
  378. vmmc-supply = <&vcc_3v3>;
  379. vqmmc-supply = <&flash_1v8>;
  380. };
  381. &spdifout {
  382. pinctrl-0 = <&spdif_out_h_pins>;
  383. pinctrl-names = "default";
  384. status = "okay";
  385. };
  386. &spdifout_b {
  387. status = "okay";
  388. };
  389. &tdmif_b {
  390. status = "okay";
  391. };
  392. &tdmout_b {
  393. status = "okay";
  394. };
  395. &tohdmitx {
  396. status = "okay";
  397. };