ARM: shmobile: r8a73a4 SoC support V2
Subsystems (5)
Magnus Damm
maintainercover ARM: shmobile: r8a73a4 SoC support V2
ARM: shmobile: r8a73a4 SoC support V2
[PATCH 01/04] ARM: shmobile: Initial r8a73a4 SoC support V2 [PATCH 02/04] ARM: shmobile: r8a73a4 SCIF support V2 [PATCH 03/04] ARM: shmobile: r8a73a4 IRQC support V2 [PATCH 04/04] ARM: shmobile: r8a73a4 PFC support
This series is V2 of initial support for the r8a73a4 SoC. The SoC is known as r8a73a4 which is built around Cortex-A15 and makes use of SCIF for serial, IRQC interrupt controller for external IRQs and PFC for combined support for pinmux and GPIO.
Changes in V2:
- Move away from static platform devices
- Use platform_device_register_data/resndata/simple
- Add PFC support (tables excluded)
- About 150 lines smaller than V1 but without board code
For more details please see the individual patches.
The previous patch set included APE6EVM board support, but from now board support will be submitted separately as an independent series.
Also, this series makes use of PFC if available, but actual PFC tables will be submitted separately.
Many thanks to Arnd Bergmann for his kind support!
---
Written against "next" renesas.git 811689afc214564c4a5f238ecf4d8bdc0e52b615 [PATCH 01/04] requires [PATCH] ARM: shmobile: Disallow PINCTRL without GPIOLIB [PATCH 03/04] requires the IRQC driver to build
arch/arm/boot/dts/r8a73a4.dtsi | 87 +++++++++++ arch/arm/mach-shmobile/Kconfig | 9 + arch/arm/mach-shmobile/Makefile | 1 arch/arm/mach-shmobile/clock-r8a73a4.c | 104 +++++++++++++ arch/arm/mach-shmobile/include/mach/r8a73a4.h | 8 + arch/arm/mach-shmobile/setup-r8a73a4.c | 187 +++++++++++++++++++++++++ 6 files changed, 395 insertions(+), 1 deletion(-)
Magnus Damm
maintainerPATCH 1/4 ARM: shmobile: Initial r8a73a4 SoC support V2
From: Magnus Damm <[email protected]>
Add initial support for the r8a73a4 SoC including:
- Single Cortex-A15 CPU Core
- GIC
- Architecture timer
No static virtual mappings are used, all the components make use of ioremap(). DT_MACHINE_START is still wrapped in CONFIG_USE_OF to match other mach-shmobile code.
---
Changes since V1:
- Best-effort sort of headers
- Removed r8a73a4_devices[] and platform_add_devices()
- Let r8a73a4_clock_init() be called directly by board code
arch/arm/boot/dts/r8a73a4.dtsi | 55 +++++++++++++++ arch/arm/mach-shmobile/Kconfig | 7 + arch/arm/mach-shmobile/Makefile | 1 arch/arm/mach-shmobile/clock-r8a73a4.c | 89 +++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/r8a73a4.h | 7 + arch/arm/mach-shmobile/setup-r8a73a4.c | 50 ++++++++++++++ 6 files changed, 209 insertions(+)
arch/arm/boot/dts/r8a73a4.dtsi new file +55 -0
@@ -0,0 +1,55 @@ +/* + * Device Tree Source for the r8a73a4 SoC + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Magnus Damm + * + * 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,r8a73a4"; + interrupt-parent = <&gic>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu0: cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a15"; + reg = <0>; + clock-frequency = <1500000000>; + }; + }; + + gic: interrupt-controller at f1001000 { + compatible = "arm,cortex-a15-gic"; + #interrupt-cells = <3>; + #address-cells = <0>; + interrupt-controller; + reg = <0xf1001000 0x1000>, + <0xf1002000 0x1000>, + <0xf1004000 0x2000>, + <0xf1006000 0x2000>; + interrupts = <1 9 0xf04>; + + gic-cpuif at 4 { + compatible = "arm,gic-cpuif"; + cpuif-id = <4>; + cpu = <&cpu0>; + }; + }; + + timer { + compatible = "arm,armv7-timer"; + interrupts = <1 13 0xf08>, + <1 14 0xf08>, + <1 11 0xf08>, + <1 10 0xf08>; + }; +};
arch/arm/mach-shmobile/Kconfig +7 -0
@@ -18,6 +18,13 @@ config ARCH_SH73A0 select SH_CLK_CPG select RENESAS_INTC_IRQPIN +config ARCH_R8A73A4 + bool "R-Mobile APE6 (R8A73A40)" + select ARM_GIC + select CPU_V7 + select ARM_ARCH_TIMER + select SH_CLK_CPG + config ARCH_R8A7740 bool "R-Mobile A1 (R8A77400)" select ARCH_WANT_OPTIONAL_GPIOLIB
arch/arm/mach-shmobile/Makefile +1 -0
@@ -8,6 +8,7 @@ obj-y := timer.o console.o clock.o # CPU objects obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o +obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o clock-r8a73a4.o obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o clock-r8a7779.o intc-r8a7779.o obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o clock-emev2.o
arch/arm/mach-shmobile/clock-r8a73a4.c new file +89 -0
89 lines not on this page · raw message
arch/arm/mach-shmobile/include/mach/r8a73a4.h new file +7 -0
@@ -0,0 +1,7 @@ +#ifndef __ASM_R8A73A4_H__ +#define __ASM_R8A73A4_H__ + +void r8a73a4_add_standard_devices (void ); +void r8a73a4_clock_init (void ); + +#endif /* __ASM_R8A73A4_H__ */
arch/arm/mach-shmobile/setup-r8a73a4.c new file +50 -0
50 lines not on this page · raw message
PATCH 3/4 ARM: shmobile: r8a73a4 IRQC support V2
In reply to Magnus DammQuoted 4 lines · Magnus Damm
Both platform devices and DT devices are added in this patch. The platform device versions are used to provide a static interrupt map configuration for board code written in C.
I had not noticed this part with the first version. Why is this required? I thought you would always have the DTS in there, so that can be used to provide the resources even for static platform devices.
Arnd
Magnus Damm
maintainerPATCH 2/4 ARM: shmobile: r8a73a4 SCIF support V2
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Add SCIF serial port support to the r8a73a4 SoC by adding platform devices for SCIFA0 -> SCIFA1 as well as SCIFB0 -> SCIFB3 together with clock bindings. DT device description is excluded at this point since such bindings are still under development.
---
Changes since V1:
- Replaced static platform devices with array of platform data together with a call to platform_device_register_data()
This version is about 70 lines smaller than V1.
arch/arm/mach-shmobile/clock-r8a73a4.c | 15 ++++++++++- arch/arm/mach-shmobile/setup-r8a73a4.c | 43 ++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/clock-r8a73a4.c +14 -1
@@ -28,6 +28,7 @@#define CPG_LEN 0x270#define MPCKCR 0xe6150080 +#define SMSTPCR2 0xe6150138static struct clk_mapping cpg_mapping = { .phys =CPG_BASE ,
@@ -53,11 +54,23 @@ static struct clk *main_clks[] = { &extal2_clk, }; -enum {MSTP_NR }; +enum {MSTP217 ,MSTP216 ,MSTP207 ,MSTP206 ,MSTP204 ,MSTP203 ,MSTP_NR };static struct clk mstp_clks[MSTP_NR ] = { + [MSTP204 ] =SH_CLK_MSTP32 (&extal2_clk,SMSTPCR2 ,4 ,0 ),/* SCIFA0 */ + [MSTP203 ] =SH_CLK_MSTP32 (&extal2_clk,SMSTPCR2 ,3 ,0 ),/* SCIFA1 */ + [MSTP206 ] =SH_CLK_MSTP32 (&extal2_clk,SMSTPCR2 ,6 ,0 ),/* SCIFB0 */ + [MSTP207 ] =SH_CLK_MSTP32 (&extal2_clk,SMSTPCR2 ,7 ,0 ),/* SCIFB1 */ + [MSTP216 ] =SH_CLK_MSTP32 (&extal2_clk,SMSTPCR2 ,16 ,0 ),/* SCIFB2 */ + [MSTP217 ] =SH_CLK_MSTP32 (&extal2_clk,SMSTPCR2 ,17 ,0 ),/* SCIFB3 */ };static struct clk_lookup lookups[] = { +CLKDEV_DEV_ID ("sh-sci.0" , &mstp_clks[MSTP204 ]), +CLKDEV_DEV_ID ("sh-sci.1" , &mstp_clks[MSTP203 ]), +CLKDEV_DEV_ID ("sh-sci.2" , &mstp_clks[MSTP206 ]), +CLKDEV_DEV_ID ("sh-sci.3" , &mstp_clks[MSTP207 ]), +CLKDEV_DEV_ID ("sh-sci.4" , &mstp_clks[MSTP216 ]), +CLKDEV_DEV_ID ("sh-sci.5" , &mstp_clks[MSTP217 ]), };void __init r8a73a4_clock_init (void )
arch/arm/mach-shmobile/setup-r8a73a4.c +43 -0
56 lines not on this page · raw message
Magnus Damm
maintainerPATCH 3/4 ARM: shmobile: r8a73a4 IRQC support V2
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Add IRQC interrupt controller support to r8a73a4 by hooking up two IRQC instances to handle 58 external IRQ signals. There IRQC controllers are tied to SPIs of the GIC. On r8a73a4 exact IRQ pin routing is handled by the PFC which is excluded from this patch.
Both platform devices and DT devices are added in this patch. The platform device versions are used to provide a static interrupt map configuration for board code written in C.
---
Change since V1:
- Use platform_device_register_resndata() instead of static platform device
Depends on:
[PATCH] irqchip: Renesas IRQC driver
[PATCH] irqchip: irqc: Add DT support
arch/arm/boot/dts/r8a73a4.dtsi | 32 ++++++++++++ arch/arm/mach-shmobile/Kconfig | 1 arch/arm/mach-shmobile/setup-r8a73a4.c | 84 ++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+)
arch/arm/boot/dts/r8a73a4.dtsi +32 -0
@@ -52,4 +52,36 @@ <1 11 0xf08>, <1 10 0xf08>; }; + + irqc0: interrupt-controller at e61c0000 { + compatible = "renesas,irqc"; + #interrupt-cells = <2>; + interrupt-controller; + reg = <0xe61c0000 0x200>; + interrupt-parent = <&gic>; + interrupts = <0 0 4>, <0 1 4>, <0 2 4>, <0 3 4>, + <0 4 4>, <0 5 4>, <0 6 4>, <0 7 4>, + <0 8 4>, <0 9 4>, <0 10 4>, <0 11 4>, + <0 12 4>, <0 13 4>, <0 14 4>, <0 15 4>, + <0 16 4>, <0 17 4>, <0 18 4>, <0 19 4>, + <0 20 4>, <0 21 4>, <0 22 4>, <0 23 4>, + <0 24 4>, <0 25 4>, <0 26 4>, <0 27 4>, + <0 28 4>, <0 29 4>, <0 30 4>, <0 31 4>; + }; + + irqc1: interrupt-controller at e61c0200 { + compatible = "renesas,irqc"; + #interrupt-cells = <2>; + interrupt-controller; + reg = <0xe61c0200 0x200>; + interrupt-parent = <&gic>; + interrupts = <0 32 4>, <0 33 4>, <0 34 4>, <0 35 4>, + <0 36 4>, <0 37 4>, <0 38 4>, <0 39 4>, + <0 40 4>, <0 41 4>, <0 42 4>, <0 43 4>, + <0 44 4>, <0 45 4>, <0 46 4>, <0 47 4>, + <0 48 4>, <0 49 4>, <0 50 4>, <0 51 4>, + <0 52 4>, <0 53 4>, <0 54 4>, <0 55 4>, + <0 56 4>, <0 57 4>; + }; + };
arch/arm/mach-shmobile/Kconfig +1 -0
@@ -24,6 +24,7 @@ config ARCH_R8A73A4 select CPU_V7 select ARM_ARCH_TIMER select SH_CLK_CPG + select RENESAS_IRQC config ARCH_R8A7740 bool "R-Mobile A1 (R8A77400)"
arch/arm/mach-shmobile/setup-r8a73a4.c +84 -0
102 lines not on this page · raw message
Magnus Damm
maintainerPATCH 4/4 ARM: shmobile: r8a73a4 PFC support
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Add a platform device for the r8a73a4 PFC.
---
No build time dependency, but requires PFC tables in separate patch series to actually do something.
arch/arm/mach-shmobile/Kconfig | 1 + arch/arm/mach-shmobile/include/mach/r8a73a4.h | 1 + arch/arm/mach-shmobile/setup-r8a73a4.c | 10 ++++++++++ 3 files changed, 12 insertions(+)
arch/arm/mach-shmobile/Kconfig +1 -0
@@ -20,6 +20,7 @@ config ARCH_SH73A0 config ARCH_R8A73A4 bool "R-Mobile APE6 (R8A73A40)" + select ARCH_WANT_OPTIONAL_GPIOLIB select ARM_GIC select CPU_V7 select ARM_ARCH_TIMER
arch/arm/mach-shmobile/include/mach/r8a73a4.h +1 -0
@@ -3,5 +3,6 @@void r8a73a4_add_standard_devices (void );void r8a73a4_clock_init (void ); +void r8a73a4_pinmux_init (void );#endif /* __ASM_R8A73A4_H__ */
arch/arm/mach-shmobile/setup-r8a73a4.c +10 -0
@@ -28,6 +28,16 @@#include <mach/r8a73a4.h> #include <asm/mach/arch.h> +static const struct resource pfc_resources[] = { +DEFINE_RES_MEM (0xe6050000 ,0x9000 ), +}; + +void __init r8a73a4_pinmux_init (void ) +{ +platform_device_register_simple ("pfc-r8a73a4" ,-1 , pfc_resources, +ARRAY_SIZE (pfc_resources)); +} +#define SCIF_COMMON (scif_type, baseaddr, irq) \ .type = PORT_SCIFA, \ .mapbase = baseaddr, \
Magnus Damm
maintainerPATCH 3/4 ARM: shmobile: r8a73a4 IRQC support V2
In reply to Arnd BergmannHi Arnd,
Quoted 9 lines · Arnd Bergmann
Quoted 4 lines · Magnus Damm
Both platform devices and DT devices are added in this patch. The platform device versions are used to provide a static interrupt map configuration for board code written in C.
I had not noticed this part with the first version. Why is this required? I thought you would always have the DTS in there, so that can be used to provide the resources even for static platform devices.
Right now there is an intentional difference between the "C" version of the board code and the DT-only version:
The "C" version of board code relies on DTS for architected timer and GIC. Besides that, platform devices are used. Other devices in DTS are not used at this point.
The DT version (DT_MACHINE_START in setup-r8a73a4.c) is using DTS only.
Would you like me to change to "C" version of the code to use DTS to describe more devices?
Thanks,
/ magnus