0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 #ifndef _LINUX_3780I_H
0050 #define _LINUX_3780I_H
0051
0052 #include <asm/io.h>
0053
0054
0055 #define DSP_IsaSlaveControl 0x0000
0056 #define DSP_IsaSlaveStatus 0x0001
0057 #define DSP_ConfigAddress 0x0002
0058 #define DSP_ConfigData 0x0003
0059 #define DSP_HBridgeControl 0x0002
0060 #define DSP_MsaAddrLow 0x0004
0061 #define DSP_MsaAddrHigh 0x0006
0062 #define DSP_MsaDataDSISHigh 0x0008
0063 #define DSP_MsaDataISLow 0x000A
0064 #define DSP_ReadAndClear 0x000C
0065 #define DSP_Interrupt 0x000E
0066
0067 typedef struct {
0068 unsigned char ClockControl:1;
0069 unsigned char SoftReset:1;
0070 unsigned char ConfigMode:1;
0071 unsigned short Reserved:13;
0072 } DSP_ISA_SLAVE_CONTROL;
0073
0074
0075 typedef struct {
0076 unsigned short EnableDspInt:1;
0077 unsigned short MemAutoInc:1;
0078 unsigned short IoAutoInc:1;
0079 unsigned short DiagnosticMode:1;
0080 unsigned short IsaPacingTimer:12;
0081 } DSP_HBRIDGE_CONTROL;
0082
0083
0084
0085 #define DSP_UartCfg1Index 0x0003
0086 #define DSP_UartCfg2Index 0x0004
0087 #define DSP_HBridgeCfg1Index 0x0007
0088 #define DSP_HBridgeCfg2Index 0x0008
0089 #define DSP_BusMasterCfg1Index 0x0009
0090 #define DSP_BusMasterCfg2Index 0x000A
0091 #define DSP_IsaProtCfgIndex 0x000F
0092 #define DSP_PowerMgCfgIndex 0x0010
0093 #define DSP_HBusTimerCfgIndex 0x0011
0094
0095 typedef struct {
0096 unsigned char IrqActiveLow:1;
0097 unsigned char IrqPulse:1;
0098 unsigned char Irq:3;
0099 unsigned char BaseIO:2;
0100 unsigned char Reserved:1;
0101 } DSP_UART_CFG_1;
0102
0103 typedef struct {
0104 unsigned char Enable:1;
0105 unsigned char Reserved:7;
0106 } DSP_UART_CFG_2;
0107
0108 typedef struct {
0109 unsigned char IrqActiveLow:1;
0110 unsigned char IrqPulse:1;
0111 unsigned char Irq:3;
0112 unsigned char AccessMode:1;
0113 unsigned char Reserved:2;
0114 } DSP_HBRIDGE_CFG_1;
0115
0116 typedef struct {
0117 unsigned char Enable:1;
0118 unsigned char Reserved:7;
0119 } DSP_HBRIDGE_CFG_2;
0120
0121
0122 typedef struct {
0123 unsigned char Dma:3;
0124 unsigned char NumTransfers:2;
0125 unsigned char ReRequest:2;
0126 unsigned char MEMCS16:1;
0127 } DSP_BUSMASTER_CFG_1;
0128
0129 typedef struct {
0130 unsigned char IsaMemCmdWidth:2;
0131 unsigned char Reserved:6;
0132 } DSP_BUSMASTER_CFG_2;
0133
0134
0135 typedef struct {
0136 unsigned char GateIOCHRDY:1;
0137 unsigned char Reserved:7;
0138 } DSP_ISA_PROT_CFG;
0139
0140 typedef struct {
0141 unsigned char Enable:1;
0142 unsigned char Reserved:7;
0143 } DSP_POWER_MGMT_CFG;
0144
0145 typedef struct {
0146 unsigned char LoadValue:8;
0147 } DSP_HBUS_TIMER_CFG;
0148
0149
0150
0151
0152 #define DSP_ChipID 0x80000000
0153 #define DSP_MspBootDomain 0x80000580
0154 #define DSP_LBusTimeoutDisable 0x80000580
0155 #define DSP_ClockControl_1 0x8000058A
0156 #define DSP_ClockControl_2 0x8000058C
0157 #define DSP_ChipReset 0x80000588
0158 #define DSP_GpioModeControl_15_8 0x80000082
0159 #define DSP_GpioDriverEnable_15_8 0x80000076
0160 #define DSP_GpioOutputData_15_8 0x80000072
0161
0162 typedef struct {
0163 unsigned short NMI:1;
0164 unsigned short Halt:1;
0165 unsigned short ResetCore:1;
0166 unsigned short Reserved:13;
0167 } DSP_BOOT_DOMAIN;
0168
0169 typedef struct {
0170 unsigned short DisableTimeout:1;
0171 unsigned short Reserved:15;
0172 } DSP_LBUS_TIMEOUT_DISABLE;
0173
0174 typedef struct {
0175 unsigned short Memory:1;
0176 unsigned short SerialPort1:1;
0177 unsigned short SerialPort2:1;
0178 unsigned short SerialPort3:1;
0179 unsigned short Gpio:1;
0180 unsigned short Dma:1;
0181 unsigned short SoundBlaster:1;
0182 unsigned short Uart:1;
0183 unsigned short Midi:1;
0184 unsigned short IsaMaster:1;
0185 unsigned short Reserved:6;
0186 } DSP_CHIP_RESET;
0187
0188 typedef struct {
0189 unsigned short N_Divisor:6;
0190 unsigned short Reserved1:2;
0191 unsigned short M_Multiplier:6;
0192 unsigned short Reserved2:2;
0193 } DSP_CLOCK_CONTROL_1;
0194
0195 typedef struct {
0196 unsigned short PllBypass:1;
0197 unsigned short Reserved:15;
0198 } DSP_CLOCK_CONTROL_2;
0199
0200 typedef struct {
0201 unsigned short Latch8:1;
0202 unsigned short Latch9:1;
0203 unsigned short Latch10:1;
0204 unsigned short Latch11:1;
0205 unsigned short Latch12:1;
0206 unsigned short Latch13:1;
0207 unsigned short Latch14:1;
0208 unsigned short Latch15:1;
0209 unsigned short Mask8:1;
0210 unsigned short Mask9:1;
0211 unsigned short Mask10:1;
0212 unsigned short Mask11:1;
0213 unsigned short Mask12:1;
0214 unsigned short Mask13:1;
0215 unsigned short Mask14:1;
0216 unsigned short Mask15:1;
0217 } DSP_GPIO_OUTPUT_DATA_15_8;
0218
0219 typedef struct {
0220 unsigned short Enable8:1;
0221 unsigned short Enable9:1;
0222 unsigned short Enable10:1;
0223 unsigned short Enable11:1;
0224 unsigned short Enable12:1;
0225 unsigned short Enable13:1;
0226 unsigned short Enable14:1;
0227 unsigned short Enable15:1;
0228 unsigned short Mask8:1;
0229 unsigned short Mask9:1;
0230 unsigned short Mask10:1;
0231 unsigned short Mask11:1;
0232 unsigned short Mask12:1;
0233 unsigned short Mask13:1;
0234 unsigned short Mask14:1;
0235 unsigned short Mask15:1;
0236 } DSP_GPIO_DRIVER_ENABLE_15_8;
0237
0238 typedef struct {
0239 unsigned short GpioMode8:2;
0240 unsigned short GpioMode9:2;
0241 unsigned short GpioMode10:2;
0242 unsigned short GpioMode11:2;
0243 unsigned short GpioMode12:2;
0244 unsigned short GpioMode13:2;
0245 unsigned short GpioMode14:2;
0246 unsigned short GpioMode15:2;
0247 } DSP_GPIO_MODE_15_8;
0248
0249
0250 #define MW_ADC_MASK 0x0001
0251 #define MW_AIC2_MASK 0x0006
0252 #define MW_MIDI_MASK 0x0008
0253 #define MW_CDDAC_MASK 0x8001
0254 #define MW_AIC1_MASK 0xE006
0255 #define MW_UART_MASK 0xE00A
0256 #define MW_ACI_MASK 0xE00B
0257
0258
0259
0260
0261
0262
0263
0264 typedef struct _DSP_3780I_CONFIG_SETTINGS {
0265
0266
0267 unsigned short usBaseConfigIO;
0268
0269
0270 int bDSPEnabled;
0271 int bModemEnabled;
0272 int bInterruptClaimed;
0273
0274
0275 unsigned short usDspIrq;
0276 unsigned short usDspDma;
0277 unsigned short usDspBaseIO;
0278 unsigned short usUartIrq;
0279 unsigned short usUartBaseIO;
0280
0281
0282 int bDspIrqActiveLow;
0283 int bUartIrqActiveLow;
0284 int bDspIrqPulse;
0285 int bUartIrqPulse;
0286
0287
0288 unsigned uIps;
0289 unsigned uDStoreSize;
0290 unsigned uIStoreSize;
0291 unsigned uDmaBandwidth;
0292
0293
0294 unsigned short usNumTransfers;
0295 unsigned short usReRequest;
0296 int bEnableMEMCS16;
0297 unsigned short usIsaMemCmdWidth;
0298 int bGateIOCHRDY;
0299 int bEnablePwrMgmt;
0300 unsigned short usHBusTimerLoadValue;
0301 int bDisableLBusTimeout;
0302 unsigned short usN_Divisor;
0303 unsigned short usM_Multiplier;
0304 int bPllBypass;
0305 unsigned short usChipletEnable;
0306
0307
0308 int bUartSaved;
0309 unsigned char ucIER;
0310 unsigned char ucFCR;
0311 unsigned char ucLCR;
0312 unsigned char ucMCR;
0313 unsigned char ucSCR;
0314 unsigned char ucDLL;
0315 unsigned char ucDLM;
0316 } DSP_3780I_CONFIG_SETTINGS;
0317
0318
0319
0320 int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
0321 unsigned short *pIrqMap,
0322 unsigned short *pDmaMap);
0323 int dsp3780I_DisableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings);
0324 int dsp3780I_Reset(DSP_3780I_CONFIG_SETTINGS * pSettings);
0325 int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings);
0326 int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
0327 unsigned uCount, unsigned long ulDSPAddr);
0328 int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
0329 void __user *pvBuffer, unsigned uCount,
0330 unsigned long ulDSPAddr);
0331 int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
0332 unsigned uCount, unsigned long ulDSPAddr);
0333 int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
0334 unsigned uCount, unsigned long ulDSPAddr);
0335 int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
0336 unsigned uCount, unsigned long ulDSPAddr);
0337 unsigned short dsp3780I_ReadMsaCfg(unsigned short usDspBaseIO,
0338 unsigned long ulMsaAddr);
0339 void dsp3780I_WriteMsaCfg(unsigned short usDspBaseIO,
0340 unsigned long ulMsaAddr, unsigned short usValue);
0341 int dsp3780I_GetIPCSource(unsigned short usDspBaseIO,
0342 unsigned short *pusIPCSource);
0343
0344
0345 #define MKWORD(var) (*((unsigned short *)(&var)))
0346 #define MKBYTE(var) (*((unsigned char *)(&var)))
0347
0348 #define WriteMsaCfg(addr,value) dsp3780I_WriteMsaCfg(usDspBaseIO,addr,value)
0349 #define ReadMsaCfg(addr) dsp3780I_ReadMsaCfg(usDspBaseIO,addr)
0350 #define WriteGenCfg(index,value) dsp3780I_WriteGenCfg(usDspBaseIO,index,value)
0351 #define ReadGenCfg(index) dsp3780I_ReadGenCfg(usDspBaseIO,index)
0352
0353 #define InWordDsp(index) inw(usDspBaseIO+index)
0354 #define InByteDsp(index) inb(usDspBaseIO+index)
0355 #define OutWordDsp(index,value) outw(value,usDspBaseIO+index)
0356 #define OutByteDsp(index,value) outb(value,usDspBaseIO+index)
0357
0358 #endif