* [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update
@ 2013-07-02 9:27 Magnus Damm
2013-07-02 9:27 ` [PATCH 01/08] ARM: shmobile: Remove unused EMEV2/KZM9D early console Magnus Damm
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: Magnus Damm @ 2013-07-02 9:27 UTC (permalink / raw)
To: linux-arm-kernel
ARM: shmobile: EMEV2 and KZM9D update
[PATCH 01/08] ARM: shmobile: Remove unused EMEV2/KZM9D early console
[PATCH 02/08] ARM: shmobile: Update KZM9D dts command line
[PATCH 03/08] ARM: shmobile: Make EMEV2 platform devices more compact
[PATCH 04/08] ARM: shmobile: Add GIO to EMEV2 dtsi
[PATCH 05/08] ARM: shmobile: Use DT for GIC on EMEV2 and KZM9D
[PATCH 06/08] ARM: shmobile: Use DT for SMP on EMEV2 and KZM9D
[PATCH 07/08] ARM: shmobile: EMEV2 map_io update
[PATCH 08/08] ARM: shmobile: Disconnect EMEV2 SMP code from clocks
Several minor updates for the EMEV2 SoC and the KZM9D board:
- Get rid of early console - the 8250-em driver does not support it
- Update command line in DTS and remove old cruft
- Make the EMEV2 platform devices more compact
- Add GIO device nodes to the EMEV2 dtsi
- Use DT for GIC and SMP for both regular KZM9D board code and DT
- Reduce the size of the EMEV2 map_io - SCU is still however needed
- Allow EMEV2 SMP to operate without legacy clock bits
Signed-off-by: Magnus Damm <damm@opensource.se>
---
Written against renesas.git renesas-next-20130702
arch/arm/boot/dts/emev2-kzm9d.dts | 2
arch/arm/boot/dts/emev2.dtsi | 59 ++++
arch/arm/mach-shmobile/board-kzm9d.c | 4
arch/arm/mach-shmobile/clock-emev2.c | 18 -
arch/arm/mach-shmobile/include/mach/emev2.h | 4
arch/arm/mach-shmobile/setup-emev2.c | 374 ++++-----------------------
arch/arm/mach-shmobile/smp-emev2.c | 28 --
7 files changed, 142 insertions(+), 347 deletions(-)
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 01/08] ARM: shmobile: Remove unused EMEV2/KZM9D early console 2013-07-02 9:27 [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Magnus Damm @ 2013-07-02 9:27 ` Magnus Damm 2013-07-02 9:27 ` [PATCH 02/08] ARM: shmobile: Update KZM9D dts command line Magnus Damm ` (8 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: Magnus Damm @ 2013-07-02 9:27 UTC (permalink / raw) To: linux-arm-kernel From: Magnus Damm <damm@opensource.se> Remove EMEV2 early console code from KZM9D and instead rely on console setup during regular platform device probe time. This makes the DT code and the KZM9D board support behave the same. Signed-off-by: Magnus Damm <damm@opensource.se> --- arch/arm/mach-shmobile/board-kzm9d.c | 2 +- arch/arm/mach-shmobile/include/mach/emev2.h | 2 +- arch/arm/mach-shmobile/setup-emev2.c | 24 +++--------------------- 3 files changed, 5 insertions(+), 23 deletions(-) --- 0001/arch/arm/mach-shmobile/board-kzm9d.c +++ work/arch/arm/mach-shmobile/board-kzm9d.c 2013-07-01 20:07:13.000000000 +0900 @@ -85,7 +85,7 @@ static const char *kzm9d_boards_compat_d DT_MACHINE_START(KZM9D_DT, "kzm9d") .smp = smp_ops(emev2_smp_ops), .map_io = emev2_map_io, - .init_early = emev2_add_early_devices, + .init_early = emev2_init_delay, .nr_irqs = NR_IRQS_LEGACY, .init_irq = emev2_init_irq, .init_machine = kzm9d_add_standard_devices, --- 0001/arch/arm/mach-shmobile/include/mach/emev2.h +++ work/arch/arm/mach-shmobile/include/mach/emev2.h 2013-07-01 20:06:35.000000000 +0900 @@ -3,7 +3,7 @@ extern void emev2_map_io(void); extern void emev2_init_irq(void); -extern void emev2_add_early_devices(void); +extern void emev2_init_delay(void); extern void emev2_add_standard_devices(void); extern void emev2_clock_init(void); extern void emev2_set_boot_vector(unsigned long value); --- 0012/arch/arm/mach-shmobile/setup-emev2.c +++ work/arch/arm/mach-shmobile/setup-emev2.c 2013-07-01 20:08:10.000000000 +0900 @@ -375,14 +375,11 @@ static struct platform_device pmu_device .resource = pmu_resources, }; -static struct platform_device *emev2_early_devices[] __initdata = { +static struct platform_device *emev2_devices[] __initdata = { &uart0_device, &uart1_device, &uart2_device, &uart3_device, -}; - -static struct platform_device *emev2_late_devices[] __initdata = { &sti_device, &gio0_device, &gio1_device, @@ -396,29 +393,14 @@ void __init emev2_add_standard_devices(v { emev2_clock_init(); - platform_add_devices(emev2_early_devices, - ARRAY_SIZE(emev2_early_devices)); - - platform_add_devices(emev2_late_devices, - ARRAY_SIZE(emev2_late_devices)); + platform_add_devices(emev2_devices, ARRAY_SIZE(emev2_devices)); } -static void __init emev2_init_delay(void) +void __init emev2_init_delay(void) { shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */ } -void __init emev2_add_early_devices(void) -{ - emev2_init_delay(); - - early_platform_add_devices(emev2_early_devices, - ARRAY_SIZE(emev2_early_devices)); - - /* setup early console here as well */ - shmobile_setup_console(); -} - void __init emev2_init_irq(void) { void __iomem *gic_dist_base; ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 02/08] ARM: shmobile: Update KZM9D dts command line 2013-07-02 9:27 [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Magnus Damm 2013-07-02 9:27 ` [PATCH 01/08] ARM: shmobile: Remove unused EMEV2/KZM9D early console Magnus Damm @ 2013-07-02 9:27 ` Magnus Damm 2013-07-02 9:27 ` [PATCH 03/08] ARM: shmobile: Make EMEV2 platform devices more compact Magnus Damm ` (7 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: Magnus Damm @ 2013-07-02 9:27 UTC (permalink / raw) To: linux-arm-kernel From: Magnus Damm <damm@opensource.se> Update the KZM9D DTS command line to remove following cruft: - console=tty0 - no graphic support upstream anyway - earlyprintk= - not supported by the 8250-em driver anyway - mem= - this is provided via DT anyway Signed-off-by: Magnus Damm <damm@opensource.se> --- arch/arm/boot/dts/emev2-kzm9d.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 0001/arch/arm/boot/dts/emev2-kzm9d.dts +++ work/arch/arm/boot/dts/emev2-kzm9d.dts 2013-07-02 17:07:18.000000000 +0900 @@ -21,6 +21,6 @@ }; chosen { - bootargs = "console=tty0 console=ttyS1,115200n81 earlyprintk=serial8250-em.1,115200n81 mem=128M at 0x40000000 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096"; + bootargs = "console=ttyS1,115200n81 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096"; }; }; ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 03/08] ARM: shmobile: Make EMEV2 platform devices more compact 2013-07-02 9:27 [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Magnus Damm 2013-07-02 9:27 ` [PATCH 01/08] ARM: shmobile: Remove unused EMEV2/KZM9D early console Magnus Damm 2013-07-02 9:27 ` [PATCH 02/08] ARM: shmobile: Update KZM9D dts command line Magnus Damm @ 2013-07-02 9:27 ` Magnus Damm 2013-07-02 9:27 ` [PATCH 04/08] ARM: shmobile: Add GIO to EMEV2 dtsi Magnus Damm ` (6 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: Magnus Damm @ 2013-07-02 9:27 UTC (permalink / raw) To: linux-arm-kernel From: Magnus Damm <damm@opensource.se> Convert the EMEV2 SoC device setup code from using very verbose resources and static platform devices to the same style as more recent boards. This reduces the size of the code. Signed-off-by: Magnus Damm <damm@opensource.se> --- Depends on "[PATCH] ARM: shmobile: emev2 GIO3 resource fix" arch/arm/mach-shmobile/setup-emev2.c | 327 ++++++---------------------------- 1 file changed, 64 insertions(+), 263 deletions(-) --- 0016/arch/arm/mach-shmobile/setup-emev2.c +++ work/arch/arm/mach-shmobile/setup-emev2.c 2013-07-01 20:31:49.000000000 +0900 @@ -62,102 +62,40 @@ void __init emev2_map_io(void) /* UART */ static struct resource uart0_resources[] = { - [0] = { - .start = 0xe1020000, - .end = 0xe1020037, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 40, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device uart0_device = { - .name = "serial8250-em", - .id = 0, - .num_resources = ARRAY_SIZE(uart0_resources), - .resource = uart0_resources, + DEFINE_RES_MEM(0xe1020000, 0x38), + DEFINE_RES_IRQ(40), }; static struct resource uart1_resources[] = { - [0] = { - .start = 0xe1030000, - .end = 0xe1030037, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 41, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device uart1_device = { - .name = "serial8250-em", - .id = 1, - .num_resources = ARRAY_SIZE(uart1_resources), - .resource = uart1_resources, + DEFINE_RES_MEM(0xe1030000, 0x38), + DEFINE_RES_IRQ(41), }; static struct resource uart2_resources[] = { - [0] = { - .start = 0xe1040000, - .end = 0xe1040037, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 42, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device uart2_device = { - .name = "serial8250-em", - .id = 2, - .num_resources = ARRAY_SIZE(uart2_resources), - .resource = uart2_resources, + DEFINE_RES_MEM(0xe1040000, 0x38), + DEFINE_RES_IRQ(42), }; static struct resource uart3_resources[] = { - [0] = { - .start = 0xe1050000, - .end = 0xe1050037, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 43, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device uart3_device = { - .name = "serial8250-em", - .id = 3, - .num_resources = ARRAY_SIZE(uart3_resources), - .resource = uart3_resources, + DEFINE_RES_MEM(0xe1050000, 0x38), + DEFINE_RES_IRQ(43), }; +#define emev2_register_uart(idx) \ + platform_device_register_simple("serial8250-em", idx, \ + uart##idx##_resources, \ + ARRAY_SIZE(uart##idx##_resources)) + /* STI */ static struct resource sti_resources[] = { - [0] = { - .name = "STI", - .start = 0xe0180000, - .end = 0xe0180053, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 157, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device sti_device = { - .name = "em_sti", - .id = 0, - .resource = sti_resources, - .num_resources = ARRAY_SIZE(sti_resources), + DEFINE_RES_MEM(0xe0180000, 0x54), + DEFINE_RES_IRQ(157), }; +#define emev2_register_sti() \ + platform_device_register_simple("em_sti", 0, \ + sti_resources, \ + ARRAY_SIZE(sti_resources)) /* GIO */ static struct gpio_em_config gio0_config = { @@ -167,36 +105,10 @@ static struct gpio_em_config gio0_config }; static struct resource gio0_resources[] = { - [0] = { - .name = "GIO_000", - .start = 0xe0050000, - .end = 0xe005002b, - .flags = IORESOURCE_MEM, - }, - [1] = { - .name = "GIO_000", - .start = 0xe0050040, - .end = 0xe005005f, - .flags = IORESOURCE_MEM, - }, - [2] = { - .start = 99, - .flags = IORESOURCE_IRQ, - }, - [3] = { - .start = 100, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device gio0_device = { - .name = "em_gio", - .id = 0, - .resource = gio0_resources, - .num_resources = ARRAY_SIZE(gio0_resources), - .dev = { - .platform_data = &gio0_config, - }, + DEFINE_RES_MEM(0xe0050000, 0x2c), + DEFINE_RES_MEM(0xe0050040, 0x20), + DEFINE_RES_IRQ(99), + DEFINE_RES_IRQ(100), }; static struct gpio_em_config gio1_config = { @@ -206,36 +118,10 @@ static struct gpio_em_config gio1_config }; static struct resource gio1_resources[] = { - [0] = { - .name = "GIO_032", - .start = 0xe0050080, - .end = 0xe00500ab, - .flags = IORESOURCE_MEM, - }, - [1] = { - .name = "GIO_032", - .start = 0xe00500c0, - .end = 0xe00500df, - .flags = IORESOURCE_MEM, - }, - [2] = { - .start = 101, - .flags = IORESOURCE_IRQ, - }, - [3] = { - .start = 102, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device gio1_device = { - .name = "em_gio", - .id = 1, - .resource = gio1_resources, - .num_resources = ARRAY_SIZE(gio1_resources), - .dev = { - .platform_data = &gio1_config, - }, + DEFINE_RES_MEM(0xe0050080, 0x2c), + DEFINE_RES_MEM(0xe00500c0, 0x20), + DEFINE_RES_IRQ(101), + DEFINE_RES_IRQ(102), }; static struct gpio_em_config gio2_config = { @@ -245,36 +131,10 @@ static struct gpio_em_config gio2_config }; static struct resource gio2_resources[] = { - [0] = { - .name = "GIO_064", - .start = 0xe0050100, - .end = 0xe005012b, - .flags = IORESOURCE_MEM, - }, - [1] = { - .name = "GIO_064", - .start = 0xe0050140, - .end = 0xe005015f, - .flags = IORESOURCE_MEM, - }, - [2] = { - .start = 103, - .flags = IORESOURCE_IRQ, - }, - [3] = { - .start = 104, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device gio2_device = { - .name = "em_gio", - .id = 2, - .resource = gio2_resources, - .num_resources = ARRAY_SIZE(gio2_resources), - .dev = { - .platform_data = &gio2_config, - }, + DEFINE_RES_MEM(0xe0050100, 0x2c), + DEFINE_RES_MEM(0xe0050140, 0x20), + DEFINE_RES_IRQ(103), + DEFINE_RES_IRQ(104), }; static struct gpio_em_config gio3_config = { @@ -284,36 +144,10 @@ static struct gpio_em_config gio3_config }; static struct resource gio3_resources[] = { - [0] = { - .name = "GIO_096", - .start = 0xe0050180, - .end = 0xe00501ab, - .flags = IORESOURCE_MEM, - }, - [1] = { - .name = "GIO_096", - .start = 0xe00501c0, - .end = 0xe00501df, - .flags = IORESOURCE_MEM, - }, - [2] = { - .start = 105, - .flags = IORESOURCE_IRQ, - }, - [3] = { - .start = 106, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device gio3_device = { - .name = "em_gio", - .id = 3, - .resource = gio3_resources, - .num_resources = ARRAY_SIZE(gio3_resources), - .dev = { - .platform_data = &gio3_config, - }, + DEFINE_RES_MEM(0xe0050180, 0x2c), + DEFINE_RES_MEM(0xe00501c0, 0x20), + DEFINE_RES_IRQ(105), + DEFINE_RES_IRQ(106), }; static struct gpio_em_config gio4_config = { @@ -323,77 +157,44 @@ static struct gpio_em_config gio4_config }; static struct resource gio4_resources[] = { - [0] = { - .name = "GIO_128", - .start = 0xe0050200, - .end = 0xe005022b, - .flags = IORESOURCE_MEM, - }, - [1] = { - .name = "GIO_128", - .start = 0xe0050240, - .end = 0xe005025f, - .flags = IORESOURCE_MEM, - }, - [2] = { - .start = 107, - .flags = IORESOURCE_IRQ, - }, - [3] = { - .start = 108, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device gio4_device = { - .name = "em_gio", - .id = 4, - .resource = gio4_resources, - .num_resources = ARRAY_SIZE(gio4_resources), - .dev = { - .platform_data = &gio4_config, - }, + DEFINE_RES_MEM(0xe0050200, 0x2c), + DEFINE_RES_MEM(0xe0050240, 0x20), + DEFINE_RES_IRQ(107), + DEFINE_RES_IRQ(108), }; +#define emev2_register_gio(idx) \ + platform_device_register_resndata(&platform_bus, "em_gio", \ + idx, gio##idx##_resources, \ + ARRAY_SIZE(gio##idx##_resources), \ + &gio##idx##_config, \ + sizeof(struct gpio_em_config)) + static struct resource pmu_resources[] = { - [0] = { - .start = 152, - .end = 152, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = 153, - .end = 153, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device pmu_device = { - .name = "arm-pmu", - .id = -1, - .num_resources = ARRAY_SIZE(pmu_resources), - .resource = pmu_resources, -}; - -static struct platform_device *emev2_devices[] __initdata = { - &uart0_device, - &uart1_device, - &uart2_device, - &uart3_device, - &sti_device, - &gio0_device, - &gio1_device, - &gio2_device, - &gio3_device, - &gio4_device, - &pmu_device, + DEFINE_RES_IRQ(152), + DEFINE_RES_IRQ(153), }; +#define emev2_register_pmu() \ + platform_device_register_simple("arm-pmu", -1, \ + pmu_resources, \ + ARRAY_SIZE(pmu_resources)) + void __init emev2_add_standard_devices(void) { emev2_clock_init(); - platform_add_devices(emev2_devices, ARRAY_SIZE(emev2_devices)); + emev2_register_uart(0); + emev2_register_uart(1); + emev2_register_uart(2); + emev2_register_uart(3); + emev2_register_sti(); + emev2_register_gio(0); + emev2_register_gio(1); + emev2_register_gio(2); + emev2_register_gio(3); + emev2_register_gio(4); + emev2_register_pmu(); } void __init emev2_init_delay(void) ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 04/08] ARM: shmobile: Add GIO to EMEV2 dtsi 2013-07-02 9:27 [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Magnus Damm ` (2 preceding siblings ...) 2013-07-02 9:27 ` [PATCH 03/08] ARM: shmobile: Make EMEV2 platform devices more compact Magnus Damm @ 2013-07-02 9:27 ` Magnus Damm 2013-07-02 9:28 ` [PATCH 05/08] ARM: shmobile: Use DT for GIC on EMEV2 and KZM9D Magnus Damm ` (5 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: Magnus Damm @ 2013-07-02 9:27 UTC (permalink / raw) To: linux-arm-kernel From: Magnus Damm <damm@opensource.se> Add GIO0->GIO4 device nodes to the EMEV2 dtsi file. Signed-off-by: Magnus Damm <damm@opensource.se> --- arch/arm/boot/dts/emev2.dtsi | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) --- 0001/arch/arm/boot/dts/emev2.dtsi +++ work/arch/arm/boot/dts/emev2.dtsi 2013-07-02 16:27:34.000000000 +0900 @@ -14,6 +14,14 @@ compatible = "renesas,emev2"; interrupt-parent = <&gic>; + aliases { + gpio0 = &gpio0; + gpio1 = &gpio1; + gpio2 = &gpio2; + gpio3 = &gpio3; + gpio4 = &gpio4; + }; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -67,4 +75,55 @@ reg = <0xe1050000 0x38>; interrupts = <0 11 0>; }; + + gpio0: gpio at e0050000 { + compatible = "renesas,em-gio"; + reg = <0xe0050000 0x2c>, <0xe0050040 0x20>; + interrupts = <0 67 0>, <0 68 0>; + gpio-controller; + #gpio-cells = <2>; + ngpios = <32>; + interrupt-controller; + #interrupt-cells = <2>; + }; + gpio1: gpio at e0050080 { + compatible = "renesas,em-gio"; + reg = <0xe0050080 0x2c>, <0xe00500c0 0x20>; + interrupts = <0 69 0>, <0 70 0>; + gpio-controller; + #gpio-cells = <2>; + ngpios = <32>; + interrupt-controller; + #interrupt-cells = <2>; + }; + gpio2: gpio at e0050100 { + compatible = "renesas,em-gio"; + reg = <0xe0050100 0x2c>, <0xe0050140 0x20>; + interrupts = <0 71 0>, <0 72 0>; + gpio-controller; + #gpio-cells = <2>; + ngpios = <32>; + interrupt-controller; + #interrupt-cells = <2>; + }; + gpio3: gpio at e0050180 { + compatible = "renesas,em-gio"; + reg = <0xe0050180 0x2c>, <0xe00501c0 0x20>; + interrupts = <0 73 0>, <0 74 0>; + gpio-controller; + #gpio-cells = <2>; + ngpios = <32>; + interrupt-controller; + #interrupt-cells = <2>; + }; + gpio4: gpio at e0050200 { + compatible = "renesas,em-gio"; + reg = <0xe0050200 0x2c>, <0xe0050240 0x20>; + interrupts = <0 75 0>, <0 76 0>; + gpio-controller; + #gpio-cells = <2>; + ngpios = <31>; + interrupt-controller; + #interrupt-cells = <2>; + }; }; ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 05/08] ARM: shmobile: Use DT for GIC on EMEV2 and KZM9D 2013-07-02 9:27 [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Magnus Damm ` (3 preceding siblings ...) 2013-07-02 9:27 ` [PATCH 04/08] ARM: shmobile: Add GIO to EMEV2 dtsi Magnus Damm @ 2013-07-02 9:28 ` Magnus Damm 2013-07-02 9:28 ` [PATCH 06/08] ARM: shmobile: Use DT for SMP " Magnus Damm ` (4 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: Magnus Damm @ 2013-07-02 9:28 UTC (permalink / raw) To: linux-arm-kernel From: Magnus Damm <damm@opensource.se> Remove the C version of the EMEV2 GIC setup code, instead rely on GIC information provided by DT. Signed-off-by: Magnus Damm <damm@opensource.se> --- arch/arm/mach-shmobile/board-kzm9d.c | 2 -- arch/arm/mach-shmobile/include/mach/emev2.h | 1 - arch/arm/mach-shmobile/setup-emev2.c | 15 --------------- 3 files changed, 18 deletions(-) --- 0002/arch/arm/mach-shmobile/board-kzm9d.c +++ work/arch/arm/mach-shmobile/board-kzm9d.c 2013-07-02 15:01:32.000000000 +0900 @@ -86,8 +86,6 @@ DT_MACHINE_START(KZM9D_DT, "kzm9d") .smp = smp_ops(emev2_smp_ops), .map_io = emev2_map_io, .init_early = emev2_init_delay, - .nr_irqs = NR_IRQS_LEGACY, - .init_irq = emev2_init_irq, .init_machine = kzm9d_add_standard_devices, .init_late = shmobile_init_late, .dt_compat = kzm9d_boards_compat_dt, --- 0002/arch/arm/mach-shmobile/include/mach/emev2.h +++ work/arch/arm/mach-shmobile/include/mach/emev2.h 2013-07-02 15:01:48.000000000 +0900 @@ -2,7 +2,6 @@ #define __ASM_EMEV2_H__ extern void emev2_map_io(void); -extern void emev2_init_irq(void); extern void emev2_init_delay(void); extern void emev2_add_standard_devices(void); extern void emev2_clock_init(void); --- 0003/arch/arm/mach-shmobile/setup-emev2.c +++ work/arch/arm/mach-shmobile/setup-emev2.c 2013-07-02 15:01:17.000000000 +0900 @@ -202,20 +202,6 @@ void __init emev2_init_delay(void) shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */ } -void __init emev2_init_irq(void) -{ - void __iomem *gic_dist_base; - void __iomem *gic_cpu_base; - - /* Static mappings, never released */ - gic_dist_base = ioremap(0xe0028000, PAGE_SIZE); - gic_cpu_base = ioremap(0xe0020000, PAGE_SIZE); - BUG_ON(!gic_dist_base || !gic_cpu_base); - - /* Use GIC to handle interrupts */ - gic_init(0, 29, gic_dist_base, gic_cpu_base); -} - #ifdef CONFIG_USE_OF static const struct of_dev_auxdata emev2_auxdata_lookup[] __initconst = { { } @@ -235,7 +221,6 @@ static const char *emev2_boards_compat_d DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") .smp = smp_ops(emev2_smp_ops), .init_early = emev2_init_delay, - .nr_irqs = NR_IRQS_LEGACY, .init_machine = emev2_add_standard_devices_dt, .dt_compat = emev2_boards_compat_dt, MACHINE_END ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 06/08] ARM: shmobile: Use DT for SMP on EMEV2 and KZM9D 2013-07-02 9:27 [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Magnus Damm ` (4 preceding siblings ...) 2013-07-02 9:28 ` [PATCH 05/08] ARM: shmobile: Use DT for GIC on EMEV2 and KZM9D Magnus Damm @ 2013-07-02 9:28 ` Magnus Damm 2013-07-02 9:28 ` [PATCH 07/08] ARM: shmobile: EMEV2 map_io update Magnus Damm ` (3 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: Magnus Damm @ 2013-07-02 9:28 UTC (permalink / raw) To: linux-arm-kernel From: Magnus Damm <damm@opensource.se> Rework the EMEV2 SMP code to rely on DT for CPU information instead of reading out number of CPU cores from the SCU. Signed-off-by: Magnus Damm <damm@opensource.se> --- arch/arm/mach-shmobile/smp-emev2.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) --- 0001/arch/arm/mach-shmobile/smp-emev2.c +++ work/arch/arm/mach-shmobile/smp-emev2.c 2013-07-02 15:09:53.000000000 +0900 @@ -38,9 +38,12 @@ static int __cpuinit emev2_boot_secondar static void __init emev2_smp_prepare_cpus(unsigned int max_cpus) { + /* setup EMEV2 specific SCU base, enable */ + shmobile_scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE); scu_enable(shmobile_scu_base); /* Tell ROM loader about our vector (in headsmp-scu.S, headsmp.S) */ + emev2_clock_init(); /* need ioremapped SMU */ emev2_set_boot_vector(__pa(shmobile_boot_vector)); shmobile_boot_fn = virt_to_phys(shmobile_boot_scu); shmobile_boot_arg = (unsigned long)shmobile_scu_base; @@ -49,21 +52,7 @@ static void __init emev2_smp_prepare_cpu scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL); } -static void __init emev2_smp_init_cpus(void) -{ - unsigned int ncores; - - /* setup EMEV2 specific SCU base */ - shmobile_scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE); - emev2_clock_init(); /* need ioremapped SMU */ - - ncores = shmobile_scu_base ? scu_get_core_count(shmobile_scu_base) : 1; - - shmobile_smp_init_cpus(ncores); -} - struct smp_operations emev2_smp_ops __initdata = { - .smp_init_cpus = emev2_smp_init_cpus, .smp_prepare_cpus = emev2_smp_prepare_cpus, .smp_boot_secondary = emev2_boot_secondary, }; ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 07/08] ARM: shmobile: EMEV2 map_io update 2013-07-02 9:27 [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Magnus Damm ` (5 preceding siblings ...) 2013-07-02 9:28 ` [PATCH 06/08] ARM: shmobile: Use DT for SMP " Magnus Damm @ 2013-07-02 9:28 ` Magnus Damm 2013-07-02 9:28 ` [PATCH 08/08] ARM: shmobile: Disconnect EMEV2 SMP code from clocks Magnus Damm ` (2 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: Magnus Damm @ 2013-07-02 9:28 UTC (permalink / raw) To: linux-arm-kernel From: Magnus Damm <damm@opensource.se> Update the EMEV2 struct map_desc to exclude the SMU and also include the ->map_io() callback in the DT version of EMEV2 board support. The EMEV2 SMP code can these days perform ioremap() early on without the SMU information in the io_desc[]. To correctly support SMP in case of DT-only board support then the ->map_io() callback is needed. Signed-off-by: Magnus Damm <damm@opensource.se> --- arch/arm/mach-shmobile/setup-emev2.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) --- 0004/arch/arm/mach-shmobile/setup-emev2.c +++ work/arch/arm/mach-shmobile/setup-emev2.c 2013-07-02 15:22:37.000000000 +0900 @@ -38,13 +38,6 @@ static struct map_desc emev2_io_desc[] __initdata = { #ifdef CONFIG_SMP - /* 128K entity map for 0xe0100000 (SMU) */ - { - .virtual = 0xe0100000, - .pfn = __phys_to_pfn(0xe0100000), - .length = SZ_128K, - .type = MT_DEVICE - }, /* 2M mapping for SCU + L2 controller */ { .virtual = 0xf0000000, @@ -220,6 +213,7 @@ static const char *emev2_boards_compat_d DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") .smp = smp_ops(emev2_smp_ops), + .map_io = emev2_map_io, .init_early = emev2_init_delay, .init_machine = emev2_add_standard_devices_dt, .dt_compat = emev2_boards_compat_dt, ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 08/08] ARM: shmobile: Disconnect EMEV2 SMP code from clocks 2013-07-02 9:27 [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Magnus Damm ` (6 preceding siblings ...) 2013-07-02 9:28 ` [PATCH 07/08] ARM: shmobile: EMEV2 map_io update Magnus Damm @ 2013-07-02 9:28 ` Magnus Damm 2013-07-03 12:29 ` [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Arnd Bergmann 2013-07-04 1:23 ` Simon Horman 9 siblings, 0 replies; 11+ messages in thread From: Magnus Damm @ 2013-07-02 9:28 UTC (permalink / raw) To: linux-arm-kernel From: Magnus Damm <damm@opensource.se> Update the EMEV2 SMP code to access the SMU directly instead of relying on help from the legacy clock code. This change moves us one step closer to common clocks. Signed-off-by: Magnus Damm <damm@opensource.se> --- arch/arm/mach-shmobile/clock-emev2.c | 18 ------------------ arch/arm/mach-shmobile/include/mach/emev2.h | 1 - arch/arm/mach-shmobile/smp-emev2.c | 11 +++++++++-- 3 files changed, 9 insertions(+), 21 deletions(-) --- 0001/arch/arm/mach-shmobile/clock-emev2.c +++ work/arch/arm/mach-shmobile/clock-emev2.c 2013-07-02 15:31:52.000000000 +0900 @@ -40,7 +40,6 @@ #define USIB2SCLKDIV 0x65c #define USIB3SCLKDIV 0x660 #define STI_CLKSEL 0x688 -#define SMU_GENERAL_REG0 0x7c0 /* not pretty, but hey */ static void __iomem *smu_base; @@ -51,11 +50,6 @@ static void emev2_smu_write(unsigned lon iowrite32(value, smu_base + offs); } -void emev2_set_boot_vector(unsigned long value) -{ - emev2_smu_write(value, SMU_GENERAL_REG0); -} - static struct clk_mapping smu_mapping = { .phys = EMEV2_SMU_BASE, .len = PAGE_SIZE, @@ -205,18 +199,6 @@ static struct clk_lookup lookups[] = { void __init emev2_clock_init(void) { int k, ret = 0; - static int is_setup; - - /* yuck, this is ugly as hell, but the non-smp case of clocks - * code is now designed to rely on ioremap() instead of static - * entity maps. in the case of smp we need access to the SMU - * register earlier than ioremap() is actually working without - * any static maps. to enable SMP in ugly but with dynamic - * mappings we have to call emev2_clock_init() from different - * places depending on UP and SMP... - */ - if (is_setup++) - return; smu_base = ioremap(EMEV2_SMU_BASE, PAGE_SIZE); BUG_ON(!smu_base); --- 0004/arch/arm/mach-shmobile/include/mach/emev2.h +++ work/arch/arm/mach-shmobile/include/mach/emev2.h 2013-07-02 15:32:05.000000000 +0900 @@ -5,7 +5,6 @@ extern void emev2_map_io(void); extern void emev2_init_delay(void); extern void emev2_add_standard_devices(void); extern void emev2_clock_init(void); -extern void emev2_set_boot_vector(unsigned long value); #define EMEV2_GPIO_BASE 200 #define EMEV2_GPIO_IRQ(n) (EMEV2_GPIO_BASE + (n)) --- 0005/arch/arm/mach-shmobile/smp-emev2.c +++ work/arch/arm/mach-shmobile/smp-emev2.c 2013-07-02 15:31:01.000000000 +0900 @@ -29,6 +29,8 @@ #include <asm/smp_scu.h> #define EMEV2_SCU_BASE 0x1e000000 +#define EMEV2_SMU_BASE 0xe0110000 +#define SMU_GENERAL_REG0 0x7c0 static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *idle) { @@ -38,13 +40,18 @@ static int __cpuinit emev2_boot_secondar static void __init emev2_smp_prepare_cpus(unsigned int max_cpus) { + void __iomem *smu; + /* setup EMEV2 specific SCU base, enable */ shmobile_scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE); scu_enable(shmobile_scu_base); /* Tell ROM loader about our vector (in headsmp-scu.S, headsmp.S) */ - emev2_clock_init(); /* need ioremapped SMU */ - emev2_set_boot_vector(__pa(shmobile_boot_vector)); + smu = ioremap(EMEV2_SMU_BASE, PAGE_SIZE); + if (smu) { + iowrite32(__pa(shmobile_boot_vector), smu + SMU_GENERAL_REG0); + iounmap(smu); + } shmobile_boot_fn = virt_to_phys(shmobile_boot_scu); shmobile_boot_arg = (unsigned long)shmobile_scu_base; ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update 2013-07-02 9:27 [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Magnus Damm ` (7 preceding siblings ...) 2013-07-02 9:28 ` [PATCH 08/08] ARM: shmobile: Disconnect EMEV2 SMP code from clocks Magnus Damm @ 2013-07-03 12:29 ` Arnd Bergmann 2013-07-04 1:23 ` Simon Horman 9 siblings, 0 replies; 11+ messages in thread From: Arnd Bergmann @ 2013-07-03 12:29 UTC (permalink / raw) To: linux-arm-kernel On Tuesday 02 July 2013, Magnus Damm wrote: > ARM: shmobile: EMEV2 and KZM9D update > > [PATCH 01/08] ARM: shmobile: Remove unused EMEV2/KZM9D early console > [PATCH 02/08] ARM: shmobile: Update KZM9D dts command line > [PATCH 03/08] ARM: shmobile: Make EMEV2 platform devices more compact > [PATCH 04/08] ARM: shmobile: Add GIO to EMEV2 dtsi > [PATCH 05/08] ARM: shmobile: Use DT for GIC on EMEV2 and KZM9D > [PATCH 06/08] ARM: shmobile: Use DT for SMP on EMEV2 and KZM9D > [PATCH 07/08] ARM: shmobile: EMEV2 map_io update > [PATCH 08/08] ARM: shmobile: Disconnect EMEV2 SMP code from clocks > > Several minor updates for the EMEV2 SoC and the KZM9D board: > - Get rid of early console - the 8250-em driver does not support it > - Update command line in DTS and remove old cruft > - Make the EMEV2 platform devices more compact > - Add GIO device nodes to the EMEV2 dtsi > - Use DT for GIC and SMP for both regular KZM9D board code and DT > - Reduce the size of the EMEV2 map_io - SCU is still however needed > - Allow EMEV2 SMP to operate without legacy clock bits Looks all good to me, Acked-by: Arnd Bergmann <arnd@arndb.de> ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update 2013-07-02 9:27 [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Magnus Damm ` (8 preceding siblings ...) 2013-07-03 12:29 ` [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Arnd Bergmann @ 2013-07-04 1:23 ` Simon Horman 9 siblings, 0 replies; 11+ messages in thread From: Simon Horman @ 2013-07-04 1:23 UTC (permalink / raw) To: linux-arm-kernel On Tue, Jul 02, 2013 at 06:27:25PM +0900, Magnus Damm wrote: > ARM: shmobile: EMEV2 and KZM9D update > > [PATCH 01/08] ARM: shmobile: Remove unused EMEV2/KZM9D early console > [PATCH 02/08] ARM: shmobile: Update KZM9D dts command line > [PATCH 03/08] ARM: shmobile: Make EMEV2 platform devices more compact > [PATCH 04/08] ARM: shmobile: Add GIO to EMEV2 dtsi > [PATCH 05/08] ARM: shmobile: Use DT for GIC on EMEV2 and KZM9D > [PATCH 06/08] ARM: shmobile: Use DT for SMP on EMEV2 and KZM9D > [PATCH 07/08] ARM: shmobile: EMEV2 map_io update > [PATCH 08/08] ARM: shmobile: Disconnect EMEV2 SMP code from clocks > > Several minor updates for the EMEV2 SoC and the KZM9D board: > - Get rid of early console - the 8250-em driver does not support it > - Update command line in DTS and remove old cruft > - Make the EMEV2 platform devices more compact > - Add GIO device nodes to the EMEV2 dtsi > - Use DT for GIC and SMP for both regular KZM9D board code and DT > - Reduce the size of the EMEV2 map_io - SCU is still however needed > - Allow EMEV2 SMP to operate without legacy clock bits > > Signed-off-by: Magnus Damm <damm@opensource.se> Thanks, I have queued up all these patches for v3.12. ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-07-04 1:23 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-07-02 9:27 [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Magnus Damm 2013-07-02 9:27 ` [PATCH 01/08] ARM: shmobile: Remove unused EMEV2/KZM9D early console Magnus Damm 2013-07-02 9:27 ` [PATCH 02/08] ARM: shmobile: Update KZM9D dts command line Magnus Damm 2013-07-02 9:27 ` [PATCH 03/08] ARM: shmobile: Make EMEV2 platform devices more compact Magnus Damm 2013-07-02 9:27 ` [PATCH 04/08] ARM: shmobile: Add GIO to EMEV2 dtsi Magnus Damm 2013-07-02 9:28 ` [PATCH 05/08] ARM: shmobile: Use DT for GIC on EMEV2 and KZM9D Magnus Damm 2013-07-02 9:28 ` [PATCH 06/08] ARM: shmobile: Use DT for SMP " Magnus Damm 2013-07-02 9:28 ` [PATCH 07/08] ARM: shmobile: EMEV2 map_io update Magnus Damm 2013-07-02 9:28 ` [PATCH 08/08] ARM: shmobile: Disconnect EMEV2 SMP code from clocks Magnus Damm 2013-07-03 12:29 ` [PATCH 00/08] ARM: shmobile: EMEV2 and KZM9D update Arnd Bergmann 2013-07-04 1:23 ` Simon Horman
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).