--- drivers/scsi/g_NCR5380.c +++ drivers/scsi/g_NCR5380.c Mon Feb 3 16:49:42 1997 @@ -104,6 +104,7 @@ #include "constants.h" #include "sd.h" #include +#include struct proc_dir_entry proc_scsi_g_ncr5380 = { PROC_SCSI_GENERIC_NCR5380, 9, "g_NCR5380", @@ -116,6 +117,7 @@ static int ncr_addr=NCR_NOT_SET; static int ncr_5380=NCR_NOT_SET; static int ncr_53c400=NCR_NOT_SET; +static int ncr_53c400a=NCR_NOT_SET; static struct override { NCR5380_implementation_fields; @@ -155,6 +157,11 @@ printk("generic_NCR53C400_setup : usage ncr53c400=" STRVAL(NCR5380_map_name) ",irq\n"); return; } + case BOARD_NCR53C400A: + if (ints[0] != 2) { + printk("generic_NCR53C400A_setup : usage ncr53c400a=" STRVAL(NCR5380_map_name) ",irq\n"); + return; + } } if (commandline_current < NO_OVERRIDES) { @@ -195,6 +202,19 @@ internal_setup (BOARD_NCR53C400, str, ints); } +/* + * Function : generic_NCR53C400A_setup (char *str, int *ints) + * + * Purpose : LILO command line initialization of the overrides array, + * + * Inputs : str - unused, ints - array of integer parameters with ints[0] + * equal to the number of ints. + */ + +void generic_NCR53C400A_setup (char *str, int *ints) { + internal_setup (BOARD_NCR53C400A, str, ints); +} + /* * Function : int generic_NCR5380_detect(Scsi_Host_Template * tpnt) * @@ -209,7 +229,9 @@ int generic_NCR5380_detect(Scsi_Host_Template * tpnt) { static int current_override = 0; - int count; + int count, i; + u_int ports[] = {0x280, 0x290, 0x300, 0x310, 0x330, + 0x340, 0x348, 0x350, 0}; int flags = 0; struct Scsi_Host *instance; @@ -223,6 +245,8 @@ overrides[0].board=BOARD_NCR5380; else if (ncr_53c400 != NCR_NOT_SET) overrides[0].board=BOARD_NCR53C400; + else if (ncr_53c400a != NCR_NOT_SET) + overrides[0].board=BOARD_NCR53C400A; tpnt->proc_dir = &proc_scsi_g_ncr5380; @@ -237,8 +261,49 @@ case BOARD_NCR53C400: flags = FLAG_NCR53C400; break; + case BOARD_NCR53C400A: + flags = FLAG_NO_PSEUDO_DMA; + + /* wakeup sequence for the NCR53C400A */ + + /* Disable the adapter and look for a free io port */ + outb(0x59, 0x779); + outb(0xb9, 0x379); + outb(0xc5, 0x379); + outb(0xae, 0x379); + outb(0xa6, 0x379); + outb(0x00, 0x379); + + if (overrides[current_override].NCR5380_map_name != PORT_AUTO) + for(i=0; ports[i]; i++) { + if (overrides[current_override].NCR5380_map_name == ports[i]) + break; + } + else + for(i=0; ports[i]; i++) { + if ((!check_region(ports[i], 16)) && (inb(ports[i]) == 0xff)) + break; + } + if (ports[i]) { + outb(0x59, 0x779); + outb(0xb9, 0x379); + outb(0xc5, 0x379); + outb(0xae, 0x379); + outb(0xa6, 0x379); + outb(0x80 | i, 0x379); /* set io port to be used */ + outb(0xc0, ports[i] + 9); + if (inb(ports[i] + 9) != 0x80) + continue; + else + overrides[current_override].NCR5380_map_name=ports[i]; + } else + continue; + break; } + request_region(overrides[current_override].NCR5380_map_name, + NCR5380_region_size, "ncr5380"); + instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata)); instance->NCR5380_instance_name = overrides[current_override].NCR5380_map_name; @@ -287,6 +352,8 @@ NCR5380_local_declare(); NCR5380_setup(instance); + + release_region(instance->NCR5380_instance_name, NCR5380_region_size); if (instance->irq != IRQ_NONE) free_irq(instance->irq, NULL); --- drivers/scsi/g_NCR5380.h +++ drivers/scsi/g_NCR5380.h Mon Feb 3 20:11:06 1997 @@ -159,6 +159,7 @@ #define BOARD_NCR5380 0 #define BOARD_NCR53C400 1 +#define BOARD_NCR53C400A 2 #endif /* else def HOSTS_C */ #endif /* ndef ASM */ --- drivers/scsi/NCR5380.h +++ drivers/scsi/NCR5380.h Mon Feb 3 16:16:56 1997 @@ -235,6 +235,7 @@ #define DMA_NONE 255 #define IRQ_AUTO 254 #define DMA_AUTO 254 +#define PORT_AUTO 0xffff /* autoprobe io port for 53c400a */ #define FLAG_HAS_LAST_BYTE_SENT 1 /* NCR53c81 or better */ #define FLAG_CHECK_LAST_BYTE_SENT 2 /* Only test once */ --- init/main.c +++ init/main.c Sat Feb 8 13:56:07 1997 @@ -310,6 +310,7 @@ #ifdef CONFIG_SCSI_GENERIC_NCR5380 { "ncr5380=", generic_NCR5380_setup }, { "ncr53c400=", generic_NCR53C400_setup }, + { "ncr53c400a=", generic_NCR53C400A_setup }, #endif #ifdef CONFIG_SCSI_AHA152X { "aha152x=", aha152x_setup},