aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/scsi/g_NCR5380.txt46
-rw-r--r--drivers/scsi/g_NCR5380.c30
2 files changed, 41 insertions, 35 deletions
diff --git a/Documentation/scsi/g_NCR5380.txt b/Documentation/scsi/g_NCR5380.txt
index e2c187947e58..37b1967a00a9 100644
--- a/Documentation/scsi/g_NCR5380.txt
+++ b/Documentation/scsi/g_NCR5380.txt
@@ -6,17 +6,15 @@ NCR53c400 extensions (c) 1994,1995,1996 Kevin Lentin
6This file documents the NCR53c400 extensions by Kevin Lentin and some 6This file documents the NCR53c400 extensions by Kevin Lentin and some
7enhancements to the NCR5380 core. 7enhancements to the NCR5380 core.
8 8
9This driver supports both NCR5380 and NCR53c400 cards in port or memory 9This driver supports NCR5380 and NCR53c400 and compatible cards in port or
10mapped modes. Currently this driver can only support one of those mapping 10memory mapped modes.
11modes at a time but it does support both of these chips at the same time.
12The next release of this driver will support port & memory mapped cards at
13the same time. It should be able to handle multiple different cards in the
14same machine.
15 11
16The drivers/scsi/Makefile has an override in it for the most common 12Use of an interrupt is recommended, if supported by the board, as this will
17NCR53c400 card, the Trantor T130B in its default configuration: 13allow targets to disconnect and thereby improve SCSI bus utilization.
18 Port: 0x350 14
19 IRQ : 5 15If the irq parameter is 254 or is omitted entirely, the driver will probe
16for the correct IRQ line automatically. If the irq parameter is 0 or 255
17then no IRQ will be used.
20 18
21The NCR53c400 does not support DMA but it does have Pseudo-DMA which is 19The NCR53c400 does not support DMA but it does have Pseudo-DMA which is
22supported by the driver. 20supported by the driver.
@@ -47,22 +45,24 @@ These old-style parameters can support only one card:
47 dtc_3181e=1 to set up for a Domex Technology Corp 3181E board 45 dtc_3181e=1 to set up for a Domex Technology Corp 3181E board
48 hp_c2502=1 to set up for a Hewlett Packard C2502 board 46 hp_c2502=1 to set up for a Hewlett Packard C2502 board
49 47
50e.g. 48E.g. Trantor T130B in its default configuration:
51OLD: modprobe g_NCR5380 ncr_irq=5 ncr_addr=0x350 ncr_5380=1 49modprobe g_NCR5380 irq=5 base=0x350 card=1
52NEW: modprobe g_NCR5380 irq=5 base=0x350 card=0 50or alternatively, using the old syntax,
53 for a port mapped NCR5380 board or 51modprobe g_NCR5380 ncr_irq=5 ncr_addr=0x350 ncr_53c400=1
54
55OLD: modprobe g_NCR5380 ncr_irq=255 ncr_addr=0xc8000 ncr_53c400=1
56NEW: modprobe g_NCR5380 irq=255 base=0xc8000 card=1
57 for a memory mapped NCR53C400 board with interrupts disabled or
58 52
59NEW: modprobe g_NCR5380 irq=0,7 base=0x240,0x300 card=3,4 53E.g. a port mapped NCR5380 board, driver to probe for IRQ:
60 for two cards: DTC3181 (in non-PnP mode) at 0x240 with no IRQ 54modprobe g_NCR5380 base=0x350 card=0
61 and HP C2502 at 0x300 with IRQ 7 55or alternatively,
56modprobe g_NCR5380 ncr_addr=0x350 ncr_5380=1
62 57
63(255 should be specified for no or DMA interrupt, 254 to autoprobe for an 58E.g. a memory mapped NCR53C400 board with no IRQ:
64 IRQ line if overridden on the command line.) 59modprobe g_NCR5380 irq=255 base=0xc8000 card=1
60or alternatively,
61modprobe g_NCR5380 ncr_irq=255 ncr_addr=0xc8000 ncr_53c400=1
65 62
63E.g. two cards, DTC3181 (in non-PnP mode) at 0x240 with no IRQ
64and HP C2502 at 0x300 with IRQ 7:
65modprobe g_NCR5380 irq=0,7 base=0x240,0x300 card=3,4
66 66
67Kevin Lentin 67Kevin Lentin
68K.Lentin@cs.monash.edu.au 68K.Lentin@cs.monash.edu.au
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index 58a0b826eb51..6f9665d50d84 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -37,7 +37,7 @@
37#define MAX_CARDS 8 37#define MAX_CARDS 8
38 38
39/* old-style parameters for compatibility */ 39/* old-style parameters for compatibility */
40static int ncr_irq; 40static int ncr_irq = -1;
41static int ncr_addr; 41static int ncr_addr;
42static int ncr_5380; 42static int ncr_5380;
43static int ncr_53c400; 43static int ncr_53c400;
@@ -52,9 +52,9 @@ module_param(ncr_53c400a, int, 0);
52module_param(dtc_3181e, int, 0); 52module_param(dtc_3181e, int, 0);
53module_param(hp_c2502, int, 0); 53module_param(hp_c2502, int, 0);
54 54
55static int irq[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 55static int irq[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
56module_param_array(irq, int, NULL, 0); 56module_param_array(irq, int, NULL, 0);
57MODULE_PARM_DESC(irq, "IRQ number(s)"); 57MODULE_PARM_DESC(irq, "IRQ number(s) (0=none, 254=auto [default])");
58 58
59static int base[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 59static int base[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
60module_param_array(base, int, NULL, 0); 60module_param_array(base, int, NULL, 0);
@@ -344,6 +344,8 @@ static int generic_NCR5380_init_one(struct scsi_host_template *tpnt,
344 /* Compatibility with documented NCR5380 kernel parameters */ 344 /* Compatibility with documented NCR5380 kernel parameters */
345 if (irq == 255 || irq == 0) 345 if (irq == 255 || irq == 0)
346 irq = NO_IRQ; 346 irq = NO_IRQ;
347 else if (irq == -1)
348 irq = IRQ_AUTO;
347 349
348 if (board == BOARD_HP_C2502) { 350 if (board == BOARD_HP_C2502) {
349 int *irq_table = hp_c2502_irqs; 351 int *irq_table = hp_c2502_irqs;
@@ -370,24 +372,28 @@ static int generic_NCR5380_init_one(struct scsi_host_template *tpnt,
370 magic_configure(port_idx, board_irq, magic); 372 magic_configure(port_idx, board_irq, magic);
371 } 373 }
372 374
373 if (irq == IRQ_AUTO) 375 if (irq == IRQ_AUTO) {
374 instance->irq = g_NCR5380_probe_irq(instance); 376 instance->irq = g_NCR5380_probe_irq(instance);
375 else 377 if (instance->irq == NO_IRQ)
378 shost_printk(KERN_INFO, instance, "no irq detected\n");
379 } else {
376 instance->irq = irq; 380 instance->irq = irq;
381 if (instance->irq == NO_IRQ)
382 shost_printk(KERN_INFO, instance, "no irq provided\n");
383 }
377 384
378 if (instance->irq != NO_IRQ) { 385 if (instance->irq != NO_IRQ) {
379 if (request_irq(instance->irq, generic_NCR5380_intr, 386 if (request_irq(instance->irq, generic_NCR5380_intr,
380 0, "NCR5380", instance)) { 387 0, "NCR5380", instance)) {
381 printk(KERN_WARNING "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq);
382 instance->irq = NO_IRQ; 388 instance->irq = NO_IRQ;
389 shost_printk(KERN_INFO, instance,
390 "irq %d denied\n", instance->irq);
391 } else {
392 shost_printk(KERN_INFO, instance,
393 "irq %d acquired\n", instance->irq);
383 } 394 }
384 } 395 }
385 396
386 if (instance->irq == NO_IRQ) {
387 printk(KERN_INFO "scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
388 printk(KERN_INFO "scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
389 }
390
391 ret = scsi_add_host(instance, pdev); 397 ret = scsi_add_host(instance, pdev);
392 if (ret) 398 if (ret)
393 goto out_free_irq; 399 goto out_free_irq;
@@ -698,7 +704,7 @@ static int __init generic_NCR5380_init(void)
698 int ret = 0; 704 int ret = 0;
699 705
700 /* compatibility with old-style parameters */ 706 /* compatibility with old-style parameters */
701 if (irq[0] == 0 && base[0] == 0 && card[0] == -1) { 707 if (irq[0] == -1 && base[0] == 0 && card[0] == -1) {
702 irq[0] = ncr_irq; 708 irq[0] = ncr_irq;
703 base[0] = ncr_addr; 709 base[0] = ncr_addr;
704 if (ncr_5380) 710 if (ncr_5380)