meson-g12b-odroid-n2.dts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2019 BayLibre, SAS
  4. * Author: Neil Armstrong <narmstrong@baylibre.com>
  5. */
  6. /dts-v1/;
  7. #include "meson-g12b-s922x.dtsi"
  8. #include <dt-bindings/input/input.h>
  9. #include <dt-bindings/gpio/meson-g12a-gpio.h>
  10. #include <dt-bindings/sound/meson-g12a-toacodec.h>
  11. #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
  12. / {
  13. compatible = "hardkernel,odroid-n2", "amlogic,s922x", "amlogic,g12b";
  14. model = "Hardkernel ODROID-N2";
  15. aliases {
  16. serial0 = &uart_AO;
  17. ethernet0 = &ethmac;
  18. };
  19. dioo2133: audio-amplifier-0 {
  20. compatible = "simple-audio-amplifier";
  21. enable-gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
  22. VCC-supply = <&vcc_5v>;
  23. sound-name-prefix = "U19";
  24. status = "okay";
  25. };
  26. chosen {
  27. stdout-path = "serial0:115200n8";
  28. };
  29. memory@0 {
  30. device_type = "memory";
  31. reg = <0x0 0x0 0x0 0x40000000>;
  32. };
  33. emmc_pwrseq: emmc-pwrseq {
  34. compatible = "mmc-pwrseq-emmc";
  35. reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
  36. };
  37. leds {
  38. compatible = "gpio-leds";
  39. blue {
  40. label = "n2:blue";
  41. gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>;
  42. linux,default-trigger = "heartbeat";
  43. };
  44. };
  45. tflash_vdd: regulator-tflash_vdd {
  46. compatible = "regulator-fixed";
  47. regulator-name = "TFLASH_VDD";
  48. regulator-min-microvolt = <3300000>;
  49. regulator-max-microvolt = <3300000>;
  50. gpio = <&gpio_ao GPIOAO_8 GPIO_ACTIVE_HIGH>;
  51. enable-active-high;
  52. regulator-always-on;
  53. };
  54. tf_io: gpio-regulator-tf_io {
  55. compatible = "regulator-gpio";
  56. regulator-name = "TF_IO";
  57. regulator-min-microvolt = <1800000>;
  58. regulator-max-microvolt = <3300000>;
  59. gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>;
  60. gpios-states = <0>;
  61. states = <3300000 0>,
  62. <1800000 1>;
  63. };
  64. flash_1v8: regulator-flash_1v8 {
  65. compatible = "regulator-fixed";
  66. regulator-name = "FLASH_1V8";
  67. regulator-min-microvolt = <1800000>;
  68. regulator-max-microvolt = <1800000>;
  69. vin-supply = <&vcc_3v3>;
  70. regulator-always-on;
  71. };
  72. main_12v: regulator-main_12v {
  73. compatible = "regulator-fixed";
  74. regulator-name = "12V";
  75. regulator-min-microvolt = <12000000>;
  76. regulator-max-microvolt = <12000000>;
  77. regulator-always-on;
  78. };
  79. vcc_5v: regulator-vcc_5v {
  80. compatible = "regulator-fixed";
  81. regulator-name = "5V";
  82. regulator-min-microvolt = <5000000>;
  83. regulator-max-microvolt = <5000000>;
  84. regulator-always-on;
  85. vin-supply = <&main_12v>;
  86. };
  87. vcc_1v8: regulator-vcc_1v8 {
  88. compatible = "regulator-fixed";
  89. regulator-name = "VCC_1V8";
  90. regulator-min-microvolt = <1800000>;
  91. regulator-max-microvolt = <1800000>;
  92. vin-supply = <&vcc_3v3>;
  93. regulator-always-on;
  94. };
  95. vcc_3v3: regulator-vcc_3v3 {
  96. compatible = "regulator-fixed";
  97. regulator-name = "VCC_3V3";
  98. regulator-min-microvolt = <3300000>;
  99. regulator-max-microvolt = <3300000>;
  100. vin-supply = <&vddao_3v3>;
  101. regulator-always-on;
  102. /* FIXME: actually controlled by VDDCPU_B_EN */
  103. };
  104. vddcpu_a: regulator-vddcpu-a {
  105. /*
  106. * MP8756GD Regulator.
  107. */
  108. compatible = "pwm-regulator";
  109. regulator-name = "VDDCPU_A";
  110. regulator-min-microvolt = <721000>;
  111. regulator-max-microvolt = <1022000>;
  112. vin-supply = <&main_12v>;
  113. pwms = <&pwm_ab 0 1250 0>;
  114. pwm-dutycycle-range = <100 0>;
  115. regulator-boot-on;
  116. regulator-always-on;
  117. };
  118. vddcpu_b: regulator-vddcpu-b {
  119. /*
  120. * Silergy SY8120B1ABC Regulator.
  121. */
  122. compatible = "pwm-regulator";
  123. regulator-name = "VDDCPU_B";
  124. regulator-min-microvolt = <721000>;
  125. regulator-max-microvolt = <1022000>;
  126. vin-supply = <&main_12v>;
  127. pwms = <&pwm_AO_cd 1 1250 0>;
  128. pwm-dutycycle-range = <100 0>;
  129. regulator-boot-on;
  130. regulator-always-on;
  131. };
  132. hub_5v: regulator-hub_5v {
  133. compatible = "regulator-fixed";
  134. regulator-name = "HUB_5V";
  135. regulator-min-microvolt = <5000000>;
  136. regulator-max-microvolt = <5000000>;
  137. vin-supply = <&vcc_5v>;
  138. /* Connected to the Hub CHIPENABLE, LOW sets low power state */
  139. gpio = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
  140. enable-active-high;
  141. };
  142. usb_pwr_en: regulator-usb_pwr_en {
  143. compatible = "regulator-fixed";
  144. regulator-name = "USB_PWR_EN";
  145. regulator-min-microvolt = <5000000>;
  146. regulator-max-microvolt = <5000000>;
  147. vin-supply = <&vcc_5v>;
  148. /* Connected to the microUSB port power enable */
  149. gpio = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
  150. enable-active-high;
  151. };
  152. vddao_1v8: regulator-vddao_1v8 {
  153. compatible = "regulator-fixed";
  154. regulator-name = "VDDAO_1V8";
  155. regulator-min-microvolt = <1800000>;
  156. regulator-max-microvolt = <1800000>;
  157. vin-supply = <&vddao_3v3>;
  158. regulator-always-on;
  159. };
  160. vddao_3v3: regulator-vddao_3v3 {
  161. compatible = "regulator-fixed";
  162. regulator-name = "VDDAO_3V3";
  163. regulator-min-microvolt = <3300000>;
  164. regulator-max-microvolt = <3300000>;
  165. vin-supply = <&main_12v>;
  166. regulator-always-on;
  167. };
  168. hdmi-connector {
  169. compatible = "hdmi-connector";
  170. type = "a";
  171. port {
  172. hdmi_connector_in: endpoint {
  173. remote-endpoint = <&hdmi_tx_tmds_out>;
  174. };
  175. };
  176. };
  177. sound {
  178. compatible = "amlogic,axg-sound-card";
  179. model = "G12B-ODROID-N2";
  180. audio-widgets = "Line", "Lineout";
  181. audio-aux-devs = <&tdmout_b>, <&tdmout_c>, <&tdmin_a>,
  182. <&tdmin_b>, <&tdmin_c>, <&tdmin_lb>,
  183. <&dioo2133>;
  184. audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
  185. "TDMOUT_B IN 1", "FRDDR_B OUT 1",
  186. "TDMOUT_B IN 2", "FRDDR_C OUT 1",
  187. "TDM_B Playback", "TDMOUT_B OUT",
  188. "TDMOUT_C IN 0", "FRDDR_A OUT 2",
  189. "TDMOUT_C IN 1", "FRDDR_B OUT 2",
  190. "TDMOUT_C IN 2", "FRDDR_C OUT 2",
  191. "TDM_C Playback", "TDMOUT_C OUT",
  192. "TDMIN_A IN 4", "TDM_B Loopback",
  193. "TDMIN_B IN 4", "TDM_B Loopback",
  194. "TDMIN_C IN 4", "TDM_B Loopback",
  195. "TDMIN_LB IN 1", "TDM_B Loopback",
  196. "TDMIN_A IN 5", "TDM_C Loopback",
  197. "TDMIN_B IN 5", "TDM_C Loopback",
  198. "TDMIN_C IN 5", "TDM_C Loopback",
  199. "TDMIN_LB IN 2", "TDM_C Loopback",
  200. "TODDR_A IN 0", "TDMIN_A OUT",
  201. "TODDR_B IN 0", "TDMIN_A OUT",
  202. "TODDR_C IN 0", "TDMIN_A OUT",
  203. "TODDR_A IN 1", "TDMIN_B OUT",
  204. "TODDR_B IN 1", "TDMIN_B OUT",
  205. "TODDR_C IN 1", "TDMIN_B OUT",
  206. "TODDR_A IN 2", "TDMIN_C OUT",
  207. "TODDR_B IN 2", "TDMIN_C OUT",
  208. "TODDR_C IN 2", "TDMIN_C OUT",
  209. "TODDR_A IN 6", "TDMIN_LB OUT",
  210. "TODDR_B IN 6", "TDMIN_LB OUT",
  211. "TODDR_C IN 6", "TDMIN_LB OUT",
  212. "U19 INL", "ACODEC LOLP",
  213. "U19 INR", "ACODEC LORP",
  214. "Lineout", "U19 OUTL",
  215. "Lineout", "U19 OUTR";
  216. assigned-clocks = <&clkc CLKID_MPLL2>,
  217. <&clkc CLKID_MPLL0>,
  218. <&clkc CLKID_MPLL1>;
  219. assigned-clock-parents = <0>, <0>, <0>;
  220. assigned-clock-rates = <294912000>,
  221. <270950400>,
  222. <393216000>;
  223. status = "okay";
  224. dai-link-0 {
  225. sound-dai = <&frddr_a>;
  226. };
  227. dai-link-1 {
  228. sound-dai = <&frddr_b>;
  229. };
  230. dai-link-2 {
  231. sound-dai = <&frddr_c>;
  232. };
  233. dai-link-3 {
  234. sound-dai = <&toddr_a>;
  235. };
  236. dai-link-4 {
  237. sound-dai = <&toddr_b>;
  238. };
  239. dai-link-5 {
  240. sound-dai = <&toddr_c>;
  241. };
  242. /* 8ch hdmi interface */
  243. dai-link-6 {
  244. sound-dai = <&tdmif_b>;
  245. dai-format = "i2s";
  246. dai-tdm-slot-tx-mask-0 = <1 1>;
  247. dai-tdm-slot-tx-mask-1 = <1 1>;
  248. dai-tdm-slot-tx-mask-2 = <1 1>;
  249. dai-tdm-slot-tx-mask-3 = <1 1>;
  250. mclk-fs = <256>;
  251. codec-0 {
  252. sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
  253. };
  254. codec-1 {
  255. sound-dai = <&toacodec TOACODEC_IN_B>;
  256. };
  257. };
  258. /* i2s jack output interface */
  259. dai-link-7 {
  260. sound-dai = <&tdmif_c>;
  261. dai-format = "i2s";
  262. dai-tdm-slot-tx-mask-0 = <1 1>;
  263. mclk-fs = <256>;
  264. codec-0 {
  265. sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>;
  266. };
  267. codec-1 {
  268. sound-dai = <&toacodec TOACODEC_IN_C>;
  269. };
  270. };
  271. /* hdmi glue */
  272. dai-link-8 {
  273. sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
  274. codec {
  275. sound-dai = <&hdmi_tx>;
  276. };
  277. };
  278. /* acodec glue */
  279. dai-link-9 {
  280. sound-dai = <&toacodec TOACODEC_OUT>;
  281. codec {
  282. sound-dai = <&acodec>;
  283. };
  284. };
  285. };
  286. };
  287. &acodec {
  288. AVDD-supply = <&vddao_1v8>;
  289. status = "okay";
  290. };
  291. &arb {
  292. status = "okay";
  293. };
  294. &cec_AO {
  295. pinctrl-0 = <&cec_ao_a_h_pins>;
  296. pinctrl-names = "default";
  297. status = "disabled";
  298. hdmi-phandle = <&hdmi_tx>;
  299. };
  300. &cecb_AO {
  301. pinctrl-0 = <&cec_ao_b_h_pins>;
  302. pinctrl-names = "default";
  303. status = "okay";
  304. hdmi-phandle = <&hdmi_tx>;
  305. };
  306. &clkc_audio {
  307. status = "okay";
  308. };
  309. &cpu0 {
  310. cpu-supply = <&vddcpu_b>;
  311. operating-points-v2 = <&cpu_opp_table_0>;
  312. clocks = <&clkc CLKID_CPU_CLK>;
  313. clock-latency = <50000>;
  314. };
  315. &cpu1 {
  316. cpu-supply = <&vddcpu_b>;
  317. operating-points-v2 = <&cpu_opp_table_0>;
  318. clocks = <&clkc CLKID_CPU_CLK>;
  319. clock-latency = <50000>;
  320. };
  321. &cpu100 {
  322. cpu-supply = <&vddcpu_a>;
  323. operating-points-v2 = <&cpub_opp_table_1>;
  324. clocks = <&clkc CLKID_CPUB_CLK>;
  325. clock-latency = <50000>;
  326. };
  327. &cpu101 {
  328. cpu-supply = <&vddcpu_a>;
  329. operating-points-v2 = <&cpub_opp_table_1>;
  330. clocks = <&clkc CLKID_CPUB_CLK>;
  331. clock-latency = <50000>;
  332. };
  333. &cpu102 {
  334. cpu-supply = <&vddcpu_a>;
  335. operating-points-v2 = <&cpub_opp_table_1>;
  336. clocks = <&clkc CLKID_CPUB_CLK>;
  337. clock-latency = <50000>;
  338. };
  339. &cpu103 {
  340. cpu-supply = <&vddcpu_a>;
  341. operating-points-v2 = <&cpub_opp_table_1>;
  342. clocks = <&clkc CLKID_CPUB_CLK>;
  343. clock-latency = <50000>;
  344. };
  345. &ext_mdio {
  346. external_phy: ethernet-phy@0 {
  347. /* Realtek RTL8211F (0x001cc916) */
  348. reg = <0>;
  349. max-speed = <1000>;
  350. reset-assert-us = <10000>;
  351. reset-deassert-us = <30000>;
  352. reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
  353. interrupt-parent = <&gpio_intc>;
  354. /* MAC_INTR on GPIOZ_14 */
  355. interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
  356. };
  357. };
  358. &ethmac {
  359. pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
  360. pinctrl-names = "default";
  361. status = "okay";
  362. phy-mode = "rgmii";
  363. phy-handle = <&external_phy>;
  364. amlogic,tx-delay-ns = <2>;
  365. };
  366. &frddr_a {
  367. status = "okay";
  368. };
  369. &frddr_b {
  370. status = "okay";
  371. };
  372. &frddr_c {
  373. status = "okay";
  374. };
  375. &gpio {
  376. /*
  377. * WARNING: The USB Hub on the Odroid-N2 needs a reset signal
  378. * to be turned high in order to be detected by the USB Controller
  379. * This signal should be handled by a USB specific power sequence
  380. * in order to reset the Hub when USB bus is powered down.
  381. */
  382. usb-hub {
  383. gpio-hog;
  384. gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>;
  385. output-high;
  386. line-name = "usb-hub-reset";
  387. };
  388. };
  389. &hdmi_tx {
  390. status = "okay";
  391. pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
  392. pinctrl-names = "default";
  393. hdmi-supply = <&vcc_5v>;
  394. };
  395. &hdmi_tx_tmds_port {
  396. hdmi_tx_tmds_out: endpoint {
  397. remote-endpoint = <&hdmi_connector_in>;
  398. };
  399. };
  400. &ir {
  401. status = "okay";
  402. pinctrl-0 = <&remote_input_ao_pins>;
  403. pinctrl-names = "default";
  404. linux,rc-map-name = "rc-odroid";
  405. };
  406. &pwm_ab {
  407. pinctrl-0 = <&pwm_a_e_pins>;
  408. pinctrl-names = "default";
  409. clocks = <&xtal>;
  410. clock-names = "clkin0";
  411. status = "okay";
  412. };
  413. &pwm_AO_cd {
  414. pinctrl-0 = <&pwm_ao_d_e_pins>;
  415. pinctrl-names = "default";
  416. clocks = <&xtal>;
  417. clock-names = "clkin1";
  418. status = "okay";
  419. };
  420. /* SD card */
  421. &sd_emmc_b {
  422. status = "okay";
  423. pinctrl-0 = <&sdcard_c_pins>;
  424. pinctrl-1 = <&sdcard_clk_gate_c_pins>;
  425. pinctrl-names = "default", "clk-gate";
  426. bus-width = <4>;
  427. cap-sd-highspeed;
  428. max-frequency = <50000000>;
  429. disable-wp;
  430. cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
  431. vmmc-supply = <&tflash_vdd>;
  432. vqmmc-supply = <&tf_io>;
  433. };
  434. /* eMMC */
  435. &sd_emmc_c {
  436. status = "okay";
  437. pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
  438. pinctrl-1 = <&emmc_clk_gate_pins>;
  439. pinctrl-names = "default", "clk-gate";
  440. bus-width = <8>;
  441. cap-mmc-highspeed;
  442. mmc-ddr-1_8v;
  443. mmc-hs200-1_8v;
  444. max-frequency = <200000000>;
  445. disable-wp;
  446. mmc-pwrseq = <&emmc_pwrseq>;
  447. vmmc-supply = <&vcc_3v3>;
  448. vqmmc-supply = <&flash_1v8>;
  449. };
  450. /*
  451. * EMMC_D4, EMMC_D5, EMMC_D6 and EMMC_D7 pins are shared between SPI NOR pins
  452. * and eMMC Data 4 to 7 pins.
  453. * Replace emmc_data_8b_pins to emmc_data_4b_pins from sd_emmc_c pinctrl-0,
  454. * and change bus-width to 4 then spifc can be enabled.
  455. * The SW1 slide should also be set to the correct position.
  456. */
  457. &spifc {
  458. status = "disabled";
  459. pinctrl-0 = <&nor_pins>;
  460. pinctrl-names = "default";
  461. mx25u64: spi-flash@0 {
  462. #address-cells = <1>;
  463. #size-cells = <1>;
  464. compatible = "mxicy,mx25u6435f", "jedec,spi-nor";
  465. reg = <0>;
  466. spi-max-frequency = <104000000>;
  467. };
  468. };
  469. &tdmif_b {
  470. status = "okay";
  471. };
  472. &tdmif_c {
  473. status = "okay";
  474. };
  475. &tdmin_a {
  476. status = "okay";
  477. };
  478. &tdmin_b {
  479. status = "okay";
  480. };
  481. &tdmin_c {
  482. status = "okay";
  483. };
  484. &tdmin_lb {
  485. status = "okay";
  486. };
  487. &tdmout_b {
  488. status = "okay";
  489. };
  490. &tdmout_c {
  491. status = "okay";
  492. };
  493. &toacodec {
  494. status = "okay";
  495. };
  496. &tohdmitx {
  497. status = "okay";
  498. };
  499. &toddr_a {
  500. status = "okay";
  501. };
  502. &toddr_b {
  503. status = "okay";
  504. };
  505. &toddr_c {
  506. status = "okay";
  507. };
  508. &uart_AO {
  509. status = "okay";
  510. pinctrl-0 = <&uart_ao_a_pins>;
  511. pinctrl-names = "default";
  512. };
  513. &usb {
  514. status = "okay";
  515. vbus-supply = <&usb_pwr_en>;
  516. };
  517. &usb2_phy0 {
  518. phy-supply = <&vcc_5v>;
  519. };
  520. &usb2_phy1 {
  521. /* Enable the hub which is connected to this port */
  522. phy-supply = <&hub_5v>;
  523. };