From: John Jacques <john.jacq...@lsi.com> SEV/WFE are unusable in v1.0 silicon. The boot loader now sets bit 7 in the ACLTR register of each core, making wfe a nop. At present, bit 7 of the ACTLR does not work in simulation and emulaton. Until that is corrected, this work-around is necessary.
Signed-off-by: John Jacques <john.jacq...@lsi.com> --- arch/arm/include/asm/spinlock.h | 5 ++++ arch/arm/mach-axxia/Makefile | 5 ++-- arch/arm/mach-axxia/ev.c | 53 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-axxia/ev.c diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h index b07c09e..be4ae62 100644 --- a/arch/arm/include/asm/spinlock.h +++ b/arch/arm/include/asm/spinlock.h @@ -88,7 +88,12 @@ static inline void arch_spin_lock(arch_spinlock_t *lock) : "cc"); while (lockval.tickets.next != lockval.tickets.owner) { +#ifdef CONFIG_ARCH_AXXIA + extern void __axxia_arch_wfe(void); + __axxia_arch_wfe(); +#else wfe(); +#endif lockval.tickets.owner = ACCESS_ONCE(lock->tickets.owner); } diff --git a/arch/arm/mach-axxia/Makefile b/arch/arm/mach-axxia/Makefile index 62197f1..8125e97 100644 --- a/arch/arm/mach-axxia/Makefile +++ b/arch/arm/mach-axxia/Makefile @@ -3,8 +3,9 @@ # obj-y += axxia.o obj-y += clock.o -obj-y += io.o -obj-y += ssp-gpio.o +obj-y += ev.o +obj-y += io.o +obj-y += ssp-gpio.o obj-y += ncr.o obj-y += timers.o obj-y += pci.o diff --git a/arch/arm/mach-axxia/ev.c b/arch/arm/mach-axxia/ev.c new file mode 100644 index 0000000..f4630d1 --- /dev/null +++ b/arch/arm/mach-axxia/ev.c @@ -0,0 +1,53 @@ +/* + * arch/arm/mach-axxia/ev.c + * + * Support for the LSI Axxia boards based on ARM cores. + * + * Copyright (C) 2012 LSI + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <linux/module.h> +#include <linux/types.h> +#include <linux/of.h> +#include <linux/of_fdt.h> +#include <asm/page.h> +#include <asm/io.h> + +static int initialized; +static int wfe_available; + +inline void +__axxia_arch_wfe(void) +{ + if (0 == initialized) { + if (of_find_compatible_node(NULL, NULL, + "lsi,axm5516-sim") != NULL || + of_find_compatible_node(NULL, NULL, + "lsi,axm5516-emu") != NULL) + wfe_available = 0; + else + wfe_available = 1; + + initialized = 1; + } + + if (0 != wfe_available) + wfe(); + + return; +} +EXPORT_SYMBOL(__axxia_arch_wfe); -- 1.7.9.5 -- _______________________________________________ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto