0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _SPARC_SWIFT_H
0009 #define _SPARC_SWIFT_H
0010
0011
0012 #define SWIFT_ST 0x00800000
0013 #define SWIFT_WP 0x00400000
0014
0015
0016 #define SWIFT_BF 0x00200000
0017 #define SWIFT_PMC 0x00180000
0018 #define SWIFT_PE 0x00040000
0019 #define SWIFT_PC 0x00020000
0020 #define SWIFT_AP 0x00010000
0021 #define SWIFT_AC 0x00008000
0022 #define SWIFT_BM 0x00004000
0023 #define SWIFT_RC 0x00003c00
0024 #define SWIFT_IE 0x00000200
0025 #define SWIFT_DE 0x00000100
0026 #define SWIFT_SA 0x00000080
0027 #define SWIFT_NF 0x00000002
0028 #define SWIFT_EN 0x00000001
0029
0030
0031 static inline void swift_inv_insn_tag(unsigned long addr)
0032 {
0033 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
0034 :
0035 : "r" (addr), "i" (ASI_M_TXTC_TAG)
0036 : "memory");
0037 }
0038
0039
0040 static inline void swift_inv_data_tag(unsigned long addr)
0041 {
0042 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
0043 :
0044 : "r" (addr), "i" (ASI_M_DATAC_TAG)
0045 : "memory");
0046 }
0047
0048 static inline void swift_flush_dcache(void)
0049 {
0050 unsigned long addr;
0051
0052 for (addr = 0; addr < 0x2000; addr += 0x10)
0053 swift_inv_data_tag(addr);
0054 }
0055
0056 static inline void swift_flush_icache(void)
0057 {
0058 unsigned long addr;
0059
0060 for (addr = 0; addr < 0x4000; addr += 0x20)
0061 swift_inv_insn_tag(addr);
0062 }
0063
0064 static inline void swift_idflash_clear(void)
0065 {
0066 unsigned long addr;
0067
0068 for (addr = 0; addr < 0x2000; addr += 0x10) {
0069 swift_inv_insn_tag(addr<<1);
0070 swift_inv_data_tag(addr);
0071 }
0072 }
0073
0074
0075 static inline void swift_flush_page(unsigned long page)
0076 {
0077 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
0078 :
0079 : "r" (page), "i" (ASI_M_FLUSH_PAGE)
0080 : "memory");
0081 }
0082
0083 static inline void swift_flush_segment(unsigned long addr)
0084 {
0085 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
0086 :
0087 : "r" (addr), "i" (ASI_M_FLUSH_SEG)
0088 : "memory");
0089 }
0090
0091 static inline void swift_flush_region(unsigned long addr)
0092 {
0093 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
0094 :
0095 : "r" (addr), "i" (ASI_M_FLUSH_REGION)
0096 : "memory");
0097 }
0098
0099 static inline void swift_flush_context(void)
0100 {
0101 __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
0102 :
0103 : "i" (ASI_M_FLUSH_CTX)
0104 : "memory");
0105 }
0106
0107 #endif