meson8b-ec100.dts 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2018 Martin Blumenstingl <[email protected]>.
  4. */
  5. /dts-v1/;
  6. #include <dt-bindings/gpio/gpio.h>
  7. #include <dt-bindings/input/input.h>
  8. #include "meson8b.dtsi"
  9. / {
  10. model = "Endless Computers Endless Mini";
  11. compatible = "endless,ec100", "amlogic,meson8b";
  12. aliases {
  13. serial0 = &uart_AO;
  14. };
  15. chosen {
  16. stdout-path = "serial0:115200n8";
  17. };
  18. memory {
  19. device_type = "memory";
  20. reg = <0x40000000 0x40000000>;
  21. };
  22. emmc_pwrseq: emmc-pwrseq {
  23. compatible = "mmc-pwrseq-emmc";
  24. reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
  25. };
  26. gpio-keys {
  27. compatible = "gpio-keys-polled";
  28. #address-cells = <1>;
  29. #size-cells = <0>;
  30. poll-interval = <100>;
  31. pal-switch {
  32. label = "pal";
  33. linux,input-type = <EV_SW>;
  34. linux,code = <KEY_SWITCHVIDEOMODE>;
  35. gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
  36. };
  37. ntsc-switch {
  38. label = "ntsc";
  39. linux,input-type = <EV_SW>;
  40. linux,code = <KEY_SWITCHVIDEOMODE>;
  41. gpios = <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
  42. };
  43. power-button {
  44. label = "power";
  45. linux,code = <KEY_POWER>;
  46. gpios = <&gpio GPIOH_9 GPIO_ACTIVE_LOW>;
  47. };
  48. };
  49. gpio-poweroff {
  50. compatible = "gpio-poweroff";
  51. /*
  52. * shutdown is managed by the EC (embedded micro-controller)
  53. * which is configured through GPIOAO_2 (poweroff GPIO) and
  54. * GPIOAO_7 (power LED, which has to go LOW as well).
  55. */
  56. gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
  57. timeout-ms = <20000>;
  58. };
  59. leds {
  60. compatible = "gpio-leds";
  61. power {
  62. label = "ec100:red:power";
  63. /*
  64. * Needs to go LOW (together with the poweroff GPIO)
  65. * during shutdown to allow the EC (embedded
  66. * micro-controller) to shutdown the system. Setting
  67. * the output to LOW signals the EC to start a
  68. * "breathing"/pulsing effect until the power is fully
  69. * turned off.
  70. */
  71. gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>;
  72. default-state = "on";
  73. };
  74. };
  75. rtc32k_xtal: rtc32k-xtal-clk {
  76. /* X2 in the schematics */
  77. compatible = "fixed-clock";
  78. clock-frequency = <32768>;
  79. clock-output-names = "RTC32K";
  80. #clock-cells = <0>;
  81. };
  82. sound {
  83. compatible = "amlogic,gx-sound-card";
  84. model = "M8B-EC100";
  85. assigned-clocks = <&clkc CLKID_MPLL0>,
  86. <&clkc CLKID_MPLL1>,
  87. <&clkc CLKID_MPLL2>;
  88. assigned-clock-rates = <270950400>,
  89. <294912000>,
  90. <393216000>;
  91. dai-link-0 {
  92. sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
  93. };
  94. dai-link-1 {
  95. sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
  96. dai-format = "i2s";
  97. mclk-fs = <256>;
  98. codec-0 {
  99. sound-dai = <&rt5640>;
  100. };
  101. };
  102. };
  103. usb_vbus: regulator-usb-vbus {
  104. /*
  105. * Silergy SY6288CCAC-GP 2A Power Distribution Switch.
  106. */
  107. compatible = "regulator-fixed";
  108. regulator-name = "USB_VBUS";
  109. regulator-min-microvolt = <5000000>;
  110. regulator-max-microvolt = <5000000>;
  111. vin-supply = <&vcc_5v>;
  112. /*
  113. * signal name from the schematics: USB_PWR_EN
  114. */
  115. gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
  116. enable-active-high;
  117. };
  118. vcc_5v: regulator-vcc5v {
  119. /*
  120. * supplied by the main power input which called PWR_5V_STB
  121. * in the schematics
  122. */
  123. compatible = "regulator-fixed";
  124. regulator-name = "VCC5V";
  125. regulator-min-microvolt = <5000000>;
  126. regulator-max-microvolt = <5000000>;
  127. /*
  128. * signal name from the schematics: 3V3_5V_EN
  129. */
  130. gpio = <&gpio GPIODV_29 GPIO_ACTIVE_LOW>;
  131. regulator-boot-on;
  132. regulator-always-on;
  133. };
  134. vcck: regulator-vcck {
  135. /*
  136. * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
  137. * Synchronous Step Down Regulator.
  138. */
  139. compatible = "pwm-regulator";
  140. regulator-name = "VCCK";
  141. regulator-min-microvolt = <860000>;
  142. regulator-max-microvolt = <1140000>;
  143. pwm-supply = <&vcc_5v>;
  144. pwms = <&pwm_cd 0 1148 0>;
  145. pwm-dutycycle-range = <100 0>;
  146. regulator-boot-on;
  147. regulator-always-on;
  148. };
  149. vcc_1v8: regulator-vcc1v8 {
  150. /*
  151. * ABLIC S-1339D18-M5001-GP
  152. */
  153. compatible = "regulator-fixed";
  154. regulator-name = "VCC1V8";
  155. regulator-min-microvolt = <1800000>;
  156. regulator-max-microvolt = <1800000>;
  157. vin-supply = <&vcc_3v3>;
  158. };
  159. vcc_3v3: regulator-vcc3v3 {
  160. /*
  161. * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
  162. * Synchronous Step Down Regulator. Also called
  163. * VDDIO_AO3.3V in the schematics.
  164. */
  165. compatible = "regulator-fixed";
  166. regulator-name = "VCC3V3";
  167. regulator-min-microvolt = <3300000>;
  168. regulator-max-microvolt = <3300000>;
  169. vin-supply = <&vcc_5v>;
  170. };
  171. vcc_ddr3: regulator-vcc-ddr3 {
  172. /*
  173. * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
  174. * Synchronous Step Down Regulator. Also called
  175. * DDR3_1.5V in the schematics.
  176. */
  177. compatible = "regulator-fixed";
  178. regulator-name = "VCC_DDR3_1V5";
  179. regulator-min-microvolt = <1500000>;
  180. regulator-max-microvolt = <1500000>;
  181. vin-supply = <&vcc_5v>;
  182. regulator-boot-on;
  183. regulator-always-on;
  184. };
  185. vcc_rtc: regulator-vcc-rtc {
  186. /*
  187. * Global Mixed-mode Technology Inc. G918T12U-GP
  188. */
  189. compatible = "regulator-fixed";
  190. regulator-name = "VCC_RTC";
  191. regulator-min-microvolt = <900000>;
  192. regulator-max-microvolt = <900000>;
  193. /*
  194. * When the board is powered then the input is VCC3V3,
  195. * otherwise power is taken from the coin cell battery.
  196. */
  197. vin-supply = <&vcc_3v3>;
  198. };
  199. vddee: regulator-vddee {
  200. /*
  201. * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
  202. * Synchronous Step Down Regulator. Also called VDDAO
  203. * in a part of the schematics.
  204. */
  205. compatible = "pwm-regulator";
  206. regulator-name = "VDDEE";
  207. regulator-min-microvolt = <860000>;
  208. regulator-max-microvolt = <1140000>;
  209. pwm-supply = <&vcc_5v>;
  210. pwms = <&pwm_cd 1 1148 0>;
  211. pwm-dutycycle-range = <100 0>;
  212. regulator-boot-on;
  213. regulator-always-on;
  214. };
  215. };
  216. &aiu {
  217. status = "okay";
  218. pinctrl-0 = <&i2s_am_clk_pins>, <&i2s_out_ao_clk_pins>,
  219. <&i2s_out_lr_clk_pins>, <&i2s_out_ch01_ao_pins>;
  220. pinctrl-names = "default";
  221. };
  222. &cpu0 {
  223. cpu-supply = <&vcck>;
  224. };
  225. &ethmac {
  226. status = "okay";
  227. pinctrl-0 = <&eth_rmii_pins>;
  228. pinctrl-names = "default";
  229. phy-handle = <&eth_phy0>;
  230. phy-mode = "rmii";
  231. mdio {
  232. compatible = "snps,dwmac-mdio";
  233. #address-cells = <1>;
  234. #size-cells = <0>;
  235. eth_phy0: ethernet-phy@0 {
  236. /* IC Plus IP101A/G (0x02430c54) */
  237. reg = <0>;
  238. reset-assert-us = <10000>;
  239. reset-deassert-us = <10000>;
  240. reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
  241. icplus,select-interrupt;
  242. interrupt-parent = <&gpio_intc>;
  243. /* GPIOH_3 */
  244. interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
  245. };
  246. };
  247. };
  248. &i2c_A {
  249. status = "okay";
  250. pinctrl-0 = <&i2c_a_pins>;
  251. pinctrl-names = "default";
  252. rt5640: codec@1c {
  253. compatible = "realtek,rt5640";
  254. reg = <0x1c>;
  255. #sound-dai-cells = <0>;
  256. interrupt-parent = <&gpio_intc>;
  257. interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */
  258. /*
  259. * TODO: realtek,ldo1-en-gpios is connected to GPIO_BSD_EN.
  260. * We currently cannot configure this pin correctly.
  261. * Luckily for us it's in the "right" state by default.
  262. */
  263. realtek,in1-differential;
  264. };
  265. };
  266. &mali {
  267. mali-supply = <&vddee>;
  268. };
  269. &saradc {
  270. status = "okay";
  271. vref-supply = <&vcc_1v8>;
  272. };
  273. &sdhc {
  274. status = "okay";
  275. pinctrl-0 = <&sdxc_c_pins>;
  276. pinctrl-names = "default";
  277. bus-width = <8>;
  278. max-frequency = <50000000>;
  279. cap-mmc-highspeed;
  280. disable-wp;
  281. non-removable;
  282. no-sdio;
  283. mmc-pwrseq = <&emmc_pwrseq>;
  284. vmmc-supply = <&vcc_3v3>;
  285. vqmmc-supply = <&vcc_3v3>;
  286. };
  287. &sdio {
  288. status = "okay";
  289. pinctrl-0 = <&sd_b_pins>;
  290. pinctrl-names = "default";
  291. /* SD card */
  292. sd_card_slot: slot@1 {
  293. compatible = "mmc-slot";
  294. reg = <1>;
  295. status = "okay";
  296. bus-width = <4>;
  297. no-sdio;
  298. cap-mmc-highspeed;
  299. cap-sd-highspeed;
  300. disable-wp;
  301. cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
  302. vmmc-supply = <&vcc_3v3>;
  303. };
  304. };
  305. &gpio_ao {
  306. gpio-line-names = "Linux_TX", "Linux_RX",
  307. "SLP_S5_N", "USB2_OC_FLAG#",
  308. "HUB_RST", "USB_PWR_EN",
  309. "I2S_IN", "SLP_S1_N",
  310. "TCK", "TMS", "TDI", "TDO",
  311. "HDMI_CEC", "5640_IRQ",
  312. "MUTE", "S805_TEST#";
  313. };
  314. &gpio {
  315. gpio-line-names = /* Bank GPIOX */
  316. "WIFI_SD_D0", "WIFI_SD_D1", "WIFI_SD_D2",
  317. "WIFI_SD_D3", "BTPCM_DOUT", "BTPCM_DIN",
  318. "BTPCM_SYNC", "BTPCM_CLK", "WIFI_SD_CLK",
  319. "WIFI_SD_CMD", "WIFI_32K", "WIFI_PWREN",
  320. "UART_B_TX", "UART_B_RX", "UART_B_CTS_N",
  321. "UART_B_RTS_N", "BT_EN", "WIFI_WAKE_HOST",
  322. /* Bank GPIOY */
  323. "", "", "", "", "", "", "", "", "", "",
  324. "", "",
  325. /* Bank GPIODV */
  326. "VCCK_PWM_C", "I2C_SDA_A", "I2C_SCL_A",
  327. "I2C_SDA_B", "I2C_SCL_B", "VDDEE_PWM_D",
  328. "VDDEE_PWM 3V3_5V_EN",
  329. /* Bank GPIOH */
  330. "HDMI_HPD", "HDMI_I2C_SDA", "HDMI_I2C_SCL",
  331. "RMII_IRQ", "RMII_RST#", "RMII_TXD1",
  332. "RMII_TXD0", "AV_select_1", "AV_select_2",
  333. "MCU_Control_S",
  334. /* Bank CARD */
  335. "SD_D1_B", "SD_D0_B", "SD_CLK_8726MX",
  336. "SD_CMD_8726MX", "SD_D3_B", "SD_D2_B",
  337. "CARD_EN_DET (CARD_DET)",
  338. /* Bank BOOT */
  339. "NAND_D0 (EMMC)", "NAND_D1 (EMMC)",
  340. "NAND_D2 (EMMC)", "NAND_D3 (EMMC)",
  341. "NAND_D4 (EMMC)", "NAND_D5 (EMMC)",
  342. "NAND_D6 (EMMC)", "NAND_D7 (EMMC)",
  343. "NAND_CS1 (EMMC)", "NAND_CS2 iNAND_RS1 (EMMC)",
  344. "NAND_nR/B iNAND_CMD (EMMC)", "NAND_ALE (EMMC)",
  345. "NAND_CLE (EMMC)", "nRE_S1 NAND_nRE (EMMC)",
  346. "nWE_S1 NAND_nWE (EMMC)", "", "", "SPI_CS",
  347. /* Bank DIF */
  348. "RMII_RXD1", "RMII_RXD0", "RMII_CRS_DV",
  349. "RMII_50M_IN", "GPIODIF_4", "GPIODIF_5",
  350. "RMII_TXEN", "CPUETH_25MOUT", "RMII_MDC",
  351. "RMII_MDIO";
  352. };
  353. &pwm_cd {
  354. status = "okay";
  355. pinctrl-0 = <&pwm_c1_pins>, <&pwm_d_pins>;
  356. pinctrl-names = "default";
  357. clocks = <&xtal>, <&xtal>;
  358. clock-names = "clkin0", "clkin1";
  359. };
  360. &rtc {
  361. status = "okay";
  362. clocks = <&rtc32k_xtal>;
  363. vdd-supply = <&vcc_rtc>;
  364. };
  365. /* exposed through the pin headers labeled "URDUG1" on the top of the PCB */
  366. &uart_AO {
  367. status = "okay";
  368. pinctrl-0 = <&uart_ao_a_pins>;
  369. pinctrl-names = "default";
  370. };
  371. /*
  372. * connected to the Bluetooth part of the RTL8723BS SDIO wifi / Bluetooth
  373. * combo chip. This is only available on the variant with 2GB RAM.
  374. */
  375. &uart_B {
  376. status = "okay";
  377. pinctrl-0 = <&uart_b0_pins>, <&uart_b0_cts_rts_pins>;
  378. pinctrl-names = "default";
  379. uart-has-rtscts;
  380. };
  381. &usb1 {
  382. status = "okay";
  383. vbus-supply = <&usb_vbus>;
  384. };
  385. &usb1_phy {
  386. status = "okay";
  387. };