xref: /OK3568_Linux_fs/kernel/arch/arm/boot/dts/rk3128-fireprime.dts (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1/*
2 * This file is dual-licensed: you can use it either under the terms
3 * of the GPL or the X11 license, at your option. Note that this dual
4 * licensing only applies to this file, and not this project as a
5 * whole.
6 *
7 *  a) This file is free software; you can redistribute it and/or
8 *     modify it under the terms of the GNU General Public License as
9 *     published by the Free Software Foundation; either version 2 of the
10 *     License, or (at your option) any later version.
11 *
12 *     This file is distributed in the hope that it will be useful,
13 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
14 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 *     GNU General Public License for more details.
16 *
17 *  Or, alternatively,
18 *
19 *  b) Permission is hereby granted, free of charge, to any person
20 *     obtaining a copy of this software and associated documentation
21 *     files (the "Software"), to deal in the Software without
22 *     restriction, including without limitation the rights to use,
23 *     copy, modify, merge, publish, distribute, sublicense, and/or
24 *     sell copies of the Software, and to permit persons to whom the
25 *     Software is furnished to do so, subject to the following
26 *     conditions:
27 *
28 *     The above copyright notice and this permission notice shall be
29 *     included in all copies or substantial portions of the Software.
30 *
31 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
33 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
35 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
36 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
37 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
38 *     OTHER DEALINGS IN THE SOFTWARE.
39 */
40
41/dts-v1/;
42#include <dt-bindings/gpio/gpio.h>
43#include <dt-bindings/pinctrl/rockchip.h>
44#include <dt-bindings/pwm/pwm.h>
45#include "rk3128.dtsi"
46#include "rk312x-android.dtsi"
47
48/ {
49	model = "Rockchip RK3128 Fireprime board";
50	compatible = "rockchip,rk3128";
51
52	fiq-debugger {
53		compatible = "rockchip,fiq-debugger";
54		rockchip,serial-id = <2>;
55		rockchip,signal-irq = <159>;
56		rockchip,wake-irq = <0>;
57		/* If enable uart uses irq instead of fiq */
58		rockchip,irq-mode-enable = <1>;
59		rockchip,baudrate = <115200>;  /* Only 115200 and 1500000 */
60		interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_LOW>;
61		status = "okay";
62	};
63
64	clkin_gmac: external-gmac-clock {
65		compatible = "fixed-clock";
66		clock-frequency = <125000000>;
67		clock-output-names = "gmac_clkin";
68		#clock-cells = <0>;
69	};
70
71	vcc_phy: vcc-phy-regulator {
72		compatible = "regulator-fixed";
73		enable-active-high;
74		regulator-name = "vcc_phy";
75		regulator-always-on;
76		regulator-boot-on;
77	};
78
79	vcc_sys: vcc-sys {
80		compatible = "regulator-fixed";
81		regulator-name = "vcc_sys";
82		regulator-always-on;
83		regulator-boot-on;
84		regulator-min-microvolt = <5000000>;
85		regulator-max-microvolt = <5000000>;
86	};
87
88	vcc_host_5v: vcc-host-5v-regulator {
89		compatible = "regulator-fixed";
90		enable-active-high;
91		gpio = <&gpio3 20 GPIO_ACTIVE_HIGH>;
92		pinctrl-names = "default";
93		pinctrl-0 = <&host_vbus_drv>;
94		regulator-name = "vcc_host_5v";
95		regulator-always-on;
96	};
97
98	vcc_otg_vbus: otg-vbus-regulator {
99		compatible = "regulator-fixed";
100		gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_HIGH>;
101		pinctrl-names = "default";
102		pinctrl-0 = <&otg_vbus_drv>;
103		regulator-name = "vcc_otg_vbus";
104		regulator-min-microvolt = <5000000>;
105		regulator-max-microvolt = <5000000>;
106		enable-active-high;
107	};
108
109	xin32k: xin32k {
110		compatible = "fixed-clock";
111		clock-frequency = <32768>;
112		clock-output-names = "xin32k";
113		#clock-cells = <0>;
114	};
115};
116
117&cma_region {
118	/delete-property/ reg;
119};
120
121&cpu0 {
122	cpu-supply = <&vdd_arm>;
123};
124
125&emmc {
126	bus-width = <8>;
127	cap-mmc-highspeed;
128	no-sdio;
129	no-sd;
130	disable-wp;
131	non-removable;
132	num-slots = <1>;
133	pinctrl-names = "default";
134	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
135	status = "okay";
136};
137
138&gmac {
139	assigned-clocks = <&cru SCLK_MAC>;
140	assigned-clock-parents = <&clkin_gmac>;
141	clock_in_out = "input";
142	pinctrl-names = "default";
143	pinctrl-0 = <&rgmii_pins>;
144	phy-supply = <&vcc_phy>;
145	phy-mode = "rgmii";
146	snps,reset-active-low;
147	snps,reset-delays-us = <0 10000 50000>;
148	snps,reset-gpio = <&gpio2 24 GPIO_ACTIVE_LOW>;
149	tx_delay = <0x30>;
150	rx_delay = <0x16>;
151	status = "okay";
152};
153
154&i2c0 {
155	status = "okay";
156	clock-frequency = <400000>;
157
158	rk818: pmic@1c {
159		compatible = "rockchip,rk818";
160		status = "okay";
161		reg = <0x1c>;
162		clock-output-names = "rk818-clkout1", "wifibt_32kin";
163		interrupt-parent = <&gpio3>;
164		interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
165		pinctrl-names = "default";
166		pinctrl-0 = <&pmic_int_l>;
167		rockchip,system-power-controller;
168		wakeup-source;
169		#clock-cells = <1>;
170
171		vcc1-supply = <&vcc_sys>;
172		vcc2-supply = <&vcc_sys>;
173		vcc3-supply = <&vcc_sys>;
174		vcc4-supply = <&vcc_sys>;
175		vcc6-supply = <&vcc_sys>;
176		vcc7-supply = <&vcc_sys>;
177		vcc8-supply = <&vcc_sys>;
178		vcc9-supply = <&vcc_io>;
179
180		regulators {
181			vdd_arm: DCDC_REG1 {
182				regulator-name = "vdd_arm";
183				regulator-always-on;
184				regulator-boot-on;
185				regulator-min-microvolt = <750000>;
186				regulator-max-microvolt = <1450000>;
187				regulator-ramp-delay = <6001>;
188				regulator-state-mem {
189					regulator-on-in-suspend;
190					regulator-suspend-microvolt = <1100000>;
191				};
192			};
193
194			vdd_logic: DCDC_REG2 {
195				regulator-name = "vdd_logic";
196				regulator-always-on;
197				regulator-boot-on;
198				regulator-min-microvolt = <750000>;
199				regulator-max-microvolt = <1450000>;
200				regulator-ramp-delay = <6001>;
201				regulator-state-mem {
202					regulator-on-in-suspend;
203					regulator-suspend-microvolt = <1100000>;
204				};
205			};
206
207			vcc_ddr: DCDC_REG3 {
208				regulator-name = "vcc_ddr";
209				regulator-always-on;
210				regulator-boot-on;
211				regulator-state-mem {
212					regulator-on-in-suspend;
213				};
214			};
215
216			vcc_io: DCDC_REG4 {
217				regulator-name = "vcc_io";
218				regulator-always-on;
219				regulator-boot-on;
220				regulator-min-microvolt = <3300000>;
221				regulator-max-microvolt = <3300000>;
222				regulator-state-mem {
223					regulator-on-in-suspend;
224					regulator-suspend-microvolt = <3300000>;
225				};
226			};
227
228			rk818_ldo1: LDO_REG1 {
229				regulator-name = "rk818_ldo1";
230				regulator-always-on;
231				regulator-boot-on;
232				regulator-min-microvolt = <3300000>;
233				regulator-max-microvolt = <3300000>;
234				regulator-state-mem {
235					regulator-on-in-suspend;
236					regulator-suspend-microvolt = <3300000>;
237				};
238			};
239
240			rk818_ldo2: LDO_REG2 {
241				regulator-name = "rk818_ldo2";
242				regulator-always-on;
243				regulator-boot-on;
244				regulator-min-microvolt = <3000000>;
245				regulator-max-microvolt = <3000000>;
246				regulator-state-mem {
247					regulator-on-in-suspend;
248					regulator-suspend-microvolt = <3000000>;
249				};
250			};
251
252			rk818_ldo3: LDO_REG3 {
253				regulator-name = "rk818_ldo3";
254				regulator-always-on;
255				regulator-boot-on;
256				regulator-min-microvolt = <1100000>;
257				regulator-max-microvolt = <1100000>;
258				regulator-state-mem {
259					regulator-on-in-suspend;
260					regulator-suspend-microvolt = <1100000>;
261				};
262			};
263
264			rk818_ldo4: LDO_REG4 {
265				regulator-name = "rk818_ldo4";
266				regulator-always-on;
267				regulator-boot-on;
268				regulator-min-microvolt = <2800000>;
269				regulator-max-microvolt = <2800000>;
270				regulator-state-mem {
271					regulator-on-in-suspend;
272					regulator-suspend-microvolt = <2800000>;
273				};
274			};
275
276			rk818_ldo5: LDO_REG5 {
277				regulator-name = "rk818_ldo5";
278				regulator-always-on;
279				regulator-boot-on;
280				regulator-min-microvolt = <3000000>;
281				regulator-max-microvolt = <3000000>;
282				regulator-state-mem {
283					regulator-on-in-suspend;
284					regulator-suspend-microvolt = <3000000>;
285				};
286			};
287
288			rk818_ldo6: LDO_REG6 {
289				regulator-name = "rk818_ldo6";
290				regulator-always-on;
291				regulator-boot-on;
292				regulator-min-microvolt = <1200000>;
293				regulator-max-microvolt = <1200000>;
294				regulator-state-mem {
295					regulator-on-in-suspend;
296					regulator-suspend-microvolt = <1200000>;
297				};
298			};
299
300			rk818_ldo7: LDO_REG7 {
301				regulator-name = "rk818_ldo7";
302				regulator-always-on;
303				regulator-boot-on;
304				regulator-min-microvolt = <1800000>;
305				regulator-max-microvolt = <1800000>;
306				regulator-state-mem {
307					regulator-on-in-suspend;
308					regulator-suspend-microvolt = <1800000>;
309				};
310			};
311
312			rk818_ldo8: LDO_REG8 {
313				regulator-name = "rk818_ldo8";
314				regulator-always-on;
315				regulator-boot-on;
316				regulator-min-microvolt = <1800000>;
317				regulator-max-microvolt = <1800000>;
318				regulator-state-mem {
319					regulator-on-in-suspend;
320					regulator-suspend-microvolt = <1800000>;
321				};
322			};
323
324			vcc_sd: LDO_REG9 {
325				regulator-name = "vcc_sd";
326				regulator-always-on;
327				regulator-boot-on;
328				regulator-min-microvolt = <1800000>;
329				regulator-max-microvolt = <3000000>;
330				regulator-state-mem {
331					regulator-on-in-suspend;
332					regulator-suspend-microvolt = <3000000>;
333				};
334			};
335
336			rk818_ldo10: SWITCH_REG {
337				regulator-name = "rk818_ldo10";
338				regulator-always-on;
339				regulator-boot-on;
340				regulator-state-mem {
341					regulator-on-in-suspend;
342				};
343			};
344		};
345
346		battery {
347			compatible = "rk818-battery";
348			ocv_table = <3400 3650 3693 3707 3731 3749 3760
349				     3770 3782 3796 3812 3829 3852 3882
350				     3915 3951 3981 4047 4086 4132 4182>;
351			design_capacity = <4000>;
352			design_qmax = <4000>;
353			bat_res = <100>;
354			max_input_current = <2000>;
355			max_chrg_current = <1400>;
356			max_chrg_voltage = <4200>;
357			sleep_enter_current = <300>;
358			sleep_exit_current = <300>;
359			power_off_thresd = <3400>;
360			zero_algorithm_vol = <3850>;
361			energy_mode = <0>;
362			fb_temperature = <105>;
363			sample_res = <20>;
364			max_soc_offset = <60>;
365			monitor_sec = <5>;
366			virtual_power = <1>;
367			power_dc2otg = <0>;
368		};
369	};
370};
371
372&pinctrl {
373	pmic {
374		pmic_int_l: pmic-int-l {
375			rockchip,pins = <3 RK_PC6 RK_FUNC_GPIO &pcfg_pull_default>;
376		};
377	};
378
379	usb2 {
380		host_vbus_drv: host-vbus-drv {
381			rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
382		};
383
384		otg_vbus_drv: otg-vbus-drv {
385			rockchip,pins = <0 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
386		};
387	};
388};
389
390&sdmmc {
391	cap-mmc-highspeed;
392	no-sdio;
393	no-mmc;
394	broken-cd;
395	card-detect-delay = <800>;
396	ignore-pm-notify;
397	keep-power-in-suspend;
398	cd-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>; /* CD GPIO */
399	status = "disabled";
400};
401
402&sdio {
403	cap-mmc-highspeed;
404	no-sd;
405	no-mmc;
406	ignore-pm-notify;
407	keep-power-in-suspend;
408	non-removable;
409	cap-sdio-irq;
410	status = "disabled";
411};
412
413&u2phy {
414	status = "okay";
415
416	u2phy_otg: otg-port {
417		vbus-supply = <&vcc_otg_vbus>;
418		status = "okay";
419	};
420
421	u2phy_host: host-port {
422		phy-supply = <&vcc_host_5v>;
423		status = "okay";
424	};
425};
426
427&usb_host_ehci {
428	status = "okay";
429};
430
431&usb_host_ohci {
432	status = "okay";
433};
434
435&usb_otg {
436	status = "okay";
437};
438
439&vop {
440	status = "okay";
441};
442
443&vop_mmu {
444	status = "okay";
445};
446