blob: 24d0442dffb27f262941698cd08ee8ea6facfb9c [file] [log] [blame]
Neil Armstrong7d7da1f2020-10-02 09:47:37 +02001// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 BayLibre, SAS
4 * Author: Neil Armstrong <narmstrong@baylibre.com>
5 */
6
Neil Armstrong49111a82023-01-26 10:48:20 +01007#include "meson-g12b-odroid.dtsi"
Neil Armstrong7d7da1f2020-10-02 09:47:37 +02008
9/ {
10 aliases {
Neil Armstrong425d9d52021-09-17 09:37:00 +020011 rtc0 = &rtc;
Neil Armstrong7d7da1f2020-10-02 09:47:37 +020012 };
13
Neil Armstrong49111a82023-01-26 10:48:20 +010014 dio2133: audio-amplifier-0 {
Neil Armstrong7d7da1f2020-10-02 09:47:37 +020015 compatible = "simple-audio-amplifier";
16 enable-gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
17 VCC-supply = <&vcc_5v>;
18 sound-name-prefix = "U19";
19 status = "okay";
20 };
21
Neil Armstrong7d7da1f2020-10-02 09:47:37 +020022 hub_5v: regulator-hub_5v {
23 compatible = "regulator-fixed";
24 regulator-name = "HUB_5V";
25 regulator-min-microvolt = <5000000>;
26 regulator-max-microvolt = <5000000>;
27 vin-supply = <&vcc_5v>;
28
29 /* Connected to the Hub CHIPENABLE, LOW sets low power state */
30 gpio = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
31 enable-active-high;
32 };
33
Neil Armstrong7d7da1f2020-10-02 09:47:37 +020034 sound {
35 compatible = "amlogic,axg-sound-card";
Neil Armstrong425d9d52021-09-17 09:37:00 +020036 model = "ODROID-N2";
Neil Armstrong7d7da1f2020-10-02 09:47:37 +020037 audio-widgets = "Line", "Lineout";
38 audio-aux-devs = <&tdmout_b>, <&tdmout_c>, <&tdmin_a>,
39 <&tdmin_b>, <&tdmin_c>, <&tdmin_lb>,
Neil Armstrong49111a82023-01-26 10:48:20 +010040 <&dio2133>;
Neil Armstrong7d7da1f2020-10-02 09:47:37 +020041 audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
42 "TDMOUT_B IN 1", "FRDDR_B OUT 1",
43 "TDMOUT_B IN 2", "FRDDR_C OUT 1",
44 "TDM_B Playback", "TDMOUT_B OUT",
45 "TDMOUT_C IN 0", "FRDDR_A OUT 2",
46 "TDMOUT_C IN 1", "FRDDR_B OUT 2",
47 "TDMOUT_C IN 2", "FRDDR_C OUT 2",
48 "TDM_C Playback", "TDMOUT_C OUT",
49 "TDMIN_A IN 4", "TDM_B Loopback",
50 "TDMIN_B IN 4", "TDM_B Loopback",
51 "TDMIN_C IN 4", "TDM_B Loopback",
52 "TDMIN_LB IN 1", "TDM_B Loopback",
53 "TDMIN_A IN 5", "TDM_C Loopback",
54 "TDMIN_B IN 5", "TDM_C Loopback",
55 "TDMIN_C IN 5", "TDM_C Loopback",
56 "TDMIN_LB IN 2", "TDM_C Loopback",
57 "TODDR_A IN 0", "TDMIN_A OUT",
58 "TODDR_B IN 0", "TDMIN_A OUT",
59 "TODDR_C IN 0", "TDMIN_A OUT",
60 "TODDR_A IN 1", "TDMIN_B OUT",
61 "TODDR_B IN 1", "TDMIN_B OUT",
62 "TODDR_C IN 1", "TDMIN_B OUT",
63 "TODDR_A IN 2", "TDMIN_C OUT",
64 "TODDR_B IN 2", "TDMIN_C OUT",
65 "TODDR_C IN 2", "TDMIN_C OUT",
66 "TODDR_A IN 6", "TDMIN_LB OUT",
67 "TODDR_B IN 6", "TDMIN_LB OUT",
68 "TODDR_C IN 6", "TDMIN_LB OUT",
69 "U19 INL", "ACODEC LOLP",
70 "U19 INR", "ACODEC LORP",
71 "Lineout", "U19 OUTL",
72 "Lineout", "U19 OUTR";
73
74 assigned-clocks = <&clkc CLKID_MPLL2>,
75 <&clkc CLKID_MPLL0>,
76 <&clkc CLKID_MPLL1>;
77 assigned-clock-parents = <0>, <0>, <0>;
78 assigned-clock-rates = <294912000>,
79 <270950400>,
80 <393216000>;
81 status = "okay";
82
83 dai-link-0 {
84 sound-dai = <&frddr_a>;
85 };
86
87 dai-link-1 {
88 sound-dai = <&frddr_b>;
89 };
90
91 dai-link-2 {
92 sound-dai = <&frddr_c>;
93 };
94
95 dai-link-3 {
96 sound-dai = <&toddr_a>;
97 };
98
99 dai-link-4 {
100 sound-dai = <&toddr_b>;
101 };
102
103 dai-link-5 {
104 sound-dai = <&toddr_c>;
105 };
106
107 /* 8ch hdmi interface */
108 dai-link-6 {
109 sound-dai = <&tdmif_b>;
110 dai-format = "i2s";
111 dai-tdm-slot-tx-mask-0 = <1 1>;
112 dai-tdm-slot-tx-mask-1 = <1 1>;
113 dai-tdm-slot-tx-mask-2 = <1 1>;
114 dai-tdm-slot-tx-mask-3 = <1 1>;
115 mclk-fs = <256>;
116
117 codec-0 {
118 sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
119 };
120
121 codec-1 {
122 sound-dai = <&toacodec TOACODEC_IN_B>;
123 };
124 };
125
126 /* i2s jack output interface */
127 dai-link-7 {
128 sound-dai = <&tdmif_c>;
129 dai-format = "i2s";
130 dai-tdm-slot-tx-mask-0 = <1 1>;
131 mclk-fs = <256>;
132
133 codec-0 {
134 sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>;
135 };
136
137 codec-1 {
138 sound-dai = <&toacodec TOACODEC_IN_C>;
139 };
140 };
141
142 /* hdmi glue */
143 dai-link-8 {
144 sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
145
146 codec {
147 sound-dai = <&hdmi_tx>;
148 };
149 };
150
151 /* acodec glue */
152 dai-link-9 {
153 sound-dai = <&toacodec TOACODEC_OUT>;
154
155 codec {
156 sound-dai = <&acodec>;
157 };
158 };
159 };
160};
161
162&acodec {
163 AVDD-supply = <&vddao_1v8>;
164 status = "okay";
165};
166
Neil Armstrong49111a82023-01-26 10:48:20 +0100167&ethmac {
168 pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200169 pinctrl-names = "default";
170 status = "okay";
Neil Armstrong49111a82023-01-26 10:48:20 +0100171 phy-mode = "rgmii";
172 phy-handle = <&external_phy>;
173 amlogic,tx-delay-ns = <2>;
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200174};
175
176&ext_mdio {
177 external_phy: ethernet-phy@0 {
Neil Armstrong425d9d52021-09-17 09:37:00 +0200178 /* Realtek RTL8211F (0x001cc916) */
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200179 reg = <0>;
180 max-speed = <1000>;
181
182 reset-assert-us = <10000>;
Neil Armstrong425d9d52021-09-17 09:37:00 +0200183 reset-deassert-us = <80000>;
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200184 reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
185
186 interrupt-parent = <&gpio_intc>;
187 /* MAC_INTR on GPIOZ_14 */
188 interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
189 };
190};
191
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200192&gpio {
Neil Armstrong425d9d52021-09-17 09:37:00 +0200193 gpio-line-names =
194 /* GPIOZ */
195 "", "", "", "", "", "", "", "",
196 "", "", "", "", "", "", "", "",
197 /* GPIOH */
198 "", "", "", "", "", "", "", "",
199 "",
200 /* BOOT */
201 "", "", "", "", "", "", "", "",
202 "", "", "", "", "", "", "", "",
203 /* GPIOC */
204 "", "", "", "", "", "", "", "",
205 /* GPIOA */
206 "PIN_44", /* GPIOA_0 */
207 "PIN_46", /* GPIOA_1 */
208 "PIN_45", /* GPIOA_2 */
209 "PIN_47", /* GPIOA_3 */
210 "PIN_26", /* GPIOA_4 */
211 "", "", "", "", "", "",
212 "PIN_42", /* GPIOA_11 */
213 "PIN_32", /* GPIOA_12 */
214 "PIN_7", /* GPIOA_13 */
215 "PIN_27", /* GPIOA_14 */
216 "PIN_28", /* GPIOA_15 */
217 /* GPIOX */
218 "PIN_16", /* GPIOX_0 */
219 "PIN_18", /* GPIOX_1 */
220 "PIN_22", /* GPIOX_2 */
221 "PIN_11", /* GPIOX_3 */
222 "PIN_13", /* GPIOX_4 */
223 "PIN_33", /* GPIOX_5 */
224 "PIN_35", /* GPIOX_6 */
225 "PIN_15", /* GPIOX_7 */
226 "PIN_19", /* GPIOX_8 */
227 "PIN_21", /* GPIOX_9 */
228 "PIN_24", /* GPIOX_10 */
229 "PIN_23", /* GPIOX_11 */
230 "PIN_8", /* GPIOX_12 */
231 "PIN_10", /* GPIOX_13 */
232 "PIN_29", /* GPIOX_14 */
233 "PIN_31", /* GPIOX_15 */
234 "PIN_12", /* GPIOX_16 */
235 "PIN_3", /* GPIOX_17 */
236 "PIN_5", /* GPIOX_18 */
237 "PIN_36"; /* GPIOX_19 */
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200238 /*
239 * WARNING: The USB Hub on the Odroid-N2 needs a reset signal
240 * to be turned high in order to be detected by the USB Controller
241 * This signal should be handled by a USB specific power sequence
242 * in order to reset the Hub when USB bus is powered down.
243 */
Neil Armstrong425d9d52021-09-17 09:37:00 +0200244 hog-0 {
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200245 gpio-hog;
246 gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>;
247 output-high;
248 line-name = "usb-hub-reset";
249 };
250};
251
Neil Armstrong425d9d52021-09-17 09:37:00 +0200252&i2c3 {
253 status = "okay";
254 pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
255 pinctrl-names = "default";
256
257 rtc: rtc@51 {
258 compatible = "nxp,pcf8563";
259 reg = <0x51>;
260 wakeup-source;
261 };
262};
263
Neil Armstrong49111a82023-01-26 10:48:20 +0100264&ir {
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200265 status = "okay";
Neil Armstrong49111a82023-01-26 10:48:20 +0100266 pinctrl-0 = <&remote_input_ao_pins>;
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200267 pinctrl-names = "default";
Neil Armstrong49111a82023-01-26 10:48:20 +0100268 linux,rc-map-name = "rc-odroid";
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200269};
270
271/*
272 * EMMC_D4, EMMC_D5, EMMC_D6 and EMMC_D7 pins are shared between SPI NOR pins
273 * and eMMC Data 4 to 7 pins.
274 * Replace emmc_data_8b_pins to emmc_data_4b_pins from sd_emmc_c pinctrl-0,
275 * and change bus-width to 4 then spifc can be enabled.
276 * The SW1 slide should also be set to the correct position.
277 */
278&spifc {
279 status = "disabled";
280 pinctrl-0 = <&nor_pins>;
281 pinctrl-names = "default";
282
Neil Armstrong49111a82023-01-26 10:48:20 +0100283 mx25u64: flash@0 {
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200284 #address-cells = <1>;
285 #size-cells = <1>;
286 compatible = "mxicy,mx25u6435f", "jedec,spi-nor";
287 reg = <0>;
288 spi-max-frequency = <104000000>;
289 };
290};
291
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200292&toacodec {
293 status = "okay";
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200294};
295
296&usb {
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200297 vbus-supply = <&usb_pwr_en>;
298};
299
Neil Armstrong7d7da1f2020-10-02 09:47:37 +0200300&usb2_phy1 {
301 /* Enable the hub which is connected to this port */
302 phy-supply = <&hub_5v>;
303};