Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _SPARC_ASI_H
0003 #define _SPARC_ASI_H
0004 
0005 /* asi.h:  Address Space Identifier values for the sparc.
0006  *
0007  * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
0008  *
0009  * Pioneer work for sun4m: Paul Hatchman (paul@sfe.com.au)
0010  * Joint edition for sun4c+sun4m: Pete A. Zaitcev <zaitcev@ipmce.su>
0011  */
0012 
0013 /* The first batch are for the sun4c. */
0014 
0015 #define ASI_NULL1           0x00
0016 #define ASI_NULL2           0x01
0017 
0018 /* sun4c and sun4 control registers and mmu/vac ops */
0019 #define ASI_CONTROL         0x02
0020 #define ASI_SEGMAP          0x03
0021 #define ASI_PTE             0x04
0022 #define ASI_HWFLUSHSEG      0x05
0023 #define ASI_HWFLUSHPAGE     0x06
0024 #define ASI_REGMAP          0x06
0025 #define ASI_HWFLUSHCONTEXT  0x07
0026 
0027 #define ASI_USERTXT         0x08
0028 #define ASI_KERNELTXT       0x09
0029 #define ASI_USERDATA        0x0a
0030 #define ASI_KERNELDATA      0x0b
0031 
0032 /* VAC Cache flushing on sun4c and sun4 */
0033 #define ASI_FLUSHSEG        0x0c
0034 #define ASI_FLUSHPG         0x0d
0035 #define ASI_FLUSHCTX        0x0e
0036 
0037 /* SPARCstation-5: only 6 bits are decoded. */
0038 /* wo = Write Only, rw = Read Write;        */
0039 /* ss = Single Size, as = All Sizes;        */
0040 #define ASI_M_RES00         0x00   /* Don't touch... */
0041 #define ASI_M_UNA01         0x01   /* Same here... */
0042 #define ASI_M_MXCC          0x02   /* Access to TI VIKING MXCC registers */
0043 #define ASI_M_FLUSH_PROBE   0x03   /* Reference MMU Flush/Probe; rw, ss */
0044 #define ASI_M_MMUREGS       0x04   /* MMU Registers; rw, ss */
0045 #define ASI_M_TLBDIAG       0x05   /* MMU TLB only Diagnostics */
0046 #define ASI_M_DIAGS         0x06   /* Reference MMU Diagnostics */
0047 #define ASI_M_IODIAG        0x07   /* MMU I/O TLB only Diagnostics */
0048 #define ASI_M_USERTXT       0x08   /* Same as ASI_USERTXT; rw, as */
0049 #define ASI_M_KERNELTXT     0x09   /* Same as ASI_KERNELTXT; rw, as */
0050 #define ASI_M_USERDATA      0x0A   /* Same as ASI_USERDATA; rw, as */
0051 #define ASI_M_KERNELDATA    0x0B   /* Same as ASI_KERNELDATA; rw, as */
0052 #define ASI_M_TXTC_TAG      0x0C   /* Instruction Cache Tag; rw, ss */
0053 #define ASI_M_TXTC_DATA     0x0D   /* Instruction Cache Data; rw, ss */
0054 #define ASI_M_DATAC_TAG     0x0E   /* Data Cache Tag; rw, ss */
0055 #define ASI_M_DATAC_DATA    0x0F   /* Data Cache Data; rw, ss */
0056 
0057 /* The following cache flushing ASIs work only with the 'sta'
0058  * instruction. Results are unpredictable for 'swap' and 'ldstuba',
0059  * so don't do it.
0060  */
0061 
0062 /* These ASI flushes affect external caches too. */
0063 #define ASI_M_FLUSH_PAGE    0x10   /* Flush I&D Cache Line (page); wo, ss */
0064 #define ASI_M_FLUSH_SEG     0x11   /* Flush I&D Cache Line (seg); wo, ss */
0065 #define ASI_M_FLUSH_REGION  0x12   /* Flush I&D Cache Line (region); wo, ss */
0066 #define ASI_M_FLUSH_CTX     0x13   /* Flush I&D Cache Line (context); wo, ss */
0067 #define ASI_M_FLUSH_USER    0x14   /* Flush I&D Cache Line (user); wo, ss */
0068 
0069 /* Block-copy operations are available only on certain V8 cpus. */
0070 #define ASI_M_BCOPY         0x17   /* Block copy */
0071 
0072 /* These affect only the ICACHE and are Ross HyperSparc and TurboSparc specific. */
0073 #define ASI_M_IFLUSH_PAGE   0x18   /* Flush I Cache Line (page); wo, ss */
0074 #define ASI_M_IFLUSH_SEG    0x19   /* Flush I Cache Line (seg); wo, ss */
0075 #define ASI_M_IFLUSH_REGION 0x1A   /* Flush I Cache Line (region); wo, ss */
0076 #define ASI_M_IFLUSH_CTX    0x1B   /* Flush I Cache Line (context); wo, ss */
0077 #define ASI_M_IFLUSH_USER   0x1C   /* Flush I Cache Line (user); wo, ss */
0078 
0079 /* Block-fill operations are available on certain V8 cpus */
0080 #define ASI_M_BFILL         0x1F
0081 
0082 /* This allows direct access to main memory, actually 0x20 to 0x2f are
0083  * the available ASI's for physical ram pass-through, but I don't have
0084  * any idea what the other ones do....
0085  */
0086 
0087 #define ASI_M_BYPASS       0x20   /* Reference MMU bypass; rw, as */
0088 #define ASI_M_FBMEM        0x29   /* Graphics card frame buffer access */
0089 #define ASI_M_VMEUS        0x2A   /* VME user 16-bit access */
0090 #define ASI_M_VMEPS        0x2B   /* VME priv 16-bit access */
0091 #define ASI_M_VMEUT        0x2C   /* VME user 32-bit access */
0092 #define ASI_M_VMEPT        0x2D   /* VME priv 32-bit access */
0093 #define ASI_M_SBUS         0x2E   /* Direct SBus access */
0094 #define ASI_M_CTL          0x2F   /* Control Space (ECC and MXCC are here) */
0095 
0096 
0097 /* This is ROSS HyperSparc only. */
0098 #define ASI_M_FLUSH_IWHOLE 0x31   /* Flush entire ICACHE; wo, ss */
0099 
0100 /* Tsunami/Viking/TurboSparc i/d cache flash clear. */
0101 #define ASI_M_IC_FLCLEAR   0x36
0102 #define ASI_M_DC_FLCLEAR   0x37
0103 
0104 #define ASI_M_DCDR         0x39   /* Data Cache Diagnostics Register rw, ss */
0105 
0106 #define ASI_M_VIKING_TMP1  0x40   /* Emulation temporary 1 on Viking */
0107 /* only available on SuperSparc I */
0108 /* #define ASI_M_VIKING_TMP2  0x41 */  /* Emulation temporary 2 on Viking */
0109 
0110 #define ASI_M_ACTION       0x4c   /* Breakpoint Action Register (GNU/Viking) */
0111 
0112 /* LEON ASI */
0113 #define ASI_LEON_NOCACHE        0x01
0114 
0115 #define ASI_LEON_DCACHE_MISS    0x01
0116 
0117 #define ASI_LEON_CACHEREGS      0x02
0118 #define ASI_LEON_IFLUSH         0x10
0119 #define ASI_LEON_DFLUSH         0x11
0120 
0121 #define ASI_LEON_MMUFLUSH       0x18
0122 #define ASI_LEON_MMUREGS        0x19
0123 #define ASI_LEON_BYPASS         0x1c
0124 #define ASI_LEON_FLUSH_PAGE     0x10
0125 
0126 /* V9 Architecture mandary ASIs. */
0127 #define ASI_N           0x04 /* Nucleus             */
0128 #define ASI_NL          0x0c /* Nucleus, little endian      */
0129 #define ASI_AIUP        0x10 /* Primary, user           */
0130 #define ASI_AIUS        0x11 /* Secondary, user         */
0131 #define ASI_AIUPL       0x18 /* Primary, user, little endian    */
0132 #define ASI_AIUSL       0x19 /* Secondary, user, little endian  */
0133 #define ASI_P           0x80 /* Primary, implicit       */
0134 #define ASI_S           0x81 /* Secondary, implicit     */
0135 #define ASI_PNF         0x82 /* Primary, no fault       */
0136 #define ASI_SNF         0x83 /* Secondary, no fault     */
0137 #define ASI_PL          0x88 /* Primary, implicit, l-endian */
0138 #define ASI_SL          0x89 /* Secondary, implicit, l-endian   */
0139 #define ASI_PNFL        0x8a /* Primary, no fault, l-endian */
0140 #define ASI_SNFL        0x8b /* Secondary, no fault, l-endian   */
0141 
0142 /* SpitFire and later extended ASIs.  The "(III)" marker designates
0143  * UltraSparc-III and later specific ASIs.  The "(CMT)" marker designates
0144  * Chip Multi Threading specific ASIs.  "(NG)" designates Niagara specific
0145  * ASIs, "(4V)" designates SUN4V specific ASIs.  "(NG4)" designates SPARC-T4
0146  * and later ASIs.
0147  */
0148 #define ASI_MCD_PRIV_PRIMARY    0x02 /* (NG7) Privileged MCD version VA */
0149 #define ASI_MCD_REAL        0x05 /* (NG7) Privileged MCD version PA */
0150 #define ASI_PHYS_USE_EC     0x14 /* PADDR, E-cachable       */
0151 #define ASI_PHYS_BYPASS_EC_E    0x15 /* PADDR, E-bit            */
0152 #define ASI_BLK_AIUP_4V     0x16 /* (4V) Prim, user, block ld/st    */
0153 #define ASI_BLK_AIUS_4V     0x17 /* (4V) Sec, user, block ld/st */
0154 #define ASI_PHYS_USE_EC_L   0x1c /* PADDR, E-cachable, little endian*/
0155 #define ASI_PHYS_BYPASS_EC_E_L  0x1d /* PADDR, E-bit, little endian */
0156 #define ASI_BLK_AIUP_L_4V   0x1e /* (4V) Prim, user, block, l-endian*/
0157 #define ASI_BLK_AIUS_L_4V   0x1f /* (4V) Sec, user, block, l-endian */
0158 #define ASI_SCRATCHPAD      0x20 /* (4V) Scratch Pad Registers  */
0159 #define ASI_MMU         0x21 /* (4V) MMU Context Registers  */
0160 #define ASI_BLK_INIT_QUAD_LDD_AIUS 0x23 /* (NG) init-store, twin load,
0161                      * secondary, user
0162                      */
0163 #define ASI_NUCLEUS_QUAD_LDD    0x24 /* Cachable, qword load        */
0164 #define ASI_QUEUE       0x25 /* (4V) Interrupt Queue Registers  */
0165 #define ASI_QUAD_LDD_PHYS_4V    0x26 /* (4V) Physical, qword load   */
0166 #define ASI_NUCLEUS_QUAD_LDD_L  0x2c /* Cachable, qword load, l-endian  */
0167 #define ASI_QUAD_LDD_PHYS_L_4V  0x2e /* (4V) Phys, qword load, l-endian */
0168 #define ASI_PCACHE_DATA_STATUS  0x30 /* (III) PCache data stat RAM diag */
0169 #define ASI_PCACHE_DATA     0x31 /* (III) PCache data RAM diag  */
0170 #define ASI_PCACHE_TAG      0x32 /* (III) PCache tag RAM diag   */
0171 #define ASI_PCACHE_SNOOP_TAG    0x33 /* (III) PCache snoop tag RAM diag */
0172 #define ASI_QUAD_LDD_PHYS   0x34 /* (III+) PADDR, qword load    */
0173 #define ASI_WCACHE_VALID_BITS   0x38 /* (III) WCache Valid Bits diag    */
0174 #define ASI_WCACHE_DATA     0x39 /* (III) WCache data RAM diag  */
0175 #define ASI_WCACHE_TAG      0x3a /* (III) WCache tag RAM diag   */
0176 #define ASI_WCACHE_SNOOP_TAG    0x3b /* (III) WCache snoop tag RAM diag */
0177 #define ASI_QUAD_LDD_PHYS_L 0x3c /* (III+) PADDR, qw-load, l-endian */
0178 #define ASI_SRAM_FAST_INIT  0x40 /* (III+) Fast SRAM init       */
0179 #define ASI_CORE_AVAILABLE  0x41 /* (CMT) LP Available      */
0180 #define ASI_CORE_ENABLE_STAT    0x41 /* (CMT) LP Enable Status      */
0181 #define ASI_CORE_ENABLE     0x41 /* (CMT) LP Enable RW      */
0182 #define ASI_XIR_STEERING    0x41 /* (CMT) XIR Steering RW       */
0183 #define ASI_CORE_RUNNING_RW 0x41 /* (CMT) LP Running RW     */
0184 #define ASI_CORE_RUNNING_W1S    0x41 /* (CMT) LP Running Write-One Set  */
0185 #define ASI_CORE_RUNNING_W1C    0x41 /* (CMT) LP Running Write-One Clr  */
0186 #define ASI_CORE_RUNNING_STAT   0x41 /* (CMT) LP Running Status     */
0187 #define ASI_CMT_ERROR_STEERING  0x41 /* (CMT) Error Steering RW     */
0188 #define ASI_DCACHE_INVALIDATE   0x42 /* (III) DCache Invalidate diag    */
0189 #define ASI_DCACHE_UTAG     0x43 /* (III) DCache uTag diag      */
0190 #define ASI_DCACHE_SNOOP_TAG    0x44 /* (III) DCache snoop tag RAM diag */
0191 #define ASI_LSU_CONTROL     0x45 /* Load-store control unit     */
0192 #define ASI_DCU_CONTROL_REG 0x45 /* (III) DCache Unit Control reg   */
0193 #define ASI_DCACHE_DATA     0x46 /* DCache data-ram diag access */
0194 #define ASI_DCACHE_TAG      0x47 /* Dcache tag/valid ram diag access*/
0195 #define ASI_INTR_DISPATCH_STAT  0x48 /* IRQ vector dispatch status  */
0196 #define ASI_INTR_RECEIVE    0x49 /* IRQ vector receive status   */
0197 #define ASI_UPA_CONFIG      0x4a /* UPA config space        */
0198 #define ASI_JBUS_CONFIG     0x4a /* (IIIi) JBUS Config Register */
0199 #define ASI_SAFARI_CONFIG   0x4a /* (III) Safari Config Register    */
0200 #define ASI_SAFARI_ADDRESS  0x4a /* (III) Safari Address Register   */
0201 #define ASI_ESTATE_ERROR_EN 0x4b /* E-cache error enable space  */
0202 #define ASI_AFSR        0x4c /* Async fault status register */
0203 #define ASI_AFAR        0x4d /* Async fault address register    */
0204 #define ASI_EC_TAG_DATA     0x4e /* E-cache tag/valid ram diag acc  */
0205 #define ASI_IMMU        0x50 /* Insn-MMU main register space    */
0206 #define ASI_IMMU_TSB_8KB_PTR    0x51 /* Insn-MMU 8KB TSB pointer reg    */
0207 #define ASI_IMMU_TSB_64KB_PTR   0x52 /* Insn-MMU 64KB TSB pointer reg   */
0208 #define ASI_ITLB_DATA_IN    0x54 /* Insn-MMU TLB data in reg    */
0209 #define ASI_ITLB_DATA_ACCESS    0x55 /* Insn-MMU TLB data access reg    */
0210 #define ASI_ITLB_TAG_READ   0x56 /* Insn-MMU TLB tag read reg   */
0211 #define ASI_IMMU_DEMAP      0x57 /* Insn-MMU TLB demap      */
0212 #define ASI_DMMU        0x58 /* Data-MMU main register space    */
0213 #define ASI_DMMU_TSB_8KB_PTR    0x59 /* Data-MMU 8KB TSB pointer reg    */
0214 #define ASI_DMMU_TSB_64KB_PTR   0x5a /* Data-MMU 16KB TSB pointer reg   */
0215 #define ASI_DMMU_TSB_DIRECT_PTR 0x5b /* Data-MMU TSB direct pointer reg */
0216 #define ASI_DTLB_DATA_IN    0x5c /* Data-MMU TLB data in reg    */
0217 #define ASI_DTLB_DATA_ACCESS    0x5d /* Data-MMU TLB data access reg    */
0218 #define ASI_DTLB_TAG_READ   0x5e /* Data-MMU TLB tag read reg   */
0219 #define ASI_DMMU_DEMAP      0x5f /* Data-MMU TLB demap      */
0220 #define ASI_IIU_INST_TRAP   0x60 /* (III) Instruction Breakpoint    */
0221 #define ASI_INTR_ID     0x63 /* (CMT) Interrupt ID register */
0222 #define ASI_CORE_ID     0x63 /* (CMT) LP ID register        */
0223 #define ASI_CESR_ID     0x63 /* (CMT) CESR ID register      */
0224 #define ASI_IC_INSTR        0x66 /* Insn cache instrucion ram diag  */
0225 #define ASI_IC_TAG      0x67 /* Insn cache tag/valid ram diag   */
0226 #define ASI_IC_STAG     0x68 /* (III) Insn cache snoop tag ram  */
0227 #define ASI_IC_PRE_DECODE   0x6e /* Insn cache pre-decode ram diag  */
0228 #define ASI_IC_NEXT_FIELD   0x6f /* Insn cache next-field ram diag  */
0229 #define ASI_BRPRED_ARRAY    0x6f /* (III) Branch Prediction RAM diag*/
0230 #define ASI_BLK_AIUP        0x70 /* Primary, user, block load/store */
0231 #define ASI_BLK_AIUS        0x71 /* Secondary, user, block ld/st    */
0232 #define ASI_MCU_CTRL_REG    0x72 /* (III) Memory controller regs    */
0233 #define ASI_EC_DATA     0x74 /* (III) E-cache data staging reg  */
0234 #define ASI_EC_CTRL     0x75 /* (III) E-cache control reg   */
0235 #define ASI_EC_W        0x76 /* E-cache diag write access   */
0236 #define ASI_UDB_ERROR_W     0x77 /* External UDB error regs W   */
0237 #define ASI_UDB_CONTROL_W   0x77 /* External UDB control regs W */
0238 #define ASI_INTR_W      0x77 /* IRQ vector dispatch write   */
0239 #define ASI_INTR_DATAN_W    0x77 /* (III) Out irq vector data reg N */
0240 #define ASI_INTR_DISPATCH_W 0x77 /* (III) Interrupt vector dispatch */
0241 #define ASI_BLK_AIUPL       0x78 /* Primary, user, little, blk ld/st*/
0242 #define ASI_BLK_AIUSL       0x79 /* Secondary, user, little, blk ld/st*/
0243 #define ASI_EC_R        0x7e /* E-cache diag read access    */
0244 #define ASI_UDBH_ERROR_R    0x7f /* External UDB error regs rd hi   */
0245 #define ASI_UDBL_ERROR_R    0x7f /* External UDB error regs rd low  */
0246 #define ASI_UDBH_CONTROL_R  0x7f /* External UDB control regs rd hi */
0247 #define ASI_UDBL_CONTROL_R  0x7f /* External UDB control regs rd low*/
0248 #define ASI_INTR_R      0x7f /* IRQ vector dispatch read    */
0249 #define ASI_INTR_DATAN_R    0x7f /* (III) In irq vector data reg N  */
0250 #define ASI_MCD_PRIMARY     0x90 /* (NG7) MCD version load/store    */
0251 #define ASI_MCD_ST_BLKINIT_PRIMARY  \
0252                 0x92 /* (NG7) MCD store BLKINIT primary */
0253 #define ASI_PIC         0xb0 /* (NG4) PIC registers     */
0254 #define ASI_PST8_P      0xc0 /* Primary, 8 8-bit, partial   */
0255 #define ASI_PST8_S      0xc1 /* Secondary, 8 8-bit, partial */
0256 #define ASI_PST16_P     0xc2 /* Primary, 4 16-bit, partial  */
0257 #define ASI_PST16_S     0xc3 /* Secondary, 4 16-bit, partial    */
0258 #define ASI_PST32_P     0xc4 /* Primary, 2 32-bit, partial  */
0259 #define ASI_PST32_S     0xc5 /* Secondary, 2 32-bit, partial    */
0260 #define ASI_PST8_PL     0xc8 /* Primary, 8 8-bit, partial, L    */
0261 #define ASI_PST8_SL     0xc9 /* Secondary, 8 8-bit, partial, L  */
0262 #define ASI_PST16_PL        0xca /* Primary, 4 16-bit, partial, L   */
0263 #define ASI_PST16_SL        0xcb /* Secondary, 4 16-bit, partial, L */
0264 #define ASI_PST32_PL        0xcc /* Primary, 2 32-bit, partial, L   */
0265 #define ASI_PST32_SL        0xcd /* Secondary, 2 32-bit, partial, L */
0266 #define ASI_FL8_P       0xd0 /* Primary, 1 8-bit, fpu ld/st */
0267 #define ASI_FL8_S       0xd1 /* Secondary, 1 8-bit, fpu ld/st   */
0268 #define ASI_FL16_P      0xd2 /* Primary, 1 16-bit, fpu ld/st    */
0269 #define ASI_FL16_S      0xd3 /* Secondary, 1 16-bit, fpu ld/st  */
0270 #define ASI_FL8_PL      0xd8 /* Primary, 1 8-bit, fpu ld/st, L  */
0271 #define ASI_FL8_SL      0xd9 /* Secondary, 1 8-bit, fpu ld/st, L*/
0272 #define ASI_FL16_PL     0xda /* Primary, 1 16-bit, fpu ld/st, L */
0273 #define ASI_FL16_SL     0xdb /* Secondary, 1 16-bit, fpu ld/st,L*/
0274 #define ASI_BLK_COMMIT_P    0xe0 /* Primary, blk store commit   */
0275 #define ASI_BLK_COMMIT_S    0xe1 /* Secondary, blk store commit */
0276 #define ASI_BLK_INIT_QUAD_LDD_P 0xe2 /* (NG) init-store, twin load,
0277                       * primary, implicit
0278                       */
0279 #define ASI_BLK_INIT_QUAD_LDD_S 0xe3 /* (NG) init-store, twin load,
0280                       * secondary, implicit
0281                       */
0282 #define ASI_BLK_P       0xf0 /* Primary, blk ld/st      */
0283 #define ASI_BLK_S       0xf1 /* Secondary, blk ld/st        */
0284 #define ASI_ST_BLKINIT_MRU_P    0xf2 /* (NG4) init-store, twin load,
0285                       * Most-Recently-Used, primary,
0286                       * implicit
0287                       */
0288 #define ASI_ST_BLKINIT_MRU_S    0xf3 /* (NG4) init-store, twin load,
0289                       * Most-Recently-Used, secondary,
0290                       * implicit
0291                       */
0292 #define ASI_BLK_PL      0xf8 /* Primary, blk ld/st, little  */
0293 #define ASI_BLK_SL      0xf9 /* Secondary, blk ld/st, little    */
0294 #define ASI_ST_BLKINIT_MRU_PL   0xfa /* (NG4) init-store, twin load,
0295                       * Most-Recently-Used, primary,
0296                       * implicit, little-endian
0297                       */
0298 #define ASI_ST_BLKINIT_MRU_SL   0xfb /* (NG4) init-store, twin load,
0299                       * Most-Recently-Used, secondary,
0300                       * implicit, little-endian
0301                       */
0302 
0303 #endif /* _SPARC_ASI_H */