diff options
-rw-r--r-- | Documentation/scsi/g_NCR5380.txt | 46 | ||||
-rw-r--r-- | drivers/scsi/g_NCR5380.c | 30 |
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 | |||
6 | This file documents the NCR53c400 extensions by Kevin Lentin and some | 6 | This file documents the NCR53c400 extensions by Kevin Lentin and some |
7 | enhancements to the NCR5380 core. | 7 | enhancements to the NCR5380 core. |
8 | 8 | ||
9 | This driver supports both NCR5380 and NCR53c400 cards in port or memory | 9 | This driver supports NCR5380 and NCR53c400 and compatible cards in port or |
10 | mapped modes. Currently this driver can only support one of those mapping | 10 | memory mapped modes. |
11 | modes at a time but it does support both of these chips at the same time. | ||
12 | The next release of this driver will support port & memory mapped cards at | ||
13 | the same time. It should be able to handle multiple different cards in the | ||
14 | same machine. | ||
15 | 11 | ||
16 | The drivers/scsi/Makefile has an override in it for the most common | 12 | Use of an interrupt is recommended, if supported by the board, as this will |
17 | NCR53c400 card, the Trantor T130B in its default configuration: | 13 | allow targets to disconnect and thereby improve SCSI bus utilization. |
18 | Port: 0x350 | 14 | |
19 | IRQ : 5 | 15 | If the irq parameter is 254 or is omitted entirely, the driver will probe |
16 | for the correct IRQ line automatically. If the irq parameter is 0 or 255 | ||
17 | then no IRQ will be used. | ||
20 | 18 | ||
21 | The NCR53c400 does not support DMA but it does have Pseudo-DMA which is | 19 | The NCR53c400 does not support DMA but it does have Pseudo-DMA which is |
22 | supported by the driver. | 20 | supported 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 | ||
50 | e.g. | 48 | E.g. Trantor T130B in its default configuration: |
51 | OLD: modprobe g_NCR5380 ncr_irq=5 ncr_addr=0x350 ncr_5380=1 | 49 | modprobe g_NCR5380 irq=5 base=0x350 card=1 |
52 | NEW: modprobe g_NCR5380 irq=5 base=0x350 card=0 | 50 | or alternatively, using the old syntax, |
53 | for a port mapped NCR5380 board or | 51 | modprobe g_NCR5380 ncr_irq=5 ncr_addr=0x350 ncr_53c400=1 |
54 | |||
55 | OLD: modprobe g_NCR5380 ncr_irq=255 ncr_addr=0xc8000 ncr_53c400=1 | ||
56 | NEW: modprobe g_NCR5380 irq=255 base=0xc8000 card=1 | ||
57 | for a memory mapped NCR53C400 board with interrupts disabled or | ||
58 | 52 | ||
59 | NEW: modprobe g_NCR5380 irq=0,7 base=0x240,0x300 card=3,4 | 53 | E.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 | 54 | modprobe g_NCR5380 base=0x350 card=0 |
61 | and HP C2502 at 0x300 with IRQ 7 | 55 | or alternatively, |
56 | modprobe 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 | 58 | E.g. a memory mapped NCR53C400 board with no IRQ: |
64 | IRQ line if overridden on the command line.) | 59 | modprobe g_NCR5380 irq=255 base=0xc8000 card=1 |
60 | or alternatively, | ||
61 | modprobe g_NCR5380 ncr_irq=255 ncr_addr=0xc8000 ncr_53c400=1 | ||
65 | 62 | ||
63 | E.g. two cards, DTC3181 (in non-PnP mode) at 0x240 with no IRQ | ||
64 | and HP C2502 at 0x300 with IRQ 7: | ||
65 | modprobe g_NCR5380 irq=0,7 base=0x240,0x300 card=3,4 | ||
66 | 66 | ||
67 | Kevin Lentin | 67 | Kevin Lentin |
68 | K.Lentin@cs.monash.edu.au | 68 | K.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 */ |
40 | static int ncr_irq; | 40 | static int ncr_irq = -1; |
41 | static int ncr_addr; | 41 | static int ncr_addr; |
42 | static int ncr_5380; | 42 | static int ncr_5380; |
43 | static int ncr_53c400; | 43 | static int ncr_53c400; |
@@ -52,9 +52,9 @@ module_param(ncr_53c400a, int, 0); | |||
52 | module_param(dtc_3181e, int, 0); | 52 | module_param(dtc_3181e, int, 0); |
53 | module_param(hp_c2502, int, 0); | 53 | module_param(hp_c2502, int, 0); |
54 | 54 | ||
55 | static int irq[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; | 55 | static int irq[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; |
56 | module_param_array(irq, int, NULL, 0); | 56 | module_param_array(irq, int, NULL, 0); |
57 | MODULE_PARM_DESC(irq, "IRQ number(s)"); | 57 | MODULE_PARM_DESC(irq, "IRQ number(s) (0=none, 254=auto [default])"); |
58 | 58 | ||
59 | static int base[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; | 59 | static int base[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; |
60 | module_param_array(base, int, NULL, 0); | 60 | module_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) |