cache.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * (C) Copyright 2009
  3. * Marvell Semiconductor <www.marvell.com>
  4. * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #ifndef _ASM_CACHE_H
  9. #define _ASM_CACHE_H
  10. #include <asm/system.h>
  11. #ifndef CONFIG_ARM64
  12. /*
  13. * Invalidate L2 Cache using co-proc instruction
  14. */
  15. #ifdef CONFIG_SYS_THUMB_BUILD
  16. void invalidate_l2_cache(void);
  17. #else
  18. static inline void invalidate_l2_cache(void)
  19. {
  20. unsigned int val=0;
  21. asm volatile("mcr p15, 1, %0, c15, c11, 0 @ invl l2 cache"
  22. : : "r" (val) : "cc");
  23. isb();
  24. }
  25. #endif
  26. int check_cache_range(unsigned long start, unsigned long stop);
  27. void l2_cache_enable(void);
  28. void l2_cache_disable(void);
  29. void set_section_dcache(int section, enum dcache_option option);
  30. void arm_init_before_mmu(void);
  31. void arm_init_domains(void);
  32. void cpu_cache_initialization(void);
  33. void dram_bank_mmu_setup(int bank);
  34. #endif
  35. /*
  36. * The value of the largest data cache relevant to DMA operations shall be set
  37. * for us in CONFIG_SYS_CACHELINE_SIZE. In some cases this may be a larger
  38. * value than found in the L1 cache but this is OK to use in terms of
  39. * alignment.
  40. */
  41. #define ARCH_DMA_MINALIGN CONFIG_SYS_CACHELINE_SIZE
  42. #endif /* _ASM_CACHE_H */