Re: [PATCH v6 4/6] ARM: dts: Renesas RZ/N1 SoC base device tree file

2018-05-23 Thread M P
Hi Geert,

On Wed, 23 May 2018 at 12:18, Geert Uytterhoeven 
wrote:

> Hi Michel,

> On Wed, May 23, 2018 at 11:20 AM, M P  wrote:
> > On Wed, 23 May 2018 at 10:12, Geert Uytterhoeven 
> > wrote:
> >> On Tue, May 22, 2018 at 12:01 PM, Michel Pollet
> >>  wrote:
> >> > +   #address-cells = <1>;
> >> > +   #size-cells = <1>;
> >> > +
> >> > +   cpus {
> >> > +   #address-cells = <1>;
> >> > +   #size-cells = <0>;
> >> > +   clocks = < RZN1_DIV_CA7>;
> >
> >> I think the clocks property should be moved to the individual CPU
nodes.
> >
> > Ah, I had a look around, and I found some instances that are in the cpu
> > sub-node, and others that are not -- it seems that having it in the cpu
> > sub-node would implies it's core specific... here if that clock is
changed
> > both cores would change speed...

> Assumed the driver code knows to look in the parent node, which I doubt
> the cpufreq code does.

> > Either way, it's not used by the kernel in any way at the moment -- I
had
> > hoped cpufreq or something would claim it, but it's not the case.

> I guess you have to add your main SoC compatible value to the whitelist
> in drivers/cpufreq/cpufreq-dt-platdev.c first.

Most excellent tip here -- I'll add a further patch to enable this, after
this series eventually gets merged...

Cheers,
Michel


Re: [PATCH v6 4/6] ARM: dts: Renesas RZ/N1 SoC base device tree file

2018-05-23 Thread Geert Uytterhoeven
Hi Michel,

On Wed, May 23, 2018 at 11:20 AM, M P  wrote:
> On Wed, 23 May 2018 at 10:12, Geert Uytterhoeven 
> wrote:
>> On Tue, May 22, 2018 at 12:01 PM, Michel Pollet
>>  wrote:
>> > +   #address-cells = <1>;
>> > +   #size-cells = <1>;
>> > +
>> > +   cpus {
>> > +   #address-cells = <1>;
>> > +   #size-cells = <0>;
>> > +   clocks = < RZN1_DIV_CA7>;
>
>> I think the clocks property should be moved to the individual CPU nodes.
>
> Ah, I had a look around, and I found some instances that are in the cpu
> sub-node, and others that are not -- it seems that having it in the cpu
> sub-node would implies it's core specific... here if that clock is changed
> both cores would change speed...

Assumed the driver code knows to look in the parent node, which I doubt
the cpufreq code does.

> Either way, it's not used by the kernel in any way at the moment -- I had
> hoped cpufreq or something would claim it, but it's not the case.

I guess you have to add your main SoC compatible value to the whitelist
in drivers/cpufreq/cpufreq-dt-platdev.c first.

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH v6 4/6] ARM: dts: Renesas RZ/N1 SoC base device tree file

2018-05-23 Thread M P
Hi Geert,

On Wed, 23 May 2018 at 10:12, Geert Uytterhoeven 
wrote:

> Hi Michel,

> On Tue, May 22, 2018 at 12:01 PM, Michel Pollet
>  wrote:
> > This adds the Renesas RZ/N1D (Part #R9A06G032) SoC bare
> > bone support.
> >
> > This currently only handles generic parts (gic, architected timer)
> > and a UART.
> > For simplicity sake, this also relies on the bootloader to set the
> > pinctrl and clocks.
> >
> > Signed-off-by: Michel Pollet 

> Thanks for your patch!


> > +   #address-cells = <1>;
> > +   #size-cells = <1>;
> > +
> > +   cpus {
> > +   #address-cells = <1>;
> > +   #size-cells = <0>;
> > +   clocks = < RZN1_DIV_CA7>;

> I think the clocks property should be moved to the individual CPU nodes.


Ah, I had a look around, and I found some instances that are in the cpu
sub-node, and others that are not -- it seems that having it in the cpu
sub-node would implies it's core specific... here if that clock is changed
both cores would change speed...
Either way, it's not used by the kernel in any way at the moment -- I had
hoped cpufreq or something would claim it, but it's not the case.

Thanks,
Michel


Re: [PATCH v6 4/6] ARM: dts: Renesas RZ/N1 SoC base device tree file

2018-05-23 Thread Geert Uytterhoeven
Hi Michel,

On Tue, May 22, 2018 at 12:01 PM, Michel Pollet
 wrote:
> This adds the Renesas RZ/N1D (Part #R9A06G032) SoC bare
> bone support.
>
> This currently only handles generic parts (gic, architected timer)
> and a UART.
> For simplicity sake, this also relies on the bootloader to set the
> pinctrl and clocks.
>
> Signed-off-by: Michel Pollet 

Thanks for your patch!

> --- /dev/null
> +++ b/arch/arm/boot/dts/r9a06g032.dtsi
> @@ -0,0 +1,86 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Base Device Tree Source for the Renesas RZ/N1D (R9A06G032)
> + *
> + * Copyright (C) 2018 Renesas Electronics Europe Limited
> + *
> + */
> +
> +#include 
> +#include 
> +
> +/ {
> +   compatible = "renesas,r9a06g032", "renesas,rzn1";

Please drop the "renesas,rzn1".


> +   #address-cells = <1>;
> +   #size-cells = <1>;
> +
> +   cpus {
> +   #address-cells = <1>;
> +   #size-cells = <0>;
> +   clocks = < RZN1_DIV_CA7>;

I think the clocks property should be moved to the individual CPU nodes.

> +
> +   cpu@0 {
> +   device_type = "cpu";
> +   compatible = "arm,cortex-a7";
> +   reg = <0>;
> +   };
> +
> +   cpu@1 {
> +   device_type = "cpu";
> +   compatible = "arm,cortex-a7";
> +   reg = <1>;
> +   };
> +   };

The rest looks OK to me (pending acceptance of the clock bindings).

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH v6 4/6] ARM: dts: Renesas RZ/N1 SoC base device tree file

2018-05-23 Thread Simon Horman
On Tue, May 22, 2018 at 11:01:24AM +0100, Michel Pollet wrote:
> This adds the Renesas RZ/N1D (Part #R9A06G032) SoC bare
> bone support.
> 
> This currently only handles generic parts (gic, architected timer)
> and a UART.
> For simplicity sake, this also relies on the bootloader to set the
> pinctrl and clocks.
> 
> Signed-off-by: Michel Pollet 

I am marking this and the following patch as deferred
pending acceptance of the bindings it uses.

> ---
>  arch/arm/boot/dts/r9a06g032.dtsi | 86 
> 
>  1 file changed, 86 insertions(+)
>  create mode 100644 arch/arm/boot/dts/r9a06g032.dtsi
> 
> diff --git a/arch/arm/boot/dts/r9a06g032.dtsi 
> b/arch/arm/boot/dts/r9a06g032.dtsi
> new file mode 100644
> index 000..c7764c7
> --- /dev/null
> +++ b/arch/arm/boot/dts/r9a06g032.dtsi
> @@ -0,0 +1,86 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Base Device Tree Source for the Renesas RZ/N1D (R9A06G032)
> + *
> + * Copyright (C) 2018 Renesas Electronics Europe Limited
> + *
> + */
> +
> +#include 
> +#include 
> +
> +/ {
> + compatible = "renesas,r9a06g032", "renesas,rzn1";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + clocks = < RZN1_DIV_CA7>;
> +
> + cpu@0 {
> + device_type = "cpu";
> + compatible = "arm,cortex-a7";
> + reg = <0>;
> + };
> +
> + cpu@1 {
> + device_type = "cpu";
> + compatible = "arm,cortex-a7";
> + reg = <1>;
> + };
> + };
> +
> + soc {
> + compatible = "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + interrupt-parent = <>;
> + ranges;
> +
> + clock: clocks@4000c000 {
> + compatible = "renesas,r9a06g032-clocks",
> + "renesas,rzn1-clocks";
> + reg = <0x4000c000 0x1000>;
> + status = "okay";
> + #clock-cells = <1>;
> + };
> +
> + uart0: serial@4006 {
> + compatible = "snps,dw-apb-uart";
> + reg = <0x4006 0x400>;
> + interrupts = ;
> + reg-shift = <2>;
> + reg-io-width = <4>;
> + clocks = < RZN1_CLK_UART0>;
> + clock-names = "baudclk";
> + status = "disabled";
> + };
> +
> + gic: gic@44101000 {
> + compatible = "arm,cortex-a7-gic", "arm,gic-400";
> + interrupt-controller;
> + #interrupt-cells = <3>;
> + reg = <0x44101000 0x1000>, /* Distributer */
> +   <0x44102000 0x2000>, /* CPU interface */
> +   <0x44104000 0x2000>, /* Virt interface control */
> +   <0x44106000 0x2000>; /* Virt CPU interface */
> + interrupts =
> +  IRQ_TYPE_LEVEL_HIGH)>;
> + };
> + };
> +
> + timer {
> + compatible = "arm,cortex-a7-timer",
> +  "arm,armv7-timer";
> + interrupt-parent = <>;
> + arm,cpu-registers-not-fw-configured;
> + always-on;
> + interrupts =
> +  IRQ_TYPE_LEVEL_LOW)>,
> +  IRQ_TYPE_LEVEL_LOW)>,
> +  IRQ_TYPE_LEVEL_LOW)>,
> +  IRQ_TYPE_LEVEL_LOW)>;
> + };
> +};
> -- 
> 2.7.4
> 


[PATCH v6 4/6] ARM: dts: Renesas RZ/N1 SoC base device tree file

2018-05-22 Thread Michel Pollet
This adds the Renesas RZ/N1D (Part #R9A06G032) SoC bare
bone support.

This currently only handles generic parts (gic, architected timer)
and a UART.
For simplicity sake, this also relies on the bootloader to set the
pinctrl and clocks.

Signed-off-by: Michel Pollet 
---
 arch/arm/boot/dts/r9a06g032.dtsi | 86 
 1 file changed, 86 insertions(+)
 create mode 100644 arch/arm/boot/dts/r9a06g032.dtsi

diff --git a/arch/arm/boot/dts/r9a06g032.dtsi b/arch/arm/boot/dts/r9a06g032.dtsi
new file mode 100644
index 000..c7764c7
--- /dev/null
+++ b/arch/arm/boot/dts/r9a06g032.dtsi
@@ -0,0 +1,86 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Base Device Tree Source for the Renesas RZ/N1D (R9A06G032)
+ *
+ * Copyright (C) 2018 Renesas Electronics Europe Limited
+ *
+ */
+
+#include 
+#include 
+
+/ {
+   compatible = "renesas,r9a06g032", "renesas,rzn1";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   clocks = < RZN1_DIV_CA7>;
+
+   cpu@0 {
+   device_type = "cpu";
+   compatible = "arm,cortex-a7";
+   reg = <0>;
+   };
+
+   cpu@1 {
+   device_type = "cpu";
+   compatible = "arm,cortex-a7";
+   reg = <1>;
+   };
+   };
+
+   soc {
+   compatible = "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   interrupt-parent = <>;
+   ranges;
+
+   clock: clocks@4000c000 {
+   compatible = "renesas,r9a06g032-clocks",
+   "renesas,rzn1-clocks";
+   reg = <0x4000c000 0x1000>;
+   status = "okay";
+   #clock-cells = <1>;
+   };
+
+   uart0: serial@4006 {
+   compatible = "snps,dw-apb-uart";
+   reg = <0x4006 0x400>;
+   interrupts = ;
+   reg-shift = <2>;
+   reg-io-width = <4>;
+   clocks = < RZN1_CLK_UART0>;
+   clock-names = "baudclk";
+   status = "disabled";
+   };
+
+   gic: gic@44101000 {
+   compatible = "arm,cortex-a7-gic", "arm,gic-400";
+   interrupt-controller;
+   #interrupt-cells = <3>;
+   reg = <0x44101000 0x1000>, /* Distributer */
+ <0x44102000 0x2000>, /* CPU interface */
+ <0x44104000 0x2000>, /* Virt interface control */
+ <0x44106000 0x2000>; /* Virt CPU interface */
+   interrupts =
+   ;
+   };
+   };
+
+   timer {
+   compatible = "arm,cortex-a7-timer",
+"arm,armv7-timer";
+   interrupt-parent = <>;
+   arm,cpu-registers-not-fw-configured;
+   always-on;
+   interrupts =
+   ,
+   ,
+   ,
+   ;
+   };
+};
-- 
2.7.4