meson-sm1-odroid-c4.dts 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2020 Dongjin Kim <tobetter@gmail.com>
  4. */
  5. /dts-v1/;
  6. #include "meson-sm1.dtsi"
  7. #include <dt-bindings/gpio/meson-g12a-gpio.h>
  8. #include <dt-bindings/leds/common.h>
  9. #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
  10. / {
  11. compatible = "hardkernel,odroid-c4", "amlogic,sm1";
  12. model = "Hardkernel ODROID-C4";
  13. aliases {
  14. serial0 = &uart_AO;
  15. ethernet0 = &ethmac;
  16. };
  17. chosen {
  18. stdout-path = "serial0:115200n8";
  19. };
  20. memory@0 {
  21. device_type = "memory";
  22. reg = <0x0 0x0 0x0 0x40000000>;
  23. };
  24. emmc_pwrseq: emmc-pwrseq {
  25. compatible = "mmc-pwrseq-emmc";
  26. reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
  27. };
  28. leds {
  29. compatible = "gpio-leds";
  30. led-blue {
  31. color = <LED_COLOR_ID_BLUE>;
  32. function = LED_FUNCTION_STATUS;
  33. gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>;
  34. linux,default-trigger = "heartbeat";
  35. panic-indicator;
  36. };
  37. };
  38. tflash_vdd: regulator-tflash_vdd {
  39. compatible = "regulator-fixed";
  40. regulator-name = "TFLASH_VDD";
  41. regulator-min-microvolt = <3300000>;
  42. regulator-max-microvolt = <3300000>;
  43. gpio = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
  44. enable-active-high;
  45. regulator-always-on;
  46. };
  47. tf_io: gpio-regulator-tf_io {
  48. compatible = "regulator-gpio";
  49. regulator-name = "TF_IO";
  50. regulator-min-microvolt = <1800000>;
  51. regulator-max-microvolt = <3300000>;
  52. gpios = <&gpio_ao GPIOAO_6 GPIO_ACTIVE_HIGH>;
  53. gpios-states = <0>;
  54. states = <3300000 0>,
  55. <1800000 1>;
  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. main_12v: regulator-main_12v {
  66. compatible = "regulator-fixed";
  67. regulator-name = "12V";
  68. regulator-min-microvolt = <12000000>;
  69. regulator-max-microvolt = <12000000>;
  70. regulator-always-on;
  71. };
  72. vcc_5v: regulator-vcc_5v {
  73. compatible = "regulator-fixed";
  74. regulator-name = "5V";
  75. regulator-min-microvolt = <5000000>;
  76. regulator-max-microvolt = <5000000>;
  77. regulator-always-on;
  78. vin-supply = <&main_12v>;
  79. };
  80. vcc_1v8: regulator-vcc_1v8 {
  81. compatible = "regulator-fixed";
  82. regulator-name = "VCC_1V8";
  83. regulator-min-microvolt = <1800000>;
  84. regulator-max-microvolt = <1800000>;
  85. vin-supply = <&vcc_3v3>;
  86. regulator-always-on;
  87. };
  88. vcc_3v3: regulator-vcc_3v3 {
  89. compatible = "regulator-fixed";
  90. regulator-name = "VCC_3V3";
  91. regulator-min-microvolt = <3300000>;
  92. regulator-max-microvolt = <3300000>;
  93. vin-supply = <&vddao_3v3>;
  94. regulator-always-on;
  95. /* FIXME: actually controlled by VDDCPU_B_EN */
  96. };
  97. vddcpu: regulator-vddcpu {
  98. /*
  99. * MP8756GD Regulator.
  100. */
  101. compatible = "pwm-regulator";
  102. regulator-name = "VDDCPU";
  103. regulator-min-microvolt = <721000>;
  104. regulator-max-microvolt = <1022000>;
  105. vin-supply = <&main_12v>;
  106. pwms = <&pwm_AO_cd 1 1250 0>;
  107. pwm-dutycycle-range = <100 0>;
  108. regulator-boot-on;
  109. regulator-always-on;
  110. };
  111. hub_5v: regulator-hub_5v {
  112. compatible = "regulator-fixed";
  113. regulator-name = "HUB_5V";
  114. regulator-min-microvolt = <5000000>;
  115. regulator-max-microvolt = <5000000>;
  116. vin-supply = <&vcc_5v>;
  117. /* Connected to the Hub CHIPENABLE, LOW sets low power state */
  118. gpio = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>;
  119. enable-active-high;
  120. };
  121. usb_pwr_en: regulator-usb_pwr_en {
  122. compatible = "regulator-fixed";
  123. regulator-name = "USB_PWR_EN";
  124. regulator-min-microvolt = <5000000>;
  125. regulator-max-microvolt = <5000000>;
  126. vin-supply = <&vcc_5v>;
  127. /* Connected to the microUSB port power enable */
  128. gpio = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
  129. enable-active-high;
  130. };
  131. vddao_1v8: regulator-vddao_1v8 {
  132. compatible = "regulator-fixed";
  133. regulator-name = "VDDAO_1V8";
  134. regulator-min-microvolt = <1800000>;
  135. regulator-max-microvolt = <1800000>;
  136. vin-supply = <&vddao_3v3>;
  137. regulator-always-on;
  138. };
  139. vddao_3v3: regulator-vddao_3v3 {
  140. compatible = "regulator-fixed";
  141. regulator-name = "VDDAO_3V3";
  142. regulator-min-microvolt = <3300000>;
  143. regulator-max-microvolt = <3300000>;
  144. vin-supply = <&main_12v>;
  145. regulator-always-on;
  146. };
  147. hdmi-connector {
  148. compatible = "hdmi-connector";
  149. type = "a";
  150. port {
  151. hdmi_connector_in: endpoint {
  152. remote-endpoint = <&hdmi_tx_tmds_out>;
  153. };
  154. };
  155. };
  156. sound {
  157. compatible = "amlogic,axg-sound-card";
  158. model = "SM1-ODROID-C4";
  159. audio-aux-devs = <&tdmout_b>;
  160. audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
  161. "TDMOUT_B IN 1", "FRDDR_B OUT 1",
  162. "TDMOUT_B IN 2", "FRDDR_C OUT 1",
  163. "TDM_B Playback", "TDMOUT_B OUT";
  164. assigned-clocks = <&clkc CLKID_MPLL2>,
  165. <&clkc CLKID_MPLL0>,
  166. <&clkc CLKID_MPLL1>;
  167. assigned-clock-parents = <0>, <0>, <0>;
  168. assigned-clock-rates = <294912000>,
  169. <270950400>,
  170. <393216000>;
  171. status = "okay";
  172. dai-link-0 {
  173. sound-dai = <&frddr_a>;
  174. };
  175. dai-link-1 {
  176. sound-dai = <&frddr_b>;
  177. };
  178. dai-link-2 {
  179. sound-dai = <&frddr_c>;
  180. };
  181. /* 8ch hdmi interface */
  182. dai-link-3 {
  183. sound-dai = <&tdmif_b>;
  184. dai-format = "i2s";
  185. dai-tdm-slot-tx-mask-0 = <1 1>;
  186. dai-tdm-slot-tx-mask-1 = <1 1>;
  187. dai-tdm-slot-tx-mask-2 = <1 1>;
  188. dai-tdm-slot-tx-mask-3 = <1 1>;
  189. mclk-fs = <256>;
  190. codec {
  191. sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
  192. };
  193. };
  194. /* hdmi glue */
  195. dai-link-4 {
  196. sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
  197. codec {
  198. sound-dai = <&hdmi_tx>;
  199. };
  200. };
  201. };
  202. };
  203. &arb {
  204. status = "okay";
  205. };
  206. &clkc_audio {
  207. status = "okay";
  208. };
  209. &cpu0 {
  210. cpu-supply = <&vddcpu>;
  211. operating-points-v2 = <&cpu_opp_table>;
  212. clocks = <&clkc CLKID_CPU_CLK>;
  213. clock-latency = <50000>;
  214. };
  215. &cpu1 {
  216. cpu-supply = <&vddcpu>;
  217. operating-points-v2 = <&cpu_opp_table>;
  218. clocks = <&clkc CLKID_CPU1_CLK>;
  219. clock-latency = <50000>;
  220. };
  221. &cpu2 {
  222. cpu-supply = <&vddcpu>;
  223. operating-points-v2 = <&cpu_opp_table>;
  224. clocks = <&clkc CLKID_CPU2_CLK>;
  225. clock-latency = <50000>;
  226. };
  227. &cpu3 {
  228. cpu-supply = <&vddcpu>;
  229. operating-points-v2 = <&cpu_opp_table>;
  230. clocks = <&clkc CLKID_CPU3_CLK>;
  231. clock-latency = <50000>;
  232. };
  233. &ext_mdio {
  234. external_phy: ethernet-phy@0 {
  235. /* Realtek RTL8211F (0x001cc916) */
  236. reg = <0>;
  237. max-speed = <1000>;
  238. interrupt-parent = <&gpio_intc>;
  239. /* MAC_INTR on GPIOZ_14 */
  240. interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
  241. };
  242. };
  243. &ethmac {
  244. pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
  245. pinctrl-names = "default";
  246. status = "okay";
  247. phy-mode = "rgmii";
  248. phy-handle = <&external_phy>;
  249. amlogic,tx-delay-ns = <2>;
  250. };
  251. &frddr_a {
  252. status = "okay";
  253. };
  254. &frddr_b {
  255. status = "okay";
  256. };
  257. &frddr_c {
  258. status = "okay";
  259. };
  260. &gpio {
  261. gpio-line-names =
  262. /* GPIOZ */
  263. "", "", "", "", "", "", "", "",
  264. "", "", "", "", "", "", "", "",
  265. /* GPIOH */
  266. "", "", "", "", "",
  267. "PIN_36", /* GPIOH_5 */
  268. "PIN_26", /* GPIOH_6 */
  269. "PIN_32", /* GPIOH_7 */
  270. "",
  271. /* BOOT */
  272. "", "", "", "", "", "", "", "",
  273. "", "", "", "", "", "", "", "",
  274. /* GPIOC */
  275. "", "", "", "", "", "", "", "",
  276. /* GPIOA */
  277. "", "", "", "", "", "", "", "",
  278. "", "", "", "", "", "",
  279. "PIN_27", /* GPIOA_14 */
  280. "PIN_28", /* GPIOA_15 */
  281. /* GPIOX */
  282. "PIN_16", /* GPIOX_0 */
  283. "PIN_18", /* GPIOX_1 */
  284. "PIN_22", /* GPIOX_2 */
  285. "PIN_11", /* GPIOX_3 */
  286. "PIN_13", /* GPIOX_4 */
  287. "PIN_7", /* GPIOX_5 */
  288. "PIN_33", /* GPIOX_6 */
  289. "PIN_15", /* GPIOX_7 */
  290. "PIN_19", /* GPIOX_8 */
  291. "PIN_21", /* GPIOX_9 */
  292. "PIN_24", /* GPIOX_10 */
  293. "PIN_23", /* GPIOX_11 */
  294. "PIN_8", /* GPIOX_12 */
  295. "PIN_10", /* GPIOX_13 */
  296. "PIN_29", /* GPIOX_14 */
  297. "PIN_31", /* GPIOX_15 */
  298. "PIN_12", /* GPIOX_16 */
  299. "PIN_3", /* GPIOX_17 */
  300. "PIN_5", /* GPIOX_18 */
  301. "PIN_35"; /* GPIOX_19 */
  302. /*
  303. * WARNING: The USB Hub on the Odroid-C4 needs a reset signal
  304. * to be turned high in order to be detected by the USB Controller
  305. * This signal should be handled by a USB specific power sequence
  306. * in order to reset the Hub when USB bus is powered down.
  307. */
  308. usb-hub {
  309. gpio-hog;
  310. gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>;
  311. output-high;
  312. line-name = "usb-hub-reset";
  313. };
  314. };
  315. &gpio_ao {
  316. gpio-line-names =
  317. /* GPIOAO */
  318. "", "", "", "",
  319. "PIN_47", /* GPIOAO_4 */
  320. "", "",
  321. "PIN_45", /* GPIOAO_7 */
  322. "PIN_46", /* GPIOAO_8 */
  323. "PIN_44", /* GPIOAO_9 */
  324. "PIN_42", /* GPIOAO_10 */
  325. "",
  326. /* GPIOE */
  327. "", "", "";
  328. };
  329. &hdmi_tx {
  330. status = "okay";
  331. pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
  332. pinctrl-names = "default";
  333. hdmi-supply = <&vcc_5v>;
  334. };
  335. &hdmi_tx_tmds_port {
  336. hdmi_tx_tmds_out: endpoint {
  337. remote-endpoint = <&hdmi_connector_in>;
  338. };
  339. };
  340. &ir {
  341. status = "okay";
  342. pinctrl-0 = <&remote_input_ao_pins>;
  343. pinctrl-names = "default";
  344. linux,rc-map-name = "rc-odroid";
  345. };
  346. &pwm_AO_cd {
  347. pinctrl-0 = <&pwm_ao_d_e_pins>;
  348. pinctrl-names = "default";
  349. clocks = <&xtal>;
  350. clock-names = "clkin1";
  351. status = "okay";
  352. };
  353. &saradc {
  354. status = "okay";
  355. };
  356. /* SD card */
  357. &sd_emmc_b {
  358. status = "okay";
  359. pinctrl-0 = <&sdcard_c_pins>;
  360. pinctrl-1 = <&sdcard_clk_gate_c_pins>;
  361. pinctrl-names = "default", "clk-gate";
  362. bus-width = <4>;
  363. cap-sd-highspeed;
  364. max-frequency = <200000000>;
  365. sd-uhs-sdr12;
  366. sd-uhs-sdr25;
  367. sd-uhs-sdr50;
  368. sd-uhs-sdr104;
  369. disable-wp;
  370. cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
  371. vmmc-supply = <&tflash_vdd>;
  372. vqmmc-supply = <&tf_io>;
  373. };
  374. /* eMMC */
  375. &sd_emmc_c {
  376. status = "okay";
  377. pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
  378. pinctrl-1 = <&emmc_clk_gate_pins>;
  379. pinctrl-names = "default", "clk-gate";
  380. bus-width = <8>;
  381. cap-mmc-highspeed;
  382. mmc-ddr-1_8v;
  383. mmc-hs200-1_8v;
  384. max-frequency = <200000000>;
  385. disable-wp;
  386. mmc-pwrseq = <&emmc_pwrseq>;
  387. vmmc-supply = <&vcc_3v3>;
  388. vqmmc-supply = <&flash_1v8>;
  389. };
  390. &tdmif_b {
  391. status = "okay";
  392. };
  393. &tdmout_b {
  394. status = "okay";
  395. };
  396. &tohdmitx {
  397. status = "okay";
  398. };
  399. &uart_AO {
  400. status = "okay";
  401. pinctrl-0 = <&uart_ao_a_pins>;
  402. pinctrl-names = "default";
  403. };
  404. &usb {
  405. status = "okay";
  406. vbus-supply = <&usb_pwr_en>;
  407. };
  408. &usb2_phy0 {
  409. phy-supply = <&vcc_5v>;
  410. };
  411. &usb2_phy1 {
  412. /* Enable the hub which is connected to this port */
  413. phy-supply = <&hub_5v>;
  414. };