Skip to content

Commit f64915b

Browse files
committed
ARC: mm: No need to save cache version in @cpuinfo
Historical MMU revisions have been paired with Cache revision updates which are captured in MMU and Cache Build Configuration Registers respectively. This was used in boot code to check for configurations mismatches, speically in simulations (such as running with non existent caches, non pairing MMU and Cache version etc). This can instead be inferred from other cache params such as line size. So remove @ver from post processed @cpuinfo which could be used later to save soem other interesting info. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
1 parent 983eeba commit f64915b

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

arch/arc/include/asm/arcregs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ struct cpuinfo_arc_mmu {
244244
};
245245

246246
struct cpuinfo_arc_cache {
247-
unsigned int sz_k:14, line_len:8, assoc:4, ver:4, alias:1, vipt:1;
247+
unsigned int sz_k:14, line_len:8, assoc:4, alias:1, vipt:1, pad:4;
248248
};
249249

250250
struct cpuinfo_arc_bpu {

arch/arc/mm/cache.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ char *arc_cache_mumbojumbo(int c, char *buf, int len)
4040
struct cpuinfo_arc_cache *p;
4141

4242
#define PR_CACHE(p, cfg, str) \
43-
if (!(p)->ver) \
43+
if (!(p)->line_len) \
4444
n += scnprintf(buf + n, len - n, str"\t\t: N/A\n"); \
4545
else \
4646
n += scnprintf(buf + n, len - n, \
@@ -54,7 +54,7 @@ char *arc_cache_mumbojumbo(int c, char *buf, int len)
5454
PR_CACHE(&cpuinfo_arc700[c].dcache, CONFIG_ARC_HAS_DCACHE, "D-Cache");
5555

5656
p = &cpuinfo_arc700[c].slc;
57-
if (p->ver)
57+
if (p->line_len)
5858
n += scnprintf(buf + n, len - n,
5959
"SLC\t\t: %uK, %uB Line%s\n",
6060
p->sz_k, p->line_len, IS_USED_RUN(slc_enable));
@@ -104,7 +104,6 @@ static void read_decode_cache_bcr_arcv2(int cpu)
104104
READ_BCR(ARC_REG_SLC_BCR, sbcr);
105105
if (sbcr.ver) {
106106
READ_BCR(ARC_REG_SLC_CFG, slc_cfg);
107-
p_slc->ver = sbcr.ver;
108107
p_slc->sz_k = 128 << slc_cfg.sz;
109108
l2_line_sz = p_slc->line_len = (slc_cfg.lsz == 0) ? 128 : 64;
110109
}
@@ -152,7 +151,6 @@ void read_decode_cache_bcr(void)
152151

153152
p_ic->line_len = 8 << ibcr.line_len;
154153
p_ic->sz_k = 1 << (ibcr.sz - 1);
155-
p_ic->ver = ibcr.ver;
156154
p_ic->vipt = 1;
157155
p_ic->alias = p_ic->sz_k/p_ic->assoc/TO_KB(PAGE_SIZE) > 1;
158156

@@ -176,7 +174,6 @@ void read_decode_cache_bcr(void)
176174

177175
p_dc->line_len = 16 << dbcr.line_len;
178176
p_dc->sz_k = 1 << (dbcr.sz - 1);
179-
p_dc->ver = dbcr.ver;
180177

181178
slc_chk:
182179
if (is_isa_arcv2())
@@ -945,17 +942,13 @@ void arc_cache_init(void)
945942
if (IS_ENABLED(CONFIG_ARC_HAS_ICACHE)) {
946943
struct cpuinfo_arc_cache *ic = &cpuinfo_arc700[cpu].icache;
947944

948-
if (!ic->ver)
945+
if (!ic->line_len)
949946
panic("cache support enabled but non-existent cache\n");
950947

951948
if (ic->line_len != L1_CACHE_BYTES)
952949
panic("ICache line [%d] != kernel Config [%d]",
953950
ic->line_len, L1_CACHE_BYTES);
954951

955-
if (ic->ver != CONFIG_ARC_MMU_VER)
956-
panic("Cache ver [%d] doesn't match MMU ver [%d]\n",
957-
ic->ver, CONFIG_ARC_MMU_VER);
958-
959952
/*
960953
* In MMU v4 (HS38x) the aliasing icache config uses IVIL/PTAG
961954
* pair to provide vaddr/paddr respectively, just as in MMU v3
@@ -969,7 +962,7 @@ void arc_cache_init(void)
969962
if (IS_ENABLED(CONFIG_ARC_HAS_DCACHE)) {
970963
struct cpuinfo_arc_cache *dc = &cpuinfo_arc700[cpu].dcache;
971964

972-
if (!dc->ver)
965+
if (!dc->line_len)
973966
panic("cache support enabled but non-existent cache\n");
974967

975968
if (dc->line_len != L1_CACHE_BYTES)

0 commit comments

Comments
 (0)