48 #define NVCMD_BEGIN_READ (0x7 << 5)
49 #define NVCMD_LOAD_LOW (0x4 << 5)
50 #define NVCMD_LOAD_HIGH (0x5 << 5)
51 #define EE76_CMD_LEN 13
52 #define EE_READ 0x0180
54 #define EEPROM_DIGITALINPUT 0
55 #define EEPROM_DIGITALOUTPUT 1
56 #define EEPROM_ANALOGINPUT 2
57 #define EEPROM_ANALOGOUTPUT 3
58 #define EEPROM_TIMER 4
59 #define EEPROM_WATCHDOG 5
60 #define EEPROM_TIMER_WATCHDOG_COUNTER 10
126 char *pc_PCIChipInformation,
unsigned short w_Address,
130 char *pc_PCIChipInformation,
unsigned short w_Address,
134 char *pc_PCIChipInformation,
unsigned short w_Address,
138 char *pc_PCIChipInformation,
unsigned short w_Address,
142 char *pc_PCIChipInformation,
unsigned short w_Address,
148 unsigned short w_EepromReadWord(
unsigned short w_PCIBoardEepromAddress,
char *pc_PCIChipInformation,
149 unsigned short w_EepromStartAddress);
151 void v_EepromClock76(
unsigned int dw_Address,
unsigned int dw_RegisterValue);
154 unsigned char b_DataLengthInBits);
178 unsigned short w_EepromReadWord(
unsigned short w_PCIBoardEepromAddress,
char *pc_PCIChipInformation,
179 unsigned short w_EepromStartAddress)
182 unsigned char b_Counter = 0;
184 unsigned char b_ReadByte = 0;
186 unsigned char b_ReadLowByte = 0;
188 unsigned char b_ReadHighByte = 0;
190 unsigned char b_SelectedAddressLow = 0;
192 unsigned char b_SelectedAddressHigh = 0;
194 unsigned short w_ReadWord = 0;
202 if ((!
strcmp(pc_PCIChipInformation,
"S5920")) ||
203 (!
strcmp(pc_PCIChipInformation,
"S5933")))
206 for (b_Counter = 0; b_Counter < 2; b_Counter++)
209 b_SelectedAddressLow = (w_EepromStartAddress + b_Counter) % 256;
211 b_SelectedAddressHigh = (w_EepromStartAddress + b_Counter) / 256;
235 outb(b_SelectedAddressLow,
236 w_PCIBoardEepromAddress + 0x3E);
268 outb(b_SelectedAddressHigh,
269 w_PCIBoardEepromAddress + 0x3E);
301 b_ReadByte =
inb(w_PCIBoardEepromAddress + 0x3E);
320 b_ReadLowByte = b_ReadByte;
327 b_ReadHighByte = b_ReadByte;
333 w_ReadWord = (b_ReadLowByte | (((
unsigned short) b_ReadHighByte) * 256));
337 if (!
strcmp(pc_PCIChipInformation,
"93C76"))
386 unsigned char b_EepromBusy = 0;
411 b_EepromBusy =
inb(w_PCIBoardEepromAddress + 0x3F);
412 b_EepromBusy = b_EepromBusy & 0x80;
414 }
while (b_EepromBusy == 0x80);
457 outl(dw_RegisterValue & 0x6, dw_Address);
473 outl(dw_RegisterValue | 0x1, dw_Address);
520 unsigned char b_DataLengthInBits)
525 unsigned int dw_RegisterValue = 0;
533 dw_RegisterValue = 0x2;
541 outl(dw_RegisterValue, dw_Address);
557 for (c_BitPos = (b_DataLengthInBits - 1); c_BitPos >= 0; c_BitPos--)
566 if (dw_EepromCommand & (1 << c_BitPos))
575 dw_RegisterValue = dw_RegisterValue | 0x4;
588 dw_RegisterValue = dw_RegisterValue & 0x3;
598 outl(dw_RegisterValue, dw_Address);
659 unsigned int dw_RegisterValue = 0;
661 unsigned int dw_RegisterValueRead = 0;
678 dw_RegisterValue = (((w_offset / 2) & 0x1) << 2) | 0x2;
694 for (c_BitPos = 0; c_BitPos < 16; c_BitPos++)
711 dw_RegisterValueRead =
inl(dw_Address);
727 if (dw_RegisterValueRead & 0x8)
736 *pw_Value = (*pw_Value << 1) | 0x1;
749 *pw_Value = (*pw_Value << 1);
761 dw_RegisterValue = 0x0;
769 outl(dw_RegisterValue, dw_Address);
808 unsigned short w_Temp,
i, w_Count = 0;
809 unsigned int ui_Temp;
824 pc_PCIChipInformation, 0x100 + 10);
831 pc_PCIChipInformation, 0x100 + 12 + w_Count);
833 w_Count = w_Count + 2;
837 pc_PCIChipInformation, 0x100 + 12 + w_Count);
838 w_Count = w_Count + 2;
847 pc_PCIChipInformation,
849 &s_DigitalInputHeader);
850 devpriv->s_EeParameters.i_NbrDiChannel =
856 pc_PCIChipInformation,
858 &s_DigitalOutputHeader);
859 devpriv->s_EeParameters.i_NbrDoChannel =
861 ui_Temp = 0xffffffff;
862 devpriv->s_EeParameters.i_DoMaxdata =
864 devpriv->s_EeParameters.i_NbrDoChannel);
869 pc_PCIChipInformation,
871 &s_AnalogInputHeader);
873 devpriv->s_EeParameters.i_NbrAiChannel =
876 devpriv->s_EeParameters.i_NbrAiChannel =
878 devpriv->s_EeParameters.i_Dma =
880 devpriv->s_EeParameters.ui_MinAcquisitiontimeNs =
883 devpriv->s_EeParameters.ui_MinDelaytimeNs =
887 devpriv->s_EeParameters.i_AiMaxdata =
894 pc_PCIChipInformation,
896 &s_AnalogOutputHeader);
897 devpriv->s_EeParameters.i_NbrAoChannel =
900 devpriv->s_EeParameters.i_AoMaxdata =
907 devpriv->s_EeParameters.i_Timer = 1;
912 devpriv->s_EeParameters.i_Timer = 1;
917 devpriv->s_EeParameters.i_Timer = 1;
947 char *pc_PCIChipInformation,
unsigned short w_Address,
950 unsigned short w_Temp;
955 0x100 + w_Address + 6);
959 pc_PCIChipInformation, 0x100 + w_Address + 8);
965 0x100 + w_Address + 10);
992 char *pc_PCIChipInformation,
unsigned short w_Address,
998 0x100 + w_Address + 6);
1023 char *pc_PCIChipInformation,
unsigned short w_Address,
1027 unsigned short i, w_Size = 0, w_Temp;
1032 0x100 + w_Address + 6);
1035 for (i = 0; i < s_Header->
w_Ntimer; i++) {
1038 pc_PCIChipInformation,
1039 0x100 + w_Address + 8 + w_Size + 0);
1041 pc_PCIChipInformation,
1042 0x100 + w_Address + 8 + w_Size + 2);
1046 (
unsigned char) (w_Temp >> 10) & 0x3F;
1050 (
unsigned char) (w_Temp >> 4) & 0x3F;
1053 pc_PCIChipInformation,
1054 0x100 + w_Address + 8 + w_Size + 4);
1089 char *pc_PCIChipInformation,
unsigned short w_Address,
1092 unsigned short w_Temp;
1095 pc_PCIChipInformation, 0x100 + w_Address + 10);
1096 s_Header->
w_Nchannel = (w_Temp >> 4) & 0x03FF;
1099 pc_PCIChipInformation, 0x100 + w_Address + 16);
1127 char *pc_PCIChipInformation,
unsigned short w_Address,
1130 unsigned short w_Temp, w_Offset;
1132 pc_PCIChipInformation, 0x100 + w_Address + 10);
1133 s_Header->
w_Nchannel = (w_Temp >> 4) & 0x03FF;
1136 0x100 + w_Address + 16);
1139 0x100 + w_Address + 30);
1141 pc_PCIChipInformation, 0x100 + w_Address + 20);
1142 s_Header->
b_HasDma = (w_Temp >> 13) & 0x01;
1144 w_Temp =
w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation, 0x100 + w_Address + 72);
1145 w_Temp = w_Temp & 0x00FF;
1148 w_Offset = 74 + (2 * w_Temp) + (10 * (1 + (w_Temp / 16)));
1149 w_Offset = w_Offset + 2;
1153 w_Offset = w_Offset + 2;
1158 pc_PCIChipInformation, 0x100 + w_Address + w_Offset);