[PATCH v2 3/3] ARM: keystone: Enable SMP support on Keystone machines

Mark Rutland mark.rutland at arm.com
Thu Jun 13 11:49:49 EDT 2013


On Wed, Jun 12, 2013 at 10:25:17PM +0100, Santosh Shilimkar wrote:
> Add basic SMP support for Keystone machines. This does not
> include support for CPU hotplug for now.
> 
> Cc: Olof Johansson <olof at lixom.net>
> Cc: Arnd Bergmann <arnd at arndb.de>
> Cc: arm at kernel.org
> 
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar at ti.com>
> ---
>  arch/arm/mach-keystone/Kconfig    |    1 +
>  arch/arm/mach-keystone/Makefile   |    1 +
>  arch/arm/mach-keystone/keystone.c |    4 +++
>  arch/arm/mach-keystone/keystone.h |   17 ++++++++++++
>  arch/arm/mach-keystone/platsmp.c  |   52 +++++++++++++++++++++++++++++++++++++
>  5 files changed, 75 insertions(+)
>  create mode 100644 arch/arm/mach-keystone/keystone.h
>  create mode 100644 arch/arm/mach-keystone/platsmp.c
> 

[...]

> diff --git a/arch/arm/mach-keystone/platsmp.c b/arch/arm/mach-keystone/platsmp.c
> new file mode 100644
> index 0000000..630ab3b
> --- /dev/null
> +++ b/arch/arm/mach-keystone/platsmp.c
> @@ -0,0 +1,52 @@
> +/*
> + * Keystone SOC SMP platform code
> + *
> + * Copyright 2013 Texas Instruments, Inc.
> + *	Cyril Chemparathy <cyril at ti.com>
> + *	Santosh Shilimkar <santosh.shillimkar at ti.com>
> + *
> + * Based on platsmp.c, Copyright (C) 2002 ARM Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +
> +#include <linux/init.h>
> +#include <linux/smp.h>
> +#include <linux/io.h>
> +
> +#include <asm/smp_plat.h>
> +#include <asm/prom.h>
> +
> +#include "keystone.h"
> +
> +static int __cpuinit keystone_smp_boot_secondary(unsigned int cpu,
> +						struct task_struct *idle)
> +{
> +	unsigned long start = virt_to_phys(&secondary_startup);
> +	int error;
> +
> +	pr_debug("keystone-smp: booting cpu %d, vector %08lx\n",
> +		 cpu, start);
> +
> +	asm volatile (
> +		"mov    r0, #0\n"	/* power on cmd	*/
> +		"mov    r1, %1\n"	/* cpu		*/
> +		"mov    r2, %2\n"	/* start	*/
> +		".inst  0xe1600070\n"	/* smc #0	*/

In arch/arm/asm/opcodes-sec.h we have an __SMC() macro you could use here
that'll use the correct opcode for arm or thumb kernels.

Thanks,
Mark.



More information about the linux-arm-kernel mailing list