meson-g12b-odroid-n2.dts 10 KB

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