Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARCv2: MMUv4: support aliasing icache config

This is also default for AXS103 release

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

+14 -4
+1 -3
arch/arc/include/asm/cache.h
··· 60 60 #define ARC_REG_IC_IVIC 0x10 61 61 #define ARC_REG_IC_CTRL 0x11 62 62 #define ARC_REG_IC_IVIL 0x19 63 - #if defined(CONFIG_ARC_MMU_V3) 63 + #if defined(CONFIG_ARC_MMU_V3) || defined(CONFIG_ARC_MMU_V4) 64 64 #define ARC_REG_IC_PTAG 0x1E 65 65 #endif 66 66 ··· 74 74 #define ARC_REG_DC_IVDL 0x4A 75 75 #define ARC_REG_DC_FLSH 0x4B 76 76 #define ARC_REG_DC_FLDL 0x4C 77 - #if defined(CONFIG_ARC_MMU_V3) 78 77 #define ARC_REG_DC_PTAG 0x5C 79 - #endif 80 78 81 79 /* Bit val in DC_CTRL */ 82 80 #define DC_CTRL_INV_MODE_FLUSH 0x40
+13 -1
arch/arc/mm/cache.c
··· 21 21 #include <asm/cachectl.h> 22 22 #include <asm/setup.h> 23 23 24 + void (*_cache_line_loop_ic_fn)(unsigned long paddr, unsigned long vaddr, 25 + unsigned long sz, const int cacheop); 26 + 24 27 char *arc_cache_mumbojumbo(int c, char *buf, int len) 25 28 { 26 29 int n = 0; ··· 417 414 unsigned long flags; 418 415 419 416 local_irq_save(flags); 420 - __cache_line_loop(paddr, vaddr, sz, OP_INV_IC); 417 + (*_cache_line_loop_ic_fn)(paddr, vaddr, sz, OP_INV_IC); 421 418 local_irq_restore(flags); 422 419 } 423 420 ··· 749 746 if (ic->ver != CONFIG_ARC_MMU_VER) 750 747 panic("Cache ver [%d] doesn't match MMU ver [%d]\n", 751 748 ic->ver, CONFIG_ARC_MMU_VER); 749 + 750 + /* 751 + * In MMU v4 (HS38x) the alising icache config uses IVIL/PTAG 752 + * pair to provide vaddr/paddr respectively, just as in MMU v3 753 + */ 754 + if (is_isa_arcv2() && ic->alias) 755 + _cache_line_loop_ic_fn = __cache_line_loop_v3; 756 + else 757 + _cache_line_loop_ic_fn = __cache_line_loop; 752 758 } 753 759 754 760 if (IS_ENABLED(CONFIG_ARC_HAS_DCACHE)) {