[linux-yocto] [PATCH 4/4] arch/arm/mach-axxia: Move Simulutaion/Emulation WFE/SEV Work-Around

Charlie Paul cpaul.windriver at gmail.com
Tue May 20 15:36:11 PDT 2014


From: John Jacques <john.jacques at lsi.com>

In some simulation and emulation environments, WFE/SEV is either not
supported or doesn't work.  The work-around is to determine, using the
device tree, when running in either of those environments and disable
wfe.  This was originally done when the architecture specific wfe
function first got called, but that can cause lockups because the work-
around reads the device tree.  It is now done in the architecture's
platsmp.c file before enabling the secondary cores.

Signed-off-by: John Jacques <john.jacques at lsi.com>
---
 arch/arm/mach-axxia/Makefile  |    1 -
 arch/arm/mach-axxia/ev.c      |   53 -----------------------------------------
 arch/arm/mach-axxia/platsmp.c |   20 ++++++++++++++++
 3 files changed, 20 insertions(+), 54 deletions(-)
 delete mode 100644 arch/arm/mach-axxia/ev.c

diff --git a/arch/arm/mach-axxia/Makefile b/arch/arm/mach-axxia/Makefile
index 8125e97..e9c78da 100644
--- a/arch/arm/mach-axxia/Makefile
+++ b/arch/arm/mach-axxia/Makefile
@@ -3,7 +3,6 @@
 #
 obj-y					+= axxia.o
 obj-y					+= clock.o
-obj-y					+= ev.o
 obj-y					+= io.o
 obj-y					+= ssp-gpio.o
 obj-y					+= ncr.o
diff --git a/arch/arm/mach-axxia/ev.c b/arch/arm/mach-axxia/ev.c
deleted file mode 100644
index f4630d1..0000000
--- a/arch/arm/mach-axxia/ev.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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);
diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c
index 0ee417e..a067de2 100644
--- a/arch/arm/mach-axxia/platsmp.c
+++ b/arch/arm/mach-axxia/platsmp.c
@@ -30,6 +30,18 @@ extern void axxia_secondary_startup(void);
 #define SYSCON_PHYS_ADDR 0x002010030000ULL
 
 static int __cpuinitdata wfe_fixup;
+static int wfe_available;
+
+inline void
+__axxia_arch_wfe(void)
+{
+	if (0 != wfe_available)
+		wfe();
+
+	return;
+}
+
+EXPORT_SYMBOL(__axxia_arch_wfe);
 
 /*
  * Check if we need to enable cross-cluster SEV workaround for a bug in
@@ -181,6 +193,14 @@ static void __init axxia_smp_prepare_cpus(unsigned int max_cpus)
 	check_fixup_sev(syscon);
 	do_fixup_sev();
 
+	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;
+
 	/*
 	 * Initialise the present map, which describes the set of CPUs actually
 	 * populated at the present time.
-- 
1.7.9.5



More information about the linux-yocto mailing list