[RCAR] Fix patch on kernel dts
[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: Ronan Le Martret <ronan.lemartret@iot.bzh>
13 Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
14 ---
15 diff --git a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts
16 index de2390f009e7..4ccfa8315d17 100644
17 --- a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts
18 +++ b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts
19 @@ -15,6 +15,39 @@
20                      "renesas,r8a7796";
21  };
22  
23 +
24 +&adsp {
25 +
26 +       /* ADSP playback setting for pcm3168 */
27 +       adsp_playback0: adsp,playback {
28 +               mode  = "tdm";
29 +               clock-mode = "master";
30 +               bus-width = <24>;
31 +               ssi = <3>;
32 +               bus-if = <0>;
33 +               channels = <8>;
34 +               pin-share-ssi = <4>;
35 +       };
36 +
37 +       /* ADSP capture setting for pcm3168 */
38 +       adsp_capture0: adsp,capture {
39 +               mode  = "tdm";
40 +               clock-mode = "slave";
41 +               bus-width = <24>;
42 +               ssi = <4>;
43 +               bus-if = <0>;
44 +               channels = <8>;
45 +               pin-share-ssi = <3>;
46 +       };
47 +
48 +       adsp,ports {
49 +               port@0 {
50 +                       playback = <&adsp_playback0>;
51 +                       capture  = <&adsp_capture0>;
52 +               };
53 +       };
54 +};
55 +
56  &du {
57         ports {
58                 port@0 {
59 diff --git a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
60 index 1cd64c1b3b31..71e59da3528d 100644
61 --- a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
62 +++ b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
63 @@ -42,11 +42,18 @@
64                         reg = <0x00000000 0x54000000 0x0 0x03000000>;
65                 };
66  
67 +               /* For Audio DSP */
68 +               adsp_reserved: linux,adsp {
69 +                       compatible = "shared-dma-pool";
70 +                       reusable;
71 +                       reg = <0x00000000 0x57000000 0x0 0x01000000>;
72 +               };
73 +
74                 /* global autoconfigured region for contiguous allocations */
75                 linux,cma@57000000 {
76                         compatible = "shared-dma-pool";
77                         reusable;
78 -                       reg = <0x00000000 0x57000000 0x0 0x19000000>;
79 +                       reg = <0x00000000 0x58000000 0x0 0x18000000>;
80                         linux,cma-default;
81                 };
82  
83 @@ -110,6 +117,42 @@
84                       "dclkin.0", "dclkin.1", "dclkin.2";
85  };
86  
87 +&adsp {
88 +       status = "okay";
89 +       clock-frequency = <12288000 11289600>;
90 +       audio-clocks = <22579200 24576000>;
91 +       memory-region = <&adsp_reserved>;
92 +
93 +       /* ADSP playback setting for ak4613 */
94 +       adsp_playback0: adsp,playback {
95 +               mode  = "i2s";
96 +               clock-mode = "master";
97 +               bus-width = <16>;
98 +               ssi = <0>;
99 +               bus-if = <0>;
100 +               channels = <2>;
101 +               pin-share-ssi = <1>;
102 +       };
103 +
104 +       /* ADSP capture setting for ak4613 */
105 +       adsp_capture0: adsp,capture {
106 +               mode  = "i2s";
107 +               clock-mode = "slave";
108 +               bus-width = <16>;
109 +               ssi = <1>;
110 +               bus-if = <0>;
111 +               channels = <2>;
112 +               pin-share-ssi = <0>;
113 +       };
114 +       
115 +       adsp,ports {
116 +               port@0 {
117 +                       playback = <&adsp_playback0>;
118 +                       capture  = <&adsp_capture0>;
119 +               };
120 +       };
121 +};
122 +
123  &vspb {
124         status = "okay";
125  };