Skip to content

Commit 72dc53a

Browse files
committed
ARM: cache: detect VIPT aliasing I-cache on ARMv6
The current cache detection code does not check for an aliasing I-cache if the D-cache is found to be VIPT aliasing. This patch fixes the problem by always checking for an aliasing I-cache on v6 and later. Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent dfc40b2 commit 72dc53a

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎arch/arm/kernel/setup.c‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -280,18 +280,19 @@ static void __init cacheid_init(void)
280280
if (arch >= CPU_ARCH_ARMv6) {
281281
if ((cachetype & (7 << 29)) == 4 << 29) {
282282
/* ARMv7 register format */
283+
arch = CPU_ARCH_ARMv7;
283284
cacheid = CACHEID_VIPT_NONALIASING;
284285
if ((cachetype & (3 << 14)) == 1 << 14)
285286
cacheid |= CACHEID_ASID_TAGGED;
286-
else if (cpu_has_aliasing_icache(CPU_ARCH_ARMv7))
287-
cacheid |= CACHEID_VIPT_I_ALIASING;
288-
} else if (cachetype & (1 << 23)) {
289-
cacheid = CACHEID_VIPT_ALIASING;
290287
} else {
291-
cacheid = CACHEID_VIPT_NONALIASING;
292-
if (cpu_has_aliasing_icache(CPU_ARCH_ARMv6))
293-
cacheid |= CACHEID_VIPT_I_ALIASING;
288+
arch = CPU_ARCH_ARMv6;
289+
if (cachetype & (1 << 23))
290+
cacheid = CACHEID_VIPT_ALIASING;
291+
else
292+
cacheid = CACHEID_VIPT_NONALIASING;
294293
}
294+
if (cpu_has_aliasing_icache(arch))
295+
cacheid |= CACHEID_VIPT_I_ALIASING;
295296
} else {
296297
cacheid = CACHEID_VIVT;
297298
}

0 commit comments

Comments
 (0)