diff options
Diffstat (limited to 'arch/arm/include/asm/cacheflush.h')
-rw-r--r-- | arch/arm/include/asm/cacheflush.h | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h index 9073d9c6567e..de6c59f814a1 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h | |||
@@ -444,94 +444,4 @@ static inline void flush_ioremap_region(unsigned long phys, void __iomem *virt, | |||
444 | dmac_inv_range(start, start + size); | 444 | dmac_inv_range(start, start + size); |
445 | } | 445 | } |
446 | 446 | ||
447 | #define __cacheid_present(val) (val != read_cpuid(CPUID_ID)) | ||
448 | #define __cacheid_type_v7(val) ((val & (7 << 29)) == (4 << 29)) | ||
449 | |||
450 | #define __cacheid_vivt_prev7(val) ((val & (15 << 25)) != (14 << 25)) | ||
451 | #define __cacheid_vipt_prev7(val) ((val & (15 << 25)) == (14 << 25)) | ||
452 | #define __cacheid_vipt_nonaliasing_prev7(val) ((val & (15 << 25 | 1 << 23)) == (14 << 25)) | ||
453 | #define __cacheid_vipt_aliasing_prev7(val) ((val & (15 << 25 | 1 << 23)) == (14 << 25 | 1 << 23)) | ||
454 | |||
455 | #define __cacheid_vivt(val) (__cacheid_type_v7(val) ? 0 : __cacheid_vivt_prev7(val)) | ||
456 | #define __cacheid_vipt(val) (__cacheid_type_v7(val) ? 1 : __cacheid_vipt_prev7(val)) | ||
457 | #define __cacheid_vipt_nonaliasing(val) (__cacheid_type_v7(val) ? 1 : __cacheid_vipt_nonaliasing_prev7(val)) | ||
458 | #define __cacheid_vipt_aliasing(val) (__cacheid_type_v7(val) ? 0 : __cacheid_vipt_aliasing_prev7(val)) | ||
459 | #define __cacheid_vivt_asid_tagged_instr(val) (__cacheid_type_v7(val) ? ((val & (3 << 14)) == (1 << 14)) : 0) | ||
460 | |||
461 | #if defined(CONFIG_CPU_CACHE_VIVT) && !defined(CONFIG_CPU_CACHE_VIPT) | ||
462 | /* | ||
463 | * VIVT caches only | ||
464 | */ | ||
465 | #define cache_is_vivt() 1 | ||
466 | #define cache_is_vipt() 0 | ||
467 | #define cache_is_vipt_nonaliasing() 0 | ||
468 | #define cache_is_vipt_aliasing() 0 | ||
469 | #define icache_is_vivt_asid_tagged() 0 | ||
470 | |||
471 | #elif !defined(CONFIG_CPU_CACHE_VIVT) && defined(CONFIG_CPU_CACHE_VIPT) | ||
472 | /* | ||
473 | * VIPT caches only | ||
474 | */ | ||
475 | #define cache_is_vivt() 0 | ||
476 | #define cache_is_vipt() 1 | ||
477 | #define cache_is_vipt_nonaliasing() \ | ||
478 | ({ \ | ||
479 | unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ | ||
480 | __cacheid_vipt_nonaliasing(__val); \ | ||
481 | }) | ||
482 | |||
483 | #define cache_is_vipt_aliasing() \ | ||
484 | ({ \ | ||
485 | unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ | ||
486 | __cacheid_vipt_aliasing(__val); \ | ||
487 | }) | ||
488 | |||
489 | #define icache_is_vivt_asid_tagged() \ | ||
490 | ({ \ | ||
491 | unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ | ||
492 | __cacheid_vivt_asid_tagged_instr(__val); \ | ||
493 | }) | ||
494 | |||
495 | #else | ||
496 | /* | ||
497 | * VIVT or VIPT caches. Note that this is unreliable since ARM926 | ||
498 | * and V6 CPUs satisfy the "(val & (15 << 25)) == (14 << 25)" test. | ||
499 | * There's no way to tell from the CacheType register what type (!) | ||
500 | * the cache is. | ||
501 | */ | ||
502 | #define cache_is_vivt() \ | ||
503 | ({ \ | ||
504 | unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ | ||
505 | (!__cacheid_present(__val)) || __cacheid_vivt(__val); \ | ||
506 | }) | ||
507 | |||
508 | #define cache_is_vipt() \ | ||
509 | ({ \ | ||
510 | unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ | ||
511 | __cacheid_present(__val) && __cacheid_vipt(__val); \ | ||
512 | }) | ||
513 | |||
514 | #define cache_is_vipt_nonaliasing() \ | ||
515 | ({ \ | ||
516 | unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ | ||
517 | __cacheid_present(__val) && \ | ||
518 | __cacheid_vipt_nonaliasing(__val); \ | ||
519 | }) | ||
520 | |||
521 | #define cache_is_vipt_aliasing() \ | ||
522 | ({ \ | ||
523 | unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ | ||
524 | __cacheid_present(__val) && \ | ||
525 | __cacheid_vipt_aliasing(__val); \ | ||
526 | }) | ||
527 | |||
528 | #define icache_is_vivt_asid_tagged() \ | ||
529 | ({ \ | ||
530 | unsigned int __val = read_cpuid(CPUID_CACHETYPE); \ | ||
531 | __cacheid_present(__val) && \ | ||
532 | __cacheid_vivt_asid_tagged_instr(__val); \ | ||
533 | }) | ||
534 | |||
535 | #endif | ||
536 | |||
537 | #endif | 447 | #endif |