1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 BayLibre, SAS
4 * Author: Neil Armstrong <narmstrong@baylibre.com>
5 */
6
7#include "meson-g12-common.dtsi"
8#include <dt-bindings/clock/axg-audio-clkc.h>
9#include <dt-bindings/power/meson-sm1-power.h>
10#include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
11#include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h>
12
13/ {
14	compatible = "amlogic,sm1";
15
16	tdmif_a: audio-controller-0 {
17		compatible = "amlogic,axg-tdm-iface";
18		#sound-dai-cells = <0>;
19		sound-name-prefix = "TDM_A";
20		clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>,
21			 <&clkc_audio AUD_CLKID_MST_A_SCLK>,
22			 <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
23		clock-names = "mclk", "sclk", "lrclk";
24		status = "disabled";
25	};
26
27	tdmif_b: audio-controller-1 {
28		compatible = "amlogic,axg-tdm-iface";
29		#sound-dai-cells = <0>;
30		sound-name-prefix = "TDM_B";
31		clocks = <&clkc_audio AUD_CLKID_MST_B_MCLK>,
32			 <&clkc_audio AUD_CLKID_MST_B_SCLK>,
33			 <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
34		clock-names = "mclk", "sclk", "lrclk";
35		status = "disabled";
36	};
37
38	tdmif_c: audio-controller-2 {
39		compatible = "amlogic,axg-tdm-iface";
40		#sound-dai-cells = <0>;
41		sound-name-prefix = "TDM_C";
42		clocks = <&clkc_audio AUD_CLKID_MST_C_MCLK>,
43			 <&clkc_audio AUD_CLKID_MST_C_SCLK>,
44			 <&clkc_audio AUD_CLKID_MST_C_LRCLK>;
45		clock-names = "mclk", "sclk", "lrclk";
46		status = "disabled";
47	};
48
49	cpus {
50		#address-cells = <0x2>;
51		#size-cells = <0x0>;
52
53		cpu0: cpu@0 {
54			device_type = "cpu";
55			compatible = "arm,cortex-a55";
56			reg = <0x0 0x0>;
57			enable-method = "psci";
58			next-level-cache = <&l2>;
59			#cooling-cells = <2>;
60		};
61
62		cpu1: cpu@1 {
63			device_type = "cpu";
64			compatible = "arm,cortex-a55";
65			reg = <0x0 0x1>;
66			enable-method = "psci";
67			next-level-cache = <&l2>;
68			#cooling-cells = <2>;
69		};
70
71		cpu2: cpu@2 {
72			device_type = "cpu";
73			compatible = "arm,cortex-a55";
74			reg = <0x0 0x2>;
75			enable-method = "psci";
76			next-level-cache = <&l2>;
77			#cooling-cells = <2>;
78		};
79
80		cpu3: cpu@3 {
81			device_type = "cpu";
82			compatible = "arm,cortex-a55";
83			reg = <0x0 0x3>;
84			enable-method = "psci";
85			next-level-cache = <&l2>;
86			#cooling-cells = <2>;
87		};
88
89		l2: l2-cache0 {
90			compatible = "cache";
91		};
92	};
93
94	cpu_opp_table: opp-table {
95		compatible = "operating-points-v2";
96		opp-shared;
97
98		opp-100000000 {
99			opp-hz = /bits/ 64 <100000000>;
100			opp-microvolt = <730000>;
101		};
102
103		opp-250000000 {
104			opp-hz = /bits/ 64 <250000000>;
105			opp-microvolt = <730000>;
106		};
107
108		opp-500000000 {
109			opp-hz = /bits/ 64 <500000000>;
110			opp-microvolt = <730000>;
111		};
112
113		opp-667000000 {
114			opp-hz = /bits/ 64 <666666666>;
115			opp-microvolt = <750000>;
116		};
117
118		opp-1000000000 {
119			opp-hz = /bits/ 64 <1000000000>;
120			opp-microvolt = <770000>;
121		};
122
123		opp-1200000000 {
124			opp-hz = /bits/ 64 <1200000000>;
125			opp-microvolt = <780000>;
126		};
127
128		opp-1404000000 {
129			opp-hz = /bits/ 64 <1404000000>;
130			opp-microvolt = <790000>;
131		};
132
133		opp-1500000000 {
134			opp-hz = /bits/ 64 <1500000000>;
135			opp-microvolt = <800000>;
136		};
137
138		opp-1608000000 {
139			opp-hz = /bits/ 64 <1608000000>;
140			opp-microvolt = <810000>;
141		};
142
143		opp-1704000000 {
144			opp-hz = /bits/ 64 <1704000000>;
145			opp-microvolt = <850000>;
146		};
147
148		opp-1800000000 {
149			opp-hz = /bits/ 64 <1800000000>;
150			opp-microvolt = <900000>;
151		};
152
153		opp-1908000000 {
154			opp-hz = /bits/ 64 <1908000000>;
155			opp-microvolt = <950000>;
156		};
157	};
158};
159
160&apb {
161	audio: bus@60000 {
162		compatible = "simple-bus";
163		reg = <0x0 0x60000 0x0 0x1000>;
164		#address-cells = <2>;
165		#size-cells = <2>;
166		ranges = <0x0 0x0 0x0 0x60000 0x0 0x1000>;
167
168		clkc_audio: clock-controller@0 {
169			status = "disabled";
170			compatible = "amlogic,sm1-audio-clkc";
171			reg = <0x0 0x0 0x0 0xb4>;
172			#clock-cells = <1>;
173			#reset-cells = <1>;
174
175			clocks = <&clkc CLKID_AUDIO>,
176				 <&clkc CLKID_MPLL0>,
177				 <&clkc CLKID_MPLL1>,
178				 <&clkc CLKID_MPLL2>,
179				 <&clkc CLKID_MPLL3>,
180				 <&clkc CLKID_HIFI_PLL>,
181				 <&clkc CLKID_FCLK_DIV3>,
182				 <&clkc CLKID_FCLK_DIV4>,
183				 <&clkc CLKID_FCLK_DIV5>;
184			clock-names = "pclk",
185				      "mst_in0",
186				      "mst_in1",
187				      "mst_in2",
188				      "mst_in3",
189				      "mst_in4",
190				      "mst_in5",
191				      "mst_in6",
192				      "mst_in7";
193
194			resets = <&reset RESET_AUDIO>;
195		};
196
197		toddr_a: audio-controller@100 {
198			compatible = "amlogic,sm1-toddr",
199				     "amlogic,axg-toddr";
200			reg = <0x0 0x100 0x0 0x2c>;
201			#sound-dai-cells = <0>;
202			sound-name-prefix = "TODDR_A";
203			interrupts = <GIC_SPI 148 IRQ_TYPE_EDGE_RISING>;
204			clocks = <&clkc_audio AUD_CLKID_TODDR_A>;
205			resets = <&arb AXG_ARB_TODDR_A>,
206				 <&clkc_audio AUD_RESET_TODDR_A>;
207			reset-names = "arb", "rst";
208			amlogic,fifo-depth = <8192>;
209			status = "disabled";
210		};
211
212		toddr_b: audio-controller@140 {
213			compatible = "amlogic,sm1-toddr",
214				     "amlogic,axg-toddr";
215			reg = <0x0 0x140 0x0 0x2c>;
216			#sound-dai-cells = <0>;
217			sound-name-prefix = "TODDR_B";
218			interrupts = <GIC_SPI 149 IRQ_TYPE_EDGE_RISING>;
219			clocks = <&clkc_audio AUD_CLKID_TODDR_B>;
220			resets = <&arb AXG_ARB_TODDR_B>,
221				 <&clkc_audio AUD_RESET_TODDR_B>;
222			reset-names = "arb", "rst";
223			amlogic,fifo-depth = <256>;
224			status = "disabled";
225		};
226
227		toddr_c: audio-controller@180 {
228			compatible = "amlogic,sm1-toddr",
229				     "amlogic,axg-toddr";
230			reg = <0x0 0x180 0x0 0x2c>;
231			#sound-dai-cells = <0>;
232			sound-name-prefix = "TODDR_C";
233			interrupts = <GIC_SPI 150 IRQ_TYPE_EDGE_RISING>;
234			clocks = <&clkc_audio AUD_CLKID_TODDR_C>;
235			resets = <&arb AXG_ARB_TODDR_C>,
236				 <&clkc_audio AUD_RESET_TODDR_C>;
237			reset-names = "arb", "rst";
238			amlogic,fifo-depth = <256>;
239			status = "disabled";
240		};
241
242		frddr_a: audio-controller@1c0 {
243			compatible = "amlogic,sm1-frddr",
244				     "amlogic,axg-frddr";
245			reg = <0x0 0x1c0 0x0 0x2c>;
246			#sound-dai-cells = <0>;
247			sound-name-prefix = "FRDDR_A";
248			interrupts = <GIC_SPI 152 IRQ_TYPE_EDGE_RISING>;
249			clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
250			resets = <&arb AXG_ARB_FRDDR_A>,
251				 <&clkc_audio AUD_RESET_FRDDR_A>;
252			reset-names = "arb", "rst";
253			amlogic,fifo-depth = <512>;
254			status = "disabled";
255		};
256
257		frddr_b: audio-controller@200 {
258			compatible = "amlogic,sm1-frddr",
259				     "amlogic,axg-frddr";
260			reg = <0x0 0x200 0x0 0x2c>;
261			#sound-dai-cells = <0>;
262			sound-name-prefix = "FRDDR_B";
263			interrupts = <GIC_SPI 153 IRQ_TYPE_EDGE_RISING>;
264			clocks = <&clkc_audio AUD_CLKID_FRDDR_B>;
265			resets = <&arb AXG_ARB_FRDDR_B>,
266				 <&clkc_audio AUD_RESET_FRDDR_B>;
267			reset-names = "arb", "rst";
268			amlogic,fifo-depth = <256>;
269			status = "disabled";
270		};
271
272		frddr_c: audio-controller@240 {
273			compatible = "amlogic,sm1-frddr",
274				     "amlogic,axg-frddr";
275			reg = <0x0 0x240 0x0 0x2c>;
276			#sound-dai-cells = <0>;
277			sound-name-prefix = "FRDDR_C";
278			interrupts = <GIC_SPI 154 IRQ_TYPE_EDGE_RISING>;
279			clocks = <&clkc_audio AUD_CLKID_FRDDR_C>;
280			resets = <&arb AXG_ARB_FRDDR_C>,
281				 <&clkc_audio AUD_RESET_FRDDR_C>;
282			reset-names = "arb", "rst";
283			amlogic,fifo-depth = <256>;
284			status = "disabled";
285		};
286
287		arb: reset-controller@280 {
288			status = "disabled";
289			compatible = "amlogic,meson-sm1-audio-arb";
290			reg = <0x0 0x280 0x0 0x4>;
291			#reset-cells = <1>;
292			clocks = <&clkc_audio AUD_CLKID_DDR_ARB>;
293		};
294
295		tdmin_a: audio-controller@300 {
296			compatible = "amlogic,sm1-tdmin",
297				     "amlogic,axg-tdmin";
298			reg = <0x0 0x300 0x0 0x40>;
299			sound-name-prefix = "TDMIN_A";
300			resets = <&clkc_audio AUD_RESET_TDMIN_A>;
301			clocks = <&clkc_audio AUD_CLKID_TDMIN_A>,
302				 <&clkc_audio AUD_CLKID_TDMIN_A_SCLK>,
303				 <&clkc_audio AUD_CLKID_TDMIN_A_SCLK_SEL>,
304				 <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>,
305				 <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>;
306			clock-names = "pclk", "sclk", "sclk_sel",
307				      "lrclk", "lrclk_sel";
308			status = "disabled";
309		};
310
311		tdmin_b: audio-controller@340 {
312			compatible = "amlogic,sm1-tdmin",
313				     "amlogic,axg-tdmin";
314			reg = <0x0 0x340 0x0 0x40>;
315			sound-name-prefix = "TDMIN_B";
316			resets = <&clkc_audio AUD_RESET_TDMIN_B>;
317			clocks = <&clkc_audio AUD_CLKID_TDMIN_B>,
318				 <&clkc_audio AUD_CLKID_TDMIN_B_SCLK>,
319				 <&clkc_audio AUD_CLKID_TDMIN_B_SCLK_SEL>,
320				 <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>,
321				 <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>;
322			clock-names = "pclk", "sclk", "sclk_sel",
323				      "lrclk", "lrclk_sel";
324			status = "disabled";
325		};
326
327		tdmin_c: audio-controller@380 {
328			compatible = "amlogic,sm1-tdmin",
329				     "amlogic,axg-tdmin";
330			reg = <0x0 0x380 0x0 0x40>;
331			sound-name-prefix = "TDMIN_C";
332			resets = <&clkc_audio AUD_RESET_TDMIN_C>;
333			clocks = <&clkc_audio AUD_CLKID_TDMIN_C>,
334				 <&clkc_audio AUD_CLKID_TDMIN_C_SCLK>,
335				 <&clkc_audio AUD_CLKID_TDMIN_C_SCLK_SEL>,
336				 <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>,
337				 <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>;
338			clock-names = "pclk", "sclk", "sclk_sel",
339				      "lrclk", "lrclk_sel";
340			status = "disabled";
341		};
342
343		tdmin_lb: audio-controller@3c0 {
344			compatible = "amlogic,sm1-tdmin",
345				     "amlogic,axg-tdmin";
346			reg = <0x0 0x3c0 0x0 0x40>;
347			sound-name-prefix = "TDMIN_LB";
348			resets = <&clkc_audio AUD_RESET_TDMIN_LB>;
349			clocks = <&clkc_audio AUD_CLKID_TDMIN_LB>,
350				 <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK>,
351				 <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK_SEL>,
352				 <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>,
353				 <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>;
354			clock-names = "pclk", "sclk", "sclk_sel",
355				      "lrclk", "lrclk_sel";
356			status = "disabled";
357		};
358
359		spdifin: audio-controller@400 {
360			compatible = "amlogic,g12a-spdifin",
361				     "amlogic,axg-spdifin";
362			reg = <0x0 0x400 0x0 0x30>;
363			#sound-dai-cells = <0>;
364			sound-name-prefix = "SPDIFIN";
365			interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
366			clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
367			<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
368			clock-names = "pclk", "refclk";
369			resets = <&clkc_audio AUD_RESET_SPDIFIN>;
370			status = "disabled";
371		};
372
373		spdifout_a: audio-controller@480 {
374			compatible = "amlogic,g12a-spdifout",
375				     "amlogic,axg-spdifout";
376			reg = <0x0 0x480 0x0 0x50>;
377			#sound-dai-cells = <0>;
378			sound-name-prefix = "SPDIFOUT_A";
379			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
380			<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
381			clock-names = "pclk", "mclk";
382			resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
383			status = "disabled";
384		};
385
386		tdmout_a: audio-controller@500 {
387			compatible = "amlogic,sm1-tdmout";
388			reg = <0x0 0x500 0x0 0x40>;
389			sound-name-prefix = "TDMOUT_A";
390			resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
391			clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
392				 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
393				 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
394				 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
395				 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
396			clock-names = "pclk", "sclk", "sclk_sel",
397				      "lrclk", "lrclk_sel";
398			status = "disabled";
399		};
400
401		tdmout_b: audio-controller@540 {
402			compatible = "amlogic,sm1-tdmout";
403			reg = <0x0 0x540 0x0 0x40>;
404			sound-name-prefix = "TDMOUT_B";
405			resets = <&clkc_audio AUD_RESET_TDMOUT_B>;
406			clocks = <&clkc_audio AUD_CLKID_TDMOUT_B>,
407				 <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK>,
408				 <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK_SEL>,
409				 <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>,
410				 <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>;
411			clock-names = "pclk", "sclk", "sclk_sel",
412				      "lrclk", "lrclk_sel";
413			status = "disabled";
414		};
415
416		tdmout_c: audio-controller@580 {
417			compatible = "amlogic,sm1-tdmout";
418			reg = <0x0 0x580 0x0 0x40>;
419			sound-name-prefix = "TDMOUT_C";
420			resets = <&clkc_audio AUD_RESET_TDMOUT_C>;
421			clocks = <&clkc_audio AUD_CLKID_TDMOUT_C>,
422				 <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK>,
423				 <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK_SEL>,
424				 <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>,
425				 <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>;
426			clock-names = "pclk", "sclk", "sclk_sel",
427				      "lrclk", "lrclk_sel";
428			status = "disabled";
429		};
430
431		toacodec: audio-controller@740 {
432			compatible = "amlogic,sm1-toacodec",
433				     "amlogic,g12a-toacodec";
434			reg = <0x0 0x740 0x0 0x4>;
435			#sound-dai-cells = <1>;
436			sound-name-prefix = "TOACODEC";
437			resets = <&clkc_audio AUD_RESET_TOACODEC>;
438			status = "disabled";
439		};
440
441		tohdmitx: audio-controller@744 {
442			compatible = "amlogic,sm1-tohdmitx",
443				     "amlogic,g12a-tohdmitx";
444			reg = <0x0 0x744 0x0 0x4>;
445			#sound-dai-cells = <1>;
446			sound-name-prefix = "TOHDMITX";
447			resets = <&clkc_audio AUD_RESET_TOHDMITX>;
448			status = "disabled";
449		};
450
451		toddr_d: audio-controller@840 {
452			compatible = "amlogic,sm1-toddr",
453				     "amlogic,axg-toddr";
454			reg = <0x0 0x840 0x0 0x2c>;
455			#sound-dai-cells = <0>;
456			sound-name-prefix = "TODDR_D";
457			interrupts = <GIC_SPI 49 IRQ_TYPE_EDGE_RISING>;
458			clocks = <&clkc_audio AUD_CLKID_TODDR_D>;
459			resets = <&arb AXG_ARB_TODDR_D>,
460				 <&clkc_audio AUD_RESET_TODDR_D>;
461			reset-names = "arb", "rst";
462			amlogic,fifo-depth = <256>;
463			status = "disabled";
464		};
465
466		frddr_d: audio-controller@880 {
467			 compatible = "amlogic,sm1-frddr",
468				      "amlogic,axg-frddr";
469			reg = <0x0 0x880 0x0 0x2c>;
470			#sound-dai-cells = <0>;
471			sound-name-prefix = "FRDDR_D";
472			interrupts = <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
473			clocks = <&clkc_audio AUD_CLKID_FRDDR_D>;
474			resets = <&arb AXG_ARB_FRDDR_D>,
475				 <&clkc_audio AUD_RESET_FRDDR_D>;
476			reset-names = "arb", "rst";
477			amlogic,fifo-depth = <256>;
478			status = "disabled";
479		};
480	};
481
482	pdm: audio-controller@61000 {
483		compatible = "amlogic,sm1-pdm",
484			     "amlogic,axg-pdm";
485		reg = <0x0 0x61000 0x0 0x34>;
486		#sound-dai-cells = <0>;
487		sound-name-prefix = "PDM";
488		clocks = <&clkc_audio AUD_CLKID_PDM>,
489			 <&clkc_audio AUD_CLKID_PDM_DCLK>,
490			 <&clkc_audio AUD_CLKID_PDM_SYSCLK>;
491		clock-names = "pclk", "dclk", "sysclk";
492		resets = <&clkc_audio AUD_RESET_PDM>;
493		status = "disabled";
494	};
495};
496
497&cecb_AO {
498	compatible = "amlogic,meson-sm1-ao-cec";
499};
500
501&clk_msr {
502	compatible = "amlogic,meson-sm1-clk-measure";
503};
504
505
506&clkc {
507	compatible = "amlogic,sm1-clkc";
508};
509
510&cpu_thermal {
511	cooling-maps {
512		map0 {
513			trip = <&cpu_passive>;
514			cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
515					<&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
516					<&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
517					<&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
518		};
519
520		map1 {
521			trip = <&cpu_hot>;
522			cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
523					<&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
524					<&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
525					<&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
526		};
527	};
528};
529
530&ethmac {
531	power-domains = <&pwrc PWRC_SM1_ETH_ID>;
532};
533
534&gpio_intc {
535	compatible = "amlogic,meson-sm1-gpio-intc",
536		     "amlogic,meson-gpio-intc";
537};
538
539&pcie {
540	power-domains = <&pwrc PWRC_SM1_PCIE_ID>;
541};
542
543&pwrc {
544	compatible = "amlogic,meson-sm1-pwrc";
545};
546
547&simplefb_cvbs {
548	power-domains = <&pwrc PWRC_SM1_VPU_ID>;
549};
550
551&simplefb_hdmi {
552	power-domains = <&pwrc PWRC_SM1_VPU_ID>;
553};
554
555&vdec {
556	compatible = "amlogic,sm1-vdec";
557};
558
559&vpu {
560	power-domains = <&pwrc PWRC_SM1_VPU_ID>;
561};
562
563&usb {
564	power-domains = <&pwrc PWRC_SM1_USB_ID>;
565};
566