| @@ -15,9 +15,6 @@ · 14 unmodified lines |
| 15 | * ---- FX8010 ---- | 15 | * ---- FX8010 ---- |
| 16 | */ | 16 | */ |
| 17 | | 17 | |
| 18 | #define EMU10K1_CARD_CREATIVE 0x00000000 | | |
| 19 | #define EMU10K1_CARD_EMUAPS 0x00000001 | | |
| 20 | | | |
| 21 | #define EMU10K1_FX8010_PCM_COUNT 8 | 18 | #define EMU10K1_FX8010_PCM_COUNT 8 |
| 22 | | 19 | |
| 23 | /* | 20 | /* |
| @@ -46,6 +43,19 @@ · 22 unmodified lines |
| 46 | #define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */ | 43 | #define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */ |
| 47 | #define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */ | 44 | #define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */ |
| 48 | | 45 | |
| | 46 | #define LOWORD_OPX_MASK 0x000ffc00 /* Instruction operand X */ |
| | 47 | #define LOWORD_OPY_MASK 0x000003ff /* Instruction operand Y */ |
| | 48 | #define HIWORD_OPCODE_MASK 0x00f00000 /* Instruction opcode */ |
| | 49 | #define HIWORD_RESULT_MASK 0x000ffc00 /* Instruction result */ |
| | 50 | #define HIWORD_OPA_MASK 0x000003ff /* Instruction operand A */ |
| | 51 | |
| | 52 | /* Audigy Soundcards have a different instruction format */ |
| | 53 | #define A_LOWORD_OPX_MASK 0x007ff000 |
| | 54 | #define A_LOWORD_OPY_MASK 0x000007ff |
| | 55 | #define A_HIWORD_OPCODE_MASK 0x0f000000 |
| | 56 | #define A_HIWORD_RESULT_MASK 0x007ff000 |
| | 57 | #define A_HIWORD_OPA_MASK 0x000007ff |
| | 58 | |
| 49 | /* GPRs */ | 59 | /* GPRs */ |
| 50 | #define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */ | 60 | #define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */ |
| 51 | #define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */ | 61 | #define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */ |
| @@ -53,6 +63,16 @@ · 1 unmodified line |
| 53 | #define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */ | 63 | #define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */ |
| 54 | /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */ | 64 | /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */ |
| 55 | | 65 | |
| | 66 | #define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */ |
| | 67 | #define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */ |
| | 68 | #define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */ |
| | 69 | #define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */ |
| | 70 | #define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */ |
| | 71 | #define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" */ |
| | 72 | #define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_01 - _0F" */ |
| | 73 | #define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x1f "EMU32_IN_00 - _1F" - Only when .device = 0x0008 */ |
| | 74 | #define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x1f "EMU32_OUT_00 - _1F" - Only when .device = 0x0008 */ |
| | 75 | |
| 56 | #define C_00000000 0x40 | 76 | #define C_00000000 0x40 |
| 57 | #define C_00000001 0x41 | 77 | #define C_00000001 0x41 |
| 58 | #define C_00000002 0x42 | 78 | #define C_00000002 0x42 |
| @@ -81,12 +101,66 @@ · 22 unmodified lines |
| 81 | #define GPR_NOISE1 0x59 /* noise source */ | 101 | #define GPR_NOISE1 0x59 /* noise source */ |
| 82 | #define GPR_IRQ 0x5a /* IRQ register */ | 102 | #define GPR_IRQ 0x5a /* IRQ register */ |
| 83 | #define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */ | 103 | #define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */ |
| | 104 | |
| | 105 | /* Audigy constants */ |
| | 106 | #define A_C_00000000 0xc0 |
| | 107 | #define A_C_00000001 0xc1 |
| | 108 | #define A_C_00000002 0xc2 |
| | 109 | #define A_C_00000003 0xc3 |
| | 110 | #define A_C_00000004 0xc4 |
| | 111 | #define A_C_00000008 0xc5 |
| | 112 | #define A_C_00000010 0xc6 |
| | 113 | #define A_C_00000020 0xc7 |
| | 114 | #define A_C_00000100 0xc8 |
| | 115 | #define A_C_00010000 0xc9 |
| | 116 | #define A_C_00000800 0xca |
| | 117 | #define A_C_10000000 0xcb |
| | 118 | #define A_C_20000000 0xcc |
| | 119 | #define A_C_40000000 0xcd |
| | 120 | #define A_C_80000000 0xce |
| | 121 | #define A_C_7fffffff 0xcf |
| | 122 | #define A_C_ffffffff 0xd0 |
| | 123 | #define A_C_fffffffe 0xd1 |
| | 124 | #define A_C_c0000000 0xd2 |
| | 125 | #define A_C_4f1bbcdc 0xd3 |
| | 126 | #define A_C_5a7ef9db 0xd4 |
| | 127 | #define A_C_00100000 0xd5 |
| | 128 | #define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */ |
| | 129 | #define A_GPR_COND 0xd7 /* CCR, condition register */ |
| | 130 | #define A_GPR_NOISE0 0xd8 /* noise source */ |
| | 131 | #define A_GPR_NOISE1 0xd9 /* noise source */ |
| | 132 | #define A_GPR_IRQ 0xda /* IRQ register */ |
| | 133 | #define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */ |
| | 134 | #define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */ |
| | 135 | |
| | 136 | /* Each FX general purpose register is 32 bits in length, all bits are used */ |
| | 137 | #define FXGPREGBASE 0x100 /* FX general purpose registers base */ |
| | 138 | #define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */ |
| | 139 | |
| | 140 | #define A_TANKMEMCTLREGBASE 0x100 /* Tank memory control registers base - only for Audigy */ |
| | 141 | #define A_TANKMEMCTLREG_MASK 0x1f /* only 5 bits used - only for Audigy */ |
| | 142 | |
| | 143 | /* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is */ |
| | 144 | /* decompressed back to 20 bits on a read. There are a total of 160 locations, the last 32 */ |
| | 145 | /* locations are for external TRAM. */ |
| | 146 | #define TANKMEMDATAREGBASE 0x200 /* Tank memory data registers base */ |
| | 147 | #define TANKMEMDATAREG_MASK 0x000fffff /* 20 bit tank audio data field */ |
| | 148 | |
| | 149 | /* Combined address field and memory opcode or flag field. 160 locations, last 32 are external */ |
| | 150 | #define TANKMEMADDRREGBASE 0x300 /* Tank memory address registers base */ |
| | 151 | #define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */ |
| | 152 | #define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */ |
| | 153 | #define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */ |
| | 154 | #define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */ |
| | 155 | #define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */ |
| | 156 | |
| 84 | #define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */ | 157 | #define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */ |
| 85 | #define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ | 158 | #define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ |
| 86 | #define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ | 159 | #define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ |
| 87 | #define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ | 160 | #define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ |
| 88 | #define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ | 161 | #define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ |
| 89 | | 162 | |
| | 163 | #define A_GPR(x) (A_FXGPREGBASE + (x)) |
| 90 | #define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ | 164 | #define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ |
| 91 | #define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ | 165 | #define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ |
| 92 | #define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ | 166 | #define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ |
| @@ -94,17 +168,6 @@ · 1 unmodified line |
| 94 | #define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ | 168 | #define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ |
| 95 | #define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ | 169 | #define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ |
| 96 | | 170 | |
| 97 | #define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */ | | |
| 98 | #define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */ | | |
| 99 | #define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */ | | |
| 100 | #define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */ | | |
| 101 | #define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */ | | |
| 102 | #define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */ | | |
| 103 | #define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */ | | |
| 104 | #define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */ | | |
| 105 | #define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */ | | |
| 106 | #define A_GPR(x) (A_FXGPREGBASE + (x)) | | |
| 107 | | | |
| 108 | /* cc_reg constants */ | 171 | /* cc_reg constants */ |
| 109 | #define CC_REG_NORMALIZED C_00000001 | 172 | #define CC_REG_NORMALIZED C_00000001 |
| 110 | #define CC_REG_BORROW C_00000002 | 173 | #define CC_REG_BORROW C_00000002 |
| @@ -113,7 +176,17 @@ · 2 unmodified lines |
| 113 | #define CC_REG_SATURATE C_00000010 | 176 | #define CC_REG_SATURATE C_00000010 |
| 114 | #define CC_REG_NONZERO C_00000100 | 177 | #define CC_REG_NONZERO C_00000100 |
| 115 | | 178 | |
| | 179 | #define A_CC_REG_NORMALIZED A_C_00000001 |
| | 180 | #define A_CC_REG_BORROW A_C_00000002 |
| | 181 | #define A_CC_REG_MINUS A_C_00000004 |
| | 182 | #define A_CC_REG_ZERO A_C_00000008 |
| | 183 | #define A_CC_REG_SATURATE A_C_00000010 |
| | 184 | #define A_CC_REG_NONZERO A_C_00000100 |
| | 185 | |
| 116 | /* FX buses */ | 186 | /* FX buses */ |
| | 187 | // These are arbitrary mappings; our DSP code simply expects |
| | 188 | // the config files to route the channels this way. |
| | 189 | // The numbers are documented in {audigy,sb-live}-mixer.rst. |
| 117 | #define FXBUS_PCM_LEFT 0x00 | 190 | #define FXBUS_PCM_LEFT 0x00 |
| 118 | #define FXBUS_PCM_RIGHT 0x01 | 191 | #define FXBUS_PCM_RIGHT 0x01 |
| 119 | #define FXBUS_PCM_LEFT_REAR 0x02 | 192 | #define FXBUS_PCM_LEFT_REAR 0x02 |
| @@ -203,38 +276,7 @@ · 83 unmodified lines |
| 203 | #define A_EXTOUT_ADC_CAP_R 0x17 /* right */ | 276 | #define A_EXTOUT_ADC_CAP_R 0x17 /* right */ |
| 204 | #define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */ | 277 | #define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */ |
| 205 | | 278 | |
| 206 | /* Audigy constants */ | 279 | /* Definitions for debug register. Note that these are for emu10k1 ONLY. */ |
| 207 | #define A_C_00000000 0xc0 | | |
| 208 | #define A_C_00000001 0xc1 | | |
| 209 | #define A_C_00000002 0xc2 | | |
| 210 | #define A_C_00000003 0xc3 | | |
| 211 | #define A_C_00000004 0xc4 | | |
| 212 | #define A_C_00000008 0xc5 | | |
| 213 | #define A_C_00000010 0xc6 | | |
| 214 | #define A_C_00000020 0xc7 | | |
| 215 | #define A_C_00000100 0xc8 | | |
| 216 | #define A_C_00010000 0xc9 | | |
| 217 | #define A_C_00000800 0xca | | |
| 218 | #define A_C_10000000 0xcb | | |
| 219 | #define A_C_20000000 0xcc | | |
| 220 | #define A_C_40000000 0xcd | | |
| 221 | #define A_C_80000000 0xce | | |
| 222 | #define A_C_7fffffff 0xcf | | |
| 223 | #define A_C_ffffffff 0xd0 | | |
| 224 | #define A_C_fffffffe 0xd1 | | |
| 225 | #define A_C_c0000000 0xd2 | | |
| 226 | #define A_C_4f1bbcdc 0xd3 | | |
| 227 | #define A_C_5a7ef9db 0xd4 | | |
| 228 | #define A_C_00100000 0xd5 | | |
| 229 | #define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */ | | |
| 230 | #define A_GPR_COND 0xd7 /* CCR, condition register */ | | |
| 231 | #define A_GPR_NOISE0 0xd8 /* noise source */ | | |
| 232 | #define A_GPR_NOISE1 0xd9 /* noise source */ | | |
| 233 | #define A_GPR_IRQ 0xda /* IRQ register */ | | |
| 234 | #define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */ | | |
| 235 | #define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */ | | |
| 236 | | | |
| 237 | /* definitions for debug register */ | | |
| 238 | #define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */ | 280 | #define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */ |
| 239 | #define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */ | 281 | #define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */ |
| 240 | #define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */ | 282 | #define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */ |
| @@ -243,14 +285,14 @@ · 2 unmodified lines |
| 243 | #define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */ | 285 | #define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */ |
| 244 | #define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */ | 286 | #define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */ |
| 245 | | 287 | |
| 246 | /* tank memory address line */ | 288 | /* Definitions for emu10k2 debug register. */ |
| 247 | #ifndef __KERNEL__ | 289 | #define A_DBG_ZC 0x40000000 /* zero tram counter */ |
| 248 | #define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */ | 290 | #define A_DBG_SATURATION_OCCURED 0x20000000 |
| 249 | #define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */ | 291 | #define A_DBG_SATURATION_ADDR 0x0ffc0000 |
| 250 | #define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */ | 292 | #define A_DBG_SINGLE_STEP 0x00020000 /* Set to zero to start dsp */ |
| 251 | #define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */ | 293 | #define A_DBG_STEP 0x00010000 |
| 252 | #define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */ | 294 | #define A_DBG_CONDITION_CODE 0x0000f800 |
| 253 | #endif | 295 | #define A_DBG_STEP_ADDR 0x000003ff |
| 254 | | 296 | |
| 255 | struct snd_emu10k1_fx8010_info { | 297 | struct snd_emu10k1_fx8010_info { |
| 256 | unsigned int internal_tram_size; /* in samples */ | 298 | unsigned int internal_tram_size; /* in samples */ |