aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/53c700.c3
-rw-r--r--drivers/scsi/53c700.h192
-rw-r--r--drivers/scsi/Kconfig10
-rw-r--r--drivers/scsi/NCR_D700.c5
-rw-r--r--drivers/scsi/lasi700.c1
-rw-r--r--drivers/scsi/sim710.c5
6 files changed, 27 insertions, 189 deletions
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index a591fcb8aab1..4b1bb529f676 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -389,8 +389,7 @@ NCR_700_detect(struct scsi_host_template *tpnt,
389 host->max_lun = NCR_700_MAX_LUNS; 389 host->max_lun = NCR_700_MAX_LUNS;
390 BUG_ON(NCR_700_transport_template == NULL); 390 BUG_ON(NCR_700_transport_template == NULL);
391 host->transportt = NCR_700_transport_template; 391 host->transportt = NCR_700_transport_template;
392 host->unique_id = hostdata->base; 392 host->unique_id = (unsigned long)hostdata->base;
393 host->base = hostdata->base;
394 hostdata->eh_complete = NULL; 393 hostdata->eh_complete = NULL;
395 host->hostdata[0] = (unsigned long)hostdata; 394 host->hostdata[0] = (unsigned long)hostdata;
396 /* kick the chip */ 395 /* kick the chip */
diff --git a/drivers/scsi/53c700.h b/drivers/scsi/53c700.h
index df4aa30ae0aa..e86012cf6ab7 100644
--- a/drivers/scsi/53c700.h
+++ b/drivers/scsi/53c700.h
@@ -14,10 +14,6 @@
14#include <scsi/scsi_device.h> 14#include <scsi/scsi_device.h>
15 15
16 16
17#if defined(CONFIG_53C700_MEM_MAPPED) && defined(CONFIG_53C700_IO_MAPPED)
18#define CONFIG_53C700_BOTH_MAPPED
19#endif
20
21/* Turn on for general debugging---too verbose for normal use */ 17/* Turn on for general debugging---too verbose for normal use */
22#undef NCR_700_DEBUG 18#undef NCR_700_DEBUG
23/* Debug the tag queues, checking hash queue allocation and deallocation 19/* Debug the tag queues, checking hash queue allocation and deallocation
@@ -49,13 +45,6 @@
49/* magic byte identifying an internally generated REQUEST_SENSE command */ 45/* magic byte identifying an internally generated REQUEST_SENSE command */
50#define NCR_700_INTERNAL_SENSE_MAGIC 0x42 46#define NCR_700_INTERNAL_SENSE_MAGIC 0x42
51 47
52/* WARNING: Leave this in for now: the dependency preprocessor doesn't
53 * pick up file specific flags, so must define here if they are not
54 * set */
55#if !defined(CONFIG_53C700_IO_MAPPED) && !defined(CONFIG_53C700_MEM_MAPPED)
56#error "Config.in must define either CONFIG_53C700_IO_MAPPED or CONFIG_53C700_MEM_MAPPED to use this scsi core."
57#endif
58
59struct NCR_700_Host_Parameters; 48struct NCR_700_Host_Parameters;
60 49
61/* These are the externally used routines */ 50/* These are the externally used routines */
@@ -184,7 +173,7 @@ struct NCR_700_command_slot {
184struct NCR_700_Host_Parameters { 173struct NCR_700_Host_Parameters {
185 /* These must be filled in by the calling driver */ 174 /* These must be filled in by the calling driver */
186 int clock; /* board clock speed in MHz */ 175 int clock; /* board clock speed in MHz */
187 unsigned long base; /* the base for the port (copied to host) */ 176 void __iomem *base; /* the base for the port (copied to host) */
188 struct device *dev; 177 struct device *dev;
189 __u32 dmode_extra; /* adjustable bus settings */ 178 __u32 dmode_extra; /* adjustable bus settings */
190 __u32 differential:1; /* if we are differential */ 179 __u32 differential:1; /* if we are differential */
@@ -199,9 +188,6 @@ struct NCR_700_Host_Parameters {
199 /* NOTHING BELOW HERE NEEDS ALTERING */ 188 /* NOTHING BELOW HERE NEEDS ALTERING */
200 __u32 fast:1; /* if we can alter the SCSI bus clock 189 __u32 fast:1; /* if we can alter the SCSI bus clock
201 speed (so can negiotiate sync) */ 190 speed (so can negiotiate sync) */
202#ifdef CONFIG_53C700_BOTH_MAPPED
203 __u32 mem_mapped; /* set if memory mapped */
204#endif
205 int sync_clock; /* The speed of the SYNC core */ 191 int sync_clock; /* The speed of the SYNC core */
206 192
207 __u32 *script; /* pointer to script location */ 193 __u32 *script; /* pointer to script location */
@@ -246,12 +232,18 @@ struct NCR_700_Host_Parameters {
246#ifdef CONFIG_53C700_LE_ON_BE 232#ifdef CONFIG_53C700_LE_ON_BE
247#define bE (hostdata->force_le_on_be ? 0 : 3) 233#define bE (hostdata->force_le_on_be ? 0 : 3)
248#define bSWAP (hostdata->force_le_on_be) 234#define bSWAP (hostdata->force_le_on_be)
235/* This is terrible, but there's no raw version of ioread32. That means
236 * that on a be board we swap twice (once in ioread32 and once again to
237 * get the value correct) */
238#define bS_to_io(x) ((hostdata->force_le_on_be) ? (x) : cpu_to_le32(x))
249#elif defined(__BIG_ENDIAN) 239#elif defined(__BIG_ENDIAN)
250#define bE 3 240#define bE 3
251#define bSWAP 0 241#define bSWAP 0
242#define bS_to_io(x) (x)
252#elif defined(__LITTLE_ENDIAN) 243#elif defined(__LITTLE_ENDIAN)
253#define bE 0 244#define bE 0
254#define bSWAP 0 245#define bSWAP 0
246#define bS_to_io(x) (x)
255#else 247#else
256#error "__BIG_ENDIAN or __LITTLE_ENDIAN must be defined, did you include byteorder.h?" 248#error "__BIG_ENDIAN or __LITTLE_ENDIAN must be defined, did you include byteorder.h?"
257#endif 249#endif
@@ -455,91 +447,42 @@ struct NCR_700_Host_Parameters {
455 447
456 448
457static inline __u8 449static inline __u8
458NCR_700_mem_readb(struct Scsi_Host *host, __u32 reg) 450NCR_700_readb(struct Scsi_Host *host, __u32 reg)
459{
460 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
461 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
462
463 return readb(host->base + (reg^bE));
464}
465
466static inline __u32
467NCR_700_mem_readl(struct Scsi_Host *host, __u32 reg)
468{
469 __u32 value = __raw_readl(host->base + reg);
470 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
471 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
472#if 1
473 /* sanity check the register */
474 if((reg & 0x3) != 0)
475 BUG();
476#endif
477
478 return bS_to_cpu(value);
479}
480
481static inline void
482NCR_700_mem_writeb(__u8 value, struct Scsi_Host *host, __u32 reg)
483{
484 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
485 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
486
487 writeb(value, host->base + (reg^bE));
488}
489
490static inline void
491NCR_700_mem_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
492{
493 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
494 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
495
496#if 1
497 /* sanity check the register */
498 if((reg & 0x3) != 0)
499 BUG();
500#endif
501
502 __raw_writel(bS_to_host(value), host->base + reg);
503}
504
505static inline __u8
506NCR_700_io_readb(struct Scsi_Host *host, __u32 reg)
507{ 451{
508 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) 452 const struct NCR_700_Host_Parameters *hostdata
509 = (struct NCR_700_Host_Parameters *)host->hostdata[0]; 453 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
510 454
511 return inb(host->base + (reg^bE)); 455 return ioread8(hostdata->base + (reg^bE));
512} 456}
513 457
514static inline __u32 458static inline __u32
515NCR_700_io_readl(struct Scsi_Host *host, __u32 reg) 459NCR_700_readl(struct Scsi_Host *host, __u32 reg)
516{ 460{
517 __u32 value = inl(host->base + reg); 461 const struct NCR_700_Host_Parameters *hostdata
518 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
519 = (struct NCR_700_Host_Parameters *)host->hostdata[0]; 462 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
520 463 __u32 value = ioread32(hostdata->base + reg);
521#if 1 464#if 1
522 /* sanity check the register */ 465 /* sanity check the register */
523 if((reg & 0x3) != 0) 466 if((reg & 0x3) != 0)
524 BUG(); 467 BUG();
525#endif 468#endif
526 469
527 return bS_to_cpu(value); 470 return bS_to_io(value);
528} 471}
529 472
530static inline void 473static inline void
531NCR_700_io_writeb(__u8 value, struct Scsi_Host *host, __u32 reg) 474NCR_700_writeb(__u8 value, struct Scsi_Host *host, __u32 reg)
532{ 475{
533 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) 476 const struct NCR_700_Host_Parameters *hostdata
534 = (struct NCR_700_Host_Parameters *)host->hostdata[0]; 477 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
535 478
536 outb(value, host->base + (reg^bE)); 479 iowrite8(value, hostdata->base + (reg^bE));
537} 480}
538 481
539static inline void 482static inline void
540NCR_700_io_writel(__u32 value, struct Scsi_Host *host, __u32 reg) 483NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
541{ 484{
542 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) 485 const struct NCR_700_Host_Parameters *hostdata
543 = (struct NCR_700_Host_Parameters *)host->hostdata[0]; 486 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
544 487
545#if 1 488#if 1
@@ -548,102 +491,7 @@ NCR_700_io_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
548 BUG(); 491 BUG();
549#endif 492#endif
550 493
551 outl(bS_to_host(value), host->base + reg); 494 iowrite32(bS_to_io(value), hostdata->base + reg);
552}
553
554#ifdef CONFIG_53C700_BOTH_MAPPED
555
556static inline __u8
557NCR_700_readb(struct Scsi_Host *host, __u32 reg)
558{
559 __u8 val;
560
561 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
562 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
563
564 if(hostdata->mem_mapped)
565 val = NCR_700_mem_readb(host, reg);
566 else
567 val = NCR_700_io_readb(host, reg);
568
569 return val;
570}
571
572static inline __u32
573NCR_700_readl(struct Scsi_Host *host, __u32 reg)
574{
575 __u32 val;
576
577 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
578 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
579
580 if(hostdata->mem_mapped)
581 val = NCR_700_mem_readl(host, reg);
582 else
583 val = NCR_700_io_readl(host, reg);
584
585 return val;
586}
587
588static inline void
589NCR_700_writeb(__u8 value, struct Scsi_Host *host, __u32 reg)
590{
591 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
592 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
593
594 if(hostdata->mem_mapped)
595 NCR_700_mem_writeb(value, host, reg);
596 else
597 NCR_700_io_writeb(value, host, reg);
598}
599
600static inline void
601NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
602{
603 const struct NCR_700_Host_Parameters *hostdata __attribute__((unused))
604 = (struct NCR_700_Host_Parameters *)host->hostdata[0];
605
606 if(hostdata->mem_mapped)
607 NCR_700_mem_writel(value, host, reg);
608 else
609 NCR_700_io_writel(value, host, reg);
610}
611
612static inline void
613NCR_700_set_mem_mapped(struct NCR_700_Host_Parameters *hostdata)
614{
615 hostdata->mem_mapped = 1;
616}
617
618static inline void
619NCR_700_set_io_mapped(struct NCR_700_Host_Parameters *hostdata)
620{
621 hostdata->mem_mapped = 0;
622} 495}
623 496
624
625#elif defined(CONFIG_53C700_IO_MAPPED)
626
627#define NCR_700_readb NCR_700_io_readb
628#define NCR_700_readl NCR_700_io_readl
629#define NCR_700_writeb NCR_700_io_writeb
630#define NCR_700_writel NCR_700_io_writel
631
632#define NCR_700_set_io_mapped(x)
633#define NCR_700_set_mem_mapped(x) error I/O mapped only
634
635#elif defined(CONFIG_53C700_MEM_MAPPED)
636
637#define NCR_700_readb NCR_700_mem_readb
638#define NCR_700_readl NCR_700_mem_readl
639#define NCR_700_writeb NCR_700_mem_writeb
640#define NCR_700_writel NCR_700_mem_writel
641
642#define NCR_700_set_io_mapped(x) error MEM mapped only
643#define NCR_700_set_mem_mapped(x)
644
645#else
646#error neither CONFIG_53C700_MEM_MAPPED nor CONFIG_53C700_IO_MAPPED is set
647#endif
648
649#endif 497#endif
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index d22b32f4662d..718df4c6c3b2 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -942,11 +942,6 @@ config SCSI_NCR_D700
942 Unless you have an NCR manufactured machine, the chances are that 942 Unless you have an NCR manufactured machine, the chances are that
943 you do not have this SCSI card, so say N. 943 you do not have this SCSI card, so say N.
944 944
945config 53C700_IO_MAPPED
946 bool
947 depends on SCSI_NCR_D700
948 default y
949
950config SCSI_LASI700 945config SCSI_LASI700
951 tristate "HP Lasi SCSI support for 53c700/710" 946 tristate "HP Lasi SCSI support for 53c700/710"
952 depends on GSC && SCSI 947 depends on GSC && SCSI
@@ -956,11 +951,6 @@ config SCSI_LASI700
956 many PA-RISC workstations & servers. If you do not know whether you 951 many PA-RISC workstations & servers. If you do not know whether you
957 have a Lasi chip, it is safe to say "Y" here. 952 have a Lasi chip, it is safe to say "Y" here.
958 953
959config 53C700_MEM_MAPPED
960 bool
961 depends on SCSI_LASI700
962 default y
963
964config 53C700_LE_ON_BE 954config 53C700_LE_ON_BE
965 bool 955 bool
966 depends on SCSI_LASI700 956 depends on SCSI_LASI700
diff --git a/drivers/scsi/NCR_D700.c b/drivers/scsi/NCR_D700.c
index 507751941f1e..e993a7ba276f 100644
--- a/drivers/scsi/NCR_D700.c
+++ b/drivers/scsi/NCR_D700.c
@@ -197,12 +197,10 @@ NCR_D700_probe_one(struct NCR_D700_private *p, int siop, int irq,
197 } 197 }
198 198
199 /* Fill in the three required pieces of hostdata */ 199 /* Fill in the three required pieces of hostdata */
200 hostdata->base = region; 200 hostdata->base = ioport_map(region, 64);
201 hostdata->differential = (((1<<siop) & differential) != 0); 201 hostdata->differential = (((1<<siop) & differential) != 0);
202 hostdata->clock = NCR_D700_CLOCK_MHZ; 202 hostdata->clock = NCR_D700_CLOCK_MHZ;
203 203
204 NCR_700_set_io_mapped(hostdata);
205
206 /* and register the siop */ 204 /* and register the siop */
207 host = NCR_700_detect(&NCR_D700_driver_template, hostdata, p->dev); 205 host = NCR_700_detect(&NCR_D700_driver_template, hostdata, p->dev);
208 if (!host) { 206 if (!host) {
@@ -214,6 +212,7 @@ NCR_D700_probe_one(struct NCR_D700_private *p, int siop, int irq,
214 /* FIXME: read this from SUS */ 212 /* FIXME: read this from SUS */
215 host->this_id = id_array[slot * 2 + siop]; 213 host->this_id = id_array[slot * 2 + siop];
216 host->irq = irq; 214 host->irq = irq;
215 host->base = region;
217 scsi_scan_host(host); 216 scsi_scan_host(host);
218 217
219 return 0; 218 return 0;
diff --git a/drivers/scsi/lasi700.c b/drivers/scsi/lasi700.c
index 29f250c80b98..4cbb6187cc44 100644
--- a/drivers/scsi/lasi700.c
+++ b/drivers/scsi/lasi700.c
@@ -131,6 +131,7 @@ lasi700_probe(struct parisc_device *dev)
131 if (!host) 131 if (!host)
132 goto out_kfree; 132 goto out_kfree;
133 host->this_id = 7; 133 host->this_id = 7;
134 host->base = base;
134 host->irq = dev->irq; 135 host->irq = dev->irq;
135 if(request_irq(dev->irq, NCR_700_intr, SA_SHIRQ, "lasi700", host)) { 136 if(request_irq(dev->irq, NCR_700_intr, SA_SHIRQ, "lasi700", host)) {
136 printk(KERN_ERR "lasi700: request_irq failed!\n"); 137 printk(KERN_ERR "lasi700: request_irq failed!\n");
diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c
index 63bf2aecbc57..9171788348c4 100644
--- a/drivers/scsi/sim710.c
+++ b/drivers/scsi/sim710.c
@@ -120,11 +120,10 @@ sim710_probe_common(struct device *dev, unsigned long base_addr,
120 } 120 }
121 121
122 /* Fill in the three required pieces of hostdata */ 122 /* Fill in the three required pieces of hostdata */
123 hostdata->base = base_addr; 123 hostdata->base = ioport_map(base_addr, 64);
124 hostdata->differential = differential; 124 hostdata->differential = differential;
125 hostdata->clock = clock; 125 hostdata->clock = clock;
126 hostdata->chip710 = 1; 126 hostdata->chip710 = 1;
127 NCR_700_set_io_mapped(hostdata);
128 127
129 /* and register the chip */ 128 /* and register the chip */
130 if((host = NCR_700_detect(&sim710_driver_template, hostdata, dev)) 129 if((host = NCR_700_detect(&sim710_driver_template, hostdata, dev))
@@ -133,6 +132,7 @@ sim710_probe_common(struct device *dev, unsigned long base_addr,
133 goto out_release; 132 goto out_release;
134 } 133 }
135 host->this_id = scsi_id; 134 host->this_id = scsi_id;
135 host->base = base_addr;
136 host->irq = irq; 136 host->irq = irq;
137 if (request_irq(irq, NCR_700_intr, SA_SHIRQ, "sim710", host)) { 137 if (request_irq(irq, NCR_700_intr, SA_SHIRQ, "sim710", host)) {
138 printk(KERN_ERR "sim710: request_irq failed\n"); 138 printk(KERN_ERR "sim710: request_irq failed\n");
@@ -164,6 +164,7 @@ sim710_device_remove(struct device *dev)
164 NCR_700_release(host); 164 NCR_700_release(host);
165 kfree(hostdata); 165 kfree(hostdata);
166 free_irq(host->irq, host); 166 free_irq(host->irq, host);
167 release_region(host->base, 64);
167 return 0; 168 return 0;
168} 169}
169 170