cache.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. static inline void invalidate_l2_cache(void)
  16. {
  17. unsigned int val=0;
  18. asm volatile("mcr p15, 1, %0, c15, c11, 0 @ invl l2 cache"
  19. : : "r" (val) : "cc");
  20. isb();
  21. }
  22. void l2_cache_enable(void);
  23. void l2_cache_disable(void);
  24. void set_section_dcache(int section, enum dcache_option option);
  25. void arm_init_before_mmu(void);
  26. void arm_init_domains(void);
  27. void cpu_cache_initialization(void);
  28. void dram_bank_mmu_setup(int bank);
  29. #endif
  30. /*
  31. * The current upper bound for ARM L1 data cache line sizes is 64 bytes. We
  32. * use that value for aligning DMA buffers unless the board config has specified
  33. * an alternate cache line size.
  34. */
  35. #ifdef CONFIG_SYS_CACHELINE_SIZE
  36. #define ARCH_DMA_MINALIGN CONFIG_SYS_CACHELINE_SIZE
  37. #else
  38. #define ARCH_DMA_MINALIGN 64
  39. #endif
  40. #endif /* _ASM_CACHE_H */