[linux-yocto] [PATCH 3/3] arch/arm/mach-axxia : Make AXXIA_NCR_RESET_CHECK a Kconfig Option

Cristian Bercaru cristian.bercaru at windriver.com
Thu Nov 19 05:30:55 PST 2015


From: Gary McGee <gary.mcgee at intel.com>

Previously, this was defined in a header file. As a config option,
it can be referenced in the NCR driver in drivers/misc.
Files referencing the define were updated.

Signed-off-by: Gary McGee <gary.mcgee at intel.com>
---
 arch/arm/mach-axxia/Kconfig         |    7 +++++++
 arch/arm/mach-axxia/axxia.c         |    4 ++--
 arch/arm/mach-axxia/axxia.h         |    9 ---------
 arch/arm/mach-axxia/ddr_retention.c |    3 +++
 drivers/misc/lsi-ncr.c              |    2 +-
 include/linux/lsi-ncr.h             |   13 ++++++++++++-
 6 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-axxia/Kconfig b/arch/arm/mach-axxia/Kconfig
index 4a4922f..3f23fbb 100644
--- a/arch/arm/mach-axxia/Kconfig
+++ b/arch/arm/mach-axxia/Kconfig
@@ -28,4 +28,11 @@ config ARCH_AXXIA_DT
 	  If your bootloader supports Flattened Device Tree based booting,
 	  say Y here.
 
+config ARCH_AXXIA_NCR_RESET_CHECK
+    bool "Axxia NCR driver reset checking"
+    help
+      Enabling this option will allow the Axxia NCA Config Ring driver to
+      coordinate with the RTE ncp driver to detect when NCA hardware is
+      being held in reset.
+
 endmenu
diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c
index 1df6353..ee3b0cd 100644
--- a/arch/arm/mach-axxia/axxia.c
+++ b/arch/arm/mach-axxia/axxia.c
@@ -64,7 +64,7 @@ static const char *axxia_dt_match[] __initconst = {
 static void __iomem *base;
 void __iomem *dickens;
 
-#ifdef AXXIA_NCR_RESET_CHECK
+#ifdef CONFIG_ARCH_AXXIA_NCR_RESET_CHECK
 int ncr_reset_active;
 EXPORT_SYMBOL(ncr_reset_active);
 #endif
@@ -210,7 +210,7 @@ void __init axxia_dt_init(void)
 		flush_l3();
 	}
 
-#ifdef AXXIA_NCR_RESET_CHECK
+#ifdef CONFIG_ARCH_AXXIA_NCR_RESET_CHECK
 	ncr_reset_active = 0;
 #endif
 
diff --git a/arch/arm/mach-axxia/axxia.h b/arch/arm/mach-axxia/axxia.h
index 5b83378..c3a9084 100644
--- a/arch/arm/mach-axxia/axxia.h
+++ b/arch/arm/mach-axxia/axxia.h
@@ -11,15 +11,6 @@ extern void axxia_secondary_startup(void);
 
 extern struct smp_operations axxia_smp_ops;
 
-/*
- * when defined, the RTE driver module will set/clear
- * the ncr_reset_active flag to indicate when Axxia device
- * reset is in progress. This flag will be checked by the
- * kernel lsi-ncr driver and ddr_retention code.
- */
-#define AXXIA_NCR_RESET_CHECK
-extern int ncr_reset_active;
-
 extern void __iomem *syscon;
 extern void __iomem *dickens;
 
diff --git a/arch/arm/mach-axxia/ddr_retention.c b/arch/arm/mach-axxia/ddr_retention.c
index 1bf3e8f..243deb1 100644
--- a/arch/arm/mach-axxia/ddr_retention.c
+++ b/arch/arm/mach-axxia/ddr_retention.c
@@ -197,8 +197,11 @@ retention_reset_prepare(void)
 	 * If the axxia device is in reset then DDR retention is not
 	 * possible. Just do an emergency_restart instead.
 	 */
+
+#ifdef CONFIG_ARCH_AXXIA_NCR_RESET_CHECK
 	if (ncr_reset_active)
 		emergency_restart();
+#endif	/* CONFIG_ARCH_AXXIA_NCR_RESET_CHECK */
 
 	preempt_disable();
 
diff --git a/drivers/misc/lsi-ncr.c b/drivers/misc/lsi-ncr.c
index a00fc6c..723e2ef 100644
--- a/drivers/misc/lsi-ncr.c
+++ b/drivers/misc/lsi-ncr.c
@@ -72,7 +72,7 @@ EXPORT_SYMBOL(nca_access_lock);
 
 static unsigned long ncr_spin_flags;
 
-#ifdef AXXIA_NCR_RESET_CHECK
+#ifdef CONFIG_ARCH_AXXIA_NCR_RESET_CHECK
 /*
  * define behavior if NCA register read/write is called while
  * the axxia device is being reset. Any attempt to access NCA
diff --git a/include/linux/lsi-ncr.h b/include/linux/lsi-ncr.h
index db54f6b..c06de4a 100644
--- a/include/linux/lsi-ncr.h
+++ b/include/linux/lsi-ncr.h
@@ -23,7 +23,7 @@
 
 #ifndef NCP_REGION_ID
 #define NCP_REGION_ID(node, target) \
-(unsigned long) ((((node) & 0xffff) << 16) | ((target) & 0xffff))
+((unsigned long) ((((node) & 0xffff) << 16) | ((target) & 0xffff)))
 #endif
 
 #ifndef NCP_NODE_ID
@@ -41,4 +41,15 @@ int ncr_write(unsigned long, unsigned long, int, void *);
 int ncr_read_nolock(unsigned long, unsigned long, int, void *);
 int ncr_write_nolock(unsigned long, unsigned long, int, void *);
 
+
+ /*
+  * when defined, the RTE driver module will set/clear
+  * the ncr_reset_active flag to indicate when Axxia device
+  * reset is in progress. This flag will be checked by the
+  * kernel lsi-ncr driver and ddr_retention code.
+  */
+#ifdef CONFIG_ARCH_AXXIA_NCR_RESET_CHECK
+extern int ncr_reset_active;
+#endif
+
 #endif /*  __DRIVERS_LSI_ACP_NCR_H */
-- 
1.7.9.5



More information about the linux-yocto mailing list