From 11e031308ba660b31ffaf31f0295a2c1c358b574 Mon Sep 17 00:00:00 2001 From: Soren Brinkmann Date: Thu, 31 Oct 2013 10:37:09 -0700 Subject: arm: zynq: platsmp: Remove CPU presence check The generic code already checks that the CPU being requested is legal if the cpu possible/present masks are set correctly. Cc: Russell King Signed-off-by: Soren Brinkmann Signed-off-by: Michal Simek --- arch/arm/mach-zynq/platsmp.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'arch/arm/mach-zynq') diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c index 689fbbc3d9c8..03a62d5df8f4 100644 --- a/arch/arm/mach-zynq/platsmp.c +++ b/arch/arm/mach-zynq/platsmp.c @@ -39,11 +39,6 @@ int zynq_cpun_start(u32 address, int cpu) u32 trampoline_code_size = &zynq_secondary_trampoline_end - &zynq_secondary_trampoline; - if (cpu > ncores) { - pr_warn("CPU No. is not available in the system\n"); - return -1; - } - /* MS: Expectation that SLCR are directly map and accessible */ /* Not possible to jump to non aligned address */ if (!(address & 3) && (!address || (address >= trampoline_code_size))) { -- cgit v1.2.3 From 6a37ff388a0b5f39062b883ae2a0f5c742c2492b Mon Sep 17 00:00:00 2001 From: Soren Brinkmann Date: Thu, 31 Oct 2013 09:10:15 -0700 Subject: arm: zynq: Invalidate L1 in secondary boot During boot, Linux initiates a clean-invalidate operation only, resulting in faulty data to be written to the memory system during resume. Therefore invalidate the L1 in the secondary boot path to avoid these issues. Signed-off-by: Soren Brinkmann Signed-off-by: Michal Simek --- arch/arm/mach-zynq/common.h | 2 ++ arch/arm/mach-zynq/headsmp.S | 6 +++++- arch/arm/mach-zynq/platsmp.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-zynq') diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h index 3040d219570f..c22c92cea8cb 100644 --- a/arch/arm/mach-zynq/common.h +++ b/arch/arm/mach-zynq/common.h @@ -17,6 +17,8 @@ #ifndef __MACH_ZYNQ_COMMON_H__ #define __MACH_ZYNQ_COMMON_H__ +void zynq_secondary_startup(void); + extern int zynq_slcr_init(void); extern void zynq_slcr_system_reset(void); extern void zynq_slcr_cpu_stop(int cpu); diff --git a/arch/arm/mach-zynq/headsmp.S b/arch/arm/mach-zynq/headsmp.S index d4cd5f34fe5c..57a32869f0aa 100644 --- a/arch/arm/mach-zynq/headsmp.S +++ b/arch/arm/mach-zynq/headsmp.S @@ -18,5 +18,9 @@ zynq_secondary_trampoline_jump: .word /* cpu 1 */ .globl zynq_secondary_trampoline_end zynq_secondary_trampoline_end: - ENDPROC(zynq_secondary_trampoline) + +ENTRY(zynq_secondary_startup) + bl v7_invalidate_l1 + b secondary_startup +ENDPROC(zynq_secondary_startup) diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c index 03a62d5df8f4..f6e62c4a0afc 100644 --- a/arch/arm/mach-zynq/platsmp.c +++ b/arch/arm/mach-zynq/platsmp.c @@ -90,7 +90,7 @@ EXPORT_SYMBOL(zynq_cpun_start); static int zynq_boot_secondary(unsigned int cpu, struct task_struct *idle) { - return zynq_cpun_start(virt_to_phys(secondary_startup), cpu); + return zynq_cpun_start(virt_to_phys(zynq_secondary_startup), cpu); } /* -- cgit v1.2.3 From f1fd2fa62da103ccac5a076457d8dca1b940ba43 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 31 Oct 2013 09:10:16 -0700 Subject: arm: zynq: Add support for zynq_cpu_kill function Use simple hook to slcr to stop cpu. Signed-off-by: Michal Simek --- arch/arm/mach-zynq/platsmp.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'arch/arm/mach-zynq') diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c index f6e62c4a0afc..8021499e7b70 100644 --- a/arch/arm/mach-zynq/platsmp.c +++ b/arch/arm/mach-zynq/platsmp.c @@ -121,11 +121,20 @@ static void __init zynq_smp_prepare_cpus(unsigned int max_cpus) scu_enable(zynq_scu_base); } +#ifdef CONFIG_HOTPLUG_CPU +static int zynq_cpu_kill(unsigned cpu) +{ + zynq_slcr_cpu_stop(cpu); + return 1; +} +#endif + struct smp_operations zynq_smp_ops __initdata = { .smp_init_cpus = zynq_smp_init_cpus, .smp_prepare_cpus = zynq_smp_prepare_cpus, .smp_boot_secondary = zynq_boot_secondary, #ifdef CONFIG_HOTPLUG_CPU .cpu_die = zynq_platform_cpu_die, + .cpu_kill = zynq_cpu_kill, #endif }; -- cgit v1.2.3 From f4d5d7b7c60c0258f7556f5cfddec2934666aa77 Mon Sep 17 00:00:00 2001 From: Soren Brinkmann Date: Thu, 31 Oct 2013 09:10:17 -0700 Subject: arm: zynq: Use of_platform_populate instead of bus_probe All new boards should be using this function instead of of_platform_bus_probe. Two side effects: 1. Possible to probe node which are not in the bus 2. Remove bus_id table from platform code Signed-off-by: Soren Brinkmann Signed-off-by: Michal Simek --- arch/arm/mach-zynq/common.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'arch/arm/mach-zynq') diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 9a7bd137c8fd..b7b39294c225 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -39,11 +39,6 @@ void __iomem *zynq_scu_base; -static struct of_device_id zynq_of_bus_ids[] __initdata = { - { .compatible = "simple-bus", }, - {} -}; - static struct platform_device zynq_cpuidle_device = { .name = "cpuidle-zynq", }; @@ -59,7 +54,7 @@ static void __init zynq_init_machine(void) */ l2x0_of_init(0x02060000, 0xF0F0FFFF); - of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); platform_device_register(&zynq_cpuidle_device); } -- cgit v1.2.3 From 9f4f5d26c66153bc63ea60f4f05dd6f19e9e7b48 Mon Sep 17 00:00:00 2001 From: Soren Brinkmann Date: Thu, 31 Oct 2013 09:10:18 -0700 Subject: arm: zynq: Set proper GIC flags Zynq is able to wake up on any IRQ, so flag it with IRQCHIP_SKIP_SET_WAKE, and we want to mask off the IRQs when going to suspend to avoid transient effects so also flag this with IRQCHIP_MASK_ON_SUSPEND. This is essentially, making the same changes as commit 'ARM: ux500: set proper GIC flags' (sha1: 7e1f97ea8ffa66679252520dbbbd6ec413ecae68) for Zynq. Signed-off-by: Soren Brinkmann Signed-off-by: Michal Simek --- arch/arm/mach-zynq/common.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'arch/arm/mach-zynq') diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index b7b39294c225..1db2a5ca9ab8 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include @@ -92,6 +94,12 @@ static void __init zynq_map_io(void) zynq_scu_map_io(); } +static void __init zynq_irq_init(void) +{ + gic_arch_extn.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND; + irqchip_init(); +} + static void zynq_system_reset(enum reboot_mode mode, const char *cmd) { zynq_slcr_system_reset(); @@ -105,6 +113,7 @@ static const char * const zynq_dt_match[] = { DT_MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform") .smp = smp_ops(zynq_smp_ops), .map_io = zynq_map_io, + .init_irq = zynq_irq_init, .init_machine = zynq_init_machine, .init_time = zynq_timer_init, .dt_compat = zynq_dt_match, -- cgit v1.2.3 From 2605f85275a7d5ccc5a59b05eed139656ad4e8a2 Mon Sep 17 00:00:00 2001 From: Sudeep KarkadaNagesha Date: Tue, 23 Jul 2013 12:32:44 +0100 Subject: ARM: zynq: remove unnecessary setting of cpu_present_mask This patch also removes setting cpu_present_mask as platforms should only re-initialize it in smp_prepare_cpus() if present != possible. Cc: Michal Simek Signed-off-by: Sudeep KarkadaNagesha Signed-off-by: Michal Simek --- arch/arm/mach-zynq/platsmp.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'arch/arm/mach-zynq') diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c index 8021499e7b70..abc82ef085c1 100644 --- a/arch/arm/mach-zynq/platsmp.c +++ b/arch/arm/mach-zynq/platsmp.c @@ -109,15 +109,6 @@ static void __init zynq_smp_init_cpus(void) static void __init zynq_smp_prepare_cpus(unsigned int max_cpus) { - int i; - - /* - * Initialise the present map, which describes the set of CPUs - * actually populated at the present time. - */ - for (i = 0; i < max_cpus; i++) - set_cpu_present(i, true); - scu_enable(zynq_scu_base); } -- cgit v1.2.3