tsunami.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * tsunami.h: Module specific definitions for Tsunami V8 Sparcs
  4. *
  5. * Copyright (C) 1995 David S. Miller ([email protected])
  6. */
  7. #ifndef _SPARC_TSUNAMI_H
  8. #define _SPARC_TSUNAMI_H
  9. #include <asm/asi.h>
  10. /* The MMU control register on the Tsunami:
  11. *
  12. * -----------------------------------------------------------------------
  13. * | implvers |SW|AV|DV|MV| RSV |PC|ITD|ALC| RSV |PE| RC |IE|DE|RSV|NF|ME|
  14. * -----------------------------------------------------------------------
  15. * 31 24 23 22 21 20 19-18 17 16 14 13-12 11 10-9 8 7 6-2 1 0
  16. *
  17. * SW: Enable Software Table Walks 0=off 1=on
  18. * AV: Address View bit
  19. * DV: Data View bit
  20. * MV: Memory View bit
  21. * PC: Parity Control
  22. * ITD: ITBR disable
  23. * ALC: Alternate Cacheable
  24. * PE: Parity Enable 0=off 1=on
  25. * RC: Refresh Control
  26. * IE: Instruction cache Enable 0=off 1=on
  27. * DE: Data cache Enable 0=off 1=on
  28. * NF: No Fault, same as all other SRMMUs
  29. * ME: MMU Enable, same as all other SRMMUs
  30. */
  31. #define TSUNAMI_SW 0x00800000
  32. #define TSUNAMI_AV 0x00400000
  33. #define TSUNAMI_DV 0x00200000
  34. #define TSUNAMI_MV 0x00100000
  35. #define TSUNAMI_PC 0x00020000
  36. #define TSUNAMI_ITD 0x00010000
  37. #define TSUNAMI_ALC 0x00008000
  38. #define TSUNAMI_PE 0x00001000
  39. #define TSUNAMI_RCMASK 0x00000C00
  40. #define TSUNAMI_IENAB 0x00000200
  41. #define TSUNAMI_DENAB 0x00000100
  42. #define TSUNAMI_NF 0x00000002
  43. #define TSUNAMI_ME 0x00000001
  44. static inline void tsunami_flush_icache(void)
  45. {
  46. __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
  47. : /* no outputs */
  48. : "i" (ASI_M_IC_FLCLEAR)
  49. : "memory");
  50. }
  51. static inline void tsunami_flush_dcache(void)
  52. {
  53. __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
  54. : /* no outputs */
  55. : "i" (ASI_M_DC_FLCLEAR)
  56. : "memory");
  57. }
  58. #endif /* !(_SPARC_TSUNAMI_H) */