cache.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. void l2_cache_enable(void);
  27. void l2_cache_disable(void);
  28. void set_section_dcache(int section, enum dcache_option option);
  29. void arm_init_before_mmu(void);
  30. void arm_init_domains(void);
  31. void cpu_cache_initialization(void);
  32. void dram_bank_mmu_setup(int bank);
  33. #endif
  34. /*
  35. * The current upper bound for ARM L1 data cache line sizes is 64 bytes. We
  36. * use that value for aligning DMA buffers unless the board config has specified
  37. * an alternate cache line size.
  38. */
  39. #ifdef CONFIG_SYS_CACHELINE_SIZE
  40. #define ARCH_DMA_MINALIGN CONFIG_SYS_CACHELINE_SIZE
  41. #else
  42. #define ARCH_DMA_MINALIGN 64
  43. #endif
  44. #endif /* _ASM_CACHE_H */