summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch
blob: 9c7f01b26e888d9e846809463e329ccb31794dfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
From 274657edb779d77ad0fe5ccb52b51634d075adf8 Mon Sep 17 00:00:00 2001
From: invalid_git config <unknown@unknown>
Date: Wed, 6 Oct 2021 14:42:47 +0000
Subject: [PATCH 2/2] The ADSP on Renesas SoCs required a reserved memory area
 to become enabled, and this needs to be done manually.

This patch adds sound hardware abstraction information for the m3ulcb
and m3ulcb-kf (kingfisher) device trees. This is helpful on-board the
ADSP for dynamically determining sound hardware at runtime, allowing
single binaries to be used between the two boards.

Future work will incorporate the h3ulcb and Salvator boards into the
abstraction.

Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
---
 arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts | 45 ++++++++++++++++++-
 arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts | 45 ++++++++++++++++++-
 2 files changed, 88 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts b/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts
index fbc8c9af6e52..df3bd589d9bb 100644
--- a/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts
@@ -62,11 +62,18 @@ lossy_decompress: linux,lossy_decompress@54000000 {
 			reg = <0x00000000 0x54000000 0x0 0x03000000>;
 		};
 
+		/* For Audio DSP */
+		adsp_reserved: linux,adsp {
+			compatible = "shared-dma-pool";
+			reusable;
+			reg = <0x00000000 0x57000000 0x0 0x01000000>;
+		};
+
 		/* global autoconfigured region for contiguous allocations */
 		linux,cma@57000000 {
 			compatible = "shared-dma-pool";
 			reusable;
-			reg = <0x00000000 0x57000000 0x0 0x19000000>;
+			reg = <0x00000000 0x58000000 0x0 0x18000000>;
 			linux,cma-default;
 		};
 
@@ -126,6 +133,42 @@ &du {
 		      "dclkin.0", "dclkin.1", "dclkin.2";
 };
 
+&adsp {
+	status = "okay";
+	clock-frequency = <12288000 11289600>;
+	audio-clocks = <22579200 24576000>;
+	memory-region = <&adsp_reserved>;
+
+	/* ADSP playback setting for ak4613 */
+	adsp_playback0: adsp,playback {
+		mode  = "i2s";
+		clock-mode = "master";
+		bus-width = <16>;
+		ssi = <0>;
+		bus-if = <0>;
+		channels = <2>;
+		pin-share-ssi = <1>;
+	};
+
+	/* ADSP capture setting for ak4613 */
+	adsp_capture0: adsp,capture {
+		mode  = "i2s";
+		clock-mode = "slave";
+		bus-width = <16>;
+		ssi = <1>;
+		bus-if = <0>;
+		channels = <2>;
+		pin-share-ssi = <0>;
+	};
+	
+	adsp,ports {
+		port@0 {
+			playback = <&adsp_playback0>;
+			capture  = <&adsp_capture0>;
+		};
+	};
+};
+
 &vspb {
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts b/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts
index e57dd7bb43f7..f583cc6c18bf 100644
--- a/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts
@@ -41,11 +41,18 @@ lossy_decompress: linux,lossy_decompress@54000000 {
 			reg = <0x00000000 0x54000000 0x0 0x03000000>;
 		};
 
+		/* For Audio DSP */
+		adsp_reserved: linux,adsp {
+			compatible = "shared-dma-pool";
+			reusable;
+			reg = <0x00000000 0x57000000 0x0 0x01000000>;
+		};
+
 		/* global autoconfigured region for contiguous allocations */
 		linux,cma@57000000 {
 			compatible = "shared-dma-pool";
 			reusable;
-			reg = <0x00000000 0x57000000 0x0 0x19000000>;
+			reg = <0x00000000 0x58000000 0x0 0x18000000>;
 			linux,cma-default;
 		};
 
@@ -89,6 +96,42 @@ &du {
 		      "dclkin.0", "dclkin.1", "dclkin.2";
 };
 
+&adsp {
+	status = "okay";
+	clock-frequency = <12288000 11289600>;
+	audio-clocks = <22579200 24576000>;
+	memory-region = <&adsp_reserved>;
+
+	/* ADSP playback setting for ak4613 */
+	adsp_playback0: adsp,playback {
+		mode  = "i2s";
+		clock-mode = "master";
+		bus-width = <16>;
+		ssi = <0>;
+		bus-if = <0>;
+		channels = <2>;
+		pin-share-ssi = <1>;
+	};
+
+	/* ADSP capture setting for ak4613 */
+	adsp_capture0: adsp,capture {
+		mode  = "i2s";
+		clock-mode = "slave";
+		bus-width = <16>;
+		ssi = <1>;
+		bus-if = <0>;
+		channels = <2>;
+		pin-share-ssi = <0>;
+	};
+	
+	adsp,ports {
+		port@0 {
+			playback = <&adsp_playback0>;
+			capture  = <&adsp_capture0>;
+		};
+	};
+};
+
 &vspb {
 	status = "okay";
 };
-- 
2.31.1