1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 
  24 
  25 
  26 
  27 
  28 
  29 
  30 
  31 
  32 #ifndef _XTENSA_CORE_TIE_ASM_H
  33 #define _XTENSA_CORE_TIE_ASM_H
  34 
  35 
  36 
  37 #define XTHAL_SAS_TIE   0x0001  
  38 #define XTHAL_SAS_OPT   0x0002  
  39 #define XTHAL_SAS_ANYOT 0x0003  
  40 
  41 #define XTHAL_SAS_NOCC  0x0004  
  42 #define XTHAL_SAS_CC    0x0008  
  43 #define XTHAL_SAS_ANYCC 0x000C  
  44 
  45 #define XTHAL_SAS_CALR  0x0010  
  46 #define XTHAL_SAS_CALE  0x0020  
  47 #define XTHAL_SAS_GLOB  0x0040  
  48 #define XTHAL_SAS_ANYABI 0x0070 
  49 
  50 #define XTHAL_SAS_ALL   0xFFFF  
  51 #define XTHAL_SAS3(optie,ccuse,abi)     ( ((optie) & XTHAL_SAS_ANYOT)  \
  52                                         | ((ccuse) & XTHAL_SAS_ANYCC)  \
  53                                         | ((abi)   & XTHAL_SAS_ANYABI) )
  54 
  55 
  56 
  57     
  58 
  59 
  60 
  61 
  62 
  63 
  64 
  65 
  66 
  67 
  68 
  69 
  70 
  71 
  72 
  73 
  74 
  75 
  76 
  77     .macro xchal_ncp_store  ptr at1 at2 at3 at4  continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
  78         xchal_sa_start  \continue, \ofs
  79         
  80         .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\select)
  81         xchal_sa_align  \ptr, 0, 1020, 4, 4
  82         rur.THREADPTR   \at1            
  83         s32i    \at1, \ptr, .Lxchal_ofs_+0
  84         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 4
  85         .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0
  86         xchal_sa_align  \ptr, 0, 1020, 4, 4
  87         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 4
  88         .endif
  89         
  90         .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\select)
  91         xchal_sa_align  \ptr, 0, 1016, 4, 4
  92         rsr.ACCLO       \at1            
  93         s32i    \at1, \ptr, .Lxchal_ofs_+0
  94         rsr.ACCHI       \at1            
  95         s32i    \at1, \ptr, .Lxchal_ofs_+4
  96         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 8
  97         .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
  98         xchal_sa_align  \ptr, 0, 1016, 4, 4
  99         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 8
 100         .endif
 101         
 102         .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select)
 103         xchal_sa_align  \ptr, 0, 1000, 4, 4
 104         rsr.M0  \at1            
 105         s32i    \at1, \ptr, .Lxchal_ofs_+0
 106         rsr.M1  \at1            
 107         s32i    \at1, \ptr, .Lxchal_ofs_+4
 108         rsr.M2  \at1            
 109         s32i    \at1, \ptr, .Lxchal_ofs_+8
 110         rsr.M3  \at1            
 111         s32i    \at1, \ptr, .Lxchal_ofs_+12
 112         rsr.BR  \at1            
 113         s32i    \at1, \ptr, .Lxchal_ofs_+16
 114         rsr.SCOMPARE1   \at1            
 115         s32i    \at1, \ptr, .Lxchal_ofs_+20
 116         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 24
 117         .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
 118         xchal_sa_align  \ptr, 0, 1000, 4, 4
 119         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 24
 120         .endif
 121     .endm       
 122 
 123     
 124 
 125 
 126 
 127 
 128 
 129 
 130 
 131 
 132 
 133 
 134 
 135 
 136 
 137 
 138 
 139 
 140 
 141 
 142 
 143     .macro xchal_ncp_load  ptr at1 at2 at3 at4  continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
 144         xchal_sa_start  \continue, \ofs
 145         
 146         .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\select)
 147         xchal_sa_align  \ptr, 0, 1020, 4, 4
 148         l32i    \at1, \ptr, .Lxchal_ofs_+0
 149         wur.THREADPTR   \at1            
 150         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 4
 151         .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0
 152         xchal_sa_align  \ptr, 0, 1020, 4, 4
 153         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 4
 154         .endif
 155         
 156         .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\select)
 157         xchal_sa_align  \ptr, 0, 1016, 4, 4
 158         l32i    \at1, \ptr, .Lxchal_ofs_+0
 159         wsr.ACCLO       \at1            
 160         l32i    \at1, \ptr, .Lxchal_ofs_+4
 161         wsr.ACCHI       \at1            
 162         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 8
 163         .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
 164         xchal_sa_align  \ptr, 0, 1016, 4, 4
 165         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 8
 166         .endif
 167         
 168         .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select)
 169         xchal_sa_align  \ptr, 0, 1000, 4, 4
 170         l32i    \at1, \ptr, .Lxchal_ofs_+0
 171         wsr.M0  \at1            
 172         l32i    \at1, \ptr, .Lxchal_ofs_+4
 173         wsr.M1  \at1            
 174         l32i    \at1, \ptr, .Lxchal_ofs_+8
 175         wsr.M2  \at1            
 176         l32i    \at1, \ptr, .Lxchal_ofs_+12
 177         wsr.M3  \at1            
 178         l32i    \at1, \ptr, .Lxchal_ofs_+16
 179         wsr.BR  \at1            
 180         l32i    \at1, \ptr, .Lxchal_ofs_+20
 181         wsr.SCOMPARE1   \at1            
 182         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 24
 183         .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
 184         xchal_sa_align  \ptr, 0, 1000, 4, 4
 185         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 24
 186         .endif
 187     .endm       
 188 
 189 
 190 #define XCHAL_NCP_NUM_ATMPS     1
 191 
 192 
 193 
 194 
 195     
 196 
 197 
 198 
 199 
 200 
 201 
 202 
 203 
 204 #define xchal_cp_AudioEngineLX_store    xchal_cp1_store
 205     .macro      xchal_cp1_store  ptr at1 at2 at3 at4  continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
 206         xchal_sa_start \continue, \ofs
 207         
 208         .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select)
 209         xchal_sa_align  \ptr, 0, 0, 8, 8
 210         rur.AE_OVF_SAR  \at1            
 211         s32i    \at1, \ptr, .Lxchal_ofs_+0
 212         rur.AE_BITHEAD  \at1            
 213         s32i    \at1, \ptr, .Lxchal_ofs_+4
 214         rur.AE_TS_FTS_BU_BP     \at1            
 215         s32i    \at1, \ptr, .Lxchal_ofs_+8
 216         rur.AE_CW_SD_NO \at1            
 217         s32i    \at1, \ptr, .Lxchal_ofs_+12
 218         rur.AE_CBEGIN0  \at1            
 219         s32i    \at1, \ptr, .Lxchal_ofs_+16
 220         rur.AE_CEND0    \at1            
 221         s32i    \at1, \ptr, .Lxchal_ofs_+20
 222         AE_S64.I        aed0, \ptr, .Lxchal_ofs_+24
 223         AE_S64.I        aed1, \ptr, .Lxchal_ofs_+32
 224         AE_S64.I        aed2, \ptr, .Lxchal_ofs_+40
 225         AE_S64.I        aed3, \ptr, .Lxchal_ofs_+48
 226         AE_S64.I        aed4, \ptr, .Lxchal_ofs_+56
 227         addi    \ptr, \ptr, 64
 228         AE_S64.I        aed5, \ptr, .Lxchal_ofs_+0
 229         AE_S64.I        aed6, \ptr, .Lxchal_ofs_+8
 230         AE_S64.I        aed7, \ptr, .Lxchal_ofs_+16
 231         AE_S64.I        aed8, \ptr, .Lxchal_ofs_+24
 232         AE_S64.I        aed9, \ptr, .Lxchal_ofs_+32
 233         AE_S64.I        aed10, \ptr, .Lxchal_ofs_+40
 234         AE_S64.I        aed11, \ptr, .Lxchal_ofs_+48
 235         AE_S64.I        aed12, \ptr, .Lxchal_ofs_+56
 236         addi    \ptr, \ptr, 64
 237         AE_S64.I        aed13, \ptr, .Lxchal_ofs_+0
 238         AE_S64.I        aed14, \ptr, .Lxchal_ofs_+8
 239         AE_S64.I        aed15, \ptr, .Lxchal_ofs_+16
 240         AE_SALIGN64.I   u0, \ptr, .Lxchal_ofs_+24
 241         AE_SALIGN64.I   u1, \ptr, .Lxchal_ofs_+32
 242         AE_SALIGN64.I   u2, \ptr, .Lxchal_ofs_+40
 243         AE_SALIGN64.I   u3, \ptr, .Lxchal_ofs_+48
 244         .set    .Lxchal_pofs_, .Lxchal_pofs_ + 128
 245         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 56
 246         .elseif ((XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
 247         xchal_sa_align  \ptr, 0, 0, 8, 8
 248         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 184
 249         .endif
 250     .endm       
 251 
 252     
 253 
 254 
 255 
 256 
 257 
 258 
 259 
 260 
 261 #define xchal_cp_AudioEngineLX_load     xchal_cp1_load
 262     .macro      xchal_cp1_load  ptr at1 at2 at3 at4  continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
 263         xchal_sa_start \continue, \ofs
 264         
 265         .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select)
 266         xchal_sa_align  \ptr, 0, 0, 8, 8
 267         l32i    \at1, \ptr, .Lxchal_ofs_+0
 268         wur.AE_OVF_SAR  \at1            
 269         l32i    \at1, \ptr, .Lxchal_ofs_+4
 270         wur.AE_BITHEAD  \at1            
 271         l32i    \at1, \ptr, .Lxchal_ofs_+8
 272         wur.AE_TS_FTS_BU_BP     \at1            
 273         l32i    \at1, \ptr, .Lxchal_ofs_+12
 274         wur.AE_CW_SD_NO \at1            
 275         l32i    \at1, \ptr, .Lxchal_ofs_+16
 276         wur.AE_CBEGIN0  \at1            
 277         l32i    \at1, \ptr, .Lxchal_ofs_+20
 278         wur.AE_CEND0    \at1            
 279         AE_L64.I        aed0, \ptr, .Lxchal_ofs_+24
 280         AE_L64.I        aed1, \ptr, .Lxchal_ofs_+32
 281         AE_L64.I        aed2, \ptr, .Lxchal_ofs_+40
 282         AE_L64.I        aed3, \ptr, .Lxchal_ofs_+48
 283         AE_L64.I        aed4, \ptr, .Lxchal_ofs_+56
 284         addi    \ptr, \ptr, 64
 285         AE_L64.I        aed5, \ptr, .Lxchal_ofs_+0
 286         AE_L64.I        aed6, \ptr, .Lxchal_ofs_+8
 287         AE_L64.I        aed7, \ptr, .Lxchal_ofs_+16
 288         AE_L64.I        aed8, \ptr, .Lxchal_ofs_+24
 289         AE_L64.I        aed9, \ptr, .Lxchal_ofs_+32
 290         AE_L64.I        aed10, \ptr, .Lxchal_ofs_+40
 291         AE_L64.I        aed11, \ptr, .Lxchal_ofs_+48
 292         AE_L64.I        aed12, \ptr, .Lxchal_ofs_+56
 293         addi    \ptr, \ptr, 64
 294         AE_L64.I        aed13, \ptr, .Lxchal_ofs_+0
 295         AE_L64.I        aed14, \ptr, .Lxchal_ofs_+8
 296         AE_L64.I        aed15, \ptr, .Lxchal_ofs_+16
 297         AE_LALIGN64.I   u0, \ptr, .Lxchal_ofs_+24
 298         AE_LALIGN64.I   u1, \ptr, .Lxchal_ofs_+32
 299         AE_LALIGN64.I   u2, \ptr, .Lxchal_ofs_+40
 300         AE_LALIGN64.I   u3, \ptr, .Lxchal_ofs_+48
 301         .set    .Lxchal_pofs_, .Lxchal_pofs_ + 128
 302         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 56
 303         .elseif ((XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
 304         xchal_sa_align  \ptr, 0, 0, 8, 8
 305         .set    .Lxchal_ofs_, .Lxchal_ofs_ + 184
 306         .endif
 307     .endm       
 308 
 309 #define XCHAL_CP1_NUM_ATMPS     1
 310 #define XCHAL_SA_NUM_ATMPS      1
 311 
 312         
 313         .macro xchal_cp0_store  p a b c d continue=0 ofs=-1 select=-1 ; .endm
 314         .macro xchal_cp0_load   p a b c d continue=0 ofs=-1 select=-1 ; .endm
 315         .macro xchal_cp2_store  p a b c d continue=0 ofs=-1 select=-1 ; .endm
 316         .macro xchal_cp2_load   p a b c d continue=0 ofs=-1 select=-1 ; .endm
 317         .macro xchal_cp3_store  p a b c d continue=0 ofs=-1 select=-1 ; .endm
 318         .macro xchal_cp3_load   p a b c d continue=0 ofs=-1 select=-1 ; .endm
 319         .macro xchal_cp4_store  p a b c d continue=0 ofs=-1 select=-1 ; .endm
 320         .macro xchal_cp4_load   p a b c d continue=0 ofs=-1 select=-1 ; .endm
 321         .macro xchal_cp5_store  p a b c d continue=0 ofs=-1 select=-1 ; .endm
 322         .macro xchal_cp5_load   p a b c d continue=0 ofs=-1 select=-1 ; .endm
 323         .macro xchal_cp6_store  p a b c d continue=0 ofs=-1 select=-1 ; .endm
 324         .macro xchal_cp6_load   p a b c d continue=0 ofs=-1 select=-1 ; .endm
 325         .macro xchal_cp7_store  p a b c d continue=0 ofs=-1 select=-1 ; .endm
 326         .macro xchal_cp7_load   p a b c d continue=0 ofs=-1 select=-1 ; .endm
 327 
 328 #endif