cache-c.c 733 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Blackfin cache control code (simpler control-style functions)
  3. *
  4. * Copyright 2004-2008 Analog Devices Inc.
  5. *
  6. * Enter bugs at http://blackfin.uclinux.org/
  7. *
  8. * Licensed under the GPL-2 or later.
  9. */
  10. #include <asm/blackfin.h>
  11. /* Invalidate the Entire Data cache by
  12. * clearing DMC[1:0] bits
  13. */
  14. void blackfin_invalidate_entire_dcache(void)
  15. {
  16. u32 dmem = bfin_read_DMEM_CONTROL();
  17. bfin_write_DMEM_CONTROL(dmem & ~0xc);
  18. SSYNC();
  19. bfin_write_DMEM_CONTROL(dmem);
  20. SSYNC();
  21. }
  22. /* Invalidate the Entire Instruction cache by
  23. * clearing IMC bit
  24. */
  25. void blackfin_invalidate_entire_icache(void)
  26. {
  27. u32 imem = bfin_read_IMEM_CONTROL();
  28. bfin_write_IMEM_CONTROL(imem & ~0x4);
  29. SSYNC();
  30. bfin_write_IMEM_CONTROL(imem);
  31. SSYNC();
  32. }