diff options
author | Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> | 2018-07-26 09:15:44 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2018-07-30 12:46:19 -0400 |
commit | 386177da9e601ed176d54c04324d9ebf44c70620 (patch) | |
tree | c0cb9047afe65e8c1b4fc5156eec188927eaff79 | |
parent | eb2777397fd83a4a7eaa26984d09d3babb845d2a (diff) |
ARC: add SMP_CACHE_BYTES value validate
Check that SMP_CACHE_BYTES (and hence ARCH_DMA_MINALIGN) is larger
or equal to any cache line length by comparing it with values
previously read from ARC cache BCR registers.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r-- | arch/arc/mm/cache.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c index 9dbe645ee127..b95365e1253a 100644 --- a/arch/arc/mm/cache.c +++ b/arch/arc/mm/cache.c | |||
@@ -1246,6 +1246,16 @@ void __init arc_cache_init_master(void) | |||
1246 | } | 1246 | } |
1247 | } | 1247 | } |
1248 | 1248 | ||
1249 | /* | ||
1250 | * Check that SMP_CACHE_BYTES (and hence ARCH_DMA_MINALIGN) is larger | ||
1251 | * or equal to any cache line length. | ||
1252 | */ | ||
1253 | BUILD_BUG_ON_MSG(L1_CACHE_BYTES > SMP_CACHE_BYTES, | ||
1254 | "SMP_CACHE_BYTES must be >= any cache line length"); | ||
1255 | if (is_isa_arcv2() && (l2_line_sz > SMP_CACHE_BYTES)) | ||
1256 | panic("L2 Cache line [%d] > kernel Config [%d]\n", | ||
1257 | l2_line_sz, SMP_CACHE_BYTES); | ||
1258 | |||
1249 | /* Note that SLC disable not formally supported till HS 3.0 */ | 1259 | /* Note that SLC disable not formally supported till HS 3.0 */ |
1250 | if (is_isa_arcv2() && l2_line_sz && !slc_enable) | 1260 | if (is_isa_arcv2() && l2_line_sz && !slc_enable) |
1251 | arc_slc_disable(); | 1261 | arc_slc_disable(); |