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