Debian Codegraph @

arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi

raw
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3 * Copyright (c) 2021 BayLibre SAS
4 * Author: Neil Armstrong <[email protected]>
5 */
6
7 #include "meson-sm1.dtsi"
8 #include <dt-bindings/leds/common.h>
9 #include <dt-bindings/input/linux-event-codes.h>
10 #include <dt-bindings/gpio/meson-g12a-gpio.h>
11
12 / {
13 adc-keys {
14 compatible = "adc-keys";
15 io-channels = <&saradc 2>;
16 io-channel-names = "buttons";
17 keyup-threshold-microvolt = <1800000>;
18
19 button-sw3 {
20 label = "SW3";
21 linux,code = <BTN_3>;
22 press-threshold-microvolt = <1700000>;
23 };
24 };
25
26 aliases {
27 serial0 = &uart_AO;
28 ethernet0 = &ethmac;
29 };
30
31 chosen {
32 stdout-path = "serial0:115200n8";
33 };
34
35 emmc_pwrseq: emmc-pwrseq {
36 compatible = "mmc-pwrseq-emmc";
37 reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
38 };
39
40 gpio-keys {
41 compatible = "gpio-keys";
42
43 key {
44 label = "SW1";
45 linux,code = <BTN_1>;
46 gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
47 interrupt-parent = <&gpio_intc>;
48 interrupts = <IRQID_GPIOAO_3 IRQ_TYPE_EDGE_BOTH>;
49 };
50 };
51
52 hdmi-connector {
53 compatible = "hdmi-connector";
54 type = "a";
55
56 port {
57 hdmi_connector_in: endpoint {
58 remote-endpoint = <&hdmi_tx_tmds_out>;
59 };
60 };
61 };
62
63 leds {
64 compatible = "gpio-leds";
65
66 led-green {
67 color = <LED_COLOR_ID_GREEN>;
68 function = LED_FUNCTION_STATUS;
69 gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
70 };
71
72 led-blue {
73 color = <LED_COLOR_ID_BLUE>;
74 function = LED_FUNCTION_STATUS;
75 gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_LOW>;
76 linux,default-trigger = "heartbeat";
77 };
78 };
79
80 memory@0 {
81 device_type = "memory";
82 reg = <0x0 0x0 0x0 0x40000000>;
83 };
84
85 emmc_1v8: regulator-emmc-1v8 {
86 compatible = "regulator-fixed";
87 regulator-name = "EMMC_1V8";
88 regulator-min-microvolt = <1800000>;
89 regulator-max-microvolt = <1800000>;
90 vin-supply = <&vddao_3v3>;
91 regulator-always-on;
92 };
93
94 dc_in: regulator-dc-in {
95 compatible = "regulator-fixed";
96 regulator-name = "DC_IN";
97 regulator-min-microvolt = <5000000>;
98 regulator-max-microvolt = <5000000>;
99 regulator-always-on;
100 };
101
102 vddio_c: regulator-vddio-c {
103 compatible = "regulator-gpio";
104 regulator-name = "VDDIO_C";
105 regulator-min-microvolt = <1800000>;
106 regulator-max-microvolt = <3300000>;
107
108 enable-gpios = <&gpio_ao GPIOE_2 GPIO_OPEN_DRAIN>;
109 enable-active-high;
110 regulator-always-on;
111
112 gpios = <&gpio_ao GPIOAO_6 GPIO_OPEN_DRAIN>;
113 gpios-states = <1>;
114
115 states = <1800000 0>,
116 <3300000 1>;
117 };
118
119 tflash_vdd: regulator-tflash-vdd {
120 compatible = "regulator-fixed";
121 regulator-name = "TFLASH_VDD";
122 regulator-min-microvolt = <3300000>;
123 regulator-max-microvolt = <3300000>;
124 vin-supply = <&dc_in>;
125 gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
126 enable-active-high;
127 regulator-always-on;
128 };
129
130 vddao_1v8: regulator-vddao-1v8 {
131 compatible = "regulator-fixed";
132 regulator-name = "VDDAO_1V8";
133 regulator-min-microvolt = <1800000>;
134 regulator-max-microvolt = <1800000>;
135 vin-supply = <&vddao_3v3>;
136 regulator-always-on;
137 };
138
139 vddao_3v3: regulator-vddao-3v3 {
140 compatible = "regulator-fixed";
141 regulator-name = "VDDAO_3V3";
142 regulator-min-microvolt = <3300000>;
143 regulator-max-microvolt = <3300000>;
144 vin-supply = <&dc_in>;
145 regulator-always-on;
146 };
147
148 vddcpu: regulator-vddcpu {
149 /*
150 * SY8120B1ABC DC/DC Regulator.
151 */
152 compatible = "pwm-regulator";
153
154 regulator-name = "VDDCPU";
155 regulator-min-microvolt = <690000>;
156 regulator-max-microvolt = <1050000>;
157
158 pwm-supply = <&dc_in>;
159
160 pwms = <&pwm_AO_cd 1 1250 0>;
161 pwm-dutycycle-range = <100 0>;
162
163 regulator-boot-on;
164 regulator-always-on;
165 };
166
167 /* USB Hub Power Enable */
168 vl_pwr_en: regulator-vl-pwr-en {
169 compatible = "regulator-fixed";
170 regulator-name = "VL_PWR_EN";
171 regulator-min-microvolt = <5000000>;
172 regulator-max-microvolt = <5000000>;
173 vin-supply = <&dc_in>;
174
175 gpio = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
176 enable-active-high;
177 };
178 };
179
180 &arb {
181 status = "okay";
182 };
183
184 &cpu0 {
185 cpu-supply = <&vddcpu>;
186 };
187
188 &cpu1 {
189 cpu-supply = <&vddcpu>;
190 };
191
192 &cpu2 {
193 cpu-supply = <&vddcpu>;
194 };
195
196 &cpu3 {
197 cpu-supply = <&vddcpu>;
198 };
199
200 &ext_mdio {
201 external_phy: ethernet-phy@0 {
202 /* Realtek RTL8211F (0x001cc916) */
203 reg = <0>;
204 max-speed = <1000>;
205
206 interrupt-parent = <&gpio_intc>;
207 /* MAC_INTR on GPIOZ_14 */
208 interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
209 };
210 };
211
212 &ethmac {
213 pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
214 pinctrl-names = "default";
215 status = "okay";
216 phy-mode = "rgmii-txid";
217 phy-handle = <&external_phy>;
218 };
219
220 &gpio {
221 gpio-line-names =
222 /* GPIOZ */
223 "ETH_MDIO", /* GPIOZ_0 */
224 "ETH_MDC", /* GPIOZ_1 */
225 "ETH_RXCLK", /* GPIOZ_2 */
226 "ETH_RX_DV", /* GPIOZ_3 */
227 "ETH_RXD0", /* GPIOZ_4 */
228 "ETH_RXD1", /* GPIOZ_5 */
229 "ETH_RXD2", /* GPIOZ_6 */
230 "ETH_RXD3", /* GPIOZ_7 */
231 "ETH_TXCLK", /* GPIOZ_8 */
232 "ETH_TXEN", /* GPIOZ_9 */
233 "ETH_TXD0", /* GPIOZ_10 */
234 "ETH_TXD1", /* GPIOZ_11 */
235 "ETH_TXD2", /* GPIOZ_12 */
236 "ETH_TXD3", /* GPIOZ_13 */
237 "ETH_INTR", /* GPIOZ_14 */
238 "ETH_NRST", /* GPIOZ_15 */
239 /* GPIOH */
240 "HDMI_SDA", /* GPIOH_0 */
241 "HDMI_SCL", /* GPIOH_1 */
242 "HDMI_HPD", /* GPIOH_2 */
243 "HDMI_CEC", /* GPIOH_3 */
244 "VL-RST_N", /* GPIOH_4 */
245 "CON1-P36", /* GPIOH_5 */
246 "VL-PWREN", /* GPIOH_6 */
247 "WiFi_3V3_1V8", /* GPIOH_7 */
248 "TFLASH_VDD_EN", /* GPIOH_8 */
249 /* BOOT */
250 "eMMC_D0", /* BOOT_0 */
251 "eMMC_D1", /* BOOT_1 */
252 "eMMC_D2", /* BOOT_2 */
253 "eMMC_D3", /* BOOT_3 */
254 "eMMC_D4", /* BOOT_4 */
255 "eMMC_D5", /* BOOT_5 */
256 "eMMC_D6", /* BOOT_6 */
257 "eMMC_D7", /* BOOT_7 */
258 "eMMC_CLK", /* BOOT_8 */
259 "",
260 "eMMC_CMD", /* BOOT_10 */
261 "",
262 "eMMC_RST#", /* BOOT_12 */
263 "eMMC_DS", /* BOOT_13 */
264 "", "",
265 /* GPIOC */
266 "SD_D0_B", /* GPIOC_0 */
267 "SD_D1_B", /* GPIOC_1 */
268 "SD_D2_B", /* GPIOC_2 */
269 "SD_D3_B", /* GPIOC_3 */
270 "SD_CLK_B", /* GPIOC_4 */
271 "SD_CMD_B", /* GPIOC_5 */
272 "CARD_EN_DET", /* GPIOC_6 */
273 "",
274 /* GPIOA */
275 "", "", "", "", "", "", "", "",
276 "", "", "", "", "", "",
277 "CON1-P27", /* GPIOA_14 */
278 "CON1-P28", /* GPIOA_15 */
279 /* GPIOX */
280 "CON1-P16", /* GPIOX_0 */
281 "CON1-P18", /* GPIOX_1 */
282 "CON1-P22", /* GPIOX_2 */
283 "CON1-P11", /* GPIOX_3 */
284 "CON1-P13", /* GPIOX_4 */
285 "CON1-P07", /* GPIOX_5 */
286 "CON1-P33", /* GPIOX_6 */
287 "CON1-P15", /* GPIOX_7 */
288 "CON1-P19", /* GPIOX_8 */
289 "CON1-P21", /* GPIOX_9 */
290 "CON1-P24", /* GPIOX_10 */
291 "CON1-P23", /* GPIOX_11 */
292 "CON1-P08", /* GPIOX_12 */
293 "CON1-P10", /* GPIOX_13 */
294 "CON1-P29", /* GPIOX_14 */
295 "CON1-P31", /* GPIOX_15 */
296 "CON1-P26", /* GPIOX_16 */
297 "CON1-P03", /* GPIOX_17 */
298 "CON1-P05", /* GPIOX_18 */
299 "CON1-P32"; /* GPIOX_19 */
300
301 /*
302 * WARNING: The USB Hub needs a reset signal to be turned high in
303 * order to be detected by the USB Controller. This signal should
304 * be handled by a USB specific power sequence to reset the Hub
305 * when the USB bus is powered down.
306 */
307 usb-hub-hog {
308 gpio-hog;
309 gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>;
310 output-high;
311 line-name = "usb-hub-reset";
312 };
313 };
314
315 &gpio_ao {
316 gpio-line-names =
317 /* GPIOAO */
318 "DEBUG TX", /* GPIOAO_0 */
319 "DEBUG RX", /* GPIOAO_1 */
320 "SYS_LED2", /* GPIOAO_2 */
321 "UPDATE_KEY", /* GPIOAO_3 */
322 "CON1-P40", /* GPIOAO_4 */
323 "IR_IN", /* GPIOAO_5 */
324 "TF_3V3N_1V8_EN", /* GPIOAO_6 */
325 "CON1-P35", /* GPIOAO_7 */
326 "CON1-P12", /* GPIOAO_8 */
327 "CON1-P37", /* GPIOAO_9 */
328 "CON1-P38", /* GPIOAO_10 */
329 "SYS_LED", /* GPIOAO_11 */
330 /* GPIOE */
331 "VDDEE_PWM", /* GPIOE_0 */
332 "VDDCPU_PWM", /* GPIOE_1 */
333 "TF_PWR_EN"; /* GPIOE_2 */
334 };
335
336 &hdmi_tx {
337 status = "okay";
338 pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
339 pinctrl-names = "default";
340 hdmi-supply = <&dc_in>;
341 };
342
343 &hdmi_tx_tmds_port {
344 hdmi_tx_tmds_out: endpoint {
345 remote-endpoint = <&hdmi_connector_in>;
346 };
347 };
348
349 &ir {
350 status = "okay";
351 pinctrl-0 = <&remote_input_ao_pins>;
352 pinctrl-names = "default";
353 };
354
355 &pwm_AO_cd {
356 pinctrl-0 = <&pwm_ao_d_e_pins>;
357 pinctrl-names = "default";
358 status = "okay";
359 };
360
361 &saradc {
362 status = "okay";
363 vref-supply = <&vddao_1v8>;
364 };
365
366 /* SD card */
367 &sd_emmc_b {
368 status = "okay";
369 pinctrl-0 = <&sdcard_c_pins>;
370 pinctrl-1 = <&sdcard_clk_gate_c_pins>;
371 pinctrl-names = "default", "clk-gate";
372
373 bus-width = <4>;
374 cap-sd-highspeed;
375 /* Boot failures are observed at 50MHz */
376 max-frequency = <35000000>;
377 disable-wp;
378
379 cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
380 vmmc-supply = <&tflash_vdd>;
381 vqmmc-supply = <&vddio_c>;
382 };
383
384 /* eMMC */
385 &sd_emmc_c {
386 status = "okay";
387 pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
388 pinctrl-1 = <&emmc_clk_gate_pins>;
389 pinctrl-names = "default", "clk-gate";
390
391 bus-width = <8>;
392 cap-mmc-highspeed;
393 mmc-ddr-1_8v;
394 mmc-hs200-1_8v;
395 max-frequency = <200000000>;
396 disable-wp;
397
398 mmc-pwrseq = <&emmc_pwrseq>;
399 vmmc-supply = <&vddao_3v3>;
400 vqmmc-supply = <&emmc_1v8>;
401 };
402
403 &uart_AO {
404 status = "okay";
405 pinctrl-0 = <&uart_ao_a_pins>;
406 pinctrl-names = "default";
407 };
408
409 &usb {
410 status = "okay";
411 };
412
413 &usb2_phy0 {
414 phy-supply = <&dc_in>;
415 };
416
417 &usb2_phy1 {
418 /* Enable the hub which is connected to this port */
419 phy-supply = <&vl_pwr_en>;
420 };