Advertisement
Guest User

Untitled

a guest
Oct 28th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.79 KB | None | 0 0
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2020 Dongjin Kim <tobetter@gmail.com>
  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_b>;
  200. audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
  201. "TDMOUT_B IN 1", "FRDDR_B OUT 1",
  202. "TDMOUT_B IN 2", "FRDDR_C OUT 1",
  203. "TDM_B Playback", "TDMOUT_B OUT";
  204.  
  205. assigned-clocks = <&clkc CLKID_MPLL2>,
  206. <&clkc CLKID_MPLL0>,
  207. <&clkc CLKID_MPLL1>;
  208. assigned-clock-parents = <0>, <0>, <0>;
  209. assigned-clock-rates = <294912000>,
  210. <270950400>,
  211. <393216000>;
  212. status = "okay";
  213.  
  214. dai-link-0 {
  215. sound-dai = <&frddr_a>;
  216. };
  217.  
  218. dai-link-1 {
  219. sound-dai = <&frddr_b>;
  220. };
  221.  
  222. dai-link-2 {
  223. sound-dai = <&frddr_c>;
  224. };
  225.  
  226. /* 8ch hdmi interface */
  227. dai-link-3 {
  228. sound-dai = <&tdmif_b>;
  229. dai-format = "i2s";
  230. dai-tdm-slot-tx-mask-0 = <1 1>;
  231. dai-tdm-slot-tx-mask-1 = <1 1>;
  232. dai-tdm-slot-tx-mask-2 = <1 1>;
  233. dai-tdm-slot-tx-mask-3 = <1 1>;
  234. mclk-fs = <256>;
  235.  
  236. codec-0 {
  237. sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
  238. };
  239.  
  240. codec-1 {
  241. sound-dai = <&pcm5122>;
  242. };
  243.  
  244. };
  245.  
  246. /* hdmi glue */
  247. dai-link-4 {
  248. sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
  249.  
  250. codec {
  251. sound-dai = <&hdmi_tx>;
  252. };
  253. };
  254. };
  255. };
  256.  
  257. &arb {
  258. status = "okay";
  259. };
  260.  
  261. &clkc_audio {
  262. status = "okay";
  263. };
  264.  
  265. &cpu0 {
  266. cpu-supply = <&vddcpu>;
  267. operating-points-v2 = <&cpu_opp_table>;
  268. clocks = <&clkc CLKID_CPU_CLK>;
  269. clock-latency = <50000>;
  270. };
  271.  
  272. &cpu1 {
  273. cpu-supply = <&vddcpu>;
  274. operating-points-v2 = <&cpu_opp_table>;
  275. clocks = <&clkc CLKID_CPU1_CLK>;
  276. clock-latency = <50000>;
  277. };
  278.  
  279. &cpu2 {
  280. cpu-supply = <&vddcpu>;
  281. operating-points-v2 = <&cpu_opp_table>;
  282. clocks = <&clkc CLKID_CPU2_CLK>;
  283. clock-latency = <50000>;
  284. };
  285.  
  286. &cpu3 {
  287. cpu-supply = <&vddcpu>;
  288. operating-points-v2 = <&cpu_opp_table>;
  289. clocks = <&clkc CLKID_CPU3_CLK>;
  290. clock-latency = <50000>;
  291. };
  292.  
  293. &cpu_opp_table {
  294. opp-1000000000 {
  295. opp-hz = /bits/ 64 <1000000000>;
  296. opp-microvolt = <800000>;
  297. };
  298.  
  299. opp-1200000000 {
  300. opp-hz = /bits/ 64 <1200000000>;
  301. opp-microvolt = <810000>;
  302. };
  303.  
  304. opp-1404000000 {
  305. opp-hz = /bits/ 64 <1404000000>;
  306. opp-microvolt = <820000>;
  307. };
  308.  
  309. opp-1512000000 {
  310. opp-hz = /bits/ 64 <1500000000>;
  311. opp-microvolt = <830000>;
  312. };
  313.  
  314. opp-1608000000 {
  315. opp-hz = /bits/ 64 <1608000000>;
  316. opp-microvolt = <860000>;
  317. };
  318.  
  319. opp-1704000000 {
  320. opp-hz = /bits/ 64 <1704000000>;
  321. opp-microvolt = <900000>;
  322. };
  323.  
  324. opp-1800000000 {
  325. opp-hz = /bits/ 64 <1800000000>;
  326. opp-microvolt = <940000>;
  327. };
  328.  
  329. opp-1908000000 {
  330. opp-hz = /bits/ 64 <1908000000>;
  331. opp-microvolt = <1000000>;
  332. };
  333. };
  334.  
  335. &ext_mdio {
  336. external_phy: ethernet-phy@0 {
  337. /* Realtek RTL8211F (0x001cc916) */
  338. reg = <0>;
  339. max-speed = <1000>;
  340.  
  341. reset-assert-us = <10000>;
  342. reset-deassert-us = <30000>;
  343. reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
  344.  
  345. interrupt-parent = <&gpio_intc>;
  346. /* MAC_INTR on GPIOZ_14 */
  347. interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
  348. };
  349. };
  350.  
  351. &ethmac {
  352. pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
  353. pinctrl-names = "default";
  354. status = "okay";
  355. phy-mode = "rgmii";
  356. phy-handle = <&external_phy>;
  357. amlogic,tx-delay-ns = <2>;
  358. };
  359.  
  360. &frddr_a {
  361. status = "okay";
  362. };
  363.  
  364. &frddr_b {
  365. status = "okay";
  366. };
  367.  
  368. &frddr_c {
  369. status = "okay";
  370. };
  371.  
  372. &gpio {
  373. gpio-line-names =
  374. /* GPIOZ */
  375. "", "", "", "", "", "", "", "",
  376. "", "", "", "", "", "", "", "",
  377. /* GPIOH */
  378. "", "", "", "", "",
  379. "PIN_36", /* GPIOH_5 */
  380. "PIN_26", /* GPIOH_6 */
  381. "PIN_32", /* GPIOH_7 */
  382. "",
  383. /* BOOT */
  384. "", "", "", "", "", "", "", "",
  385. "", "", "", "", "", "", "", "",
  386. /* GPIOC */
  387. "", "", "", "", "", "", "", "",
  388. /* GPIOA */
  389. "", "", "", "", "", "", "", "",
  390. "", "", "", "", "", "",
  391. "PIN_27", /* GPIOA_14 */
  392. "PIN_28", /* GPIOA_15 */
  393. /* GPIOX */
  394. "PIN_16", /* GPIOX_0 */
  395. "PIN_18", /* GPIOX_1 */
  396. "PIN_22", /* GPIOX_2 */
  397. "PIN_11", /* GPIOX_3 */
  398. "PIN_13", /* GPIOX_4 */
  399. "PIN_7", /* GPIOX_5 */
  400. "PIN_33", /* GPIOX_6 */
  401. "PIN_15", /* GPIOX_7 */
  402. "PIN_19", /* GPIOX_8 */
  403. "PIN_21", /* GPIOX_9 */
  404. "PIN_24", /* GPIOX_10 */
  405. "PIN_23", /* GPIOX_11 */
  406. "PIN_8", /* GPIOX_12 */
  407. "PIN_10", /* GPIOX_13 */
  408. "PIN_29", /* GPIOX_14 */
  409. "PIN_31", /* GPIOX_15 */
  410. "PIN_12", /* GPIOX_16 */
  411. "PIN_3", /* GPIOX_17 */
  412. "PIN_5", /* GPIOX_18 */
  413. "PIN_35"; /* GPIOX_19 */
  414.  
  415. /*
  416. * WARNING: The USB Hub on the Odroid-C4 needs a reset signal
  417. * to be turned high in order to be detected by the USB Controller
  418. * This signal should be handled by a USB specific power sequence
  419. * in order to reset the Hub when USB bus is powered down.
  420. */
  421. usb-hub {
  422. gpio-hog;
  423. gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>;
  424. output-high;
  425. line-name = "usb-hub-reset";
  426. };
  427. };
  428.  
  429. &gpio_ao {
  430. gpio-line-names =
  431. /* GPIOAO */
  432. "", "", "", "",
  433. "PIN_47", /* GPIOAO_4 */
  434. "", "",
  435. "PIN_45", /* GPIOAO_7 */
  436. "PIN_46", /* GPIOAO_8 */
  437. "PIN_44", /* GPIOAO_9 */
  438. "PIN_42", /* GPIOAO_10 */
  439. "",
  440. /* GPIOE */
  441. "", "", "";
  442. };
  443.  
  444. &hdmi_tx {
  445. status = "okay";
  446. pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
  447. pinctrl-names = "default";
  448. hdmi-supply = <&vcc_5v>;
  449. };
  450.  
  451. &hdmi_tx_tmds_port {
  452. hdmi_tx_tmds_out: endpoint {
  453. remote-endpoint = <&hdmi_connector_in>;
  454. };
  455. };
  456.  
  457. &ir {
  458. status = "okay";
  459. pinctrl-0 = <&remote_input_ao_pins>;
  460. pinctrl-names = "default";
  461. linux,rc-map-name = "rc-odroid";
  462. };
  463.  
  464. &i2c2 {
  465. status = "okay";
  466.  
  467. /*
  468. * 40 Pin Header : SDA(GPIOX.17->3 Pin)
  469. * SCL(GPIOX.18->5 Pin)
  470. */
  471. pinctrl-names = "default";
  472. pinctrl-0 = <&i2c2_master_pins1>;
  473.  
  474. /* default 400k */
  475. clock-frequency = <400000>;
  476.  
  477. pcm5122: pcm5122@4c {
  478. #sound-dai-cells = <0>;
  479. compatible = "ti,pcm5122";
  480. reg = <0x4c>;
  481. AVDD-supply = <&vddao_3v3>;
  482. DVDD-supply = <&vddao_3v3>;
  483. CPVDD-supply = <&vddao_3v3>;
  484. clocks = <&clkc CLKID_MPLL1>;
  485. status = "okay";
  486. };
  487.  
  488. };
  489.  
  490. &i2c3 {
  491. /* default i2c clock-frequency is 100Khz */
  492. status = "okay";
  493.  
  494. /*
  495. * 40 Pin Header : SDA(GPIOA.14->27 Pin)
  496. * SCL(GPIOA.15->28 Pin)
  497. */
  498. pinctrl-names = "default";
  499. pinctrl-0 = <&i2c3_master_pins2>;
  500.  
  501. /* default 100k */
  502. clock-frequency = <100000>;
  503. };
  504.  
  505. &periphs_pinctrl {
  506. i2c2_master_pins1: i2c2-master-pins1 {
  507. mux {
  508. groups = "i2c2_sda_x",
  509. "i2c2_sck_x";
  510. function = "i2c2";
  511. bias-pull-up;
  512. drive-strength-microamp = <3000>;
  513. };
  514. };
  515.  
  516. i2c3_master_pins2: i2c3-master-pins2 {
  517. mux {
  518. groups = "i2c3_sda_a",
  519. "i2c3_sck_a";
  520. function = "i2c3";
  521. bias-pull-up;
  522. drive-strength-microamp = <3000>;
  523. };
  524. };
  525. };
  526.  
  527. &pwm_AO_cd {
  528. pinctrl-0 = <&pwm_ao_d_e_pins>;
  529. pinctrl-names = "default";
  530. clocks = <&xtal>;
  531. clock-names = "clkin1";
  532. status = "okay";
  533. };
  534.  
  535. &saradc {
  536. status = "okay";
  537. };
  538.  
  539. &saradc {
  540. status = "okay";
  541. };
  542.  
  543. /* SD card */
  544. &sd_emmc_b {
  545. status = "okay";
  546. pinctrl-0 = <&sdcard_c_pins>;
  547. pinctrl-1 = <&sdcard_clk_gate_c_pins>;
  548. pinctrl-names = "default", "clk-gate";
  549.  
  550. bus-width = <4>;
  551. cap-sd-highspeed;
  552. max-frequency = <200000000>;
  553. sd-uhs-sdr12;
  554. sd-uhs-sdr25;
  555. sd-uhs-sdr50;
  556. sd-uhs-sdr104;
  557. disable-wp;
  558.  
  559. cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
  560. vmmc-supply = <&tflash_vdd>;
  561. vqmmc-supply = <&tf_io>;
  562. };
  563.  
  564. /* eMMC */
  565. &sd_emmc_c {
  566. status = "okay";
  567. pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
  568. pinctrl-1 = <&emmc_clk_gate_pins>;
  569. pinctrl-names = "default", "clk-gate";
  570.  
  571. bus-width = <8>;
  572. cap-mmc-highspeed;
  573. mmc-ddr-1_8v;
  574. mmc-hs200-1_8v;
  575. max-frequency = <200000000>;
  576. disable-wp;
  577.  
  578. mmc-pwrseq = <&emmc_pwrseq>;
  579. vmmc-supply = <&vcc_3v3>;
  580. vqmmc-supply = <&flash_1v8>;
  581. };
  582.  
  583. &spicc0 {
  584. status = "okay";
  585.  
  586. /*
  587. * 40 Pin Header : MOSI(GPIOX.8->19 Pin),
  588. * MISO(GPIOX.9->21 Pin),
  589. * SPI0_CLK(GPIOX.11->23 Pin)
  590. * SPI_CS0(GPIOX.10->24 Pin)
  591. * SPI_CS1(GPIOH.6->26 Pin)
  592. */
  593. pinctrl-names = "default","gpio_periphs";
  594. pinctrl-0 = <&spicc0_x_pins>;
  595. pinctrl-1 = <&spicc0_ss0_x_pins>;
  596. num_chipselect = <1>;
  597.  
  598. cs-gpios = <&gpio GPIOX_10 GPIO_ACTIVE_LOW>;
  599.  
  600. spidev@0 {
  601. status = "okay";
  602.  
  603. compatible = "linux,spidev";
  604. /* spi default max clock 100Mhz */
  605. spi-max-frequency = <100000000>;
  606. reg = <0>;
  607. };
  608. };
  609.  
  610. &tdmif_b {
  611. pinctrl-0 = <&tdm_b_dout0_pins>, <&tdm_b_fs_pins>, <&tdm_b_sclk_pins>;
  612. pinctrl-names = "default";
  613. status = "okay";
  614.  
  615. assigned-clocks = <&clkc_audio AUD_CLKID_TDM_MCLK_PAD0>,
  616. <&clkc_audio AUD_CLKID_TDM_SCLK_PAD1>,
  617. <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD1>;
  618. assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_B_MCLK>,
  619. <&clkc_audio AUD_CLKID_MST_B_SCLK>,
  620. <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
  621. assigned-clock-rates = <0>, <0>, <0>;
  622. };
  623.  
  624.  
  625. &tdmout_b {
  626. status = "okay";
  627. };
  628.  
  629. &tohdmitx {
  630. status = "okay";
  631. };
  632.  
  633. &uart_A {
  634. status = "okay";
  635. pinctrl-names = "default";
  636. pinctrl-0 = <&uart_a_pins>;
  637. };
  638.  
  639. &uart_AO {
  640. status = "okay";
  641. pinctrl-0 = <&uart_ao_a_pins>;
  642. pinctrl-names = "default";
  643. };
  644.  
  645. &usb {
  646. status = "okay";
  647. vbus-supply = <&usb_pwr_en>;
  648. };
  649.  
  650. &usb2_phy0 {
  651. phy-supply = <&vcc_5v>;
  652. };
  653.  
  654. &usb2_phy1 {
  655. /* Enable the hub which is connected to this port */
  656. phy-supply = <&hub_5v>;
  657. };
  658.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement