Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3695adc2 authored by Marc Zyngier's avatar Marc Zyngier Committed by Arnd Bergmann
Browse files

ARM: SoC: convert VExpress/RealView to SMP operations



Convert both Realview and VExpress to use struct smp_operations to
provide their SMP and CPU hotplug operation.

Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Acked-by: default avatarNicolas Pitre <nico@fluxnic.net>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent abcee5fb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -56,4 +56,7 @@ extern void realview_init_early(void);
extern void realview_fixup(struct tag *tags, char **from,
			   struct meminfo *meminfo);

extern struct smp_operations realview_smp_ops;
extern void realview_cpu_die(unsigned int cpu);

#endif
+1 −15
Original line number Diff line number Diff line
@@ -89,17 +89,12 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
	}
}

int platform_cpu_kill(unsigned int cpu)
{
	return 1;
}

/*
 * platform-specific code to shutdown a CPU
 *
 * Called with IRQs disabled
 */
void platform_cpu_die(unsigned int cpu)
void __ref realview_cpu_die(unsigned int cpu)
{
	int spurious = 0;

@@ -118,12 +113,3 @@ void platform_cpu_die(unsigned int cpu)
	if (spurious)
		pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
}

int platform_cpu_disable(unsigned int cpu)
{
	/*
	 * we don't allow CPU 0 to be shutdown (it is still too special
	 * e.g. clock tick interrupts)
	 */
	return cpu == 0 ? -EPERM : 0;
}
+14 −4
Original line number Diff line number Diff line
@@ -22,9 +22,9 @@
#include <mach/board-pb11mp.h>
#include <mach/board-pbx.h>

#include "core.h"
#include <plat/platsmp.h>

extern void versatile_secondary_startup(void);
#include "core.h"

static void __iomem *scu_base_addr(void)
{
@@ -43,7 +43,7 @@ static void __iomem *scu_base_addr(void)
 * Initialise the CPU possible map early - this describes the CPUs
 * which may be present or become present in the system.
 */
void __init smp_init_cpus(void)
static void __init realview_smp_init_cpus(void)
{
	void __iomem *scu_base = scu_base_addr();
	unsigned int i, ncores;
@@ -63,7 +63,7 @@ void __init smp_init_cpus(void)
	set_smp_cross_call(gic_raise_softirq);
}

void __init platform_smp_prepare_cpus(unsigned int max_cpus)
static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
{

	scu_enable(scu_base_addr());
@@ -77,3 +77,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
	__raw_writel(virt_to_phys(versatile_secondary_startup),
		     __io_address(REALVIEW_SYS_FLAGSSET));
}

struct smp_operations realview_smp_ops __initdata = {
	.smp_init_cpus		= realview_smp_init_cpus,
	.smp_prepare_cpus	= realview_smp_prepare_cpus,
	.smp_secondary_init	= versatile_secondary_init,
	.smp_boot_secondary	= versatile_boot_secondary,
#ifdef CONFIG_HOTPLUG_CPU
	.cpu_die		= realview_cpu_die,
#endif
};
+1 −0
Original line number Diff line number Diff line
@@ -366,6 +366,7 @@ static void __init realview_pb11mp_init(void)
MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
	/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
	.atag_offset	= 0x100,
	.smp		= smp_ops(realview_smp_ops),
	.fixup		= realview_fixup,
	.map_io		= realview_pb11mp_map_io,
	.init_early	= realview_init_early,
+1 −0
Original line number Diff line number Diff line
@@ -403,6 +403,7 @@ static void __init realview_pbx_init(void)
MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
	/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
	.atag_offset	= 0x100,
	.smp		= smp_ops(realview_smp_ops),
	.fixup		= realview_pbx_fixup,
	.map_io		= realview_pbx_map_io,
	.init_early	= realview_init_early,
Loading