Advertisement
Guest User

Untitled

a guest
Oct 29th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.32 KB | None | 0 0
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2020 Dongjin Kim <[email protected]>
  4. */
  5.  
  6. /dts-v1/;
  7.  
  8. #include "meson-sm1.dtsi"
  9. #include <dt-bindings/gpio/meson-g12a-gpio.h>
  10. #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
  11. #include <dt-bindings/leds/common.h>
  12. #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
  13.  
  14. / {
  15. compatible = "hardkernel,odroid-c4", "amlogic,sm1";
  16. model = "Hardkernel ODROID-C4";
  17.  
  18. aliases {
  19. ethernet0 = &ethmac;
  20. i2c0 = &i2c2;
  21. i2c1 = &i2c3;
  22. serial0 = &uart_AO;
  23. serial1 = &uart_A;
  24. spi0 = &spicc0;
  25. };
  26.  
  27. chosen {
  28. stdout-path = "serial0:115200n8";
  29. };
  30.  
  31. memory@0 {
  32. device_type = "memory";
  33. reg = <0x0 0x0 0x0 0x40000000>;
  34. };
  35.  
  36. emmc_pwrseq: emmc-pwrseq {
  37. compatible = "mmc-pwrseq-emmc";
  38. reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
  39. };
  40.  
  41. leds {
  42. compatible = "gpio-leds";
  43.  
  44. led-blue {
  45. color = <LED_COLOR_ID_BLUE>;
  46. function = LED_FUNCTION_STATUS;
  47. gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>;
  48. linux,default-trigger = "heartbeat";
  49. panic-indicator;
  50. };
  51. };
  52.  
  53. tflash_vdd: regulator-tflash_vdd {
  54. compatible = "regulator-fixed";
  55.  
  56. regulator-name = "TFLASH_VDD";
  57. regulator-min-microvolt = <3300000>;
  58. regulator-max-microvolt = <3300000>;
  59.  
  60. gpio = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
  61. enable-active-high;
  62. regulator-always-on;
  63. };
  64.  
  65. tf_io: gpio-regulator-tf_io {
  66. compatible = "regulator-gpio";
  67.  
  68. regulator-name = "TF_IO";
  69. regulator-min-microvolt = <1800000>;
  70. regulator-max-microvolt = <3300000>;
  71.  
  72. gpios = <&gpio_ao GPIOAO_6 GPIO_ACTIVE_HIGH>;
  73. gpios-states = <0>;
  74.  
  75. states = <3300000 0>,
  76. <1800000 1>;
  77. };
  78.  
  79. flash_1v8: regulator-flash_1v8 {
  80. compatible = "regulator-fixed";
  81. regulator-name = "FLASH_1V8";
  82. regulator-min-microvolt = <1800000>;
  83. regulator-max-microvolt = <1800000>;
  84. vin-supply = <&vcc_3v3>;
  85. regulator-always-on;
  86. };
  87.  
  88. main_12v: regulator-main_12v {
  89. compatible = "regulator-fixed";
  90. regulator-name = "12V";
  91. regulator-min-microvolt = <12000000>;
  92. regulator-max-microvolt = <12000000>;
  93. regulator-always-on;
  94. };
  95.  
  96. vcc_5v: regulator-vcc_5v {
  97. compatible = "regulator-fixed";
  98. regulator-name = "5V";
  99. regulator-min-microvolt = <5000000>;
  100. regulator-max-microvolt = <5000000>;
  101. regulator-always-on;
  102. vin-supply = <&main_12v>;
  103. };
  104.  
  105. vcc_1v8: regulator-vcc_1v8 {
  106. compatible = "regulator-fixed";
  107. regulator-name = "VCC_1V8";
  108. regulator-min-microvolt = <1800000>;
  109. regulator-max-microvolt = <1800000>;
  110. vin-supply = <&vcc_3v3>;
  111. regulator-always-on;
  112. };
  113.  
  114. vcc_3v3: regulator-vcc_3v3 {
  115. compatible = "regulator-fixed";
  116. regulator-name = "VCC_3V3";
  117. regulator-min-microvolt = <3300000>;
  118. regulator-max-microvolt = <3300000>;
  119. vin-supply = <&vddao_3v3>;
  120. regulator-always-on;
  121. /* FIXME: actually controlled by VDDCPU_B_EN */
  122. };
  123.  
  124. vddcpu: regulator-vddcpu {
  125. /*
  126. * MP8756GD Regulator.
  127. */
  128. compatible = "pwm-regulator";
  129.  
  130. regulator-name = "VDDCPU";
  131. regulator-min-microvolt = <721000>;
  132. regulator-max-microvolt = <1022000>;
  133.  
  134. vin-supply = <&main_12v>;
  135.  
  136. pwms = <&pwm_AO_cd 1 1250 0>;
  137. pwm-dutycycle-range = <100 0>;
  138.  
  139. regulator-boot-on;
  140. regulator-always-on;
  141. };
  142.  
  143. hub_5v: regulator-hub_5v {
  144. compatible = "regulator-fixed";
  145. regulator-name = "HUB_5V";
  146. regulator-min-microvolt = <5000000>;
  147. regulator-max-microvolt = <5000000>;
  148. vin-supply = <&vcc_5v>;
  149.  
  150. /* Connected to the Hub CHIPENABLE, LOW sets low power state */
  151. gpio = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>;
  152. enable-active-high;
  153. };
  154.  
  155. usb_pwr_en: regulator-usb_pwr_en {
  156. compatible = "regulator-fixed";
  157. regulator-name = "USB_PWR_EN";
  158. regulator-min-microvolt = <5000000>;
  159. regulator-max-microvolt = <5000000>;
  160. vin-supply = <&vcc_5v>;
  161.  
  162. /* Connected to the microUSB port power enable */
  163. gpio = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
  164. enable-active-high;
  165. };
  166.  
  167. vddao_1v8: regulator-vddao_1v8 {
  168. compatible = "regulator-fixed";
  169. regulator-name = "VDDAO_1V8";
  170. regulator-min-microvolt = <1800000>;
  171. regulator-max-microvolt = <1800000>;
  172. vin-supply = <&vddao_3v3>;
  173. regulator-always-on;
  174. };
  175.  
  176. vddao_3v3: regulator-vddao_3v3 {
  177. compatible = "regulator-fixed";
  178. regulator-name = "VDDAO_3V3";
  179. regulator-min-microvolt = <3300000>;
  180. regulator-max-microvolt = <3300000>;
  181. vin-supply = <&main_12v>;
  182. regulator-always-on;
  183. };
  184.  
  185. hdmi-connector {
  186. compatible = "hdmi-connector";
  187. type = "a";
  188.  
  189. port {
  190. hdmi_connector_in: endpoint {
  191. remote-endpoint = <&hdmi_tx_tmds_out>;
  192. };
  193. };
  194. };
  195.  
  196. sound {
  197. compatible = "amlogic,axg-sound-card";
  198. model = "SM1-ODROID-C4";
  199. audio-aux-devs = <&tdmout_a>, <&tdmout_b>;
  200. audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 1",
  201. "TDMOUT_A IN 1", "FRDDR_B OUT 1",
  202. "TDMOUT_A IN 2", "FRDDR_C OUT 1",
  203. "TDM_A Playback", "TDMOUT_A OUT",
  204. "TDMOUT_B IN 0", "FRDDR_A OUT 1",
  205. "TDMOUT_B IN 1", "FRDDR_B OUT 1",
  206. "TDMOUT_B IN 2", "FRDDR_C OUT 1",
  207. "TDM_B Playback", "TDMOUT_B OUT";
  208.  
  209. assigned-clocks = <&clkc CLKID_MPLL2>,
  210. <&clkc CLKID_MPLL0>,
  211. <&clkc CLKID_MPLL1>;
  212. assigned-clock-parents = <0>, <0>, <0>;
  213. assigned-clock-rates = <294912000>,
  214. <270950400>,
  215. <393216000>;
  216. status = "okay";
  217.  
  218. dai-link-0 {
  219. sound-dai = <&frddr_a>;
  220. };
  221.  
  222. dai-link-1 {
  223. sound-dai = <&frddr_b>;
  224. };
  225.  
  226. dai-link-2 {
  227. sound-dai = <&frddr_c>;
  228. };
  229.  
  230. dai-link-3 {
  231. sound-dai = <&tdmif_b>;
  232. dai-format = "i2s";
  233. dai-tdm-slot-width = <32>;
  234. dai-tdm-slot-tx-mask-0 = <1 1>;
  235. mclk-fs = <256>;
  236.  
  237. codec {
  238. sound-dai = <&pcm5122>;
  239. };
  240. };
  241.  
  242. dai-link-4 {
  243. sound-dai = <&tdmif_a>;
  244. dai-format = "i2s";
  245. dai-tdm-slot-tx-mask-0 = <1 1>;
  246. dai-tdm-slot-tx-mask-1 = <1 1>;
  247. dai-tdm-slot-tx-mask-2 = <1 1>;
  248. dai-tdm-slot-tx-mask-3 = <1 1>;
  249. mclk-fs = <256>;
  250.  
  251. codec {
  252. sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
  253. };
  254. };
  255.  
  256. /* hdmi glue */
  257. dai-link-5 {
  258. sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
  259.  
  260. codec {
  261. sound-dai = <&hdmi_tx>;
  262. };
  263. };
  264.  
  265. };
  266. };
  267.  
  268. &arb {
  269. status = "okay";
  270. };
  271.  
  272. &clkc_audio {
  273. status = "okay";
  274. };
  275.  
  276. &cpu0 {
  277. cpu-supply = <&vddcpu>;
  278. operating-points-v2 = <&cpu_opp_table>;
  279. clocks = <&clkc CLKID_CPU_CLK>;
  280. clock-latency = <50000>;
  281. };
  282.  
  283. &cpu1 {
  284. cpu-supply = <&vddcpu>;
  285. operating-points-v2 = <&cpu_opp_table>;
  286. clocks = <&clkc CLKID_CPU1_CLK>;
  287. clock-latency = <50000>;
  288. };
  289.  
  290. &cpu2 {
  291. cpu-supply = <&vddcpu>;
  292. operating-points-v2 = <&cpu_opp_table>;
  293. clocks = <&clkc CLKID_CPU2_CLK>;
  294. clock-latency = <50000>;
  295. };
  296.  
  297. &cpu3 {
  298. cpu-supply = <&vddcpu>;
  299. operating-points-v2 = <&cpu_opp_table>;
  300. clocks = <&clkc CLKID_CPU3_CLK>;
  301. clock-latency = <50000>;
  302. };
  303.  
  304. &cpu_opp_table {
  305. opp-1000000000 {
  306. opp-hz = /bits/ 64 <1000000000>;
  307. opp-microvolt = <800000>;
  308. };
  309.  
  310. opp-1200000000 {
  311. opp-hz = /bits/ 64 <1200000000>;
  312. opp-microvolt = <810000>;
  313. };
  314.  
  315. opp-1404000000 {
  316. opp-hz = /bits/ 64 <1404000000>;
  317. opp-microvolt = <820000>;
  318. };
  319.  
  320. opp-1512000000 {
  321. opp-hz = /bits/ 64 <1500000000>;
  322. opp-microvolt = <830000>;
  323. };
  324.  
  325. opp-1608000000 {
  326. opp-hz = /bits/ 64 <1608000000>;
  327. opp-microvolt = <860000>;
  328. };
  329.  
  330. opp-1704000000 {
  331. opp-hz = /bits/ 64 <1704000000>;
  332. opp-microvolt = <900000>;
  333. };
  334.  
  335. opp-1800000000 {
  336. opp-hz = /bits/ 64 <1800000000>;
  337. opp-microvolt = <940000>;
  338. };
  339.  
  340. opp-1908000000 {
  341. opp-hz = /bits/ 64 <1908000000>;
  342. opp-microvolt = <1000000>;
  343. };
  344. };
  345.  
  346. &ext_mdio {
  347. external_phy: ethernet-phy@0 {
  348. /* Realtek RTL8211F (0x001cc916) */
  349. reg = <0>;
  350. max-speed = <1000>;
  351.  
  352. reset-assert-us = <10000>;
  353. reset-deassert-us = <30000>;
  354. reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
  355.  
  356. interrupt-parent = <&gpio_intc>;
  357. /* MAC_INTR on GPIOZ_14 */
  358. interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
  359. };
  360. };
  361.  
  362. &ethmac {
  363. pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
  364. pinctrl-names = "default";
  365. status = "okay";
  366. phy-mode = "rgmii";
  367. phy-handle = <&external_phy>;
  368. amlogic,tx-delay-ns = <2>;
  369. };
  370.  
  371. &frddr_a {
  372. status = "okay";
  373. };
  374.  
  375. &frddr_b {
  376. status = "okay";
  377. };
  378.  
  379. &frddr_c {
  380. status = "okay";
  381. };
  382.  
  383. &gpio {
  384. gpio-line-names =
  385. /* GPIOZ */
  386. "", "", "", "", "", "", "", "",
  387. "", "", "", "", "", "", "", "",
  388. /* GPIOH */
  389. "", "", "", "", "",
  390. "PIN_36", /* GPIOH_5 */
  391. "PIN_26", /* GPIOH_6 */
  392. "PIN_32", /* GPIOH_7 */
  393. "",
  394. /* BOOT */
  395. "", "", "", "", "", "", "", "",
  396. "", "", "", "", "", "", "", "",
  397. /* GPIOC */
  398. "", "", "", "", "", "", "", "",
  399. /* GPIOA */
  400. "", "", "", "", "", "", "", "",
  401. "", "", "", "", "", "",
  402. "PIN_27", /* GPIOA_14 */
  403. "PIN_28", /* GPIOA_15 */
  404. /* GPIOX */
  405. "PIN_16", /* GPIOX_0 */
  406. "PIN_18", /* GPIOX_1 */
  407. "PIN_22", /* GPIOX_2 */
  408. "PIN_11", /* GPIOX_3 */
  409. "PIN_13", /* GPIOX_4 */
  410. "PIN_7", /* GPIOX_5 */
  411. "PIN_33", /* GPIOX_6 */
  412. "PIN_15", /* GPIOX_7 */
  413. "PIN_19", /* GPIOX_8 */
  414. "PIN_21", /* GPIOX_9 */
  415. "PIN_24", /* GPIOX_10 */
  416. "PIN_23", /* GPIOX_11 */
  417. "PIN_8", /* GPIOX_12 */
  418. "PIN_10", /* GPIOX_13 */
  419. "PIN_29", /* GPIOX_14 */
  420. "PIN_31", /* GPIOX_15 */
  421. "PIN_12", /* GPIOX_16 */
  422. "PIN_3", /* GPIOX_17 */
  423. "PIN_5", /* GPIOX_18 */
  424. "PIN_35"; /* GPIOX_19 */
  425.  
  426. /*
  427. * WARNING: The USB Hub on the Odroid-C4 needs a reset signal
  428. * to be turned high in order to be detected by the USB Controller
  429. * This signal should be handled by a USB specific power sequence
  430. * in order to reset the Hub when USB bus is powered down.
  431. */
  432. usb-hub {
  433. gpio-hog;
  434. gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>;
  435. output-high;
  436. line-name = "usb-hub-reset";
  437. };
  438. };
  439.  
  440. &gpio_ao {
  441. gpio-line-names =
  442. /* GPIOAO */
  443. "", "", "", "",
  444. "PIN_47", /* GPIOAO_4 */
  445. "", "",
  446. "PIN_45", /* GPIOAO_7 */
  447. "PIN_46", /* GPIOAO_8 */
  448. "PIN_44", /* GPIOAO_9 */
  449. "PIN_42", /* GPIOAO_10 */
  450. "",
  451. /* GPIOE */
  452. "", "", "";
  453. };
  454.  
  455. &hdmi_tx {
  456. status = "okay";
  457. pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
  458. pinctrl-names = "default";
  459. hdmi-supply = <&vcc_5v>;
  460. };
  461.  
  462. &hdmi_tx_tmds_port {
  463. hdmi_tx_tmds_out: endpoint {
  464. remote-endpoint = <&hdmi_connector_in>;
  465. };
  466. };
  467.  
  468. &ir {
  469. status = "okay";
  470. pinctrl-0 = <&remote_input_ao_pins>;
  471. pinctrl-names = "default";
  472. linux,rc-map-name = "rc-odroid";
  473. };
  474.  
  475. &i2c2 {
  476. status = "okay";
  477.  
  478. /*
  479. * 40 Pin Header : SDA(GPIOX.17->3 Pin)
  480. * SCL(GPIOX.18->5 Pin)
  481. */
  482. pinctrl-names = "default";
  483. pinctrl-0 = <&i2c2_master_pins1>;
  484.  
  485. /* default 400k */
  486. clock-frequency = <400000>;
  487.  
  488. pcm5122: pcm5122@4c {
  489. #sound-dai-cells = <0>;
  490. compatible = "ti,pcm5122";
  491. reg = <0x4c>;
  492. AVDD-supply = <&vddao_3v3>;
  493. DVDD-supply = <&vddao_3v3>;
  494. CPVDD-supply = <&vddao_3v3>;
  495. status = "okay";
  496. };
  497.  
  498. };
  499.  
  500. &i2c3 {
  501. /* default i2c clock-frequency is 100Khz */
  502. status = "okay";
  503.  
  504. /*
  505. * 40 Pin Header : SDA(GPIOA.14->27 Pin)
  506. * SCL(GPIOA.15->28 Pin)
  507. */
  508. pinctrl-names = "default";
  509. pinctrl-0 = <&i2c3_master_pins2>;
  510.  
  511. /* default 100k */
  512. clock-frequency = <100000>;
  513. };
  514.  
  515. &periphs_pinctrl {
  516. i2c2_master_pins1: i2c2-master-pins1 {
  517. mux {
  518. groups = "i2c2_sda_x",
  519. "i2c2_sck_x";
  520. function = "i2c2";
  521. bias-pull-up;
  522. drive-strength-microamp = <3000>;
  523. };
  524. };
  525.  
  526. i2c3_master_pins2: i2c3-master-pins2 {
  527. mux {
  528. groups = "i2c3_sda_a",
  529. "i2c3_sck_a";
  530. function = "i2c3";
  531. bias-pull-up;
  532. drive-strength-microamp = <3000>;
  533. };
  534. };
  535. };
  536.  
  537. &pwm_AO_cd {
  538. pinctrl-0 = <&pwm_ao_d_e_pins>;
  539. pinctrl-names = "default";
  540. clocks = <&xtal>;
  541. clock-names = "clkin1";
  542. status = "okay";
  543. };
  544.  
  545. &saradc {
  546. status = "okay";
  547. };
  548.  
  549. &saradc {
  550. status = "okay";
  551. };
  552.  
  553. /* SD card */
  554. &sd_emmc_b {
  555. status = "okay";
  556. pinctrl-0 = <&sdcard_c_pins>;
  557. pinctrl-1 = <&sdcard_clk_gate_c_pins>;
  558. pinctrl-names = "default", "clk-gate";
  559.  
  560. bus-width = <4>;
  561. cap-sd-highspeed;
  562. max-frequency = <200000000>;
  563. sd-uhs-sdr12;
  564. sd-uhs-sdr25;
  565. sd-uhs-sdr50;
  566. sd-uhs-sdr104;
  567. disable-wp;
  568.  
  569. cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
  570. vmmc-supply = <&tflash_vdd>;
  571. vqmmc-supply = <&tf_io>;
  572. };
  573.  
  574. /* eMMC */
  575. &sd_emmc_c {
  576. status = "okay";
  577. pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
  578. pinctrl-1 = <&emmc_clk_gate_pins>;
  579. pinctrl-names = "default", "clk-gate";
  580.  
  581. bus-width = <8>;
  582. cap-mmc-highspeed;
  583. mmc-ddr-1_8v;
  584. mmc-hs200-1_8v;
  585. max-frequency = <200000000>;
  586. disable-wp;
  587.  
  588. mmc-pwrseq = <&emmc_pwrseq>;
  589. vmmc-supply = <&vcc_3v3>;
  590. vqmmc-supply = <&flash_1v8>;
  591. };
  592.  
  593. &spicc0 {
  594. status = "okay";
  595.  
  596. /*
  597. * 40 Pin Header : MOSI(GPIOX.8->19 Pin),
  598. * MISO(GPIOX.9->21 Pin),
  599. * SPI0_CLK(GPIOX.11->23 Pin)
  600. * SPI_CS0(GPIOX.10->24 Pin)
  601. * SPI_CS1(GPIOH.6->26 Pin)
  602. */
  603. pinctrl-names = "default","gpio_periphs";
  604. pinctrl-0 = <&spicc0_x_pins>;
  605. pinctrl-1 = <&spicc0_ss0_x_pins>;
  606. num_chipselect = <1>;
  607.  
  608. cs-gpios = <&gpio GPIOX_10 GPIO_ACTIVE_LOW>;
  609.  
  610. spidev@0 {
  611. status = "okay";
  612.  
  613. compatible = "linux,spidev";
  614. /* spi default max clock 100Mhz */
  615. spi-max-frequency = <100000000>;
  616. reg = <0>;
  617. };
  618. };
  619.  
  620. &tdmif_a {
  621. status = "okay";
  622. };
  623.  
  624. &tdmif_b {
  625. pinctrl-0 = <&mclk0_ao_pins>, <&tdm_ao_b_fs_pins>, <&tdm_ao_b_sclk_pins>,
  626. <&tdm_ao_b_dout0_pins>;
  627.  
  628. pinctrl-names = "default";
  629. status = "okay";
  630.  
  631. assigned-clocks = <&clkc_audio AUD_CLKID_TDM_MCLK_PAD0>,
  632. <&clkc_audio AUD_CLKID_TDM_SCLK_PAD1>,
  633. <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD1>;
  634. assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_B_MCLK>,
  635. <&clkc_audio AUD_CLKID_MST_B_SCLK>,
  636. <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
  637. assigned-clock-rates = <0>, <0>, <0>;
  638. };
  639.  
  640. &tdmout_a {
  641. status = "okay";
  642. };
  643.  
  644. &tdmout_b {
  645. status = "okay";
  646. };
  647.  
  648. &tohdmitx {
  649. status = "okay";
  650. };
  651.  
  652. &uart_A {
  653. status = "okay";
  654. pinctrl-names = "default";
  655. pinctrl-0 = <&uart_a_pins>;
  656. };
  657.  
  658. &uart_AO {
  659. status = "okay";
  660. pinctrl-0 = <&uart_ao_a_pins>;
  661. pinctrl-names = "default";
  662. };
  663.  
  664. &usb {
  665. status = "okay";
  666. vbus-supply = <&usb_pwr_en>;
  667. };
  668.  
  669. &usb2_phy0 {
  670. phy-supply = <&vcc_5v>;
  671. };
  672.  
  673. &usb2_phy1 {
  674. /* Enable the hub which is connected to this port */
  675. phy-supply = <&hub_5v>;
  676. };
  677.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement