cache.h 972 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef __ASM_AVR32_CACHE_H
  2. #define __ASM_AVR32_CACHE_H
  3. #define L1_CACHE_SHIFT 5
  4. #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
  5. /*
  6. * Memory returned by kmalloc() may be used for DMA, so we must make
  7. * sure that all such allocations are cache aligned. Otherwise,
  8. * unrelated code may cause parts of the buffer to be read into the
  9. * cache before the transfer is done, causing old data to be seen by
  10. * the CPU.
  11. */
  12. #define ARCH_DMA_MINALIGN L1_CACHE_BYTES
  13. #ifndef __ASSEMBLER__
  14. struct cache_info {
  15. unsigned int ways;
  16. unsigned int sets;
  17. unsigned int linesz;
  18. };
  19. #endif /* __ASSEMBLER */
  20. /* Cache operation constants */
  21. #define ICACHE_FLUSH 0x00
  22. #define ICACHE_INVALIDATE 0x01
  23. #define ICACHE_LOCK 0x02
  24. #define ICACHE_UNLOCK 0x03
  25. #define ICACHE_PREFETCH 0x04
  26. #define DCACHE_FLUSH 0x08
  27. #define DCACHE_LOCK 0x09
  28. #define DCACHE_UNLOCK 0x0a
  29. #define DCACHE_INVALIDATE 0x0b
  30. #define DCACHE_CLEAN 0x0c
  31. #define DCACHE_CLEAN_INVAL 0x0d
  32. #endif /* __ASM_AVR32_CACHE_H */