cache.h 1.2 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. 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. void sram_bank_mmu_setup(phys_addr_t start, phys_addr_t size);
  35. #endif
  36. /*
  37. * The value of the largest data cache relevant to DMA operations shall be set
  38. * for us in CONFIG_SYS_CACHELINE_SIZE. In some cases this may be a larger
  39. * value than found in the L1 cache but this is OK to use in terms of
  40. * alignment.
  41. */
  42. #define ARCH_DMA_MINALIGN CONFIG_SYS_CACHELINE_SIZE
  43. #endif /* _ASM_CACHE_H */