1
2// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
3/*
4 * Copyright (c) 2019 BayLibre, SAS
5 * Author: Jerome Brunet <jbrunet@baylibre.com>
6 */
7
8#include "meson-g12-common.dtsi"
9#include <dt-bindings/clock/axg-audio-clkc.h>
10#include <dt-bindings/power/meson-g12a-power.h>
11#include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
12#include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h>
13
14/ {
15	tdmif_a: audio-controller-0 {
16		compatible = "amlogic,axg-tdm-iface";
17		#sound-dai-cells = <0>;
18		sound-name-prefix = "TDM_A";
19		clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>,
20			 <&clkc_audio AUD_CLKID_MST_A_SCLK>,
21			 <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
22		clock-names = "mclk", "sclk", "lrclk";
23		status = "disabled";
24	};
25
26	tdmif_b: audio-controller-1 {
27		compatible = "amlogic,axg-tdm-iface";
28		#sound-dai-cells = <0>;
29		sound-name-prefix = "TDM_B";
30		clocks = <&clkc_audio AUD_CLKID_MST_B_MCLK>,
31			 <&clkc_audio AUD_CLKID_MST_B_SCLK>,
32			 <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
33		clock-names = "mclk", "sclk", "lrclk";
34		status = "disabled";
35	};
36
37	tdmif_c: audio-controller-2 {
38		compatible = "amlogic,axg-tdm-iface";
39		#sound-dai-cells = <0>;
40		sound-name-prefix = "TDM_C";
41		clocks = <&clkc_audio AUD_CLKID_MST_C_MCLK>,
42			 <&clkc_audio AUD_CLKID_MST_C_SCLK>,
43			 <&clkc_audio AUD_CLKID_MST_C_LRCLK>;
44		clock-names = "mclk", "sclk", "lrclk";
45		status = "disabled";
46	};
47};
48
49&apb {
50	pdm: audio-controller@40000 {
51		compatible = "amlogic,g12a-pdm",
52			     "amlogic,axg-pdm";
53		reg = <0x0 0x40000 0x0 0x34>;
54		#sound-dai-cells = <0>;
55		sound-name-prefix = "PDM";
56		clocks = <&clkc_audio AUD_CLKID_PDM>,
57			 <&clkc_audio AUD_CLKID_PDM_DCLK>,
58			 <&clkc_audio AUD_CLKID_PDM_SYSCLK>;
59		clock-names = "pclk", "dclk", "sysclk";
60		resets = <&clkc_audio AUD_RESET_PDM>;
61		status = "disabled";
62	};
63
64	audio: bus@42000 {
65		compatible = "simple-bus";
66		reg = <0x0 0x42000 0x0 0x2000>;
67		#address-cells = <2>;
68		#size-cells = <2>;
69		ranges = <0x0 0x0 0x0 0x42000 0x0 0x2000>;
70
71		clkc_audio: clock-controller@0 {
72			status = "disabled";
73			compatible = "amlogic,g12a-audio-clkc";
74			reg = <0x0 0x0 0x0 0xb4>;
75			#clock-cells = <1>;
76			#reset-cells = <1>;
77
78			clocks = <&clkc CLKID_AUDIO>,
79				 <&clkc CLKID_MPLL0>,
80				 <&clkc CLKID_MPLL1>,
81				 <&clkc CLKID_MPLL2>,
82				 <&clkc CLKID_MPLL3>,
83				 <&clkc CLKID_HIFI_PLL>,
84				 <&clkc CLKID_FCLK_DIV3>,
85				 <&clkc CLKID_FCLK_DIV4>,
86				 <&clkc CLKID_GP0_PLL>;
87			clock-names = "pclk",
88				      "mst_in0",
89				      "mst_in1",
90				      "mst_in2",
91				      "mst_in3",
92				      "mst_in4",
93				      "mst_in5",
94				      "mst_in6",
95				      "mst_in7";
96
97			resets = <&reset RESET_AUDIO>;
98		};
99
100		toddr_a: audio-controller@100 {
101			compatible = "amlogic,g12a-toddr",
102				     "amlogic,axg-toddr";
103			reg = <0x0 0x100 0x0 0x2c>;
104			#sound-dai-cells = <0>;
105			sound-name-prefix = "TODDR_A";
106			interrupts = <GIC_SPI 148 IRQ_TYPE_EDGE_RISING>;
107			clocks = <&clkc_audio AUD_CLKID_TODDR_A>;
108			resets = <&arb AXG_ARB_TODDR_A>,
109				 <&clkc_audio AUD_RESET_TODDR_A>;
110			reset-names = "arb", "rst";
111			amlogic,fifo-depth = <512>;
112			status = "disabled";
113		};
114
115		toddr_b: audio-controller@140 {
116			compatible = "amlogic,g12a-toddr",
117				     "amlogic,axg-toddr";
118			reg = <0x0 0x140 0x0 0x2c>;
119			#sound-dai-cells = <0>;
120			sound-name-prefix = "TODDR_B";
121			interrupts = <GIC_SPI 149 IRQ_TYPE_EDGE_RISING>;
122			clocks = <&clkc_audio AUD_CLKID_TODDR_B>;
123			resets = <&arb AXG_ARB_TODDR_B>,
124				 <&clkc_audio AUD_RESET_TODDR_B>;
125			reset-names = "arb", "rst";
126			amlogic,fifo-depth = <256>;
127			status = "disabled";
128		};
129
130		toddr_c: audio-controller@180 {
131			compatible = "amlogic,g12a-toddr",
132				     "amlogic,axg-toddr";
133			reg = <0x0 0x180 0x0 0x2c>;
134			#sound-dai-cells = <0>;
135			sound-name-prefix = "TODDR_C";
136			interrupts = <GIC_SPI 150 IRQ_TYPE_EDGE_RISING>;
137			clocks = <&clkc_audio AUD_CLKID_TODDR_C>;
138			resets = <&arb AXG_ARB_TODDR_C>,
139				 <&clkc_audio AUD_RESET_TODDR_C>;
140			reset-names = "arb", "rst";
141			amlogic,fifo-depth = <256>;
142			status = "disabled";
143		};
144
145		frddr_a: audio-controller@1c0 {
146			compatible = "amlogic,g12a-frddr",
147				     "amlogic,axg-frddr";
148			reg = <0x0 0x1c0 0x0 0x2c>;
149			#sound-dai-cells = <0>;
150			sound-name-prefix = "FRDDR_A";
151			interrupts = <GIC_SPI 152 IRQ_TYPE_EDGE_RISING>;
152			clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
153			resets = <&arb AXG_ARB_FRDDR_A>,
154				 <&clkc_audio AUD_RESET_FRDDR_A>;
155			reset-names = "arb", "rst";
156			amlogic,fifo-depth = <512>;
157			status = "disabled";
158		};
159
160		frddr_b: audio-controller@200 {
161			compatible = "amlogic,g12a-frddr",
162				     "amlogic,axg-frddr";
163			reg = <0x0 0x200 0x0 0x2c>;
164			#sound-dai-cells = <0>;
165			sound-name-prefix = "FRDDR_B";
166			interrupts = <GIC_SPI 153 IRQ_TYPE_EDGE_RISING>;
167			clocks = <&clkc_audio AUD_CLKID_FRDDR_B>;
168			resets = <&arb AXG_ARB_FRDDR_B>,
169				 <&clkc_audio AUD_RESET_FRDDR_B>;
170			reset-names = "arb", "rst";
171			amlogic,fifo-depth = <256>;
172			status = "disabled";
173		};
174
175		frddr_c: audio-controller@240 {
176			compatible = "amlogic,g12a-frddr",
177				     "amlogic,axg-frddr";
178			reg = <0x0 0x240 0x0 0x2c>;
179			#sound-dai-cells = <0>;
180			sound-name-prefix = "FRDDR_C";
181			interrupts = <GIC_SPI 154 IRQ_TYPE_EDGE_RISING>;
182			clocks = <&clkc_audio AUD_CLKID_FRDDR_C>;
183			resets = <&arb AXG_ARB_FRDDR_C>,
184				 <&clkc_audio AUD_RESET_FRDDR_C>;
185			reset-names = "arb", "rst";
186			amlogic,fifo-depth = <256>;
187			status = "disabled";
188		};
189
190		arb: reset-controller@280 {
191			status = "disabled";
192			compatible = "amlogic,meson-axg-audio-arb";
193			reg = <0x0 0x280 0x0 0x4>;
194			#reset-cells = <1>;
195			clocks = <&clkc_audio AUD_CLKID_DDR_ARB>;
196		};
197
198		tdmin_a: audio-controller@300 {
199			compatible = "amlogic,g12a-tdmin",
200				     "amlogic,axg-tdmin";
201			reg = <0x0 0x300 0x0 0x40>;
202			sound-name-prefix = "TDMIN_A";
203			resets = <&clkc_audio AUD_RESET_TDMIN_A>;
204			clocks = <&clkc_audio AUD_CLKID_TDMIN_A>,
205				 <&clkc_audio AUD_CLKID_TDMIN_A_SCLK>,
206				 <&clkc_audio AUD_CLKID_TDMIN_A_SCLK_SEL>,
207				 <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>,
208				 <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>;
209			clock-names = "pclk", "sclk", "sclk_sel",
210				      "lrclk", "lrclk_sel";
211			status = "disabled";
212		};
213
214		tdmin_b: audio-controller@340 {
215			compatible = "amlogic,g12a-tdmin",
216				     "amlogic,axg-tdmin";
217			reg = <0x0 0x340 0x0 0x40>;
218			sound-name-prefix = "TDMIN_B";
219			resets = <&clkc_audio AUD_RESET_TDMIN_B>;
220			clocks = <&clkc_audio AUD_CLKID_TDMIN_B>,
221				 <&clkc_audio AUD_CLKID_TDMIN_B_SCLK>,
222				 <&clkc_audio AUD_CLKID_TDMIN_B_SCLK_SEL>,
223				 <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>,
224				 <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>;
225			clock-names = "pclk", "sclk", "sclk_sel",
226				      "lrclk", "lrclk_sel";
227			status = "disabled";
228		};
229
230		tdmin_c: audio-controller@380 {
231			compatible = "amlogic,g12a-tdmin",
232				     "amlogic,axg-tdmin";
233			reg = <0x0 0x380 0x0 0x40>;
234			sound-name-prefix = "TDMIN_C";
235			resets = <&clkc_audio AUD_RESET_TDMIN_C>;
236			clocks = <&clkc_audio AUD_CLKID_TDMIN_C>,
237				 <&clkc_audio AUD_CLKID_TDMIN_C_SCLK>,
238				 <&clkc_audio AUD_CLKID_TDMIN_C_SCLK_SEL>,
239				 <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>,
240				 <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>;
241			clock-names = "pclk", "sclk", "sclk_sel",
242				      "lrclk", "lrclk_sel";
243			status = "disabled";
244		};
245
246		tdmin_lb: audio-controller@3c0 {
247			compatible = "amlogic,g12a-tdmin",
248				     "amlogic,axg-tdmin";
249			reg = <0x0 0x3c0 0x0 0x40>;
250			sound-name-prefix = "TDMIN_LB";
251			resets = <&clkc_audio AUD_RESET_TDMIN_LB>;
252			clocks = <&clkc_audio AUD_CLKID_TDMIN_LB>,
253				 <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK>,
254				 <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK_SEL>,
255				 <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>,
256				 <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>;
257			clock-names = "pclk", "sclk", "sclk_sel",
258				      "lrclk", "lrclk_sel";
259			status = "disabled";
260		};
261
262		spdifin: audio-controller@400 {
263			compatible = "amlogic,g12a-spdifin",
264				     "amlogic,axg-spdifin";
265			reg = <0x0 0x400 0x0 0x30>;
266			#sound-dai-cells = <0>;
267			sound-name-prefix = "SPDIFIN";
268			interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
269			clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
270				 <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
271			clock-names = "pclk", "refclk";
272			resets = <&clkc_audio AUD_RESET_SPDIFIN>;
273			status = "disabled";
274		};
275
276		spdifout: audio-controller@480 {
277			compatible = "amlogic,g12a-spdifout",
278				     "amlogic,axg-spdifout";
279			reg = <0x0 0x480 0x0 0x50>;
280			#sound-dai-cells = <0>;
281			sound-name-prefix = "SPDIFOUT";
282			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
283				 <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
284			clock-names = "pclk", "mclk";
285			resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
286			status = "disabled";
287		};
288
289		tdmout_a: audio-controller@500 {
290			compatible = "amlogic,g12a-tdmout";
291			reg = <0x0 0x500 0x0 0x40>;
292			sound-name-prefix = "TDMOUT_A";
293			resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
294			clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
295				 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
296				 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
297				 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
298				 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
299			clock-names = "pclk", "sclk", "sclk_sel",
300				      "lrclk", "lrclk_sel";
301			status = "disabled";
302		};
303
304		tdmout_b: audio-controller@540 {
305			compatible = "amlogic,g12a-tdmout";
306			reg = <0x0 0x540 0x0 0x40>;
307			sound-name-prefix = "TDMOUT_B";
308			resets = <&clkc_audio AUD_RESET_TDMOUT_B>;
309			clocks = <&clkc_audio AUD_CLKID_TDMOUT_B>,
310				 <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK>,
311				 <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK_SEL>,
312				 <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>,
313				 <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>;
314			clock-names = "pclk", "sclk", "sclk_sel",
315				      "lrclk", "lrclk_sel";
316			status = "disabled";
317		};
318
319		tdmout_c: audio-controller@580 {
320			compatible = "amlogic,g12a-tdmout";
321			reg = <0x0 0x580 0x0 0x40>;
322			sound-name-prefix = "TDMOUT_C";
323			resets = <&clkc_audio AUD_RESET_TDMOUT_C>;
324			clocks = <&clkc_audio AUD_CLKID_TDMOUT_C>,
325				 <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK>,
326				 <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK_SEL>,
327				 <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>,
328				 <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>;
329			clock-names = "pclk", "sclk", "sclk_sel",
330				      "lrclk", "lrclk_sel";
331			status = "disabled";
332		};
333
334		spdifout_b: audio-controller@680 {
335			compatible = "amlogic,g12a-spdifout",
336				     "amlogic,axg-spdifout";
337			reg = <0x0 0x680 0x0 0x50>;
338			#sound-dai-cells = <0>;
339			sound-name-prefix = "SPDIFOUT_B";
340			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
341				 <&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
342			clock-names = "pclk", "mclk";
343			resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
344			status = "disabled";
345		};
346
347		tohdmitx: audio-controller@744 {
348			compatible = "amlogic,g12a-tohdmitx";
349			reg = <0x0 0x744 0x0 0x4>;
350			#sound-dai-cells = <1>;
351			sound-name-prefix = "TOHDMITX";
352			resets = <&clkc_audio AUD_RESET_TOHDMITX>;
353			status = "disabled";
354		};
355	};
356};
357
358&cpu_thermal {
359	cooling-maps {
360		map0 {
361			trip = <&cpu_passive>;
362			cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
363					 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
364					 <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
365					 <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
366					 <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
367					 <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
368		};
369		map1 {
370			trip = <&cpu_hot>;
371			cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
372					 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
373					 <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
374					 <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
375					 <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
376					 <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
377		};
378	};
379};
380
381&ethmac {
382	power-domains = <&pwrc PWRC_G12A_ETH_ID>;
383};
384
385&vpu {
386	power-domains = <&pwrc PWRC_G12A_VPU_ID>;
387};
388
389&sd_emmc_a {
390	amlogic,dram-access-quirk;
391};
392
393&simplefb_cvbs {
394	power-domains = <&pwrc PWRC_G12A_VPU_ID>;
395};
396
397&simplefb_hdmi {
398	power-domains = <&pwrc PWRC_G12A_VPU_ID>;
399};
400
401