1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2//
3// Device Tree Source for UniPhier LD20 SoC
4//
5// Copyright (C) 2015-2016 Socionext Inc.
6//   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/gpio/uniphier-gpio.h>
10#include <dt-bindings/thermal/thermal.h>
11
12/memreserve/ 0x80000000 0x02000000;
13
14/ {
15	compatible = "socionext,uniphier-ld20";
16	#address-cells = <2>;
17	#size-cells = <2>;
18	interrupt-parent = <&gic>;
19
20	cpus {
21		#address-cells = <2>;
22		#size-cells = <0>;
23
24		cpu-map {
25			cluster0 {
26				core0 {
27					cpu = <&cpu0>;
28				};
29				core1 {
30					cpu = <&cpu1>;
31				};
32			};
33
34			cluster1 {
35				core0 {
36					cpu = <&cpu2>;
37				};
38				core1 {
39					cpu = <&cpu3>;
40				};
41			};
42		};
43
44		cpu0: cpu@0 {
45			device_type = "cpu";
46			compatible = "arm,cortex-a72", "arm,armv8";
47			reg = <0 0x000>;
48			clocks = <&sys_clk 32>;
49			enable-method = "psci";
50			operating-points-v2 = <&cluster0_opp>;
51			#cooling-cells = <2>;
52		};
53
54		cpu1: cpu@1 {
55			device_type = "cpu";
56			compatible = "arm,cortex-a72", "arm,armv8";
57			reg = <0 0x001>;
58			clocks = <&sys_clk 32>;
59			enable-method = "psci";
60			operating-points-v2 = <&cluster0_opp>;
61		};
62
63		cpu2: cpu@100 {
64			device_type = "cpu";
65			compatible = "arm,cortex-a53", "arm,armv8";
66			reg = <0 0x100>;
67			clocks = <&sys_clk 33>;
68			enable-method = "psci";
69			operating-points-v2 = <&cluster1_opp>;
70			#cooling-cells = <2>;
71		};
72
73		cpu3: cpu@101 {
74			device_type = "cpu";
75			compatible = "arm,cortex-a53", "arm,armv8";
76			reg = <0 0x101>;
77			clocks = <&sys_clk 33>;
78			enable-method = "psci";
79			operating-points-v2 = <&cluster1_opp>;
80		};
81	};
82
83	cluster0_opp: opp-table0 {
84		compatible = "operating-points-v2";
85		opp-shared;
86
87		opp-250000000 {
88			opp-hz = /bits/ 64 <250000000>;
89			clock-latency-ns = <300>;
90		};
91		opp-275000000 {
92			opp-hz = /bits/ 64 <275000000>;
93			clock-latency-ns = <300>;
94		};
95		opp-500000000 {
96			opp-hz = /bits/ 64 <500000000>;
97			clock-latency-ns = <300>;
98		};
99		opp-550000000 {
100			opp-hz = /bits/ 64 <550000000>;
101			clock-latency-ns = <300>;
102		};
103		opp-666667000 {
104			opp-hz = /bits/ 64 <666667000>;
105			clock-latency-ns = <300>;
106		};
107		opp-733334000 {
108			opp-hz = /bits/ 64 <733334000>;
109			clock-latency-ns = <300>;
110		};
111		opp-1000000000 {
112			opp-hz = /bits/ 64 <1000000000>;
113			clock-latency-ns = <300>;
114		};
115		opp-1100000000 {
116			opp-hz = /bits/ 64 <1100000000>;
117			clock-latency-ns = <300>;
118		};
119	};
120
121	cluster1_opp: opp-table1 {
122		compatible = "operating-points-v2";
123		opp-shared;
124
125		opp-250000000 {
126			opp-hz = /bits/ 64 <250000000>;
127			clock-latency-ns = <300>;
128		};
129		opp-275000000 {
130			opp-hz = /bits/ 64 <275000000>;
131			clock-latency-ns = <300>;
132		};
133		opp-500000000 {
134			opp-hz = /bits/ 64 <500000000>;
135			clock-latency-ns = <300>;
136		};
137		opp-550000000 {
138			opp-hz = /bits/ 64 <550000000>;
139			clock-latency-ns = <300>;
140		};
141		opp-666667000 {
142			opp-hz = /bits/ 64 <666667000>;
143			clock-latency-ns = <300>;
144		};
145		opp-733334000 {
146			opp-hz = /bits/ 64 <733334000>;
147			clock-latency-ns = <300>;
148		};
149		opp-1000000000 {
150			opp-hz = /bits/ 64 <1000000000>;
151			clock-latency-ns = <300>;
152		};
153		opp-1100000000 {
154			opp-hz = /bits/ 64 <1100000000>;
155			clock-latency-ns = <300>;
156		};
157	};
158
159	psci {
160		compatible = "arm,psci-1.0";
161		method = "smc";
162	};
163
164	clocks {
165		refclk: ref {
166			compatible = "fixed-clock";
167			#clock-cells = <0>;
168			clock-frequency = <25000000>;
169		};
170	};
171
172	emmc_pwrseq: emmc-pwrseq {
173		compatible = "mmc-pwrseq-emmc";
174		reset-gpios = <&gpio UNIPHIER_GPIO_PORT(3, 2) GPIO_ACTIVE_LOW>;
175	};
176
177	timer {
178		compatible = "arm,armv8-timer";
179		interrupts = <1 13 4>,
180			     <1 14 4>,
181			     <1 11 4>,
182			     <1 10 4>;
183	};
184
185	thermal-zones {
186		cpu-thermal {
187			polling-delay-passive = <250>;	/* 250ms */
188			polling-delay = <1000>;		/* 1000ms */
189			thermal-sensors = <&pvtctl>;
190
191			trips {
192				cpu_crit: cpu-crit {
193					temperature = <110000>;	/* 110C */
194					hysteresis = <2000>;
195					type = "critical";
196				};
197				cpu_alert: cpu-alert {
198					temperature = <100000>;	/* 100C */
199					hysteresis = <2000>;
200					type = "passive";
201				};
202			};
203
204			cooling-maps {
205				map0 {
206					trip = <&cpu_alert>;
207					cooling-device = <&cpu0
208					    THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
209				};
210				map1 {
211					trip = <&cpu_alert>;
212					cooling-device = <&cpu2
213					    THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
214				};
215			};
216		};
217	};
218
219	soc@0 {
220		compatible = "simple-bus";
221		#address-cells = <1>;
222		#size-cells = <1>;
223		ranges = <0 0 0 0xffffffff>;
224
225		serial0: serial@54006800 {
226			compatible = "socionext,uniphier-uart";
227			status = "disabled";
228			reg = <0x54006800 0x40>;
229			interrupts = <0 33 4>;
230			pinctrl-names = "default";
231			pinctrl-0 = <&pinctrl_uart0>;
232			clocks = <&peri_clk 0>;
233			resets = <&peri_rst 0>;
234		};
235
236		serial1: serial@54006900 {
237			compatible = "socionext,uniphier-uart";
238			status = "disabled";
239			reg = <0x54006900 0x40>;
240			interrupts = <0 35 4>;
241			pinctrl-names = "default";
242			pinctrl-0 = <&pinctrl_uart1>;
243			clocks = <&peri_clk 1>;
244			resets = <&peri_rst 1>;
245		};
246
247		serial2: serial@54006a00 {
248			compatible = "socionext,uniphier-uart";
249			status = "disabled";
250			reg = <0x54006a00 0x40>;
251			interrupts = <0 37 4>;
252			pinctrl-names = "default";
253			pinctrl-0 = <&pinctrl_uart2>;
254			clocks = <&peri_clk 2>;
255			resets = <&peri_rst 2>;
256		};
257
258		serial3: serial@54006b00 {
259			compatible = "socionext,uniphier-uart";
260			status = "disabled";
261			reg = <0x54006b00 0x40>;
262			interrupts = <0 177 4>;
263			pinctrl-names = "default";
264			pinctrl-0 = <&pinctrl_uart3>;
265			clocks = <&peri_clk 3>;
266			resets = <&peri_rst 3>;
267		};
268
269		gpio: gpio@55000000 {
270			compatible = "socionext,uniphier-gpio";
271			reg = <0x55000000 0x200>;
272			interrupt-parent = <&aidet>;
273			interrupt-controller;
274			#interrupt-cells = <2>;
275			gpio-controller;
276			#gpio-cells = <2>;
277			gpio-ranges = <&pinctrl 0 0 0>,
278				      <&pinctrl 96 0 0>,
279				      <&pinctrl 160 0 0>;
280			gpio-ranges-group-names = "gpio_range0",
281						  "gpio_range1",
282						  "gpio_range2";
283			ngpios = <205>;
284			socionext,interrupt-ranges = <0 48 16>, <16 154 5>,
285						     <21 217 3>;
286		};
287
288		audio@56000000 {
289			compatible = "socionext,uniphier-ld20-aio";
290			reg = <0x56000000 0x80000>;
291			interrupts = <0 144 4>;
292			pinctrl-names = "default";
293			pinctrl-0 = <&pinctrl_aout1>,
294				    <&pinctrl_aoutiec1>;
295			clock-names = "aio";
296			clocks = <&sys_clk 40>;
297			reset-names = "aio";
298			resets = <&sys_rst 40>;
299			#sound-dai-cells = <1>;
300
301			i2s_port0: port@0 {
302				i2s_hdmi: endpoint {
303				};
304			};
305
306			i2s_port1: port@1 {
307				i2s_pcmin2: endpoint {
308				};
309			};
310
311			i2s_port2: port@2 {
312				i2s_line: endpoint {
313					dai-format = "i2s";
314					remote-endpoint = <&evea_line>;
315				};
316			};
317
318			i2s_port3: port@3 {
319				i2s_hpcmout1: endpoint {
320				};
321			};
322
323			i2s_port4: port@4 {
324				i2s_hp: endpoint {
325					dai-format = "i2s";
326					remote-endpoint = <&evea_hp>;
327				};
328			};
329
330			spdif_port0: port@5 {
331				spdif_hiecout1: endpoint {
332				};
333			};
334
335			src_port0: port@6 {
336				i2s_epcmout2: endpoint {
337				};
338			};
339
340			src_port1: port@7 {
341				i2s_epcmout3: endpoint {
342				};
343			};
344
345			comp_spdif_port0: port@8 {
346				comp_spdif_hiecout1: endpoint {
347				};
348			};
349		};
350
351		codec@57900000 {
352			compatible = "socionext,uniphier-evea";
353			reg = <0x57900000 0x1000>;
354			clock-names = "evea", "exiv";
355			clocks = <&sys_clk 41>, <&sys_clk 42>;
356			reset-names = "evea", "exiv", "adamv";
357			resets = <&sys_rst 41>, <&sys_rst 42>, <&adamv_rst 0>;
358			#sound-dai-cells = <1>;
359
360			port@0 {
361				evea_line: endpoint {
362					remote-endpoint = <&i2s_line>;
363				};
364			};
365
366			port@1 {
367				evea_hp: endpoint {
368					remote-endpoint = <&i2s_hp>;
369				};
370			};
371		};
372
373		adamv@57920000 {
374			compatible = "socionext,uniphier-ld20-adamv",
375				     "simple-mfd", "syscon";
376			reg = <0x57920000 0x1000>;
377
378			adamv_rst: reset {
379				compatible = "socionext,uniphier-ld20-adamv-reset";
380				#reset-cells = <1>;
381			};
382		};
383
384		i2c0: i2c@58780000 {
385			compatible = "socionext,uniphier-fi2c";
386			status = "disabled";
387			reg = <0x58780000 0x80>;
388			#address-cells = <1>;
389			#size-cells = <0>;
390			interrupts = <0 41 4>;
391			pinctrl-names = "default";
392			pinctrl-0 = <&pinctrl_i2c0>;
393			clocks = <&peri_clk 4>;
394			resets = <&peri_rst 4>;
395			clock-frequency = <100000>;
396		};
397
398		i2c1: i2c@58781000 {
399			compatible = "socionext,uniphier-fi2c";
400			status = "disabled";
401			reg = <0x58781000 0x80>;
402			#address-cells = <1>;
403			#size-cells = <0>;
404			interrupts = <0 42 4>;
405			pinctrl-names = "default";
406			pinctrl-0 = <&pinctrl_i2c1>;
407			clocks = <&peri_clk 5>;
408			resets = <&peri_rst 5>;
409			clock-frequency = <100000>;
410		};
411
412		i2c2: i2c@58782000 {
413			compatible = "socionext,uniphier-fi2c";
414			reg = <0x58782000 0x80>;
415			#address-cells = <1>;
416			#size-cells = <0>;
417			interrupts = <0 43 4>;
418			clocks = <&peri_clk 6>;
419			resets = <&peri_rst 6>;
420			clock-frequency = <400000>;
421		};
422
423		i2c3: i2c@58783000 {
424			compatible = "socionext,uniphier-fi2c";
425			status = "disabled";
426			reg = <0x58783000 0x80>;
427			#address-cells = <1>;
428			#size-cells = <0>;
429			interrupts = <0 44 4>;
430			pinctrl-names = "default";
431			pinctrl-0 = <&pinctrl_i2c3>;
432			clocks = <&peri_clk 7>;
433			resets = <&peri_rst 7>;
434			clock-frequency = <100000>;
435		};
436
437		i2c4: i2c@58784000 {
438			compatible = "socionext,uniphier-fi2c";
439			status = "disabled";
440			reg = <0x58784000 0x80>;
441			#address-cells = <1>;
442			#size-cells = <0>;
443			interrupts = <0 45 4>;
444			pinctrl-names = "default";
445			pinctrl-0 = <&pinctrl_i2c4>;
446			clocks = <&peri_clk 8>;
447			resets = <&peri_rst 8>;
448			clock-frequency = <100000>;
449		};
450
451		i2c5: i2c@58785000 {
452			compatible = "socionext,uniphier-fi2c";
453			reg = <0x58785000 0x80>;
454			#address-cells = <1>;
455			#size-cells = <0>;
456			interrupts = <0 25 4>;
457			clocks = <&peri_clk 9>;
458			resets = <&peri_rst 9>;
459			clock-frequency = <400000>;
460		};
461
462		system_bus: system-bus@58c00000 {
463			compatible = "socionext,uniphier-system-bus";
464			status = "disabled";
465			reg = <0x58c00000 0x400>;
466			#address-cells = <2>;
467			#size-cells = <1>;
468			pinctrl-names = "default";
469			pinctrl-0 = <&pinctrl_system_bus>;
470		};
471
472		smpctrl@59801000 {
473			compatible = "socionext,uniphier-smpctrl";
474			reg = <0x59801000 0x400>;
475		};
476
477		sdctrl@59810000 {
478			compatible = "socionext,uniphier-ld20-sdctrl",
479				     "simple-mfd", "syscon";
480			reg = <0x59810000 0x400>;
481
482			sd_clk: clock {
483				compatible = "socionext,uniphier-ld20-sd-clock";
484				#clock-cells = <1>;
485			};
486
487			sd_rst: reset {
488				compatible = "socionext,uniphier-ld20-sd-reset";
489				#reset-cells = <1>;
490			};
491		};
492
493		perictrl@59820000 {
494			compatible = "socionext,uniphier-ld20-perictrl",
495				     "simple-mfd", "syscon";
496			reg = <0x59820000 0x200>;
497
498			peri_clk: clock {
499				compatible = "socionext,uniphier-ld20-peri-clock";
500				#clock-cells = <1>;
501			};
502
503			peri_rst: reset {
504				compatible = "socionext,uniphier-ld20-peri-reset";
505				#reset-cells = <1>;
506			};
507		};
508
509		emmc: sdhc@5a000000 {
510			compatible = "socionext,uniphier-sd4hc", "cdns,sd4hc";
511			reg = <0x5a000000 0x400>;
512			interrupts = <0 78 4>;
513			pinctrl-names = "default";
514			pinctrl-0 = <&pinctrl_emmc>;
515			clocks = <&sys_clk 4>;
516			resets = <&sys_rst 4>;
517			bus-width = <8>;
518			mmc-ddr-1_8v;
519			mmc-hs200-1_8v;
520			mmc-pwrseq = <&emmc_pwrseq>;
521			cdns,phy-input-delay-legacy = <4>;
522			cdns,phy-input-delay-mmc-highspeed = <2>;
523			cdns,phy-input-delay-mmc-ddr = <3>;
524			cdns,phy-dll-delay-sdclk = <21>;
525			cdns,phy-dll-delay-sdclk-hsmmc = <21>;
526		};
527
528		soc-glue@5f800000 {
529			compatible = "socionext,uniphier-ld20-soc-glue",
530				     "simple-mfd", "syscon";
531			reg = <0x5f800000 0x2000>;
532
533			pinctrl: pinctrl {
534				compatible = "socionext,uniphier-ld20-pinctrl";
535			};
536		};
537
538		soc-glue@5f900000 {
539			compatible = "socionext,uniphier-ld20-soc-glue-debug",
540				     "simple-mfd";
541			#address-cells = <1>;
542			#size-cells = <1>;
543			ranges = <0 0x5f900000 0x2000>;
544
545			efuse@100 {
546				compatible = "socionext,uniphier-efuse";
547				reg = <0x100 0x28>;
548			};
549
550			efuse@200 {
551				compatible = "socionext,uniphier-efuse";
552				reg = <0x200 0x68>;
553			};
554		};
555
556		aidet: aidet@5fc20000 {
557			compatible = "socionext,uniphier-ld20-aidet";
558			reg = <0x5fc20000 0x200>;
559			interrupt-controller;
560			#interrupt-cells = <2>;
561		};
562
563		gic: interrupt-controller@5fe00000 {
564			compatible = "arm,gic-v3";
565			reg = <0x5fe00000 0x10000>,	/* GICD */
566			      <0x5fe80000 0x80000>;	/* GICR */
567			interrupt-controller;
568			#interrupt-cells = <3>;
569			interrupts = <1 9 4>;
570		};
571
572		sysctrl@61840000 {
573			compatible = "socionext,uniphier-ld20-sysctrl",
574				     "simple-mfd", "syscon";
575			reg = <0x61840000 0x10000>;
576
577			sys_clk: clock {
578				compatible = "socionext,uniphier-ld20-clock";
579				#clock-cells = <1>;
580			};
581
582			sys_rst: reset {
583				compatible = "socionext,uniphier-ld20-reset";
584				#reset-cells = <1>;
585			};
586
587			watchdog {
588				compatible = "socionext,uniphier-wdt";
589			};
590
591			pvtctl: pvtctl {
592				compatible = "socionext,uniphier-ld20-thermal";
593				interrupts = <0 3 4>;
594				#thermal-sensor-cells = <0>;
595				socionext,tmod-calibration = <0x0f22 0x68ee>;
596			};
597		};
598
599		eth: ethernet@65000000 {
600			compatible = "socionext,uniphier-ld20-ave4";
601			status = "disabled";
602			reg = <0x65000000 0x8500>;
603			interrupts = <0 66 4>;
604			pinctrl-names = "default";
605			pinctrl-0 = <&pinctrl_ether_rgmii>;
606			clocks = <&sys_clk 6>;
607			resets = <&sys_rst 6>;
608			phy-mode = "rgmii";
609			local-mac-address = [00 00 00 00 00 00];
610
611			mdio: mdio {
612				#address-cells = <1>;
613				#size-cells = <0>;
614			};
615		};
616
617		nand: nand@68000000 {
618			compatible = "socionext,uniphier-denali-nand-v5b";
619			status = "disabled";
620			reg-names = "nand_data", "denali_reg";
621			reg = <0x68000000 0x20>, <0x68100000 0x1000>;
622			interrupts = <0 65 4>;
623			pinctrl-names = "default";
624			pinctrl-0 = <&pinctrl_nand>;
625			clocks = <&sys_clk 2>;
626			resets = <&sys_rst 2>;
627		};
628	};
629};
630
631#include "uniphier-pinctrl.dtsi"
632
633&pinctrl_aout1 {
634	drive-strength = <4>;	/* default: 3.5mA */
635
636	ao1dacck {
637		pins = "AO1DACCK";
638		drive-strength = <5>;	/* 5mA */
639	};
640};
641
642&pinctrl_aoutiec1 {
643	drive-strength = <4>;	/* default: 3.5mA */
644
645	ao1arc {
646		pins = "AO1ARC";
647		drive-strength = <11>;	/* 11mA */
648	};
649};
650