initialize_mmu.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * arch/xtensa/include/asm/initialize_mmu.h
  3. *
  4. * Initializes MMU:
  5. *
  6. * For the new V3 MMU we remap the TLB from virtual == physical
  7. * to the standard Linux mapping used in earlier MMU's.
  8. *
  9. * The the MMU we also support a new configuration register that
  10. * specifies how the S32C1I instruction operates with the cache
  11. * controller.
  12. *
  13. * This file is subject to the terms and conditions of the GNU General
  14. * Public License. See the file "COPYING" in the main directory of
  15. * this archive for more details.
  16. *
  17. * Copyright (C) 2008 - 2012 Tensilica, Inc.
  18. *
  19. * Marc Gauthier <marc@tensilica.com>
  20. * Pete Delaney <piet@tensilica.com>
  21. */
  22. #ifndef _XTENSA_INITIALIZE_MMU_H
  23. #define _XTENSA_INITIALIZE_MMU_H
  24. #ifdef __ASSEMBLY__
  25. #define XTENSA_HWVERSION_RC_2009_0 230000
  26. .macro initialize_mmu
  27. #if XCHAL_HAVE_S32C1I && (XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RC_2009_0)
  28. /*
  29. * We Have Atomic Operation Control (ATOMCTL) Register; Initialize it.
  30. * For details see Documentation/xtensa/atomctl.txt
  31. */
  32. #if XCHAL_DCACHE_IS_COHERENT
  33. movi a3, 0x25 /* For SMP/MX -- internal for writeback,
  34. * RCW otherwise
  35. */
  36. #else
  37. movi a3, 0x29 /* non-MX -- Most cores use Std Memory
  38. * Controlers which usually can't use RCW
  39. */
  40. #endif
  41. wsr a3, atomctl
  42. #endif /* XCHAL_HAVE_S32C1I &&
  43. * (XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RC_2009_0)
  44. */
  45. .endm
  46. #endif /*__ASSEMBLY__*/
  47. #endif /* _XTENSA_INITIALIZE_MMU_H */