meson-gx-libretech-pc.dtsi 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2019 BayLibre SAS.
  4. * Author: Jerome Brunet <jbrunet@baylibre.com>
  5. */
  6. /* Libretech Amlogic GX PC form factor - AKA: Tartiflette */
  7. #include <dt-bindings/input/input.h>
  8. #include <dt-bindings/leds/common.h>
  9. #include <dt-bindings/sound/meson-aiu.h>
  10. / {
  11. adc-keys {
  12. compatible = "adc-keys";
  13. io-channels = <&saradc 0>;
  14. io-channel-names = "buttons";
  15. keyup-threshold-microvolt = <1800000>;
  16. update-button {
  17. label = "update";
  18. linux,code = <KEY_VENDOR>;
  19. press-threshold-microvolt = <1300000>;
  20. };
  21. };
  22. aliases {
  23. serial0 = &uart_AO;
  24. ethernet0 = &ethmac;
  25. spi0 = &spifc;
  26. };
  27. dio2133: analog-amplifier {
  28. compatible = "simple-audio-amplifier";
  29. sound-name-prefix = "AU2";
  30. VCC-supply = <&vcc5v>;
  31. enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
  32. };
  33. chosen {
  34. stdout-path = "serial0:115200n8";
  35. };
  36. cvbs-connector {
  37. compatible = "composite-video-connector";
  38. status = "disabled";
  39. port {
  40. cvbs_connector_in: endpoint {
  41. remote-endpoint = <&cvbs_vdac_out>;
  42. };
  43. };
  44. };
  45. emmc_pwrseq: emmc-pwrseq {
  46. compatible = "mmc-pwrseq-emmc";
  47. reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
  48. };
  49. hdmi-connector {
  50. compatible = "hdmi-connector";
  51. type = "a";
  52. port {
  53. hdmi_connector_in: endpoint {
  54. remote-endpoint = <&hdmi_tx_tmds_out>;
  55. };
  56. };
  57. };
  58. gpio-keys-polled {
  59. compatible = "gpio-keys-polled";
  60. poll-interval = <100>;
  61. power-button {
  62. label = "power";
  63. linux,code = <KEY_POWER>;
  64. gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
  65. };
  66. };
  67. memory@0 {
  68. device_type = "memory";
  69. reg = <0x0 0x0 0x0 0x80000000>;
  70. };
  71. ao_5v: regulator-ao_5v {
  72. compatible = "regulator-fixed";
  73. regulator-name = "AO_5V";
  74. regulator-min-microvolt = <5000000>;
  75. regulator-max-microvolt = <5000000>;
  76. vin-supply = <&dc_in>;
  77. regulator-always-on;
  78. };
  79. dc_in: regulator-dc_in {
  80. compatible = "regulator-fixed";
  81. regulator-name = "DC_IN";
  82. regulator-min-microvolt = <5000000>;
  83. regulator-max-microvolt = <5000000>;
  84. regulator-always-on;
  85. };
  86. leds {
  87. compatible = "gpio-leds";
  88. led-green {
  89. color = <LED_COLOR_ID_GREEN>;
  90. function = LED_FUNCTION_DISK_ACTIVITY;
  91. gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>;
  92. linux,default-trigger = "disk-activity";
  93. };
  94. led-blue {
  95. color = <LED_COLOR_ID_BLUE>;
  96. function = LED_FUNCTION_STATUS;
  97. gpios = <&gpio GPIODV_28 GPIO_ACTIVE_HIGH>;
  98. linux,default-trigger = "heartbeat";
  99. panic-indicator;
  100. };
  101. };
  102. vcc_card: regulator-vcc_card {
  103. compatible = "regulator-fixed";
  104. regulator-name = "VCC_CARD";
  105. regulator-min-microvolt = <3300000>;
  106. regulator-max-microvolt = <3300000>;
  107. vin-supply = <&vddio_ao3v3>;
  108. gpio = <&gpio GPIODV_4 GPIO_ACTIVE_HIGH>;
  109. enable-active-high;
  110. };
  111. vcc5v: regulator-vcc5v {
  112. compatible = "regulator-fixed";
  113. regulator-name = "VCC5V";
  114. regulator-min-microvolt = <5000000>;
  115. regulator-max-microvolt = <5000000>;
  116. vin-supply = <&ao_5v>;
  117. gpio = <&gpio GPIOH_3 GPIO_OPEN_DRAIN>;
  118. };
  119. vddio_ao18: regulator-vddio_ao18 {
  120. compatible = "regulator-fixed";
  121. regulator-name = "VDDIO_AO18";
  122. regulator-min-microvolt = <1800000>;
  123. regulator-max-microvolt = <1800000>;
  124. vin-supply = <&ao_5v>;
  125. regulator-always-on;
  126. };
  127. vddio_ao3v3: regulator-vddio_ao3v3 {
  128. compatible = "regulator-fixed";
  129. regulator-name = "VDDIO_AO3V3";
  130. regulator-min-microvolt = <3300000>;
  131. regulator-max-microvolt = <3300000>;
  132. vin-supply = <&ao_5v>;
  133. regulator-always-on;
  134. };
  135. vddio_boot: regulator-vddio_boot {
  136. compatible = "regulator-fixed";
  137. regulator-name = "VDDIO_BOOT";
  138. regulator-min-microvolt = <1800000>;
  139. regulator-max-microvolt = <1800000>;
  140. vin-supply = <&vddio_ao3v3>;
  141. regulator-always-on;
  142. };
  143. vddio_card: regulator-vddio-card {
  144. compatible = "regulator-gpio";
  145. regulator-name = "VDDIO_CARD";
  146. regulator-min-microvolt = <1800000>;
  147. regulator-max-microvolt = <3300000>;
  148. gpios = <&gpio GPIODV_5 GPIO_ACTIVE_HIGH>;
  149. gpios-states = <0>;
  150. states = <3300000 0>,
  151. <1800000 1>;
  152. regulator-settling-time-up-us = <200>;
  153. regulator-settling-time-down-us = <50000>;
  154. };
  155. sound {
  156. compatible = "amlogic,gx-sound-card";
  157. model = "GXL-LIBRETECH-S9XX-PC";
  158. audio-aux-devs = <&dio2133>;
  159. audio-widgets = "Speaker", "7J4-14 LEFT",
  160. "Speaker", "7J4-11 RIGHT";
  161. audio-routing = "AU2 INL", "ACODEC LOLN",
  162. "AU2 INR", "ACODEC LORN",
  163. "7J4-14 LEFT", "AU2 OUTL",
  164. "7J4-11 RIGHT", "AU2 OUTR";
  165. assigned-clocks = <&clkc CLKID_MPLL0>,
  166. <&clkc CLKID_MPLL1>,
  167. <&clkc CLKID_MPLL2>;
  168. assigned-clock-parents = <0>, <0>, <0>;
  169. assigned-clock-rates = <294912000>,
  170. <270950400>,
  171. <393216000>;
  172. status = "okay";
  173. dai-link-0 {
  174. sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
  175. };
  176. dai-link-1 {
  177. sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
  178. dai-format = "i2s";
  179. mclk-fs = <256>;
  180. codec-0 {
  181. sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
  182. };
  183. codec-1 {
  184. sound-dai = <&aiu AIU_ACODEC CTRL_I2S>;
  185. };
  186. };
  187. dai-link-2 {
  188. sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
  189. codec-0 {
  190. sound-dai = <&hdmi_tx>;
  191. };
  192. };
  193. dai-link-3 {
  194. sound-dai = <&aiu AIU_ACODEC CTRL_OUT>;
  195. codec-0 {
  196. sound-dai = <&acodec>;
  197. };
  198. };
  199. };
  200. };
  201. &acodec {
  202. AVDD-supply = <&vddio_ao18>;
  203. status = "okay";
  204. };
  205. &aiu {
  206. status = "okay";
  207. };
  208. &cec_AO {
  209. pinctrl-0 = <&ao_cec_pins>;
  210. pinctrl-names = "default";
  211. hdmi-phandle = <&hdmi_tx>;
  212. status = "okay";
  213. };
  214. &cvbs_vdac_port {
  215. cvbs_vdac_out: endpoint {
  216. remote-endpoint = <&cvbs_connector_in>;
  217. };
  218. };
  219. &ethmac {
  220. pinctrl-0 = <&eth_pins>, <&eth_phy_irq_pins>;
  221. pinctrl-names = "default";
  222. phy-handle = <&external_phy>;
  223. amlogic,tx-delay-ns = <2>;
  224. phy-mode = "rgmii";
  225. status = "okay";
  226. };
  227. &external_mdio {
  228. external_phy: ethernet-phy@0 {
  229. reg = <0>;
  230. max-speed = <1000>;
  231. reset-assert-us = <10000>;
  232. reset-deassert-us = <30000>;
  233. reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
  234. interrupt-parent = <&gpio_intc>;
  235. interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
  236. };
  237. };
  238. &pinctrl_periphs {
  239. /*
  240. * Make sure the reset pin of the usb HUB is driven high to take
  241. * it out of reset.
  242. */
  243. usb1_rst_pins: usb1_rst_irq {
  244. mux {
  245. groups = "GPIODV_3";
  246. function = "gpio_periphs";
  247. bias-disable;
  248. output-high;
  249. };
  250. };
  251. /* Make sure the phy irq pin is properly configured as input */
  252. eth_phy_irq_pins: eth_phy_irq {
  253. mux {
  254. groups = "GPIOZ_15";
  255. function = "gpio_periphs";
  256. bias-disable;
  257. output-disable;
  258. };
  259. };
  260. };
  261. &hdmi_tx {
  262. pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
  263. pinctrl-names = "default";
  264. hdmi-supply = <&vcc5v>;
  265. status = "okay";
  266. };
  267. &hdmi_tx_tmds_port {
  268. hdmi_tx_tmds_out: endpoint {
  269. remote-endpoint = <&hdmi_connector_in>;
  270. };
  271. };
  272. &ir {
  273. pinctrl-0 = <&remote_input_ao_pins>;
  274. pinctrl-names = "default";
  275. status = "okay";
  276. };
  277. &i2c_C {
  278. pinctrl-0 = <&i2c_c_dv18_pins>;
  279. pinctrl-names = "default";
  280. status = "okay";
  281. rtc: rtc@51 {
  282. reg = <0x51>;
  283. compatible = "nxp,pcf8563";
  284. #clock-cells = <0>;
  285. clock-output-names = "rtc_clkout";
  286. };
  287. };
  288. &pwm_AO_ab {
  289. pinctrl-0 = <&pwm_ao_a_3_pins>;
  290. pinctrl-names = "default";
  291. clocks = <&clkc CLKID_FCLK_DIV4>;
  292. clock-names = "clkin0";
  293. status = "okay";
  294. };
  295. &pwm_ab {
  296. pinctrl-0 = <&pwm_b_pins>;
  297. pinctrl-names = "default";
  298. clocks = <&clkc CLKID_FCLK_DIV4>;
  299. clock-names = "clkin0";
  300. status = "okay";
  301. };
  302. &pwm_ef {
  303. pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>;
  304. pinctrl-names = "default";
  305. clocks = <&clkc CLKID_FCLK_DIV4>;
  306. clock-names = "clkin0";
  307. status = "okay";
  308. };
  309. &saradc {
  310. vref-supply = <&vddio_ao18>;
  311. status = "okay";
  312. };
  313. /* SD card */
  314. &sd_emmc_b {
  315. pinctrl-0 = <&sdcard_pins>;
  316. pinctrl-1 = <&sdcard_clk_gate_pins>;
  317. pinctrl-names = "default", "clk-gate";
  318. bus-width = <4>;
  319. cap-sd-highspeed;
  320. sd-uhs-sdr12;
  321. sd-uhs-sdr25;
  322. sd-uhs-sdr50;
  323. sd-uhs-ddr50;
  324. max-frequency = <200000000>;
  325. disable-wp;
  326. cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
  327. vmmc-supply = <&vcc_card>;
  328. vqmmc-supply = <&vddio_card>;
  329. status = "okay";
  330. };
  331. /* eMMC */
  332. &sd_emmc_c {
  333. pinctrl-0 = <&emmc_pins>;
  334. pinctrl-1 = <&emmc_clk_gate_pins>;
  335. pinctrl-names = "default", "clk-gate";
  336. bus-width = <8>;
  337. cap-mmc-highspeed;
  338. mmc-ddr-1_8v;
  339. mmc-hs200-1_8v;
  340. max-frequency = <200000000>;
  341. disable-wp;
  342. mmc-pwrseq = <&emmc_pwrseq>;
  343. vmmc-supply = <&vddio_ao3v3>;
  344. vqmmc-supply = <&vddio_boot>;
  345. status = "okay";
  346. };
  347. &spifc {
  348. pinctrl-0 = <&nor_pins>;
  349. pinctrl-names = "default";
  350. status = "okay";
  351. gd25lq128: spi-flash@0 {
  352. compatible = "jedec,spi-nor";
  353. #address-cells = <1>;
  354. #size-cells = <1>;
  355. reg = <0>;
  356. spi-max-frequency = <12000000>;
  357. };
  358. };
  359. &uart_AO {
  360. pinctrl-0 = <&uart_ao_a_pins>;
  361. pinctrl-names = "default";
  362. status = "okay";
  363. };
  364. &usb {
  365. status = "okay";
  366. dr_mode = "host";
  367. };
  368. &usb2_phy0 {
  369. pinctrl-0 = <&usb1_rst_pins>;
  370. pinctrl-names = "default";
  371. phy-supply = <&vcc5v>;
  372. };
  373. &usb2_phy1 {
  374. phy-supply = <&vcc5v>;
  375. };