linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: shmobile: r8a7791: add ADSP clocks
@ 2014-12-29 20:19 Sergei Shtylyov
  2014-12-29 20:24 ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2014-12-29 20:19 UTC (permalink / raw)
  To: linux-arm-kernel

Add the ADSP clocks to the CPG and MSTP5 nodes of the R8A7791 device tree.

Based on the original patch by Konstantin Kozhevnikov
<konstantin.kozhevnikov@cogentembedded.com>.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against 'renesas-devel-20141229-v3.19-rc2' tag of Simon Horman's
'renesas.git' repo plus the R8A7791 CAN patches posted last week. It depends on
the patch adding the ADSP clock support to  the 'clk-rcar-gen2' driver in order
to work.

 arch/arm/boot/dts/r8a7791.dtsi            |   11 +++++++----
 include/dt-bindings/clock/r8a7791-clock.h |    4 +++-
 2 files changed, 10 insertions(+), 5 deletions(-)

Index: renesas/arch/arm/boot/dts/r8a7791.dtsi
=================================--- renesas.orig/arch/arm/boot/dts/r8a7791.dtsi
+++ renesas/arch/arm/boot/dts/r8a7791.dtsi
@@ -909,7 +909,7 @@
 			#clock-cells = <1>;
 			clock-output-names = "main", "pll0", "pll1", "pll3",
 					     "lb", "qspi", "sdh", "sd0", "z",
-					     "rcan";
+					     "adsp", "rcan";
 		};
 
 		/* Variable factor clocks */
@@ -1164,13 +1164,16 @@
 		mstp5_clks: mstp5_clks@e6150144 {
 			compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
 			reg = <0 0xe6150144 0 4>, <0 0xe615003c 0 4>;
-			clocks = <&hp_clk>, <&hp_clk>, <&extal_clk>, <&p_clk>;
+			clocks = <&hp_clk>, <&hp_clk>, <&cpg_clocks R8A7791_CLK_ADSP>,
+				 <&extal_clk>, <&p_clk>;
 			#clock-cells = <1>;
 			clock-indices = <
 				R8A7791_CLK_AUDIO_DMAC0 R8A7791_CLK_AUDIO_DMAC1
-				R8A7791_CLK_THERMAL R8A7791_CLK_PWM
+				R8A7791_CLK_ADSP_MOD R8A7791_CLK_THERMAL
+				R8A7791_CLK_PWM
 			>;
-			clock-output-names = "audmac0", "audmac1", "thermal", "pwm";
+			clock-output-names = "audmac0", "audmac1", "adsp_mod",
+					     "thermal", "pwm";
 		};
 		mstp7_clks: mstp7_clks@e615014c {
 			compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
Index: renesas/include/dt-bindings/clock/r8a7791-clock.h
=================================--- renesas.orig/include/dt-bindings/clock/r8a7791-clock.h
+++ renesas/include/dt-bindings/clock/r8a7791-clock.h
@@ -20,7 +20,8 @@
 #define R8A7791_CLK_SDH			6
 #define R8A7791_CLK_SD0			7
 #define R8A7791_CLK_Z			8
-#define R8A7791_CLK_RCAN		9
+#define R8A7791_CLK_ADSP		9
+#define R8A7791_CLK_RCAN		10
 
 /* MSTP0 */
 #define R8A7791_CLK_MSIOF0		0
@@ -72,6 +73,7 @@
 /* MSTP5 */
 #define R8A7791_CLK_AUDIO_DMAC1		1
 #define R8A7791_CLK_AUDIO_DMAC0		2
+#define R8A7791_CLK_ADSP_MOD		6
 #define R8A7791_CLK_THERMAL		22
 #define R8A7791_CLK_PWM			23
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: shmobile: r8a7791: add ADSP clocks
  2014-12-29 20:19 [PATCH] ARM: shmobile: r8a7791: add ADSP clocks Sergei Shtylyov
@ 2014-12-29 20:24 ` Geert Uytterhoeven
  2014-12-29 20:34   ` Sergei Shtylyov
  0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2014-12-29 20:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 29, 2014 at 9:19 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> --- renesas.orig/include/dt-bindings/clock/r8a7791-clock.h
> +++ renesas/include/dt-bindings/clock/r8a7791-clock.h

> -#define R8A7791_CLK_RCAN               9
> +#define R8A7791_CLK_ADSP               9
> +#define R8A7791_CLK_RCAN               10

R8A7791_CLK_RCAN is changed?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: shmobile: r8a7791: add ADSP clocks
  2014-12-29 20:24 ` Geert Uytterhoeven
@ 2014-12-29 20:34   ` Sergei Shtylyov
  2014-12-29 21:23     ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2014-12-29 20:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 12/29/2014 11:24 PM, Geert Uytterhoeven wrote:

>> --- renesas.orig/include/dt-bindings/clock/r8a7791-clock.h
>> +++ renesas/include/dt-bindings/clock/r8a7791-clock.h

>> -#define R8A7791_CLK_RCAN               9
>> +#define R8A7791_CLK_ADSP               9
>> +#define R8A7791_CLK_RCAN               10

> R8A7791_CLK_RCAN is changed?

    Yes. It shouldn't be?

> Gr{oetje,eeting}s,
>                          Geert

WBR, Sergei


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: shmobile: r8a7791: add ADSP clocks
  2014-12-29 20:34   ` Sergei Shtylyov
@ 2014-12-29 21:23     ` Geert Uytterhoeven
  2014-12-29 22:13       ` Sergei Shtylyov
  0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2014-12-29 21:23 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sergei,

On Mon, Dec 29, 2014 at 9:34 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 12/29/2014 11:24 PM, Geert Uytterhoeven wrote:
>
>>> --- renesas.orig/include/dt-bindings/clock/r8a7791-clock.h
>>> +++ renesas/include/dt-bindings/clock/r8a7791-clock.h
>
>
>>> -#define R8A7791_CLK_RCAN               9
>>> +#define R8A7791_CLK_ADSP               9
>>> +#define R8A7791_CLK_RCAN               10
>
>> R8A7791_CLK_RCAN is changed?
>
>    Yes. It shouldn't be?

All definitions in include/dt-bindings/ are part of the DT ABI, and cannot be
changed without breaking the DT binding.

Hence when adding new entries, they must be added at the end of the list,
using a new available value.

Apart from that, what happens if you boot a new DTS on a kernel with an old
clk-rcar-gen2 driver that doesn't know about the new CPG clock?
Does it just fail to initialize and find that single clock, or does
the whole CPG
driver fail?
I wanted to check that after seeing the RCAN CPG patch, but haven't gotten to it
yet due to Xmas and NY holidays.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: shmobile: r8a7791: add ADSP clocks
  2014-12-29 21:23     ` Geert Uytterhoeven
@ 2014-12-29 22:13       ` Sergei Shtylyov
  0 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2014-12-29 22:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 12/30/2014 12:23 AM, Geert Uytterhoeven wrote:

>>>> --- renesas.orig/include/dt-bindings/clock/r8a7791-clock.h
>>>> +++ renesas/include/dt-bindings/clock/r8a7791-clock.h

>>>> -#define R8A7791_CLK_RCAN               9
>>>> +#define R8A7791_CLK_ADSP               9
>>>> +#define R8A7791_CLK_RCAN               10

>>> R8A7791_CLK_RCAN is changed?

>>     Yes. It shouldn't be?

> All definitions in include/dt-bindings/ are part of the DT ABI, and cannot be
> changed without breaking the DT binding.

> Hence when adding new entries, they must be added at the end of the list,
> using a new available value.

    Oh, OK...

> Apart from that, what happens if you boot a new DTS on a kernel with an old
> clk-rcar-gen2 driver that doesn't know about the new CPG clock?
> Does it just fail to initialize and find that single clock,

    Yes, exactly. The driver will cuss loudly but will continue to work.

> or does the whole CPG driver fail?

    No.

> I wanted to check that after seeing the RCAN CPG patch, but haven't gotten to it
> yet due to Xmas and NY holidays.

    No holidays yet here. There will be long holidays starting from January 1st...

> Gr{oetje,eeting}s,
>                          Geert

WBR, Sergei


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-29 22:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-29 20:19 [PATCH] ARM: shmobile: r8a7791: add ADSP clocks Sergei Shtylyov
2014-12-29 20:24 ` Geert Uytterhoeven
2014-12-29 20:34   ` Sergei Shtylyov
2014-12-29 21:23     ` Geert Uytterhoeven
2014-12-29 22:13       ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).