060-cache-fa.diff 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --- a/arch/arm/mm/cache-fa.S
  2. +++ b/arch/arm/mm/cache-fa.S
  3. @@ -24,7 +24,8 @@
  4. /*
  5. * The size of one data cache line.
  6. */
  7. -#define CACHE_DLINESIZE 16
  8. +#define CACHE_DLINESIZE 16
  9. +#define CACHE_DLINESHIFT 4
  10. /*
  11. * The total size of the data cache.
  12. @@ -169,7 +170,17 @@ ENTRY(fa_flush_kern_dcache_area)
  13. * - start - virtual start address
  14. * - end - virtual end address
  15. */
  16. +__flush_whole_dcache:
  17. + mcr p15, 0, r0, c7, c14, 0 @ clean/invalidate D cache
  18. + mov r0, #0
  19. + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
  20. + mov pc, lr
  21. +
  22. fa_dma_inv_range:
  23. + sub r3, r1, r0 @ calculate total size
  24. + cmp r3, #CACHE_DLIMIT @ total size >= limit?
  25. + bhs __flush_whole_dcache @ flush whole D cache
  26. +
  27. tst r0, #CACHE_DLINESIZE - 1
  28. bic r0, r0, #CACHE_DLINESIZE - 1
  29. mcrne p15, 0, r0, c7, c14, 1 @ clean & invalidate D entry
  30. @@ -193,6 +204,10 @@ fa_dma_inv_range:
  31. * - end - virtual end address
  32. */
  33. fa_dma_clean_range:
  34. + sub r3, r1, r0 @ calculate total size
  35. + cmp r3, #CACHE_DLIMIT @ total size >= limit?
  36. + bhs __flush_whole_dcache @ flush whole D cache
  37. +
  38. bic r0, r0, #CACHE_DLINESIZE - 1
  39. 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
  40. add r0, r0, #CACHE_DLINESIZE