1// SPDX-License-Identifier: GPL-2.0
2/*
3 * TOPEET's Exynos4412 based itop board device tree source
4 *
5 * Copyright (c) 2016 SUMOMO Computer Association
6 *			https://www.sumomo.mobi
7 *			Randy Li <ayaka@soulik.info>
8 *
9 * Device tree source file for TOPEET iTop Exynos 4412 SCP package core
10 * board which is based on Samsung's Exynos4412 SoC.
11 */
12
13#include <dt-bindings/clock/samsung,s2mps11.h>
14#include <dt-bindings/gpio/gpio.h>
15#include <dt-bindings/input/input.h>
16#include "exynos4412.dtsi"
17#include "exynos4412-ppmu-common.dtsi"
18#include "exynos-mfc-reserved-memory.dtsi"
19
20/ {
21	memory@40000000 {
22		device_type = "memory";
23		reg = <0x40000000 0x40000000>;
24	};
25
26	firmware@203f000 {
27		compatible = "samsung,secure-firmware";
28		reg = <0x0203F000 0x1000>;
29	};
30
31	fixed-rate-clocks {
32		xxti {
33			compatible = "samsung,clock-xxti";
34			clock-frequency = <0>;
35		};
36
37		xusbxti {
38			compatible = "samsung,clock-xusbxti";
39			clock-frequency = <24000000>;
40		};
41	};
42
43	thermal-zones {
44		cpu_thermal: cpu-thermal {
45			cooling-maps {
46				map0 {
47				     /* Corresponds to 800MHz at freq_table */
48				     cooling-device = <&cpu0 7 7>, <&cpu1 7 7>,
49						      <&cpu2 7 7>, <&cpu3 7 7>;
50				};
51				map1 {
52				     /* Corresponds to 200MHz at freq_table */
53				     cooling-device = <&cpu0 13 13>,
54						      <&cpu1 13 13>,
55						      <&cpu2 13 13>,
56						      <&cpu3 13 13>;
57			       };
58		       };
59		};
60	};
61
62	usb-hub {
63		compatible = "smsc,usb3503a";
64		reset-gpios = <&gpm2 4 GPIO_ACTIVE_LOW>;
65		connect-gpios = <&gpm3 3 GPIO_ACTIVE_HIGH>;
66		intn-gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>;
67		pinctrl-names = "default";
68		pinctrl-0 = <&hsic_reset>;
69	};
70};
71
72&bus_dmc {
73	devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
74	vdd-supply = <&buck1_reg>;
75	status = "okay";
76};
77
78&bus_acp {
79	devfreq = <&bus_dmc>;
80	status = "okay";
81};
82
83&bus_c2c {
84	devfreq = <&bus_dmc>;
85	status = "okay";
86};
87
88&bus_leftbus {
89	devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
90	vdd-supply = <&buck3_reg>;
91	status = "okay";
92};
93
94&bus_rightbus {
95	devfreq = <&bus_leftbus>;
96	status = "okay";
97};
98
99&bus_fsys {
100	devfreq = <&bus_leftbus>;
101	status = "okay";
102};
103
104&bus_peri {
105	devfreq = <&bus_leftbus>;
106	status = "okay";
107};
108
109&bus_mfc {
110	devfreq = <&bus_leftbus>;
111	status = "okay";
112};
113
114&cpu0 {
115	cpu0-supply = <&buck2_reg>;
116};
117
118&gpu {
119	mali-supply = <&buck4_reg>;
120	status = "okay";
121};
122
123&hsotg {
124	vusb_d-supply = <&ldo15_reg>;
125	vusb_a-supply = <&ldo12_reg>;
126};
127
128&i2c_1 {
129	#address-cells = <1>;
130	#size-cells = <0>;
131	samsung,i2c-sda-delay = <100>;
132	samsung,i2c-max-bus-freq = <400000>;
133	pinctrl-0 = <&i2c1_bus>;
134	pinctrl-names = "default";
135	status = "okay";
136
137	s5m8767: pmic@66 {
138		compatible = "samsung,s5m8767-pmic";
139		reg = <0x66>;
140
141		s5m8767,pmic-buck-default-dvs-idx = <3>;
142
143		s5m8767,pmic-buck-dvs-gpios = <&gpb 5 GPIO_ACTIVE_HIGH>,
144						 <&gpb 6 GPIO_ACTIVE_HIGH>,
145						 <&gpb 7 GPIO_ACTIVE_HIGH>;
146
147		s5m8767,pmic-buck-ds-gpios = <&gpm3 5 GPIO_ACTIVE_HIGH>,
148						<&gpm3 6 GPIO_ACTIVE_HIGH>,
149						<&gpm3 7 GPIO_ACTIVE_HIGH>;
150
151		/* VDD_ARM */
152		s5m8767,pmic-buck2-dvs-voltage = <1356250>, <1300000>,
153						 <1243750>, <1118750>,
154						 <1068750>, <1012500>,
155						 <956250>, <900000>;
156		/* VDD_INT */
157		s5m8767,pmic-buck3-dvs-voltage = <1000000>, <1000000>,
158						 <925000>, <925000>,
159						 <887500>, <887500>,
160						 <850000>, <850000>;
161		/* VDD_G3D */
162		s5m8767,pmic-buck4-dvs-voltage = <1081250>, <1081250>,
163						 <1025000>, <950000>,
164						 <918750>, <900000>,
165						 <875000>, <831250>;
166		wakeup-source;
167
168		regulators {
169			ldo1_reg: LDO1 {
170				regulator-name = "VDD_ALIVE";
171				regulator-min-microvolt = <1100000>;
172				regulator-max-microvolt = <1100000>;
173				regulator-always-on;
174				regulator-boot-on;
175				op_mode = <1>; /* Normal Mode */
176			};
177
178			/* SCP uses 1.5v, POP uses 1.2v */
179			ldo2_reg: LDO2 {
180				regulator-name = "VDDQ_M12";
181				regulator-min-microvolt = <1500000>;
182				regulator-max-microvolt = <1500000>;
183				regulator-always-on;
184				regulator-boot-on;
185				op_mode = <1>; /* Normal Mode */
186			};
187
188			ldo3_reg: LDO3 {
189				regulator-name = "VDDIOAP_18";
190				regulator-min-microvolt = <1800000>;
191				regulator-max-microvolt = <1800000>;
192				regulator-always-on;
193				op_mode = <1>; /* Normal Mode */
194			};
195
196			ldo4_reg: LDO4 {
197				regulator-name = "VDDQ_PRE";
198				regulator-min-microvolt = <1800000>;
199				regulator-max-microvolt = <1800000>;
200				regulator-always-on;
201				op_mode = <1>; /* Normal Mode */
202			};
203
204			ldo5_reg: LDO5 {
205				regulator-name = "VDD_LDO5";
206				op_mode = <0>; /* Always off Mode */
207			};
208
209			ldo6_reg: LDO6 {
210				regulator-name = "VDD10_MPLL";
211				regulator-min-microvolt = <1000000>;
212				regulator-max-microvolt = <1000000>;
213				regulator-always-on;
214				op_mode = <1>; /* Normal Mode */
215			};
216
217			ldo7_reg: LDO7 {
218				regulator-name = "VDD10_XPLL";
219				regulator-min-microvolt = <1000000>;
220				regulator-max-microvolt = <1000000>;
221				regulator-always-on;
222				op_mode = <1>; /* Normal Mode */
223			};
224
225			ldo8_reg: LDO8 {
226				regulator-name = "VDD10_MIPI";
227				regulator-min-microvolt = <1000000>;
228				regulator-max-microvolt = <1000000>;
229				op_mode = <1>; /* Normal Mode */
230			};
231
232			ldo9_reg: LDO9 {
233				regulator-name = "VDD33_LCD";
234				regulator-min-microvolt = <3300000>;
235				regulator-max-microvolt = <3300000>;
236				op_mode = <1>; /* Normal Mode */
237			};
238
239			ldo10_reg: LDO10 {
240				regulator-name = "VDD18_MIPI";
241				regulator-min-microvolt = <1800000>;
242				regulator-max-microvolt = <1800000>;
243				op_mode = <1>; /* Normal Mode */
244			};
245
246			ldo11_reg: LDO11 {
247				regulator-name = "VDD18_ABB1";
248				regulator-min-microvolt = <1800000>;
249				regulator-max-microvolt = <1800000>;
250				regulator-always-on;
251				op_mode = <1>; /* Normal Mode */
252			};
253
254			ldo12_reg: LDO12 {
255				regulator-name = "VDD33_UOTG";
256				regulator-min-microvolt = <3300000>;
257				regulator-max-microvolt = <3300000>;
258				regulator-always-on;
259				op_mode = <1>; /* Normal Mode */
260			};
261
262			ldo13_reg: LDO13 {
263				regulator-name = "VDDIOPERI_18";
264				regulator-min-microvolt = <1800000>;
265				regulator-max-microvolt = <1800000>;
266				regulator-always-on;
267				op_mode = <1>; /* Normal Mode */
268			};
269
270			ldo14_reg: LDO14 {
271				regulator-name = "VDD18_ABB02";
272				regulator-min-microvolt = <1800000>;
273				regulator-max-microvolt = <1800000>;
274				regulator-always-on;
275				op_mode = <1>; /* Normal Mode */
276			};
277
278			ldo15_reg: LDO15 {
279				regulator-name = "VDD10_USH";
280				regulator-min-microvolt = <1000000>;
281				regulator-max-microvolt = <1000000>;
282				regulator-always-on;
283				op_mode = <1>; /* Normal Mode */
284			};
285
286			ldo16_reg: LDO16 {
287				regulator-name = "VDD18_HSIC";
288				regulator-min-microvolt = <1800000>;
289				regulator-max-microvolt = <1800000>;
290				regulator-always-on;
291				op_mode = <1>; /* Normal Mode */
292			};
293
294			ldo17_reg: LDO17 {
295				regulator-name = "VDDIOAP_MMC012_28";
296				regulator-min-microvolt = <2800000>;
297				regulator-max-microvolt = <2800000>;
298				op_mode = <1>; /* Normal Mode */
299			};
300
301			/* Used by HSIC */
302			ldo18_reg: LDO18 {
303				regulator-name = "VDDIOPERI_28";
304				regulator-min-microvolt = <3300000>;
305				regulator-max-microvolt = <3300000>;
306				regulator-always-on;
307				op_mode = <1>; /* Normal Mode */
308			};
309
310			ldo19_reg: LDO19 {
311				regulator-name = "VDD_LDO19";
312				op_mode = <0>; /* Always off Mode */
313			};
314
315			ldo20_reg: LDO20 {
316				regulator-name = "VDD28_CAM";
317				regulator-min-microvolt = <1800000>;
318				regulator-max-microvolt = <2800000>;
319				op_mode = <1>; /* Normal Mode */
320			};
321
322			ldo21_reg: LDO21 {
323				regulator-name = "VDD28_AF";
324				regulator-min-microvolt = <1800000>;
325				regulator-max-microvolt = <2800000>;
326				op_mode = <1>; /* Normal Mode */
327			};
328
329			ldo22_reg: LDO22 {
330				regulator-name = "VDDA28_2M";
331				regulator-min-microvolt = <2800000>;
332				regulator-max-microvolt = <2800000>;
333				op_mode = <1>; /* Normal Mode */
334			};
335
336			ldo23_reg: LDO23 {
337				regulator-name = "VDD28_TF";
338				regulator-min-microvolt = <2800000>;
339				regulator-max-microvolt = <2800000>;
340				op_mode = <1>; /* Normal Mode */
341			};
342
343			ldo24_reg: LDO24 {
344				regulator-name = "VDD33_A31";
345				regulator-min-microvolt = <3300000>;
346				regulator-max-microvolt = <3300000>;
347				op_mode = <1>; /* Normal Mode */
348			};
349
350			ldo25_reg: LDO25 {
351				regulator-name = "VDD18_CAM";
352				regulator-min-microvolt = <1800000>;
353				regulator-max-microvolt = <1800000>;
354				op_mode = <1>; /* Normal Mode */
355			};
356
357			ldo26_reg: LDO26 {
358				regulator-name = "VDD18_A31";
359				regulator-min-microvolt = <1800000>;
360				regulator-max-microvolt = <1800000>;
361				op_mode = <1>; /* Normal Mode */
362			};
363
364			ldo27_reg: LDO27 {
365				regulator-name = "GPS_1V8";
366				regulator-min-microvolt = <1800000>;
367				regulator-max-microvolt = <1800000>;
368				op_mode = <1>; /* Normal Mode */
369			};
370
371			ldo28_reg: LDO28 {
372				regulator-name = "DVDD12";
373				regulator-min-microvolt = <1200000>;
374				regulator-max-microvolt = <1200000>;
375				op_mode = <1>; /* Normal Mode */
376			};
377
378			buck1_reg: BUCK1 {
379				regulator-name = "vdd_mif";
380				regulator-min-microvolt = <850000>;
381				regulator-max-microvolt = <1100000>;
382				regulator-always-on;
383				regulator-boot-on;
384				op_mode = <1>; /* Normal Mode */
385			};
386
387			buck2_reg: BUCK2 {
388				regulator-name = "vdd_arm";
389				regulator-min-microvolt = <850000>;
390				regulator-max-microvolt = <1456250>;
391				regulator-always-on;
392				regulator-boot-on;
393				op_mode = <1>; /* Normal Mode */
394			};
395
396			buck3_reg: BUCK3 {
397				regulator-name = "vdd_int";
398				regulator-min-microvolt = <875000>;
399				regulator-max-microvolt = <1200000>;
400				regulator-always-on;
401				regulator-boot-on;
402				op_mode = <1>; /* Normal Mode */
403			};
404
405			buck4_reg: BUCK4 {
406				regulator-name = "vdd_g3d";
407				regulator-min-microvolt = <750000>;
408				regulator-max-microvolt = <1500000>;
409				regulator-always-on;
410				regulator-boot-on;
411				op_mode = <1>; /* Normal Mode */
412			};
413
414			buck5_reg: BUCK5 {
415				regulator-name = "vdd_m12";
416				regulator-min-microvolt = <750000>;
417				regulator-max-microvolt = <1500000>;
418				regulator-always-on;
419				regulator-boot-on;
420				op_mode = <1>; /* Normal Mode */
421			};
422
423			buck6_reg: BUCK6 {
424				regulator-name = "vdd12_5m";
425				regulator-min-microvolt = <750000>;
426				regulator-max-microvolt = <1500000>;
427				regulator-always-on;
428				regulator-boot-on;
429				op_mode = <1>; /* Normal Mode */
430			};
431
432			buck7_reg: BUCK7 {
433				regulator-name = "pvdd_buck7";
434				regulator-min-microvolt = <750000>;
435				regulator-max-microvolt = <2000000>;
436				regulator-boot-on;
437				regulator-always-on;
438				op_mode = <1>; /* Normal Mode */
439			};
440
441			buck8_reg: BUCK8 {
442				regulator-name = "pvdd_buck8";
443				regulator-min-microvolt = <750000>;
444				regulator-max-microvolt = <1500000>;
445				regulator-boot-on;
446				regulator-always-on;
447				op_mode = <1>; /* Normal Mode */
448			};
449
450			buck9_reg: BUCK9 {
451				regulator-name = "vddf28_emmc";
452				regulator-min-microvolt = <750000>;
453				regulator-max-microvolt = <3000000>;
454				op_mode = <1>; /* Normal Mode */
455			};
456		};
457
458		s5m8767_osc: clocks {
459			compatible = "samsung,s5m8767-clk";
460			#clock-cells = <1>;
461			clock-output-names = "s5m8767_ap",
462					"s5m8767_cp", "s5m8767_bt";
463		};
464
465	};
466};
467
468&mfc {
469	status = "okay";
470};
471
472&mshc_0 {
473	pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
474	pinctrl-names = "default";
475	status = "okay";
476	vmmc-supply = <&buck9_reg>;
477	broken-cd;
478	card-detect-delay = <200>;
479	samsung,dw-mshc-ciu-div = <3>;
480	samsung,dw-mshc-sdr-timing = <2 3>;
481	samsung,dw-mshc-ddr-timing = <1 2>;
482	bus-width = <8>;
483	cap-mmc-highspeed;
484};
485
486&pinctrl_1 {
487	hsic_reset: hsic-reset {
488		samsung,pins = "gpm2-4";
489		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
490		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
491		samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
492	};
493};
494
495&rtc {
496	status = "okay";
497	clocks = <&clock CLK_RTC>, <&s5m8767_osc S2MPS11_CLK_AP>;
498	clock-names = "rtc", "rtc_src";
499};
500
501&tmu {
502	vtmu-supply = <&ldo16_reg>;
503	status = "okay";
504};
505