xref: /linux/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts (revision 0cac5ce06e524755b3dac1e0a060b05992076d93)
1// SPDX-License-Identifier: GPL-2.0 OR MIT
2/*
3 * Copyright (C) 2024 Yangyu Chen <cyy@cyyself.name>
4 */
5
6#include "k1.dtsi"
7#include "k1-pinctrl.dtsi"
8
9/ {
10	model = "Banana Pi BPI-F3";
11	compatible = "bananapi,bpi-f3", "spacemit,k1";
12
13	aliases {
14		ethernet0 = &eth0;
15		ethernet1 = &eth1;
16		serial0 = &uart0;
17		i2c2 = &i2c2;
18		i2c8 = &i2c8;
19	};
20
21	chosen {
22		stdout-path = "serial0";
23	};
24
25	leds {
26		compatible = "gpio-leds";
27
28		led1 {
29			label = "sys-led";
30			gpios = <&gpio K1_GPIO(96) GPIO_ACTIVE_HIGH>;
31			linux,default-trigger = "heartbeat";
32			default-state = "on";
33		};
34	};
35
36	reg_dc_in: dc-in-12v {
37		compatible = "regulator-fixed";
38		regulator-name = "dc_in_12v";
39		regulator-min-microvolt = <12000000>;
40		regulator-max-microvolt = <12000000>;
41		regulator-boot-on;
42		regulator-always-on;
43	};
44
45	reg_vcc_4v: vcc-4v {
46		compatible = "regulator-fixed";
47		regulator-name = "vcc_4v";
48		regulator-min-microvolt = <4000000>;
49		regulator-max-microvolt = <4000000>;
50		regulator-boot-on;
51		regulator-always-on;
52		vin-supply = <&reg_dc_in>;
53	};
54};
55
56&emmc {
57	bus-width = <8>;
58	mmc-hs400-1_8v;
59	mmc-hs400-enhanced-strobe;
60	non-removable;
61	no-sd;
62	no-sdio;
63	status = "okay";
64};
65
66&eth0 {
67	phy-handle = <&rgmii0>;
68	phy-mode = "rgmii-id";
69	pinctrl-names = "default";
70	pinctrl-0 = <&gmac0_cfg>;
71	rx-internal-delay-ps = <0>;
72	tx-internal-delay-ps = <0>;
73	status = "okay";
74
75	mdio-bus {
76		#address-cells = <0x1>;
77		#size-cells = <0x0>;
78
79		reset-gpios = <&gpio K1_GPIO(110) GPIO_ACTIVE_LOW>;
80		reset-delay-us = <10000>;
81		reset-post-delay-us = <100000>;
82
83		rgmii0: phy@1 {
84			reg = <0x1>;
85		};
86	};
87};
88
89&eth1 {
90	phy-handle = <&rgmii1>;
91	phy-mode = "rgmii-id";
92	pinctrl-names = "default";
93	pinctrl-0 = <&gmac1_cfg>;
94	rx-internal-delay-ps = <0>;
95	tx-internal-delay-ps = <250>;
96	status = "okay";
97
98	mdio-bus {
99		#address-cells = <0x1>;
100		#size-cells = <0x0>;
101
102		reset-gpios = <&gpio K1_GPIO(115) GPIO_ACTIVE_LOW>;
103		reset-delay-us = <10000>;
104		reset-post-delay-us = <100000>;
105
106		rgmii1: phy@1 {
107			reg = <0x1>;
108		};
109	};
110};
111
112&pdma {
113	status = "okay";
114};
115
116&qspi {
117	pinctrl-names = "default";
118	pinctrl-0 = <&qspi_cfg>;
119	status = "okay";
120};
121
122&i2c2 {
123	pinctrl-0 = <&i2c2_0_cfg>;
124	pinctrl-names = "default";
125	status = "okay";
126
127	eeprom@50 {
128		compatible = "atmel,24c02";
129		reg = <0x50>;
130		vcc-supply = <&buck3_1v8>; /* EEPROM_VCC1V8 */
131		pagesize = <16>;
132		read-only;
133		size = <256>;
134
135		nvmem-layout {
136			compatible = "onie,tlv-layout";
137
138			mac-address {
139				#nvmem-cell-cells = <1>;
140			};
141
142			num-macs {
143			};
144
145			serial-number {
146			};
147		};
148	};
149};
150
151&i2c8 {
152	pinctrl-0 = <&i2c8_cfg>;
153	pinctrl-names = "default";
154	status = "okay";
155
156	pmic@41 {
157		compatible = "spacemit,p1";
158		reg = <0x41>;
159		interrupts = <64>;
160		vin-supply = <&reg_vcc_4v>;
161
162		regulators {
163			buck1 {
164				regulator-min-microvolt = <500000>;
165				regulator-max-microvolt = <3450000>;
166				regulator-ramp-delay = <5000>;
167				regulator-always-on;
168			};
169
170			buck2 {
171				regulator-min-microvolt = <500000>;
172				regulator-max-microvolt = <3450000>;
173				regulator-ramp-delay = <5000>;
174				regulator-always-on;
175			};
176
177			buck3_1v8: buck3 {
178				regulator-min-microvolt = <500000>;
179				regulator-max-microvolt = <1800000>;
180				regulator-ramp-delay = <5000>;
181				regulator-always-on;
182			};
183
184			buck4 {
185				regulator-min-microvolt = <500000>;
186				regulator-max-microvolt = <3300000>;
187				regulator-ramp-delay = <5000>;
188				regulator-always-on;
189			};
190
191			buck5 {
192				regulator-min-microvolt = <500000>;
193				regulator-max-microvolt = <3450000>;
194				regulator-ramp-delay = <5000>;
195				regulator-always-on;
196			};
197
198			buck6 {
199				regulator-min-microvolt = <500000>;
200				regulator-max-microvolt = <3450000>;
201				regulator-ramp-delay = <5000>;
202				regulator-always-on;
203			};
204
205			aldo1 {
206				regulator-min-microvolt = <500000>;
207				regulator-max-microvolt = <3400000>;
208				regulator-boot-on;
209			};
210
211			aldo2 {
212				regulator-min-microvolt = <500000>;
213				regulator-max-microvolt = <3400000>;
214			};
215
216			aldo3 {
217				regulator-min-microvolt = <500000>;
218				regulator-max-microvolt = <3400000>;
219			};
220
221			aldo4 {
222				regulator-min-microvolt = <500000>;
223				regulator-max-microvolt = <3400000>;
224			};
225
226			dldo1 {
227				regulator-min-microvolt = <500000>;
228				regulator-max-microvolt = <3400000>;
229				regulator-boot-on;
230			};
231
232			dldo2 {
233				regulator-min-microvolt = <500000>;
234				regulator-max-microvolt = <3400000>;
235			};
236
237			dldo3 {
238				regulator-min-microvolt = <500000>;
239				regulator-max-microvolt = <3400000>;
240			};
241
242			dldo4 {
243				regulator-min-microvolt = <500000>;
244				regulator-max-microvolt = <3400000>;
245				regulator-always-on;
246			};
247
248			dldo5 {
249				regulator-min-microvolt = <500000>;
250				regulator-max-microvolt = <3400000>;
251			};
252
253			dldo6 {
254				regulator-min-microvolt = <500000>;
255				regulator-max-microvolt = <3400000>;
256				regulator-always-on;
257			};
258
259			dldo7 {
260				regulator-min-microvolt = <500000>;
261				regulator-max-microvolt = <3400000>;
262			};
263		};
264	};
265};
266
267&uart0 {
268	pinctrl-names = "default";
269	pinctrl-0 = <&uart0_2_cfg>;
270	status = "okay";
271};
272