Commit 798c67c3 authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Linus Torvalds

[PATCH] improve NCR53c710 SCSI driver

parent 5f8c40c2
This diff is collapsed.
...@@ -24,7 +24,7 @@ int sim710_release(struct Scsi_Host *); ...@@ -24,7 +24,7 @@ int sim710_release(struct Scsi_Host *);
#include <scsi/scsicam.h> #include <scsi/scsicam.h>
#define SIM710_SCSI { proc_name: "sim710", \ #define SIM710_SCSI { proc_name: "sim710", \
name: "Simple 53c710", \ name: "53c710", \
detect: sim710_detect, \ detect: sim710_detect, \
release: sim710_release, \ release: sim710_release, \
queuecommand: sim710_queuecommand, \ queuecommand: sim710_queuecommand, \
...@@ -413,7 +413,7 @@ int sim710_release(struct Scsi_Host *); ...@@ -413,7 +413,7 @@ int sim710_release(struct Scsi_Host *);
#define CTEST3_800_FM 0x02 /* Fetch mode pin */ #define CTEST3_800_FM 0x02 /* Fetch mode pin */
/* bit 0 is reserved on 800 series chips */ /* bit 0 is reserved on 800 series chips */
#define CTEST4_REG_400 (0x18^bE) /* Chip test 4 rw */ #define CTEST4_REG_700 (0x18^bE) /* Chip test 4 rw */
#define CTEST4_REG_800 (0x21^bE) /* Chip test 4 rw */ #define CTEST4_REG_800 (0x21^bE) /* Chip test 4 rw */
/* 0x80 is reserved on 700 series chips */ /* 0x80 is reserved on 700 series chips */
#define CTEST4_800_BDIS 0x80 /* Burst mode disable */ #define CTEST4_800_BDIS 0x80 /* Burst mode disable */
...@@ -791,6 +791,20 @@ int sim710_release(struct Scsi_Host *); ...@@ -791,6 +791,20 @@ int sim710_release(struct Scsi_Host *);
#define ISTAT_REG ISTAT_REG_700 #define ISTAT_REG ISTAT_REG_700
#define SCRATCH_REG SCRATCHB_REG_10 #define SCRATCH_REG SCRATCHB_REG_10
#define ADDER_REG ADDER_REG_10
#define SIEN_REG SIEN_REG_700
#define SDID_REG SDID_REG_700
#define CTEST0_REG CTEST0_REG_700
#define CTEST1_REG CTEST1_REG_700
#define CTEST2_REG CTEST2_REG_700
#define CTEST3_REG CTEST3_REG_700
#define CTEST4_REG CTEST4_REG_700
#define CTEST5_REG CTEST5_REG_700
#define CTEST6_REG CTEST6_REG_700
#define SODL_REG SODL_REG_700
#define SBDL_REG SBDL_REG_700
#define SIDL_REG SIDL_REG_700
#define LCRC_REG LCRC_REG_10
#ifdef MEM_MAPPED #ifdef MEM_MAPPED
#define NCR_read8(address) \ #define NCR_read8(address) \
......
...@@ -15,15 +15,12 @@ ABSOLUTE dsa_size = 2088 ...@@ -15,15 +15,12 @@ ABSOLUTE dsa_size = 2088
ABSOLUTE reselected_identify = 0 ABSOLUTE reselected_identify = 0
ABSOLUTE msgin_buf = 0 ABSOLUTE msgin_buf = 0
ABSOLUTE msg_reject = 0
ABSOLUTE test1_src = 0
ABSOLUTE test1_dst = 0
/* Interrupt values passed back to driver */ /* Interrupt values passed back to driver */
ABSOLUTE int_bad_extmsg1a = 0xab930000
ABSOLUTE int_bad_extmsg1b = 0xab930001
ABSOLUTE int_bad_extmsg2a = 0xab930002
ABSOLUTE int_bad_extmsg2b = 0xab930003
ABSOLUTE int_bad_extmsg3a = 0xab930004
ABSOLUTE int_bad_extmsg3b = 0xab930005
ABSOLUTE int_bad_msg1 = 0xab930006 ABSOLUTE int_bad_msg1 = 0xab930006
ABSOLUTE int_bad_msg2 = 0xab930007 ABSOLUTE int_bad_msg2 = 0xab930007
ABSOLUTE int_bad_msg3 = 0xab930008 ABSOLUTE int_bad_msg3 = 0xab930008
...@@ -47,9 +44,9 @@ ABSOLUTE int_disc1 = 0xab930019 ...@@ -47,9 +44,9 @@ ABSOLUTE int_disc1 = 0xab930019
ABSOLUTE int_disc2 = 0xab93001a ABSOLUTE int_disc2 = 0xab93001a
ABSOLUTE int_disc3 = 0xab93001b ABSOLUTE int_disc3 = 0xab93001b
ABSOLUTE int_not_rej = 0xab93001c ABSOLUTE int_not_rej = 0xab93001c
ABSOLUTE int_test1 = 0xab93001d
/* Bit field settings used to record status in SCRATCH0 */
/* Bit field settings used to record status in SCRATCH */
ABSOLUTE had_select = 0x01 ABSOLUTE had_select = 0x01
ABSOLUTE had_msgout = 0x02 ABSOLUTE had_msgout = 0x02
...@@ -60,6 +57,9 @@ ABSOLUTE had_status = 0x20 ...@@ -60,6 +57,9 @@ ABSOLUTE had_status = 0x20
ABSOLUTE had_msgin = 0x40 ABSOLUTE had_msgin = 0x40
ABSOLUTE had_extmsg = 0x80 ABSOLUTE had_extmsg = 0x80
/* Bit field settings used to record status in SCRATCH1 */
ABSOLUTE did_reject = 0x01
/* These scripts are heavily based on the examples in the NCR 53C710 /* These scripts are heavily based on the examples in the NCR 53C710
* Programmer's Guide (Preliminary). * Programmer's Guide (Preliminary).
...@@ -68,7 +68,6 @@ ABSOLUTE had_extmsg = 0x80 ...@@ -68,7 +68,6 @@ ABSOLUTE had_extmsg = 0x80
ENTRY do_select ENTRY do_select
do_select: do_select:
CLEAR TARGET CLEAR TARGET
MOVE SCRATCH0 & 0 TO SCRATCH0
; Enable selection timer ; Enable selection timer
MOVE CTEST7 & 0xef TO CTEST7 MOVE CTEST7 & 0xef TO CTEST7
SELECT ATN FROM dsa_select, reselect SELECT ATN FROM dsa_select, reselect
...@@ -401,17 +400,23 @@ ext_msg1: ...@@ -401,17 +400,23 @@ ext_msg1:
MOVE SCRATCH0 | had_extmsg TO SCRATCH0 MOVE SCRATCH0 | had_extmsg TO SCRATCH0
CLEAR ACK CLEAR ACK
MOVE 1, msgin_buf + 1, WHEN MSG_IN MOVE 1, msgin_buf + 1, WHEN MSG_IN
JUMP ext_msg1a, IF 0x03 JUMP reject_msg1, IF NOT 0x03 ; Only handle SDTR
INT int_bad_extmsg1a
ext_msg1a:
CLEAR ACK CLEAR ACK
MOVE 1, msgin_buf + 2, WHEN MSG_IN MOVE 1, msgin_buf + 2, WHEN MSG_IN
JUMP ext_msg1b, IF 0x01 ; Must be SDTR JUMP reject_msg1, IF NOT 0x01 ; Only handle SDTR
INT int_bad_extmsg1b
ext_msg1b:
CLEAR ACK CLEAR ACK
MOVE 2, msgin_buf + 3, WHEN MSG_IN MOVE 2, msgin_buf + 3, WHEN MSG_IN
INT int_msg_sdtr1 INT int_msg_sdtr1
reject_msg1:
MOVE SCRATCH1 | did_reject TO SCRATCH1
SET ATN
CLEAR ACK
JUMP reject_msg1a, WHEN NOT MSG_IN
MOVE 1, msgin_buf + 7, WHEN MSG_IN
JUMP reject_msg1
reject_msg1a:
MOVE 1, msg_reject, WHEN MSG_OUT
JUMP redo_msgin1
disc1: disc1:
CLEAR ACK CLEAR ACK
ENTRY wait_disc1 ENTRY wait_disc1
...@@ -446,17 +451,23 @@ ext_msg2: ...@@ -446,17 +451,23 @@ ext_msg2:
MOVE SCRATCH0 | had_extmsg TO SCRATCH0 MOVE SCRATCH0 | had_extmsg TO SCRATCH0
CLEAR ACK CLEAR ACK
MOVE 1, msgin_buf + 1, WHEN MSG_IN MOVE 1, msgin_buf + 1, WHEN MSG_IN
JUMP ext_msg2a, IF 0x03 JUMP reject_msg2, IF NOT 0x03 ; Only handle SDTR
INT int_bad_extmsg2a
ext_msg2a:
CLEAR ACK CLEAR ACK
MOVE 1, msgin_buf + 2, WHEN MSG_IN MOVE 1, msgin_buf + 2, WHEN MSG_IN
JUMP ext_msg2b, IF 0x01 ; Must be SDTR JUMP reject_msg2, IF NOT 0x01 ; Only handle SDTR
INT int_bad_extmsg2b
ext_msg2b:
CLEAR ACK CLEAR ACK
MOVE 2, msgin_buf + 3, WHEN MSG_IN MOVE 2, msgin_buf + 3, WHEN MSG_IN
INT int_msg_sdtr2 INT int_msg_sdtr2
reject_msg2:
MOVE SCRATCH1 | did_reject TO SCRATCH1
SET ATN
CLEAR ACK
JUMP reject_msg2a, WHEN NOT MSG_IN
MOVE 1, msgin_buf + 7, WHEN MSG_IN
JUMP reject_msg2
reject_msg2a:
MOVE 1, msg_reject, WHEN MSG_OUT
JUMP redo_msgin2
disc2: disc2:
CLEAR ACK CLEAR ACK
ENTRY wait_disc2 ENTRY wait_disc2
...@@ -491,17 +502,23 @@ ext_msg3: ...@@ -491,17 +502,23 @@ ext_msg3:
MOVE SCRATCH0 | had_extmsg TO SCRATCH0 MOVE SCRATCH0 | had_extmsg TO SCRATCH0
CLEAR ACK CLEAR ACK
MOVE 1, msgin_buf + 1, WHEN MSG_IN MOVE 1, msgin_buf + 1, WHEN MSG_IN
JUMP ext_msg3a, IF 0x03 JUMP reject_msg3, IF NOT 0x03 ; Only handle SDTR
INT int_bad_extmsg3a
ext_msg3a:
CLEAR ACK CLEAR ACK
MOVE 1, msgin_buf + 2, WHEN MSG_IN MOVE 1, msgin_buf + 2, WHEN MSG_IN
JUMP ext_msg3b, IF 0x01 ; Must be SDTR JUMP reject_msg3, IF NOT 0x01 ; Only handle SDTR
INT int_bad_extmsg3b
ext_msg3b:
CLEAR ACK CLEAR ACK
MOVE 2, msgin_buf + 3, WHEN MSG_IN MOVE 2, msgin_buf + 3, WHEN MSG_IN
INT int_msg_sdtr3 INT int_msg_sdtr3
reject_msg3:
MOVE SCRATCH1 | did_reject TO SCRATCH1
SET ATN
CLEAR ACK
JUMP reject_msg3a, WHEN NOT MSG_IN
MOVE 1, msgin_buf + 7, WHEN MSG_IN
JUMP reject_msg3
reject_msg3a:
MOVE 1, msg_reject, WHEN MSG_OUT
JUMP redo_msgin3
disc3: disc3:
CLEAR ACK CLEAR ACK
ENTRY wait_disc3 ENTRY wait_disc3
...@@ -552,3 +569,8 @@ patch_new_dsa: ...@@ -552,3 +569,8 @@ patch_new_dsa:
selected: selected:
INT int_selected INT int_selected
ENTRY test1
test1:
MOVE MEMORY 4, test1_src, test1_dst
INT int_test1
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment