cache.c 502 B

12345678910111213141516171819202122232425262728
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2016
  4. * Heiko Schocher, DENX Software Engineering, hs@denx.de.
  5. */
  6. #include <linux/types.h>
  7. #include <common.h>
  8. void enable_caches(void)
  9. {
  10. #ifndef CONFIG_SYS_ICACHE_OFF
  11. icache_enable();
  12. #endif
  13. }
  14. #ifndef CONFIG_SYS_ICACHE_OFF
  15. /* Invalidate entire I-cache and branch predictor array */
  16. void invalidate_icache_all(void)
  17. {
  18. unsigned long i = 0;
  19. asm ("mcr p15, 0, %0, c7, c5, 0" : : "r" (i));
  20. }
  21. #else
  22. void invalidate_icache_all(void)
  23. {
  24. }
  25. #endif