Skip to content

Commit 8235703

Browse files
committed
ARC: Use kconfig helper IS_ENABLED() to get rid of defines.h
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
1 parent ba5afad commit 8235703

8 files changed

Lines changed: 23 additions & 68 deletions

File tree

‎arch/arc/Makefile‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ KBUILD_DEFCONFIG := fpga_defconfig
1616

1717
cflags-y += -mA7 -fno-common -pipe -fno-builtin -D__linux__
1818

19-
LINUXINCLUDE += -include ${src}/arch/arc/include/asm/defines.h
20-
2119
ifdef CONFIG_ARC_CURR_IN_REG
2220
# For a global register defintion, make sure it gets passed to every file
2321
# We had a customer reported bug where some code built in kernel was NOT using
2422
# any kernel headers, and missing the r25 global register
25-
# Can't do unconditionally (like above) because of recursive include issues
23+
# Can't do unconditionally because of recursive include issues
2624
# due to <linux/thread_info.h>
2725
LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h
2826
endif

‎arch/arc/include/asm/cache.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#ifndef __ARC_ASM_CACHE_H
1010
#define __ARC_ASM_CACHE_H
1111

12+
#include <asm/mmu.h> /* some of cache registers depend on MMU ver */
13+
1214
/* In case $$ not config, setup a dummy number for rest of kernel */
1315
#ifndef CONFIG_ARC_CACHE_LINE_SHIFT
1416
#define L1_CACHE_SHIFT 6

‎arch/arc/include/asm/defines.h‎

Lines changed: 0 additions & 56 deletions
This file was deleted.

‎arch/arc/include/asm/mmu.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
#ifndef _ASM_ARC_MMU_H
1010
#define _ASM_ARC_MMU_H
1111

12+
#if defined(CONFIG_ARC_MMU_V1)
13+
#define CONFIG_ARC_MMU_VER 1
14+
#elif defined(CONFIG_ARC_MMU_V2)
15+
#define CONFIG_ARC_MMU_VER 2
16+
#elif defined(CONFIG_ARC_MMU_V3)
17+
#define CONFIG_ARC_MMU_VER 3
18+
#endif
19+
1220
#ifndef __ASSEMBLY__
1321

1422
typedef struct {

‎arch/arc/include/asm/tlb-mmu1.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
#ifndef __ASM_TLB_MMU_V1_H__
1010
#define __ASM_TLB_MMU_V1_H__
1111

12-
#if defined(__ASSEMBLY__) && defined(CONFIG_ARC_MMU_VER == 1)
13-
12+
#include <asm/mmu.h>
1413
#include <asm/tlb.h>
1514

15+
#if defined(__ASSEMBLY__) && (CONFIG_ARC_MMU_VER == 1)
16+
1617
.macro TLB_WRITE_HEURISTICS
1718

1819
#define JH_HACK1

‎arch/arc/kernel/setup.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len)
182182
FIX_PTR(cpu);
183183
#define IS_AVAIL1(var, str) ((var) ? str : "")
184184
#define IS_AVAIL2(var, str) ((var == 0x2) ? str : "")
185-
#define IS_USED(var) ((var) ? "(in-use)" : "(not used)")
185+
#define IS_USED(cfg) (IS_ENABLED(cfg) ? "(in-use)" : "(not used)")
186186

187187
n += scnprintf(buf + n, len - n,
188188
"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)
202202
if (cpu->core.family == 0x34) {
203203
n += scnprintf(buf + n, len - n,
204204
"Extn [700-4.10]\t: LLOCK/SCOND %s, SWAPE %s, RTSC %s\n",
205-
IS_USED(__CONFIG_ARC_HAS_LLSC_VAL),
206-
IS_USED(__CONFIG_ARC_HAS_SWAPE_VAL),
207-
IS_USED(__CONFIG_ARC_HAS_RTSC_VAL));
205+
IS_USED(CONFIG_ARC_HAS_LLSC),
206+
IS_USED(CONFIG_ARC_HAS_SWAPE),
207+
IS_USED(CONFIG_ARC_HAS_RTSC));
208208
}
209209

210210
n += scnprintf(buf + n, len - n, "Extn [CCM]\t: %s",

‎arch/arc/mm/cache_arc700.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len)
8989
enb ? "" : "DISABLED (kernel-build)"); \
9090
}
9191

92-
PR_CACHE(&cpuinfo_arc700[c].icache, __CONFIG_ARC_HAS_ICACHE, "I-Cache");
93-
PR_CACHE(&cpuinfo_arc700[c].dcache, __CONFIG_ARC_HAS_DCACHE, "D-Cache");
92+
PR_CACHE(&cpuinfo_arc700[c].icache, IS_ENABLED(CONFIG_ARC_HAS_ICACHE),
93+
"I-Cache");
94+
PR_CACHE(&cpuinfo_arc700[c].dcache, IS_ENABLED(CONFIG_ARC_HAS_DCACHE),
95+
"D-Cache");
9496

9597
return buf;
9698
}

‎arch/arc/mm/tlb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len)
505505
"J-TLB %d (%dx%d), uDTLB %d, uITLB %d, %s\n",
506506
p_mmu->num_tlb, p_mmu->sets, p_mmu->ways,
507507
p_mmu->u_dtlb, p_mmu->u_itlb,
508-
__CONFIG_ARC_MMU_SASID_VAL ? "SASID" : "");
508+
IS_ENABLED(CONFIG_ARC_MMU_SASID) ? "SASID" : "");
509509

510510
return buf;
511511
}

0 commit comments

Comments
 (0)