ARC: Use kconfig helper IS_ENABLED() to get rid of defines.h
authorVineet Gupta <vgupta@synopsys.com>
Sat, 1 Jun 2013 07:25:42 +0000 (12:55 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Sat, 22 Jun 2013 08:16:42 +0000 (13:46 +0530)
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/Makefile
arch/arc/include/asm/cache.h
arch/arc/include/asm/defines.h [deleted file]
arch/arc/include/asm/mmu.h
arch/arc/include/asm/tlb-mmu1.h
arch/arc/kernel/setup.c
arch/arc/mm/cache_arc700.c
arch/arc/mm/tlb.c

index 183397fd289eb5e5146883147e2466538db984df..fbc1b84e31f90eab582158e1ca0c221d646e2bb4 100644 (file)
@@ -16,13 +16,11 @@ KBUILD_DEFCONFIG := fpga_defconfig
 
 cflags-y       += -mA7 -fno-common -pipe -fno-builtin -D__linux__
 
-LINUXINCLUDE   +=  -include ${src}/arch/arc/include/asm/defines.h
-
 ifdef CONFIG_ARC_CURR_IN_REG
 # For a global register defintion, make sure it gets passed to every file
 # We had a customer reported bug where some code built in kernel was NOT using
 # any kernel headers, and missing the r25 global register
-# Can't do unconditionally (like above) because of recursive include issues
+# Can't do unconditionally because of recursive include issues
 # due to <linux/thread_info.h>
 LINUXINCLUDE   +=  -include ${src}/arch/arc/include/asm/current.h
 endif
index d5555fe4742a3f696c7c8ef72d6eae757b51469e..2fe8e41a551c1d01fcbe2f3791bb5e4b608f09bb 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef __ARC_ASM_CACHE_H
 #define __ARC_ASM_CACHE_H
 
+#include <asm/mmu.h>   /* some of cache registers depend on MMU ver */
+
 /* In case $$ not config, setup a dummy number for rest of kernel */
 #ifndef CONFIG_ARC_CACHE_LINE_SHIFT
 #define L1_CACHE_SHIFT         6
diff --git a/arch/arc/include/asm/defines.h b/arch/arc/include/asm/defines.h
deleted file mode 100644 (file)
index 6097bb4..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __ARC_ASM_DEFINES_H__
-#define __ARC_ASM_DEFINES_H__
-
-#if defined(CONFIG_ARC_MMU_V1)
-#define CONFIG_ARC_MMU_VER 1
-#elif defined(CONFIG_ARC_MMU_V2)
-#define CONFIG_ARC_MMU_VER 2
-#elif defined(CONFIG_ARC_MMU_V3)
-#define CONFIG_ARC_MMU_VER 3
-#endif
-
-#ifdef CONFIG_ARC_HAS_LLSC
-#define __CONFIG_ARC_HAS_LLSC_VAL 1
-#else
-#define __CONFIG_ARC_HAS_LLSC_VAL 0
-#endif
-
-#ifdef CONFIG_ARC_HAS_SWAPE
-#define __CONFIG_ARC_HAS_SWAPE_VAL 1
-#else
-#define __CONFIG_ARC_HAS_SWAPE_VAL 0
-#endif
-
-#ifdef CONFIG_ARC_HAS_RTSC
-#define __CONFIG_ARC_HAS_RTSC_VAL 1
-#else
-#define __CONFIG_ARC_HAS_RTSC_VAL 0
-#endif
-
-#ifdef CONFIG_ARC_MMU_SASID
-#define __CONFIG_ARC_MMU_SASID_VAL 1
-#else
-#define __CONFIG_ARC_MMU_SASID_VAL 0
-#endif
-
-#ifdef CONFIG_ARC_HAS_ICACHE
-#define __CONFIG_ARC_HAS_ICACHE        1
-#else
-#define __CONFIG_ARC_HAS_ICACHE        0
-#endif
-
-#ifdef CONFIG_ARC_HAS_DCACHE
-#define __CONFIG_ARC_HAS_DCACHE        1
-#else
-#define __CONFIG_ARC_HAS_DCACHE        0
-#endif
-
-#endif /* __ARC_ASM_DEFINES_H__ */
index 56b02320f1a928b3614f7ec6de3604b2ff9f65b4..33548f975cd2c33ced59dd2b03e6b35a0fc54990 100644 (file)
@@ -9,6 +9,14 @@
 #ifndef _ASM_ARC_MMU_H
 #define _ASM_ARC_MMU_H
 
+#if defined(CONFIG_ARC_MMU_V1)
+#define CONFIG_ARC_MMU_VER 1
+#elif defined(CONFIG_ARC_MMU_V2)
+#define CONFIG_ARC_MMU_VER 2
+#elif defined(CONFIG_ARC_MMU_V3)
+#define CONFIG_ARC_MMU_VER 3
+#endif
+
 #ifndef __ASSEMBLY__
 
 typedef struct {
index a5ff961b1efcb09ca8db2826e4ad55d5b4e86a2f..351ae6568d0aeabadc36a210eea077f06dc3b247 100644 (file)
@@ -9,10 +9,11 @@
 #ifndef __ASM_TLB_MMU_V1_H__
 #define __ASM_TLB_MMU_V1_H__
 
-#if defined(__ASSEMBLY__) && defined(CONFIG_ARC_MMU_VER == 1)
-
+#include <asm/mmu.h>
 #include <asm/tlb.h>
 
+#if defined(__ASSEMBLY__) && (CONFIG_ARC_MMU_VER == 1)
+
 .macro TLB_WRITE_HEURISTICS
 
 #define JH_HACK1
index b2b3731dd1e9c65638b69cd5402382ab2bbb275c..5b6ee41113bfd9a8d01e6e2e1c34c186d4f74d86 100644 (file)
@@ -182,7 +182,7 @@ char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len)
        FIX_PTR(cpu);
 #define IS_AVAIL1(var, str)    ((var) ? str : "")
 #define IS_AVAIL2(var, str)    ((var == 0x2) ? str : "")
-#define IS_USED(var)           ((var) ? "(in-use)" : "(not used)")
+#define IS_USED(cfg)           (IS_ENABLED(cfg) ? "(in-use)" : "(not used)")
 
        n += scnprintf(buf + n, len - n,
                       "Extn [700-Base]\t: %s %s %s %s %s %s\n",
@@ -202,9 +202,9 @@ char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len)
        if (cpu->core.family == 0x34) {
                n += scnprintf(buf + n, len - n,
                "Extn [700-4.10]\t: LLOCK/SCOND %s, SWAPE %s, RTSC %s\n",
-                              IS_USED(__CONFIG_ARC_HAS_LLSC_VAL),
-                              IS_USED(__CONFIG_ARC_HAS_SWAPE_VAL),
-                              IS_USED(__CONFIG_ARC_HAS_RTSC_VAL));
+                              IS_USED(CONFIG_ARC_HAS_LLSC),
+                              IS_USED(CONFIG_ARC_HAS_SWAPE),
+                              IS_USED(CONFIG_ARC_HAS_RTSC));
        }
 
        n += scnprintf(buf + n, len - n, "Extn [CCM]\t: %s",
index aedce1905441cffb1958f00af149b0a939740371..28007d25066e93a7d4c69b4f3b15da8168f7510d 100644 (file)
@@ -89,8 +89,10 @@ char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len)
                        enb ?  "" : "DISABLED (kernel-build)");         \
 }
 
-       PR_CACHE(&cpuinfo_arc700[c].icache, __CONFIG_ARC_HAS_ICACHE, "I-Cache");
-       PR_CACHE(&cpuinfo_arc700[c].dcache, __CONFIG_ARC_HAS_DCACHE, "D-Cache");
+       PR_CACHE(&cpuinfo_arc700[c].icache, IS_ENABLED(CONFIG_ARC_HAS_ICACHE),
+                       "I-Cache");
+       PR_CACHE(&cpuinfo_arc700[c].dcache, IS_ENABLED(CONFIG_ARC_HAS_DCACHE),
+                       "D-Cache");
 
        return buf;
 }
index fe1c5a073afe4cf996d28b6486c6b296fbd94344..1ced5f18e6b3e8e91fa97872e12e09c82b4fbb2b 100644 (file)
@@ -505,7 +505,7 @@ char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len)
                       "J-TLB %d (%dx%d), uDTLB %d, uITLB %d, %s\n",
                       p_mmu->num_tlb, p_mmu->sets, p_mmu->ways,
                       p_mmu->u_dtlb, p_mmu->u_itlb,
-                      __CONFIG_ARC_MMU_SASID_VAL ? "SASID" : "");
+                      IS_ENABLED(CONFIG_ARC_MMU_SASID) ? "SASID" : "");
 
        return buf;
 }