ARM: mach-shmobile: r8a7779, marzen: Reference DT implementation
Subsystems (6)
Provide minimal DT initialisation for the r8a7779 SoC and marzen board as a reference for developers.
In general the idea is to grow the hardware supported by this initialisation as DT coverage of relevant drivers and other code grows.
overall diffstat:
arch/arm/boot/dts/Makefile | 1 arch/arm/boot/dts/r8a7779-marzen-reference.dts | 41 ++++++ arch/arm/boot/dts/r8a7779.dtsi | 85 ++++++++++++++ arch/arm/configs/marzen_defconfig | 2 arch/arm/mach-shmobile/Kconfig | 11 + arch/arm/mach-shmobile/Makefile | 1 arch/arm/mach-shmobile/board-marzen-reference.c | 71 +++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 3 arch/arm/mach-shmobile/intc-r8a7779.c | 27 +++- arch/arm/mach-shmobile/setup-r8a7779.c | 58 ++++++++- 10 files changed, 288 insertions(+), 12 deletions(-)
PATCH 1/4 ARM: mach-shmobile: marzen: defconfig: use regulators by default
Use regulators by default
This is in preparation for initialising devices using DT.
--- arch/arm/configs/marzen_defconfig | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/configs/marzen_defconfig +2 -0
@@ -83,6 +83,8 @@ CONFIG_USB=y CONFIG_USB_RCAR_PHY=y CONFIG_MMC=y CONFIG_MMC_SDHI=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_DUMMY=y CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_OHCI_HCD=y
Signature · 1 line
1.7.10.4
PATCH 2/4 ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
In reply to Simon HormanThis allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
--- arch/arm/boot/dts/r8a7779.dtsi | 40 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 +++++++++++++---- 3 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsi
arch/arm/boot/dts/r8a7779.dtsi new file +40 -0
@@ -0,0 +1,40 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + cpu at 0 { + compatible = "arm,cortex-a9"; + }; + cpu at 1 { + compatible = "arm,cortex-a9"; + }; + cpu at 2 { + compatible = "arm,cortex-a9"; + }; + cpu at 3 { + compatible = "arm,cortex-a9"; + }; + }; + + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <1>; + interrupt-controller; + reg = <0xf0001000 0x1000>, + <0xf0000100 0x100>; + }; +};
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -63,6 +63,7 @@ extern void r8a7740_pinmux_init(void);extern void r8a7740_pm_init (void );extern void r8a7779_init_irq (void ); +extern void r8a7779_init_irq_dt (void );extern void r8a7779_map_io (void );extern void r8a7779_earlytimer_init (void );extern void r8a7779_add_early_devices (void );
arch/arm/mach-shmobile/intc-r8a7779.c +21 -6
@@ -24,6 +24,7 @@#include <linux/io.h> #include <linux/irqchip/arm-gic.h> #include <mach/common.h> +#include <linux/irqchip.h> #include <mach/intc.h> #include <mach/r8a7779.h> #include <asm/mach-types.h>
@@ -43,13 +44,8 @@ static int r8a7779_set_wake(struct irq_data *data, unsigned int on)return 0 ;/* always allow wakeup */ } -void __init r8a7779_init_irq (void ) +static void __init r8a7779_init_irq_common (void ) { -void __iomem *gic_dist_base =IOMEM (0xf0001000 ); -void __iomem *gic_cpu_base =IOMEM (0xf0000100 ); - -/* use GIC to handle interrupts */ -gic_init (0 ,29 , gic_dist_base, gic_cpu_base); gic_arch_extn.irq_set_wake = r8a7779_set_wake;/* route all interrupts to ARM */
@@ -63,3 +59,22 @@ void __init r8a7779_init_irq(void)__raw_writel (0xbffffffc ,INT2SMSKCR3 );__raw_writel (0x003fee3f ,INT2SMSKCR4 ); } + +void __init r8a7779_init_irq (void ) +{ +void __iomem *gic_dist_base =IOMEM (0xf0001000 ); +void __iomem *gic_cpu_base =IOMEM (0xf0000100 ); + +/* use GIC to handle interrupts */ +gic_init (0 ,29 , gic_dist_base, gic_cpu_base); + +r8a7779_init_irq_common (); +} + +#ifdef CONFIG_OF +void __init r8a7779_init_irq_dt (void ) +{ +irqchip_init (); +r8a7779_init_irq_common (); +} +#endif
Signature · 1 line
1.7.10.4
PATCH 2/4 ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
Hi Simon,
Quoted 37 lines · Simon Horman
This allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
Signed-off-by Simon Horman <[email protected]>--- arch/arm/boot/dts/r8a7779.dtsi | 40 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 +++++++++++++---- 3 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsiarch/arm/boot/dts/r8a7779.dtsi new file +20
-0@@ -0,0 +1,40 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + cpu at 0 { + compatible = "arm,cortex-a9"; + };
arch/arm/boot/dts/r8a7779.dtsi line 30
Quoted 10 lines
arch/arm/boot/dts/r8a7779.dtsi new file +10
-0+ cpu at 1 { + compatible = "arm,cortex-a9"; + }; + cpu at 2 { + compatible = "arm,cortex-a9"; + }; + cpu at 3 { + compatible = "arm,cortex-a9"; + }; + };
Sorry to sound like a broken record, but it'd be good to see reg and device_type set here.
arch/arm/boot/dts/r8a7779.dtsi line 35
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <1>;
Why is #address-cells needed here (and without #size-cells)? I see it's in the binding document example, but I can't figure out why.
arch/arm/boot/dts/r8a7779.dtsi line 40
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ interrupt-controller; + reg = <0xf0001000 0x1000>, + <0xf0000100 0x100>; + }; +};
[...]
Thanks,
Mark.
PATCH 2/4 ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
Quoted 45 lines · Mark Rutland
Hi Simon,
Quoted 42 lines · Simon Horman
This allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
Signed-off-by Simon Horman <[email protected]>--- arch/arm/boot/dts/r8a7779.dtsi | 40 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 +++++++++++++---- 3 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsiarch/arm/boot/dts/r8a7779.dtsi new file +25
-0@@ -0,0 +1,40 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + cpu at 0 { + compatible = "arm,cortex-a9"; + }; + cpu at 1 { + compatible = "arm,cortex-a9"; + }; + cpu at 2 { + compatible = "arm,cortex-a9";
Quoted 8 lines
arch/arm/boot/dts/r8a7779.dtsi line 30
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ }; + cpu at 3 { + compatible = "arm,cortex-a9"; + }; + };Sorry to sound like a broken record, but it'd be good to see reg and
device_typeset here.
Sure, will do.
Quoted 8 lines
arch/arm/boot/dts/r8a7779.dtsi line 35
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <1>;Why is #address-cells needed here (and without #size-cells)? I see it's in the binding document example, but I can't figure out why.
Its here because I copied the example.
I will see about removing it from here.
Quoted 16 lines
arch/arm/boot/dts/r8a7779.dtsi line 40
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ interrupt-controller; + reg = <0xf0001000 0x1000>, + <0xf0000100 0x100>; + }; +};[...]
Thanks,
Mark.--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/4 ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
Quoted 63 lines · Simon Horman
Quoted 45 lines · Mark Rutland
Hi Simon,
Quoted 42 lines · Simon Horman
This allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
Signed-off-by Simon Horman <[email protected]>--- arch/arm/boot/dts/r8a7779.dtsi | 40 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 +++++++++++++---- 3 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsiarch/arm/boot/dts/r8a7779.dtsi new file +25
-0@@ -0,0 +1,40 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + cpu at 0 { + compatible = "arm,cortex-a9"; + }; + cpu at 1 { + compatible = "arm,cortex-a9"; + }; + cpu at 2 { + compatible = "arm,cortex-a9";Quoted 8 lines
arch/arm/boot/dts/r8a7779.dtsi line 30
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ }; + cpu at 3 { + compatible = "arm,cortex-a9"; + }; + };Sorry to sound like a broken record, but it'd be good to see reg and
device_typeset here.Sure, will do.
Quoted 6 lines
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <1>;
Quoted 11 lines
Quoted 2 lines
Why is #address-cells needed here (and without #size-cells)? I see it's in the binding document example, but I can't figure out why.
Its here because I copied the example.
I will see about removing it from here.Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ interrupt-controller; + reg = <0xf0001000 0x1000>, + <0xf0000100 0x100>; + }; +};
A revised patch is below. I should also remove "#address-cells = <1>" from gic in arch/arm/boot/dts/sh73a0.dtsi if it is indeed unnecessary.
Quoted 1 line
From
f08f5df1bd6e2133232d06b8cfb847424d6d4cc8Mon Sep 17 00:00:00 2001
From: Simon Horman <[email protected]>
Date: Tue, 29 Jan 2013 14:21:46 +0900
Subject: [PATCH] ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by
DT
This allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
--- arch/arm/boot/dts/r8a7779.dtsi | 50 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 ++++++++++---- 3 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsi
v2
As suggested by Mark Rutland
* Add reg and device_type to cpus
* Remove #address-cells from gic
arch/arm/boot/dts/r8a7779.dtsi new file +50 -0
@@ -0,0 +1,50 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + cpu at 1 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + cpu at 2 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + cpu at 3 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + }; + + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + interrupt-controller; + reg = <0xf0001000 0x1000>, + <0xf0000100 0x100>; + }; +};
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -63,6 +63,7 @@ extern void r8a7740_pinmux_init(void);extern void r8a7740_pm_init (void );extern void r8a7779_init_irq (void ); +extern void r8a7779_init_irq_dt (void );extern void r8a7779_map_io (void );extern void r8a7779_earlytimer_init (void );extern void r8a7779_add_early_devices (void );
arch/arm/mach-shmobile/intc-r8a7779.c +21 -6
@@ -24,6 +24,7 @@#include <linux/io.h> #include <linux/irqchip/arm-gic.h> #include <mach/common.h> +#include <linux/irqchip.h> #include <mach/intc.h> #include <mach/r8a7779.h> #include <asm/mach-types.h>
@@ -43,13 +44,8 @@ static int r8a7779_set_wake(struct irq_data *data, unsigned int on)return 0 ;/* always allow wakeup */ } -void __init r8a7779_init_irq (void ) +static void __init r8a7779_init_irq_common (void ) { -void __iomem *gic_dist_base =IOMEM (0xf0001000 ); -void __iomem *gic_cpu_base =IOMEM (0xf0000100 ); - -/* use GIC to handle interrupts */ -gic_init (0 ,29 , gic_dist_base, gic_cpu_base); gic_arch_extn.irq_set_wake = r8a7779_set_wake;/* route all interrupts to ARM */
@@ -63,3 +59,22 @@ void __init r8a7779_init_irq(void)__raw_writel (0xbffffffc ,INT2SMSKCR3 );__raw_writel (0x003fee3f ,INT2SMSKCR4 ); } + +void __init r8a7779_init_irq (void ) +{ +void __iomem *gic_dist_base =IOMEM (0xf0001000 ); +void __iomem *gic_cpu_base =IOMEM (0xf0000100 ); + +/* use GIC to handle interrupts */ +gic_init (0 ,29 , gic_dist_base, gic_cpu_base); + +r8a7779_init_irq_common (); +} + +#ifdef CONFIG_OF +void __init r8a7779_init_irq_dt (void ) +{ +irqchip_init (); +r8a7779_init_irq_common (); +} +#endif
Signature · 1 line
1.7.10.4
PATCH 2/4 ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
Quoted 139 lines · Simon Horman
Quoted 63 lines · Simon Horman
Quoted 45 lines · Mark Rutland
Hi Simon,
Quoted 42 lines · Simon Horman
This allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
Signed-off-by Simon Horman <[email protected]>--- arch/arm/boot/dts/r8a7779.dtsi | 40 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 +++++++++++++---- 3 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsiarch/arm/boot/dts/r8a7779.dtsi new file +25
-0@@ -0,0 +1,40 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + cpu at 0 { + compatible = "arm,cortex-a9"; + }; + cpu at 1 { + compatible = "arm,cortex-a9"; + }; + cpu at 2 { + compatible = "arm,cortex-a9";Quoted 8 lines
arch/arm/boot/dts/r8a7779.dtsi line 41
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ }; + cpu at 3 { + compatible = "arm,cortex-a9"; + }; + };Sorry to sound like a broken record, but it'd be good to see reg and
device_typeset here.Sure, will do.
Quoted 6 lines
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <1>;Quoted 11 lines
Quoted 2 lines
Why is #address-cells needed here (and without #size-cells)? I see it's in the binding document example, but I can't figure out why.
Its here because I copied the example.
I will see about removing it from here.Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ interrupt-controller; + reg = <0xf0001000 0x1000>, + <0xf0000100 0x100>; + }; +};A revised patch is below. I should also remove "#address-cells = <1>" from gic in
arch/arm/boot/dts/sh73a0.dtsiif it is indeed unnecessary.Quoted 1 line
From
f08f5df1bd6e2133232d06b8cfb847424d6d4cc8Mon Sep 17 00:00:00 2001From: Simon Horman <[email protected]>
Date: Tue, 29 Jan 2013 14:21:46 +0900
Subject: [PATCH] ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by
DTThis allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
Signed-off-by Simon Horman <[email protected]>--- arch/arm/boot/dts/r8a7779.dtsi | 50 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 ++++++++++---- 3 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsiv2
As suggested by Mark Rutland
* Add reg anddevice_typeto cpus
* Remove #address-cells from gicarch/arm/boot/dts/r8a7779.dtsi new file +31
-0@@ -0,0 +1,50 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + cpu at 1 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + cpu at 2 {
arch/arm/boot/dts/r8a7779.dtsi line 41
Quoted 10 lines
arch/arm/boot/dts/r8a7779.dtsi new file +10
-0+ device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + cpu at 3 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + };
Sorry, the above reg values are rubbish. I'll fix them and repost.
Quoted 74 lines
arch/arm/boot/dts/r8a7779.dtsi new file +9
-0+ + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + interrupt-controller; + reg = <0xf0001000 0x1000>, + <0xf0000100 0x100>; + }; +};arch/arm/mach-shmobile/include/mach/common.h +1
-0@@ -63,6 +63,7 @@ extern void r8a7740_pinmux_init(void);extern void r8a7740_pm_init (void );extern void r8a7779_init_irq (void ); +extern void r8a7779_init_irq_dt (void );extern void r8a7779_map_io (void );extern void r8a7779_earlytimer_init (void );extern void r8a7779_add_early_devices (void );arch/arm/mach-shmobile/intc-r8a7779.c +21
-6@@ -24,6 +24,7 @@#include <linux/io.h> #include <linux/irqchip/arm-gic.h> #include <mach/common.h> +#include <linux/irqchip.h> #include <mach/intc.h> #include <mach/r8a7779.h> #include <asm/mach-types.h> @@ -43,13 +44,8 @@ static int r8a7779_set_wake(struct irq_data *data, unsigned int on)return 0 ;/* always allow wakeup */ } -void __init r8a7779_init_irq (void ) +static void __init r8a7779_init_irq_common (void ) { -void __iomem *gic_dist_base =IOMEM (0xf0001000 ); -void __iomem *gic_cpu_base =IOMEM (0xf0000100 ); - -/* use GIC to handle interrupts */ -gic_init (0 ,29 , gic_dist_base, gic_cpu_base); gic_arch_extn.irq_set_wake = r8a7779_set_wake;/* route all interrupts to ARM */ @@ -63,3 +59,22 @@ void __init r8a7779_init_irq(void)__raw_writel (0xbffffffc ,INT2SMSKCR3 );__raw_writel (0x003fee3f ,INT2SMSKCR4 ); } + +void __init r8a7779_init_irq (void ) +{ +void __iomem *gic_dist_base =IOMEM (0xf0001000 ); +void __iomem *gic_cpu_base =IOMEM (0xf0000100 ); + +/* use GIC to handle interrupts */ +gic_init (0 ,29 , gic_dist_base, gic_cpu_base); + +r8a7779_init_irq_common (); +} + +#ifdef CONFIG_OF +void __init r8a7779_init_irq_dt (void ) +{ +irqchip_init (); +r8a7779_init_irq_common (); +} +#endif Signature · 1 line
1.7.10.4
PATCH 2/4 ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
Quoted 71 lines · Simon Horman
Quoted 70 lines · Simon Horman
Quoted 69 lines · Simon Horman
Quoted 45 lines · Mark Rutland
Hi Simon,
Quoted 42 lines · Simon Horman
This allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
Signed-off-by Simon Horman <[email protected]>--- arch/arm/boot/dts/r8a7779.dtsi | 40 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 +++++++++++++---- 3 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsiarch/arm/boot/dts/r8a7779.dtsi new file +25
-0@@ -0,0 +1,40 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + cpu at 0 { + compatible = "arm,cortex-a9"; + }; + cpu at 1 { + compatible = "arm,cortex-a9"; + }; + cpu at 2 { + compatible = "arm,cortex-a9";Quoted 8 lines
arch/arm/boot/dts/r8a7779.dtsi line 30
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ }; + cpu at 3 { + compatible = "arm,cortex-a9"; + }; + };Sorry to sound like a broken record, but it'd be good to see reg and
device_typeset here.Sure, will do.
Quoted 8 lines
arch/arm/boot/dts/r8a7779.dtsi line 35
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <1>;Why is #address-cells needed here (and without #size-cells)? I see it's in the binding document example, but I can't figure out why.
Its here because I copied the example.
I will see about removing it from here.
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi line 40
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ interrupt-controller; + reg = <0xf0001000 0x1000>, + <0xf0000100 0x100>; + }; +};A revised patch is below. I should also remove "#address-cells = <1>" from gic in
arch/arm/boot/dts/sh73a0.dtsiif it is indeed unnecessary.
One more time:
Quoted 1 line
From
6031d5177193431a57392dfd2f38be0676bdb535Mon Sep 17 00:00:00 2001
From: Simon Horman <[email protected]>
Date: Tue, 29 Jan 2013 14:21:46 +0900
Subject: [PATCH] ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by
DT
This allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
---
v3
* Fix copy-paste error and use unique reg values for each CPU
v2
As suggested by Mark Rutland
* Add reg and device_type to cpus
* Remove #address-cells from gic
--- arch/arm/boot/dts/r8a7779.dtsi | 50 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 ++++++++++---- 3 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsi
arch/arm/boot/dts/r8a7779.dtsi new file +50 -0
@@ -0,0 +1,50 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + cpu at 1 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <1>; + }; + cpu at 2 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <2>; + }; + cpu at 3 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <3>; + }; + }; + + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + interrupt-controller; + reg = <0xf0001000 0x1000>, + <0xf0000100 0x100>; + }; +};
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -63,6 +63,7 @@ extern void r8a7740_pinmux_init(void);extern void r8a7740_pm_init (void );extern void r8a7779_init_irq (void ); +extern void r8a7779_init_irq_dt (void );extern void r8a7779_map_io (void );extern void r8a7779_earlytimer_init (void );extern void r8a7779_add_early_devices (void );
arch/arm/mach-shmobile/intc-r8a7779.c +21 -6
@@ -24,6 +24,7 @@#include <linux/io.h> #include <linux/irqchip/arm-gic.h> #include <mach/common.h> +#include <linux/irqchip.h> #include <mach/intc.h> #include <mach/r8a7779.h> #include <asm/mach-types.h>
@@ -43,13 +44,8 @@ static int r8a7779_set_wake(struct irq_data *data, unsigned int on)return 0 ;/* always allow wakeup */ } -void __init r8a7779_init_irq (void ) +static void __init r8a7779_init_irq_common (void ) { -void __iomem *gic_dist_base =IOMEM (0xf0001000 ); -void __iomem *gic_cpu_base =IOMEM (0xf0000100 ); - -/* use GIC to handle interrupts */ -gic_init (0 ,29 , gic_dist_base, gic_cpu_base); gic_arch_extn.irq_set_wake = r8a7779_set_wake;/* route all interrupts to ARM */
@@ -63,3 +59,22 @@ void __init r8a7779_init_irq(void)__raw_writel (0xbffffffc ,INT2SMSKCR3 );__raw_writel (0x003fee3f ,INT2SMSKCR4 ); } + +void __init r8a7779_init_irq (void ) +{ +void __iomem *gic_dist_base =IOMEM (0xf0001000 ); +void __iomem *gic_cpu_base =IOMEM (0xf0000100 ); + +/* use GIC to handle interrupts */ +gic_init (0 ,29 , gic_dist_base, gic_cpu_base); + +r8a7779_init_irq_common (); +} + +#ifdef CONFIG_OF +void __init r8a7779_init_irq_dt (void ) +{ +irqchip_init (); +r8a7779_init_irq_common (); +} +#endif
Signature · 1 line
1.7.10.4
PATCH 2/4 ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
Quoted 72 lines · Simon Horman
Quoted 71 lines · Simon Horman
Quoted 70 lines · Simon Horman
Quoted 69 lines · Simon Horman
Quoted 45 lines · Mark Rutland
Hi Simon,
Quoted 42 lines · Simon Horman
This allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
Signed-off-by Simon Horman <[email protected]>--- arch/arm/boot/dts/r8a7779.dtsi | 40 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 +++++++++++++---- 3 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsiarch/arm/boot/dts/r8a7779.dtsi new file +25
-0@@ -0,0 +1,40 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + cpu at 0 { + compatible = "arm,cortex-a9"; + }; + cpu at 1 { + compatible = "arm,cortex-a9"; + }; + cpu at 2 { + compatible = "arm,cortex-a9";Quoted 8 lines
arch/arm/boot/dts/r8a7779.dtsi line 41
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ }; + cpu at 3 { + compatible = "arm,cortex-a9"; + }; + };Sorry to sound like a broken record, but it'd be good to see reg and
device_typeset here.Sure, will do.
Quoted 8 lines
arch/arm/boot/dts/r8a7779.dtsi
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <1>;Why is #address-cells needed here (and without #size-cells)? I see it's in the binding document example, but I can't figure out why.
Its here because I copied the example.
I will see about removing it from here.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi line 50
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ interrupt-controller; + reg = <0xf0001000 0x1000>, + <0xf0000100 0x100>; + }; +};A revised patch is below. I should also remove "#address-cells = <1>" from gic in
arch/arm/boot/dts/sh73a0.dtsiif it is indeed unnecessary.
I just poked Rob and Grant in another subthread. Hopefully they'll be able to tell us if there's something we missed.
Quoted 76 lines
One more time:
From
6031d5177193431a57392dfd2f38be0676bdb535Mon Sep 17 00:00:00 2001
From: Simon Horman <[email protected]>
Date: Tue, 29 Jan 2013 14:21:46 +0900
Subject: [PATCH] ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by
DTThis allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
Signed-off-by Simon Horman <[email protected]>---
v3
* Fix copy-paste error and use unique reg values for each CPUv2
As suggested by Mark Rutland
* Add reg anddevice_typeto cpus
* Remove #address-cells from gic--- arch/arm/boot/dts/r8a7779.dtsi | 50 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 ++++++++++---- 3 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsiarch/arm/boot/dts/r8a7779.dtsi new file +40
-0@@ -0,0 +1,50 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + cpu at 1 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <1>; + }; + cpu at 2 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <2>; + }; + cpu at 3 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <3>; + };
arch/arm/boot/dts/r8a7779.dtsi line 50
Quoted 10 lines
arch/arm/boot/dts/r8a7779.dtsi new file +10
-0+ }; + + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + interrupt-controller; + reg = <0xf0001000 0x1000>, + <0xf0000100 0x100>; + }; +};
Thanks, this looks much better now! :)
For the dtsi: Reviewed-by: Mark Rutland <[email protected]>
Thanks,
Mark.
PATCH 2/4 ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
In reply to Simon HormanQuoted 64 lines · Simon Horman
Quoted 63 lines · Simon Horman
Quoted 45 lines · Mark Rutland
Hi Simon,
Quoted 42 lines · Simon Horman
This allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob.
Signed-off-by Simon Horman <[email protected]>--- arch/arm/boot/dts/r8a7779.dtsi | 40 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/intc-r8a7779.c | 27 +++++++++++++---- 3 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/r8a7779.dtsiarch/arm/boot/dts/r8a7779.dtsi new file +25
-0@@ -0,0 +1,40 @@ +/* + * Device Tree Source for Renesas r8a7740 + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Simon Horman + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "renesas,r8a7779"; + + cpus { + cpu at 0 { + compatible = "arm,cortex-a9"; + }; + cpu at 1 { + compatible = "arm,cortex-a9"; + }; + cpu at 2 { + compatible = "arm,cortex-a9";Quoted 8 lines
arch/arm/boot/dts/r8a7779.dtsi line 30
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ }; + cpu at 3 { + compatible = "arm,cortex-a9"; + }; + };Sorry to sound like a broken record, but it'd be good to see reg and
device_typeset here.Sure, will do.
Quoted 6 lines
Quoted 5 lines
arch/arm/boot/dts/r8a7779.dtsi new file +5
-0+ + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <1>;
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Why is #address-cells needed here (and without #size-cells)? I see it's in the binding document example, but I can't figure out why.
Its here because I copied the example.
I will see about removing it from here.
Rob, Grant, do either of you know if there's a reason for this that we've missed?
The gic doesn't have any direct children, and this doesn't seem to be some decvicetree interrupt-controller magic.
If this is superfluous, how about the patch below?
I took a quick look at arch/arm/boot/dts/. Some gic nodes don't have #address-cells, some have it but not #size-cells, and some have both. These should probably be cleaned up too.
[...]
Thanks,
Mark.
---->8----
Quoted 1 line
From
dc734edb8040513785429c11e40a420870dc55a4Mon Sep 17 00:00:00 2001
From: Mark Rutland <[email protected]>
Date: Fri, 1 Feb 2013 10:18:05 +0000
Subject: [PATCH] Docs: gic: remove #address-cells from example
The gic has no child nodes, and so doesn't need #address-cells. Having the property defined in the example only serves as a source of confusion.
--- Documentation/devicetree/bindings/arm/gic.txt | 1 - 1 file changed, 1 deletion(-)
Documentation/devicetree/bindings/arm/gic.txt +0 -1
@@ -54,7 +54,6 @@ Example: intc: interrupt-controller at fff11000 { compatible = "arm,cortex-a9-gic"; #interrupt-cells = <3>; - #address-cells = <1>; interrupt-controller; reg = <0xfff11000 0x1000>, <0xfff10100 0x100>;
Signature · 1 line
1.8.1.1
PATCH 2/4 ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
Quoted 16 lines · Mark Rutland
Quoted 15 lines · Simon Horman
Quoted 14 lines · Simon Horman
Quoted 12 lines · Mark Rutland
Hi Simon,
Review
Quoted 5 lines · Simon Horman
(quoted diff) +5
-0+ + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <1>;Why is #address-cells needed here (and without #size-cells)? I see it's in the binding document example, but I can't figure out why.
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Its here because I copied the example.
I will see about removing it from here.Rob, Grant, do either of you know if there's a reason for this that we've missed?
The gic doesn't have any direct children, and this doesn't seem to be some decvicetree interrupt-controller magic.
If you look at of_irq_map_raw, there are cases that look at #address-cells. Those appear to be only when you have an interrupt-map though.
Quoted 2 lines
If this is superfluous, how about the patch below?
The docs probably should state #addr-cells is only required with interrupt-map.
Quoted 4 lines
I took a quick look at
arch/arm/boot/dts/. Some gic nodes don't have #address-cells, some have it but not #size-cells, and some have both. These should probably be cleaned up too.
Some boards are using interrupt-map, so they may need #address-cells. So I'm inclined to leave things alone.
Rob
Quoted 35 lines
[...]
Thanks,
Mark.---->8----
From
dc734edb8040513785429c11e40a420870dc55a4Mon Sep 17 00:00:00 2001
From: Mark Rutland <[email protected]>
Date: Fri, 1 Feb 2013 10:18:05 +0000
Subject: [PATCH] Docs: gic: remove #address-cells from exampleThe gic has no child nodes, and so doesn't need #address-cells. Having the property defined in the example only serves as a source of confusion.
Signed-off-by Mark Rutland <[email protected]>--- Documentation/devicetree/bindings/arm/gic.txt | 1 - 1 file changed, 1 deletion(-)Documentation/devicetree/bindings/arm/gic.txt +0
-1@@ -54,7 +54,6 @@ Example: intc: interrupt-controller at fff11000 { compatible = "arm,cortex-a9-gic"; #interrupt-cells = <3>; - #address-cells = <1>; interrupt-controller; reg = <0xfff11000 0x1000>, <0xfff10100 0x100>;
PATCH 2/4 ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
Quoted 23 lines · Rob Herring
Quoted 22 lines · Mark Rutland
Quoted 12 lines · Simon Horman
Quoted 11 lines · Simon Horman
Quoted 10 lines · Mark Rutland
Hi Simon,
Quoted 5 lines · Simon Horman
(quoted diff) +5
-0+ + gic: interrupt-controller at f0001000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <1>;Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Why is #address-cells needed here (and without #size-cells)? I see it's in the binding document example, but I can't figure out why.
Its here because I copied the example.
I will see about removing it from here.Rob, Grant, do either of you know if there's a reason for this that we've missed?
Quoted 6 lines
Quoted 2 lines
The gic doesn't have any direct children, and this doesn't seem to be some decvicetree interrupt-controller magic.
If you look at
of_irq_map_raw, there are cases that look at #address-cells. Those appear to be only when you have an interrupt-map though.
Aah. So this is some devicetree magic after all. Thanks for looking into it.
Quoted 5 lines
Quoted 2 lines
If this is superfluous, how about the patch below?
The docs probably should state #addr-cells is only required with interrupt-map.
That'd be nice. It might limit the confusion we had here.
Quoted 8 lines
Quoted 5 lines
I took a quick look at
arch/arm/boot/dts/. Some gic nodes don't have #address-cells, some have it but not #size-cells, and some have both. These should probably be cleaned up too.Some boards are using interrupt-map, so they may need #address-cells. So I'm inclined to leave things alone.
That would make sense.
Thanks,
Mark.
PATCH 3/4 ARM: mach-shmobile: r8a7779: Minimal setup using DT
In reply to Simon HormanAllow a minimal setup of the r8a7779 SoC using a flattened device tree. In particular, configure the i2c and ethernet controllers using a flattened device tree.
SCI serial controller and TMU clock source, whose drivers do not yet support configuration using a flattened device tree, are still configured using C code in order to allow booting of a board with this SoC.
The ethernet controller also requires a regulator which is a board property. A sample snippet DT for the marzen board is as follows:
/dts-v1/;
/include/ "r8a7779.dtsi"
/ {
fixedregulator3v3: fixedregulator at 0 {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
};
};&lan0 {
vddvario-supply = <&fixedregulator3v3>;
vdd33a-supply = <&fixedregulator3v3>;
};--- arch/arm/boot/dts/r8a7779.dtsi | 45 ++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 2 + arch/arm/mach-shmobile/setup-r8a7779.c | 58 +++++++++++++++++++++++--- 3 files changed, 99 insertions(+), 6 deletions(-)
arch/arm/boot/dts/r8a7779.dtsi +45 -0
@@ -37,4 +37,49 @@ reg = <0xf0001000 0x1000>, <0xf0000100 0x100>; }; + + i2c0: i2c at 0xffc70000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc70000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 79 0x4>; + }; + + i2c1: i2c at 0xffc71000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc71000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 82 0x4>; + }; + + i2c2: i2c at 0xffc72000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc72000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 80 0x4>; + }; + + i2c3: i2c at 0xffc73000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc73000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 81 0x4>; + }; + + lan0: lan0 at 18000000 { + compatible = "smsc,lan9220", "smsc,lan9115"; + reg = <0x18000000 0x100>; + phy-mode = "mii"; + interrupt-parent = <&gic>; + interrupts = <0 28 0x4>; + reg-io-width = <4>; + }; };
arch/arm/mach-shmobile/include/mach/common.h +2 -0
@@ -67,7 +67,9 @@ extern void r8a7779_init_irq_dt(void);extern void r8a7779_map_io (void );extern void r8a7779_earlytimer_init (void );extern void r8a7779_add_early_devices (void ); +extern void r8a7779_add_early_devices_dt (void );extern void r8a7779_add_standard_devices (void ); +extern void r8a7779_add_standard_devices_dt (void );extern void r8a7779_clock_init (void );extern void r8a7779_pinmux_init (void );extern void r8a7779_pm_init (void );
arch/arm/mach-shmobile/setup-r8a7779.c +52 -6
93 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Magnus Damm
maintainerPATCH 3/4 ARM: mach-shmobile: r8a7779: Minimal setup using DT
Hi Simon,
Here's some feedback on your r8a7779 DT code.
Quoted 50 lines · Simon Horman
Allow a minimal setup of the r8a7779 SoC using a flattened device tree. In particular, configure the i2c and ethernet controllers using a flattened device tree.
SCI serial controller and TMU clock source, whose drivers do not yet support configuration using a flattened device tree, are still configured using C code in order to allow booting of a board with this SoC.
The ethernet controller also requires a regulator which is a board property. A sample snippet DT for the marzen board is as follows:
/dts-v1/;
/include/ "r8a7779.dtsi"/ { fixedregulator3v3: fixedregulator at 0 { compatible = "regulator-fixed"; regulator-name = "fixed-3.3V"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-boot-on; regulator-always-on; }; };&lan0 { vddvario-supply = <&fixedregulator3v3>; vdd33a-supply = <&fixedregulator3v3>; };Signed-off-by Simon Horman <[email protected]>---
arch/arm/mach-shmobile/setup-r8a7779.c +3
-1@@ -321,7 +321,7 @@ static struct platform_device i2c3_device = { .num_resources = ARRAY_SIZE(rcar_i2c3_res), }; -static struct platform_device *r8a7779_early_devices[]__initdata = { +static struct platform_device *r8a7779_early_devices_dt[]__initdata = { &scif0_device, &scif1_device, &scif2_device,@@ -330,15 +330,15 @@ static struct platform_device *r8a7779_early_devices[] __initdata = { &scif5_device, &tmu00_device, &tmu01_device, +}; +
arch/arm/mach-shmobile/setup-r8a7779.c static struct platform_device *r8a7779_early_devices[] __initdata = { · line 341
Quoted 10 lines
arch/arm/mach-shmobile/setup-r8a7779.c +1
-3+static struct platform_device *r8a7779_early_devices[]__initdata = { &i2c0_device, &i2c1_device, &i2c2_device, &i2c3_device, }; -static struct platform_device *r8a7779_late_devices[]__initdata = { -}; -
Thanks for your work on this. Two things with early/late devices on r8a7779:
1) Same thing as sh73a0 applies here, please refrain from using early devices with DT.
2) The i2c devices as early devices look incorrect. Can you make them late devices?
Cheers,
/ magnus
PATCH 3/4 ARM: mach-shmobile: r8a7779: Minimal setup using DT
Quoted 63 lines · Magnus Damm
Hi Simon,
Here's some feedback on your r8a7779 DT code.
Quoted 57 lines · Simon Horman
Allow a minimal setup of the r8a7779 SoC using a flattened device tree. In particular, configure the i2c and ethernet controllers using a flattened device tree.
SCI serial controller and TMU clock source, whose drivers do not yet support configuration using a flattened device tree, are still configured using C code in order to allow booting of a board with this SoC.
The ethernet controller also requires a regulator which is a board property. A sample snippet DT for the marzen board is as follows:
/dts-v1/;
/include/ "r8a7779.dtsi"/ { fixedregulator3v3: fixedregulator at 0 { compatible = "regulator-fixed"; regulator-name = "fixed-3.3V"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-boot-on; regulator-always-on; }; };&lan0 { vddvario-supply = <&fixedregulator3v3>; vdd33a-supply = <&fixedregulator3v3>; };Signed-off-by Simon Horman <[email protected]>---
arch/arm/mach-shmobile/setup-r8a7779.c +4
-1@@ -321,7 +321,7 @@ static struct platform_device i2c3_device = { .num_resources = ARRAY_SIZE(rcar_i2c3_res), }; -static struct platform_device *r8a7779_early_devices[]__initdata = { +static struct platform_device *r8a7779_early_devices_dt[]__initdata = { &scif0_device, &scif1_device, &scif2_device,@@ -330,15 +330,15 @@ static struct platform_device *r8a7779_early_devices[] __initdata = { &scif5_device, &tmu00_device, &tmu01_device, +}; + +static struct platform_device *r8a7779_early_devices[]__initdata = { &i2c0_device, &i2c1_device, &i2c2_device, &i2c3_device, };
Quoted 8 lines
arch/arm/mach-shmobile/setup-r8a7779.c static struct platform_device *r8a7779_early_devices[] __initdata = { · line 341
Quoted 3 lines
arch/arm/mach-shmobile/setup-r8a7779.c +0
-3-static struct platform_device *r8a7779_late_devices[]__initdata = { -}; -Thanks for your work on this. Two things with early/late devices on r8a7779:
1) Same thing as sh73a0 applies here, please refrain from using early devices with DT.
I guess you are referring to tmu.
If so, yes, I can move them to r8a7779_early_devices.
Quoted 2 lines
2) The i2c devices as early devices look incorrect. Can you make them late devices?
r8a7779_early_devices is only used for the non-DT case.
For the non-DT case i2c was set up as early devices before this patch-set. Would you like me to change them to late devices for non-DT,
a change that is orthogonal to this patch-set?
Magnus Damm
maintainerPATCH 3/4 ARM: mach-shmobile: r8a7779: Minimal setup using DT
Quoted 70 lines · Simon Horman
Quoted 69 lines · Magnus Damm
Hi Simon,
Here's some feedback on your r8a7779 DT code.
Quoted 50 lines · Simon Horman
Allow a minimal setup of the r8a7779 SoC using a flattened device tree. In particular, configure the i2c and ethernet controllers using a flattened device tree.
SCI serial controller and TMU clock source, whose drivers do not yet support configuration using a flattened device tree, are still configured using C code in order to allow booting of a board with this SoC.
The ethernet controller also requires a regulator which is a board property. A sample snippet DT for the marzen board is as follows:
/dts-v1/;
/include/ "r8a7779.dtsi"/ { fixedregulator3v3: fixedregulator at 0 { compatible = "regulator-fixed"; regulator-name = "fixed-3.3V"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-boot-on; regulator-always-on; }; };&lan0 { vddvario-supply = <&fixedregulator3v3>; vdd33a-supply = <&fixedregulator3v3>; };Signed-off-by Simon Horman <[email protected]>---
arch/arm/mach-shmobile/setup-r8a7779.c +3
-1@@ -321,7 +321,7 @@ static struct platform_device i2c3_device = { .num_resources = ARRAY_SIZE(rcar_i2c3_res), }; -static struct platform_device *r8a7779_early_devices[]__initdata = { +static struct platform_device *r8a7779_early_devices_dt[]__initdata = { &scif0_device, &scif1_device, &scif2_device,@@ -330,15 +330,15 @@ static struct platform_device *r8a7779_early_devices[] __initdata = { &scif5_device, &tmu00_device, &tmu01_device, +}; +arch/arm/mach-shmobile/setup-r8a7779.c static struct platform_device *r8a7779_early_devices[] __initdata = { · line 341
Quoted 10 lines
arch/arm/mach-shmobile/setup-r8a7779.c +1
-3+static struct platform_device *r8a7779_early_devices[]__initdata = { &i2c0_device, &i2c1_device, &i2c2_device, &i2c3_device, }; -static struct platform_device *r8a7779_late_devices[]__initdata = { -}; -Thanks for your work on this. Two things with early/late devices on r8a7779:
Quoted 5 lines
Quoted 2 lines
1) Same thing as sh73a0 applies here, please refrain from using early devices with DT.
I guess you are referring to tmu.
If so, yes, I can move them tor8a7779_early_devices.
As we talked about last Friday, please try to avoid using early devices in general. It is enough to add SCIF and TMU as late devices. This goes for both sh73a0 and r8a7779. The only thing you need to do early is to setup the delay. Please look at the emev2 implementation for what is needed.
Quoted 7 lines
Quoted 2 lines
2) The i2c devices as early devices look incorrect. Can you make them late devices?
r8a7779_early_devicesis only used for the non-DT case.
For the non-DT case i2c was set up as early devices before this patch-set. Would you like me to change them to late devices for non-DT,
a change that is orthogonal to this patch-set?
Yes. I realize it is not really related to this DT feature, but it certainly looks incorrect.
Thanks,
/ magnus
PATCH 3/4 ARM: mach-shmobile: r8a7779: Minimal setup using DT
Quoted 74 lines · Magnus Damm
Quoted 73 lines · Simon Horman
Quoted 71 lines · Magnus Damm
Hi Simon,
Here's some feedback on your r8a7779 DT code.
Quoted 50 lines · Simon Horman
Allow a minimal setup of the r8a7779 SoC using a flattened device tree. In particular, configure the i2c and ethernet controllers using a flattened device tree.
SCI serial controller and TMU clock source, whose drivers do not yet support configuration using a flattened device tree, are still configured using C code in order to allow booting of a board with this SoC.
The ethernet controller also requires a regulator which is a board property. A sample snippet DT for the marzen board is as follows:
/dts-v1/;
/include/ "r8a7779.dtsi"/ { fixedregulator3v3: fixedregulator at 0 { compatible = "regulator-fixed"; regulator-name = "fixed-3.3V"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-boot-on; regulator-always-on; }; };&lan0 { vddvario-supply = <&fixedregulator3v3>; vdd33a-supply = <&fixedregulator3v3>; };Signed-off-by Simon Horman <[email protected]>---
arch/arm/mach-shmobile/setup-r8a7779.c +3
-1@@ -321,7 +321,7 @@ static struct platform_device i2c3_device = { .num_resources = ARRAY_SIZE(rcar_i2c3_res), }; -static struct platform_device *r8a7779_early_devices[]__initdata = { +static struct platform_device *r8a7779_early_devices_dt[]__initdata = { &scif0_device, &scif1_device, &scif2_device,@@ -330,15 +330,15 @@ static struct platform_device *r8a7779_early_devices[] __initdata = { &scif5_device, &tmu00_device, &tmu01_device, +}; +arch/arm/mach-shmobile/setup-r8a7779.c static struct platform_device *r8a7779_early_devices[] __initdata = { · line 341
Quoted 10 lines
arch/arm/mach-shmobile/setup-r8a7779.c +1
-3+static struct platform_device *r8a7779_early_devices[]__initdata = { &i2c0_device, &i2c1_device, &i2c2_device, &i2c3_device, }; -static struct platform_device *r8a7779_late_devices[]__initdata = { -}; -Thanks for your work on this. Two things with early/late devices on r8a7779:
1) Same thing as sh73a0 applies here, please refrain from using early devices with DT.
Quoted 8 lines
Quoted 2 lines
I guess you are referring to tmu.
If so, yes, I can move them tor8a7779_early_devices.As we talked about last Friday, please try to avoid using early devices in general. It is enough to add SCIF and TMU as late devices. This goes for both sh73a0 and r8a7779. The only thing you need to do early is to setup the delay. Please look at the emev2 implementation for what is needed.
Thanks, I understand.
Quoted 10 lines
Quoted 7 lines
Quoted 2 lines
2) The i2c devices as early devices look incorrect. Can you make them late devices?
r8a7779_early_devicesis only used for the non-DT case.
For the non-DT case i2c was set up as early devices before this patch-set. Would you like me to change them to late devices for non-DT,
a change that is orthogonal to this patch-set?Yes. I realize it is not really related to this DT feature, but it certainly looks incorrect.
Got it. I will see about making it so.
Magnus Damm
maintainerPATCH 3/4 ARM: mach-shmobile: r8a7779: Minimal setup using DT
In reply to Simon HormanHi Simon,
Quoted 81 lines · Simon Horman
Allow a minimal setup of the r8a7779 SoC using a flattened device tree. In particular, configure the i2c and ethernet controllers using a flattened device tree.
SCI serial controller and TMU clock source, whose drivers do not yet support configuration using a flattened device tree, are still configured using C code in order to allow booting of a board with this SoC.
The ethernet controller also requires a regulator which is a board property. A sample snippet DT for the marzen board is as follows:
/dts-v1/;
/include/ "r8a7779.dtsi"/ { fixedregulator3v3: fixedregulator at 0 { compatible = "regulator-fixed"; regulator-name = "fixed-3.3V"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-boot-on; regulator-always-on; }; };&lan0 { vddvario-supply = <&fixedregulator3v3>; vdd33a-supply = <&fixedregulator3v3>; };Signed-off-by Simon Horman <[email protected]>--- arch/arm/boot/dts/r8a7779.dtsi | 45 ++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 2 + arch/arm/mach-shmobile/setup-r8a7779.c | 58 +++++++++++++++++++++++--- 3 files changed, 99 insertions(+), 6 deletions(-)arch/arm/boot/dts/r8a7779.dtsi +36
-0@@ -37,4 +37,49 @@ reg = <0xf0001000 0x1000>, <0xf0000100 0x100>; }; + + i2c0: i2c at 0xffc70000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc70000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 79 0x4>; + }; + + i2c1: i2c at 0xffc71000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc71000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 82 0x4>; + }; + + i2c2: i2c at 0xffc72000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc72000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 80 0x4>; + }; + + i2c3: i2c at 0xffc73000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc73000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 81 0x4>; + };
arch/arm/boot/dts/r8a7779.dtsi line 85
Quoted 10 lines
arch/arm/boot/dts/r8a7779.dtsi +9
-0+ + lan0: lan0 at 18000000 { + compatible = "smsc,lan9220", "smsc,lan9115"; + reg = <0x18000000 0x100>; + phy-mode = "mii"; + interrupt-parent = <&gic>; + interrupts = <0 28 0x4>; + reg-io-width = <4>; + }; };
Simon, thanks for your efforts on this DT reference implementation.
The lan0 snippet above seems incorrect. If I understand the code above correctly then it is written to be specific to the r8a7779 SoC. I suspect so because it is located in the SoC-specific dtsi file. The smsc ethernet controller is a board specific property - so it should instead be located in r8a7779-marzen-reference.dts.
In the future, feel free to ask if you are unsure which bits that are SoC specific properties and which that belong to the board.
Thanks,
/ magnus
PATCH 3/4 ARM: mach-shmobile: r8a7779: Minimal setup using DT
Quoted 98 lines · Magnus Damm
Hi Simon,
Quoted 81 lines · Simon Horman
Allow a minimal setup of the r8a7779 SoC using a flattened device tree. In particular, configure the i2c and ethernet controllers using a flattened device tree.
SCI serial controller and TMU clock source, whose drivers do not yet support configuration using a flattened device tree, are still configured using C code in order to allow booting of a board with this SoC.
The ethernet controller also requires a regulator which is a board property. A sample snippet DT for the marzen board is as follows:
/dts-v1/;
/include/ "r8a7779.dtsi"/ { fixedregulator3v3: fixedregulator at 0 { compatible = "regulator-fixed"; regulator-name = "fixed-3.3V"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-boot-on; regulator-always-on; }; };&lan0 { vddvario-supply = <&fixedregulator3v3>; vdd33a-supply = <&fixedregulator3v3>; };Signed-off-by Simon Horman <[email protected]>--- arch/arm/boot/dts/r8a7779.dtsi | 45 ++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 2 + arch/arm/mach-shmobile/setup-r8a7779.c | 58 +++++++++++++++++++++++--- 3 files changed, 99 insertions(+), 6 deletions(-)arch/arm/boot/dts/r8a7779.dtsi +36
-0@@ -37,4 +37,49 @@ reg = <0xf0001000 0x1000>, <0xf0000100 0x100>; }; + + i2c0: i2c at 0xffc70000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc70000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 79 0x4>; + }; + + i2c1: i2c at 0xffc71000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc71000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 82 0x4>; + }; + + i2c2: i2c at 0xffc72000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc72000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 80 0x4>; + }; + + i2c3: i2c at 0xffc73000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,rmobile-iic"; + reg = <0xffc73000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 81 0x4>; + };arch/arm/boot/dts/r8a7779.dtsi line 85
Quoted 10 lines
arch/arm/boot/dts/r8a7779.dtsi +9
-0+ + lan0: lan0 at 18000000 { + compatible = "smsc,lan9220", "smsc,lan9115"; + reg = <0x18000000 0x100>; + phy-mode = "mii"; + interrupt-parent = <&gic>; + interrupts = <0 28 0x4>; + reg-io-width = <4>; + }; };Simon, thanks for your efforts on this DT reference implementation.
Quoted 8 lines
The lan0 snippet above seems incorrect. If I understand the code above correctly then it is written to be specific to the r8a7779 SoC. I suspect so because it is located in the SoC-specific dtsi file. The smsc ethernet controller is a board specific property - so it should instead be located in
r8a7779-marzen-reference.dts.In the future, feel free to ask if you are unsure which bits that are SoC specific properties and which that belong to the board.
Thanks, I will move it.
PATCH 4/4 ARM: mach-shmobile: marzen: Reference DT implementation
In reply to Simon HormanProvide alternate board code for the marzen to demonstrate how DT may be used given the current state of driver device tree support. This is intended to act as a reference for mach-shmobile developers.
--- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/r8a7779-marzen-reference.dts | 41 +++++++++++++ arch/arm/mach-shmobile/Kconfig | 11 ++++ arch/arm/mach-shmobile/Makefile | 1 + arch/arm/mach-shmobile/board-marzen-reference.c | 71 +++++++++++++++++++++++ 5 files changed, 125 insertions(+) create mode 100644 arch/arm/boot/dts/r8a7779-marzen-reference.dts create mode 100644 arch/arm/mach-shmobile/board-marzen-reference.c
arch/arm/boot/dts/Makefile +1 -0
@@ -123,6 +123,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \ dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \ r8a7740-armadillo800eva.dtb \ r8a7740-armadillo800eva-reference.dtb \ + r8a7779-marzen-reference.dtb \ sh73a0-kzm9g.dtb \ sh73a0-kzm9g-reference.dtb \ sh7372-mackerel.dtb \
arch/arm/boot/dts/r8a7779-marzen-reference.dts new file +41 -0
41 lines not on this page · raw message
arch/arm/mach-shmobile/Kconfig +11 -0
@@ -120,6 +120,17 @@ config MACH_MARZEN select ARCH_REQUIRE_GPIOLIB select REGULATOR_FIXED_VOLTAGE if REGULATOR +config MACH_MARZEN_REFERENCE + bool "MARZEN board - Reference Device Tree Implementation" + depends on MACH_MARZEN + select USE_OF + ---help--- + Use reference implementation of Marzen board support + which makes use of device tree at the expense + of not supporting a number of devices. + + This is intended to aid developers + config MACH_KZM9D bool "KZM9D board" depends on ARCH_EMEV2
arch/arm/mach-shmobile/Makefile +1 -0
@@ -40,6 +40,7 @@ obj-$(CONFIG_MACH_MACKEREL_REFERENCE) += board-mackerel-reference.o obj-$(CONFIG_MACH_KOTA2) += board-kota2.o obj-$(CONFIG_MACH_BONITO) += board-bonito.o obj-$(CONFIG_MACH_MARZEN) += board-marzen.o +obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o
arch/arm/mach-shmobile/board-marzen-reference.c new file +71 -0
71 lines not on this page · raw message
Signature · 1 line
1.7.10.4