Guest User

Untitled

a guest
Jul 26th, 2021
81
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cat meson-g12a-radxa-zero.dts
  2. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  3. /*
  4. * piotr.oniszczuk@gmail.com based on
  5. * BayLibre SAS DT for G12A.
  6. */
  7.  
  8. /dts-v1/;
  9.  
  10. #include "meson-g12a.dtsi"
  11. #include <dt-bindings/gpio/gpio.h>
  12. #include <dt-bindings/input/input.h>
  13. #include <dt-bindings/gpio/meson-g12a-gpio.h>
  14. #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
  15.  
  16. / {
  17. compatible = "radxa,zero", "amlogic,g12a";
  18. model = "Radxa Zero";
  19.  
  20. adc_keys {
  21. compatible = "adc-keys";
  22. io-channels = <&saradc 0>;
  23. io-channel-names = "buttons";
  24. keyup-threshold-microvolt = <1800000>;
  25.  
  26. button-onoff {
  27. label = "On/Off";
  28. linux,code = <KEY_POWER>;
  29. press-threshold-microvolt = <1700000>;
  30. };
  31. };
  32.  
  33. aliases {
  34. serial0 = &uart_AO;
  35. };
  36.  
  37. mono_dac: audio-codec-0 {
  38. compatible = "maxim,max98357a";
  39. #sound-dai-cells = <0>;
  40. sound-name-prefix = "U16";
  41. sdmode-gpios = <&gpio GPIOX_8 GPIO_ACTIVE_HIGH>;
  42. };
  43.  
  44. dmics: audio-codec-1 {
  45. #sound-dai-cells = <0>;
  46. compatible = "dmic-codec";
  47. num-channels = <2>;
  48. wakeup-delay-ms = <50>;
  49. status = "okay";
  50. sound-name-prefix = "MIC";
  51. };
  52.  
  53. chosen {
  54. stdout-path = "serial0:115200n8";
  55. };
  56.  
  57. emmc_pwrseq: emmc-pwrseq {
  58. compatible = "mmc-pwrseq-emmc";
  59. reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
  60. };
  61.  
  62. hdmi-connector {
  63. compatible = "hdmi-connector";
  64. type = "a";
  65.  
  66. port {
  67. hdmi_connector_in: endpoint {
  68. remote-endpoint = <&hdmi_tx_tmds_out>;
  69. };
  70. };
  71. };
  72.  
  73. memory@0 {
  74. device_type = "memory";
  75. reg = <0x0 0x0 0x0 0x40000000>;
  76. };
  77.  
  78. ao_5v: regulator-ao_5v {
  79. compatible = "regulator-fixed";
  80. regulator-name = "AO_5V";
  81. regulator-min-microvolt = <5000000>;
  82. regulator-max-microvolt = <5000000>;
  83. vin-supply = <&dc_in>;
  84. regulator-always-on;
  85. };
  86.  
  87. dc_in: regulator-dc_in {
  88. compatible = "regulator-fixed";
  89. regulator-name = "DC_IN";
  90. regulator-min-microvolt = <5000000>;
  91. regulator-max-microvolt = <5000000>;
  92. regulator-always-on;
  93. };
  94.  
  95. emmc_1v8: regulator-emmc_1v8 {
  96. compatible = "regulator-fixed";
  97. regulator-name = "EMMC_1V8";
  98. regulator-min-microvolt = <1800000>;
  99. regulator-max-microvolt = <1800000>;
  100. vin-supply = <&vddao_3v3>;
  101. regulator-always-on;
  102. };
  103.  
  104. vddao_3v3: regulator-vddao_3v3 {
  105. compatible = "regulator-fixed";
  106. regulator-name = "VDDAO_3V3";
  107. regulator-min-microvolt = <3300000>;
  108. regulator-max-microvolt = <3300000>;
  109. vin-supply = <&dc_in>;
  110. regulator-always-on;
  111. };
  112.  
  113. vddcpu: regulator-vddcpu {
  114. /*
  115. * SY8120B1ABC DC/DC Regulator.
  116. */
  117. compatible = "pwm-regulator";
  118.  
  119. regulator-name = "VDDCPU";
  120. regulator-min-microvolt = <721000>;
  121. regulator-max-microvolt = <1022000>;
  122.  
  123. vin-supply = <&dc_in>;
  124.  
  125. pwms = <&pwm_AO_cd 1 1250 0>;
  126. pwm-dutycycle-range = <100 0>;
  127.  
  128. regulator-boot-on;
  129. regulator-always-on;
  130. };
  131.  
  132. vddio_ao1v8: regulator-vddio_ao1v8 {
  133. compatible = "regulator-fixed";
  134. regulator-name = "VDDIO_AO1V8";
  135. regulator-min-microvolt = <1800000>;
  136. regulator-max-microvolt = <1800000>;
  137. vin-supply = <&vddao_3v3>;
  138. regulator-always-on;
  139. };
  140.  
  141. reserved-memory {
  142. /* TEE Reserved Memory */
  143. bl32_reserved: bl32@5000000 {
  144. reg = <0x0 0x05300000 0x0 0x2000000>;
  145. no-map;
  146. };
  147. };
  148.  
  149. sdio_pwrseq: sdio-pwrseq {
  150. compatible = "mmc-pwrseq-simple";
  151. reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
  152. clocks = <&wifi32k>;
  153. clock-names = "ext_clock";
  154. };
  155.  
  156. wifi32k: wifi32k {
  157. compatible = "pwm-clock";
  158. #clock-cells = <0>;
  159. clock-frequency = <32768>;
  160. pwms = <&pwm_ef 0 30518 0>;
  161. };
  162.  
  163. sound {
  164. compatible = "amlogic,axg-sound-card";
  165. model = "G12A-RADXA-ZERO";
  166. audio-aux-devs = <&tdmout_a>, <&tdmout_b>,
  167. <&tdmin_a>, <&tdmin_b>;
  168. audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
  169. "TDMOUT_A IN 1", "FRDDR_B OUT 0",
  170. "TDMOUT_A IN 2", "FRDDR_C OUT 0",
  171. "TDM_A Playback", "TDMOUT_A OUT",
  172. "TDMOUT_B IN 0", "FRDDR_A OUT 1",
  173. "TDMOUT_B IN 1", "FRDDR_B OUT 1",
  174. "TDMOUT_B IN 2", "FRDDR_C OUT 1",
  175. "TDM_B Playback", "TDMOUT_B OUT",
  176. "TODDR_A IN 4", "PDM Capture",
  177. "TODDR_B IN 4", "PDM Capture",
  178. "TODDR_C IN 4", "PDM Capture",
  179. "TDMIN_A IN 0", "TDM_A Capture",
  180. "TDMIN_A IN 3", "TDM_A Loopback",
  181. "TDMIN_B IN 0", "TDM_A Capture",
  182. "TDMIN_B IN 3", "TDM_A Loopback",
  183. "TDMIN_A IN 1", "TDM_B Capture",
  184. "TDMIN_A IN 4", "TDM_B Loopback",
  185. "TDMIN_B IN 1", "TDM_B Capture",
  186. "TDMIN_B IN 4", "TDM_B Loopback",
  187. "TODDR_A IN 0", "TDMIN_A OUT",
  188. "TODDR_B IN 0", "TDMIN_A OUT",
  189. "TODDR_C IN 0", "TDMIN_A OUT",
  190. "TODDR_A IN 1", "TDMIN_B OUT",
  191. "TODDR_B IN 1", "TDMIN_B OUT",
  192. "TODDR_C IN 1", "TDMIN_B OUT";
  193.  
  194. assigned-clocks = <&clkc CLKID_MPLL2>,
  195. <&clkc CLKID_MPLL0>,
  196. <&clkc CLKID_MPLL1>;
  197. assigned-clock-parents = <0>, <0>, <0>;
  198. assigned-clock-rates = <294912000>,
  199. <270950400>,
  200. <393216000>;
  201. status = "okay";
  202.  
  203. dai-link-0 {
  204. sound-dai = <&frddr_a>;
  205. };
  206.  
  207. dai-link-1 {
  208. sound-dai = <&frddr_b>;
  209. };
  210.  
  211. dai-link-2 {
  212. sound-dai = <&frddr_c>;
  213. };
  214.  
  215. dai-link-3 {
  216. sound-dai = <&toddr_a>;
  217. };
  218.  
  219. dai-link-4 {
  220. sound-dai = <&toddr_b>;
  221. };
  222.  
  223. dai-link-5 {
  224. sound-dai = <&toddr_c>;
  225. };
  226.  
  227. /* internal speaker interface */
  228. dai-link-6 {
  229. sound-dai = <&tdmif_a>;
  230. dai-format = "i2s";
  231. dai-tdm-slot-tx-mask-0 = <1 1>;
  232. mclk-fs = <256>;
  233.  
  234. codec-0 {
  235. sound-dai = <&mono_dac>;
  236. };
  237.  
  238. codec-1 {
  239. sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
  240. };
  241. };
  242.  
  243. /* 8ch hdmi interface */
  244. dai-link-7 {
  245. sound-dai = <&tdmif_b>;
  246. dai-format = "i2s";
  247. dai-tdm-slot-tx-mask-0 = <1 1>;
  248. dai-tdm-slot-tx-mask-1 = <1 1>;
  249. dai-tdm-slot-tx-mask-2 = <1 1>;
  250. dai-tdm-slot-tx-mask-3 = <1 1>;
  251. mclk-fs = <256>;
  252.  
  253. codec {
  254. sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
  255. };
  256. };
  257.  
  258. /* internal digital mics */
  259. dai-link-8 {
  260. sound-dai = <&pdm>;
  261.  
  262. codec {
  263. sound-dai = <&dmics>;
  264. };
  265. };
  266.  
  267. /* hdmi glue */
  268. dai-link-9 {
  269. sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
  270.  
  271. codec {
  272. sound-dai = <&hdmi_tx>;
  273. };
  274. };
  275. };
  276. };
  277.  
  278. &arb {
  279. status = "okay";
  280. };
  281.  
  282. &cec_AO {
  283. pinctrl-0 = <&cec_ao_a_h_pins>;
  284. pinctrl-names = "default";
  285. status = "disabled";
  286. hdmi-phandle = <&hdmi_tx>;
  287. };
  288.  
  289. &cecb_AO {
  290. pinctrl-0 = <&cec_ao_b_h_pins>;
  291. pinctrl-names = "default";
  292. status = "okay";
  293. hdmi-phandle = <&hdmi_tx>;
  294. };
  295.  
  296. &clkc_audio {
  297. status = "okay";
  298. };
  299.  
  300. &cpu0 {
  301. cpu-supply = <&vddcpu>;
  302. operating-points-v2 = <&cpu_opp_table>;
  303. clocks = <&clkc CLKID_CPU_CLK>;
  304. clock-latency = <50000>;
  305. };
  306.  
  307. &cpu1 {
  308. cpu-supply = <&vddcpu>;
  309. operating-points-v2 = <&cpu_opp_table>;
  310. clocks = <&clkc CLKID_CPU_CLK>;
  311. clock-latency = <50000>;
  312. };
  313.  
  314. &cpu2 {
  315. cpu-supply = <&vddcpu>;
  316. operating-points-v2 = <&cpu_opp_table>;
  317. clocks = <&clkc CLKID_CPU_CLK>;
  318. clock-latency = <50000>;
  319. };
  320.  
  321. &cpu3 {
  322. cpu-supply = <&vddcpu>;
  323. operating-points-v2 = <&cpu_opp_table>;
  324. clocks = <&clkc CLKID_CPU_CLK>;
  325. clock-latency = <50000>;
  326. };
  327.  
  328. &frddr_a {
  329. status = "okay";
  330. };
  331.  
  332. &frddr_b {
  333. status = "okay";
  334. };
  335.  
  336. &frddr_c {
  337. status = "okay";
  338. };
  339.  
  340. &hdmi_tx {
  341. status = "okay";
  342. pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
  343. pinctrl-names = "default";
  344. };
  345.  
  346. &hdmi_tx_tmds_port {
  347. hdmi_tx_tmds_out: endpoint {
  348. remote-endpoint = <&hdmi_connector_in>;
  349. };
  350. };
  351.  
  352. &i2c3 {
  353. status = "okay";
  354. pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
  355. pinctrl-names = "default";
  356. };
  357.  
  358. &pwm_AO_cd {
  359. pinctrl-0 = <&pwm_ao_d_e_pins>;
  360. pinctrl-names = "default";
  361. clocks = <&xtal>;
  362. clock-names = "clkin1";
  363. status = "okay";
  364. };
  365.  
  366. &pwm_ef {
  367. status = "okay";
  368. pinctrl-0 = <&pwm_e_pins>;
  369. pinctrl-names = "default";
  370. clocks = <&xtal>;
  371. clock-names = "clkin0";
  372. };
  373.  
  374. &pdm {
  375. pinctrl-0 = <&pdm_din0_z_pins>, <&pdm_din1_z_pins>,
  376. <&pdm_din2_z_pins>, <&pdm_din3_z_pins>,
  377. <&pdm_dclk_z_pins>;
  378. pinctrl-names = "default";
  379. status = "okay";
  380. };
  381.  
  382. &saradc {
  383. status = "okay";
  384. vref-supply = <&vddio_ao1v8>;
  385. };
  386.  
  387. /* SDIO */
  388. &sd_emmc_a {
  389. status = "okay";
  390. pinctrl-0 = <&sdio_pins>;
  391. pinctrl-1 = <&sdio_clk_gate_pins>;
  392. pinctrl-names = "default", "clk-gate";
  393. #address-cells = <1>;
  394. #size-cells = <0>;
  395.  
  396. bus-width = <4>;
  397. cap-sd-highspeed;
  398. sd-uhs-sdr50;
  399. max-frequency = <100000000>;
  400.  
  401. non-removable;
  402. disable-wp;
  403.  
  404. amlogic,dram-access-quirk;
  405.  
  406. /* WiFi firmware requires power to be kept while in suspend */
  407. keep-power-in-suspend;
  408.  
  409. mmc-pwrseq = <&sdio_pwrseq>;
  410.  
  411. vmmc-supply = <&vddao_3v3>;
  412. vqmmc-supply = <&vddio_ao1v8>;
  413.  
  414. brcmf: wifi@1 {
  415. reg = <1>;
  416. compatible = "brcm,bcm4329-fmac";
  417. interrupts = <&gpio GPIOX_7 GPIO_ACTIVE_HIGH>;
  418. interrupt-names = "host-wake";
  419. };
  420. };
  421.  
  422. /* SD card */
  423. &sd_emmc_b {
  424. status = "okay";
  425. pinctrl-0 = <&sdcard_c_pins>;
  426. pinctrl-1 = <&sdcard_clk_gate_c_pins>;
  427. pinctrl-names = "default", "clk-gate";
  428.  
  429. bus-width = <4>;
  430. cap-sd-highspeed;
  431. max-frequency = <50000000>;
  432. disable-wp;
  433.  
  434. cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
  435. vmmc-supply = <&vddao_3v3>;
  436. vqmmc-supply = <&vddao_3v3>;
  437. };
  438.  
  439. /* eMMC */
  440. &sd_emmc_c {
  441. status = "okay";
  442. pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
  443. pinctrl-1 = <&emmc_clk_gate_pins>;
  444. pinctrl-names = "default", "clk-gate";
  445.  
  446. bus-width = <8>;
  447. cap-mmc-highspeed;
  448. mmc-ddr-1_8v;
  449. mmc-hs200-1_8v;
  450. max-frequency = <200000000>;
  451. non-removable;
  452. disable-wp;
  453.  
  454. mmc-pwrseq = <&emmc_pwrseq>;
  455. vmmc-supply = <&vddao_3v3>;
  456. vqmmc-supply = <&emmc_1v8>;
  457. };
  458.  
  459. &tdmif_a {
  460. pinctrl-0 = <&tdm_a_dout0_pins>, <&tdm_a_fs_pins>, <&tdm_a_sclk_pins>;
  461. pinctrl-names = "default";
  462. status = "okay";
  463.  
  464. assigned-clocks = <&clkc_audio AUD_CLKID_TDM_SCLK_PAD0>,
  465. <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD0>;
  466. assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_A_SCLK>,
  467. <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
  468. assigned-clock-rates = <0>, <0>;
  469. };
  470.  
  471. &tdmif_b {
  472. status = "okay";
  473. };
  474.  
  475. &tdmin_a {
  476. status = "okay";
  477. };
  478.  
  479. &tdmin_b {
  480. status = "okay";
  481. };
  482.  
  483. &tdmout_a {
  484. status = "okay";
  485. };
  486.  
  487. &tdmout_b {
  488. status = "okay";
  489. };
  490.  
  491. &toddr_a {
  492. status = "okay";
  493. };
  494.  
  495. &toddr_b {
  496. status = "okay";
  497. };
  498.  
  499. &toddr_c {
  500. status = "okay";
  501. };
  502.  
  503. &tohdmitx {
  504. status = "okay";
  505. };
  506.  
  507. &uart_A {
  508. status = "okay";
  509. pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
  510. pinctrl-names = "default";
  511. uart-has-rtscts;
  512.  
  513. bluetooth {
  514. compatible = "brcm,bcm43438-bt";
  515. shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
  516. max-speed = <2000000>;
  517. clocks = <&wifi32k>;
  518. clock-names = "lpo";
  519. vbat-supply = <&vddao_3v3>;
  520. vddio-supply = <&vddio_ao1v8>;
  521. };
  522. };
  523.  
  524. &uart_AO {
  525. status = "okay";
  526. pinctrl-0 = <&uart_ao_a_pins>;
  527. pinctrl-names = "default";
  528. };
  529.  
  530. &usb {
  531. status = "okay";
  532. dr_mode = "host";
  533. };
RAW Paste Data