diff options
author | Miguel de Icaza <miguel@nuclecu.unam.mx> | 1997-08-06 19:14:48 +0000 |
---|---|---|
committer | Miguel de Icaza <miguel@nuclecu.unam.mx> | 1997-08-06 19:14:48 +0000 |
commit | e2819e52a162873ff5061de81bb749831bdb5de9 (patch) | |
tree | 6067ea700202750ba335a423696f2972700e5f76 /drivers/scsi/atari_scsi.c | |
parent | 17a005074429bbf143e40401f405ae4363e56828 (diff) |
Merge to 2.1.38.
IMPORTANT NOTE: I could not figure out what information is the
one that should be used for the following files (ie, those
that were in our tree, or those that came from Linus' patch),
please, check these:
include/asm-mips/jazz.h
include/asm-mips/jazzdma.h
include/asm-mips/ioctls.h
Diffstat (limited to 'drivers/scsi/atari_scsi.c')
-rw-r--r-- | drivers/scsi/atari_scsi.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c index 15dfb01f1..50ce159a2 100644 --- a/drivers/scsi/atari_scsi.c +++ b/drivers/scsi/atari_scsi.c @@ -90,6 +90,7 @@ #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/init.h> +#include <linux/nvram.h> #include <asm/setup.h> #include <asm/atarihw.h> @@ -596,20 +597,6 @@ int atari_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) #endif -#define RTC_READ(reg) \ - ({ unsigned char __val; \ - outb(reg,&tt_rtc.regsel); \ - __val = tt_rtc.data; \ - __val; \ - }) - -#define RTC_WRITE(reg,val) \ - do { \ - outb(reg,&tt_rtc.regsel); \ - tt_rtc.data = (val); \ - } while(0) - - int atari_scsi_detect (Scsi_Host_Template *host) { static int called = 0; @@ -645,20 +632,11 @@ int atari_scsi_detect (Scsi_Host_Template *host) /* use 7 as default */ host->this_id = 7; /* Test if a host id is set in the NVRam */ - if (ATARIHW_PRESENT(TT_CLK)) { - unsigned char sum = 0, b; - int i; - - /* Make checksum */ - for( i = 14; i < 62; ++i ) - sum += RTC_READ(i); - - if (/* NV-Ram checksum valid? */ - RTC_READ(62) == sum && RTC_READ(63) == ~sum && - /* Arbitration enabled? (for TOS) */ - (b = RTC_READ( 30 )) & 0x80) { + if (ATARIHW_PRESENT(TT_CLK) && nvram_check_checksum()) { + unsigned char b = nvram_read_byte( 14 ); + /* Arbitration enabled? (for TOS) If yes, use configured host ID */ + if (b & 0x80) host->this_id = b & 7; - } } } |