cache.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * (C) Copyright 2011
  3. * Ilya Yanok, EmCraft Systems
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc.
  21. */
  22. #include <linux/types.h>
  23. #include <common.h>
  24. #ifndef CONFIG_SYS_DCACHE_OFF
  25. static inline void dcache_noop(void)
  26. {
  27. if (dcache_status()) {
  28. puts("WARNING: cache operations are not implemented!\n"
  29. "WARNING: disabling D-Cache now, you can re-enable it"
  30. "later with 'dcache on' command\n");
  31. dcache_disable();
  32. }
  33. }
  34. void invalidate_dcache_all(void)
  35. {
  36. dcache_noop();
  37. }
  38. void flush_dcache_all(void)
  39. {
  40. dcache_noop();
  41. }
  42. void invalidate_dcache_range(unsigned long start, unsigned long stop)
  43. {
  44. dcache_noop();
  45. }
  46. void flush_dcache_range(unsigned long start, unsigned long stop)
  47. {
  48. dcache_noop();
  49. }
  50. #else /* #ifndef CONFIG_SYS_DCACHE_OFF */
  51. void invalidate_dcache_all(void)
  52. {
  53. }
  54. void flush_dcache_all(void)
  55. {
  56. }
  57. void invalidate_dcache_range(unsigned long start, unsigned long stop)
  58. {
  59. }
  60. void flush_dcache_range(unsigned long start, unsigned long stop)
  61. {
  62. }
  63. void flush_cache(unsigned long start, unsigned long size)
  64. {
  65. }
  66. #endif /* #ifndef CONFIG_SYS_DCACHE_OFF */