aha154x.c
This is the port driver for the Adaptec 1540B SCSI Adapter.
// This conditionally compiles in the code to force the DMA transfer speed
// to 5.0.
#define FORCE_DMA_SPEED 1
// Set the DMA transfer speed to 5.0 MB/second. This is because
// faster transfer speeds cause data corruption on 486/33 machines.
// This overrides the card jumper setting.
**Ed: AHA-1640 is rated 8 MB/sec and uses the same driver. AHA-1542C/CF
allows to test and set the DMA speed (5 MB/sec is the default) and the speed
depends on the quality of the ISA/EISA mainboard, normally about 7 MB/sec
can be reached. The code can be recompiled with the above setting disabled,
but what will be then the default DMA transfer speed of AHA-1640?
AHA-1640 is 1991, the PDF of AHA-1540/42B is dated April 1990. Selectable
DMA speeds are 5.0, 5.7, 6.7, 8.0 MB/sec, hence AHA-1640 should support them
too. Could be there an undocumented option of the > 1 GB translation, since
the miniport driver queries (port I/O) this setting.
...............
// MCA specific definitions.
#define NUMBER_POS_SLOTS 8
#define POS_IDENTIFIER 0x0F1F
// ** Ed: 0F1F Adaptec AHA-1640 SCSI Host Adapter
#define POS_PORT_MASK 0xC7
#define POS_PORT_130 0x01
#define POS_PORT_134 0x41
#define POS_PORT_230 0x02
#define POS_PORT_234 0x42
#define POS_PORT_330 0x03
#define POS_PORT_334 0x43
typedef struct _POS_DATA {
USHORT AdapterId;
UCHAR BiosEnabled;
UCHAR IoPortInformation;
UCHAR ScsiInformation;
UCHAR DmaInformation;
} POS_DATA, *PPOS_DATA;
typedef struct _INIT_DATA {
ULONG AdapterId;
ULONG CardSlot;
POS_DATA PosData[NUMBER_POS_SLOTS];
} INIT_DATA, *PINIT_DATA;
..........
-
UZ
I/O Port Interface:
base + 0 = control (write) / status (read) register
base + 1 = command (write) / data (read) register
base + 2 = interrupt flags (read) register
Example: Adapter Inquiry, command opcode of 0x04
- Boot DOS
- Find out base address (1640: run sysconfig or run QUMC, look at the last
three bits (0, 1, 2) of pos[1] then look for a match in 0F1F.ADF), assume
port 330 for the following steps.
- Run debug
- Read in from port 330 (base + 0, enter 'i 330'), should return 10 meaning
idle
- Write 04 to port 331 (base + 1, enter 'o 331 04')
- Read four bytes from port 331 (base + 1, enter 'i 331', repeat four
times):
AHA-1640:
byte 0 = 42 - board id
byte 1 = 41 - hardware id
byte 2 = 42 - hardware revision in hardware id
byte 3 = 33 - firmware id
1542CF:
byte 0 = 45
byte 1 = 30
byte 2 = 45
byte 3 = 30
Interpretation:
41 (byte 0) = AHA-154xB
42 (byte 0) = AHA-1640
44 (byte 0) = AHA-154xC
45 (byte 0) = AHA-154xCF (with floppy controller)
30 (byte 1) = interpreted as 'bad hardware id'
33 (byte 3) = interpreted as 'bad firmware id'
Bad hardware ID and/or bad firmware ID may have the scatter/gatter bug,
there is a special routine to check for this bug.
Another command: Return Configuration Data, opcode 0B
1542CF:
20
02
07 - adapter ID ?
1640:
00
40
07 - adapter ID ?
- Quit debug
- REBOOT (adapter may have been left in an indetermined state)
--
UZ