e0e726994a5ebc4efd4e06cbcaa14a13d0736a4b
[AGL/meta-agl.git] / meta-agl-bsp / meta-rcar-gen3 / recipes-kernel / linux / files / 0004-ADSP-enable-and-add-sound-hardware-abstraction.patch
1 The ADSP on Renesas SoCs required a reserved memory area to become
2 enabled, and this needs to be done manually.
3
4 This patch adds sound hardware abstraction information for the m3ulcb
5 and m3ulcb-kf (kingfisher) device trees. This is helpful on-board the
6 ADSP for dynamically determining sound hardware at runtime, allowing
7 single binaries to be used between the two boards. 
8
9 Future work will incorporate the h3ulcb and Salvator boards into the
10 abstraction.
11
12 Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
13 ---
14 diff --git a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts
15 index de2390f009e7..4ccfa8315d17 100644
16 --- a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts
17 +++ b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts
18 @@ -17,3 +17,35 @@
19         compatible = "shimafuji,kingfisher", "renesas,m3ulcb",
20                      "renesas,r8a7796";
21  };
22 +
23 +&adsp {
24 +
25 +       /* ADSP playback setting for pcm3168 */
26 +       adsp_playback0: adsp,playback {
27 +               mode  = "tdm";
28 +               clock-mode = "master";
29 +               bus-width = <24>;
30 +               ssi = <3>;
31 +               bus-if = <0>;
32 +               channels = <8>;
33 +               pin-share-ssi = <4>;
34 +       };
35 +
36 +       /* ADSP capture setting for pcm3168 */
37 +       adsp_capture0: adsp,capture {
38 +               mode  = "tdm";
39 +               clock-mode = "slave";
40 +               bus-width = <24>;
41 +               ssi = <4>;
42 +               bus-if = <0>;
43 +               channels = <8>;
44 +               pin-share-ssi = <3>;
45 +       };
46 +       
47 +       adsp,ports {
48 +               port@0 {
49 +                       playback = <&adsp_playback0>;
50 +                       capture  = <&adsp_capture0>;
51 +               };
52 +       };
53 +};
54 \ No newline at end of file
55 diff --git a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
56 index 1cd64c1b3b31..71e59da3528d 100644
57 --- a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
58 +++ b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
59 @@ -45,11 +45,18 @@
60                         reg = <0x00000000 0x54000000 0x0 0x03000000>;
61                 };
62  
63 +               /* For Audio DSP */
64 +               adsp_reserved: linux,adsp {
65 +                       compatible = "shared-dma-pool";
66 +                       reusable;
67 +                       reg = <0x00000000 0x57000000 0x0 0x01000000>;
68 +               };
69 +               
70                 /* global autoconfigured region for contiguous allocations */
71                 linux,cma {
72                         compatible = "shared-dma-pool";
73                         reusable;
74 -                       reg = <0x00000000 0x57000000 0x0 0x19000000>;
75 +                       reg = <0x00000000 0x58000000 0x0 0x18000000>;
76                         linux,cma-default;
77                 };
78  
79 @@ -110,6 +117,42 @@
80                       "dclkin.0", "dclkin.1", "dclkin.2";
81  };
82  
83 +&adsp {
84 +       status = "okay";
85 +       clock-frequency = <12288000 11289600>;
86 +       audio-clocks = <22579200 24576000>;
87 +       memory-region = <&adsp_reserved>;
88 +
89 +       /* ADSP playback setting for ak4613 */
90 +       adsp_playback0: adsp,playback {
91 +               mode  = "i2s";
92 +               clock-mode = "master";
93 +               bus-width = <16>;
94 +               ssi = <0>;
95 +               bus-if = <0>;
96 +               channels = <2>;
97 +               pin-share-ssi = <1>;
98 +       };
99 +
100 +       /* ADSP capture setting for ak4613 */
101 +       adsp_capture0: adsp,capture {
102 +               mode  = "i2s";
103 +               clock-mode = "slave";
104 +               bus-width = <16>;
105 +               ssi = <1>;
106 +               bus-if = <0>;
107 +               channels = <2>;
108 +               pin-share-ssi = <0>;
109 +       };
110 +       
111 +       adsp,ports {
112 +               port@0 {
113 +                       playback = <&adsp_playback0>;
114 +                       capture  = <&adsp_capture0>;
115 +               };
116 +       };
117 +};
118 +
119  &vspb {
120         status = "okay";
121  };