Commit ce39ffcd authored by Russell King's avatar Russell King

[ARM] Acorn SCSI: Ensure iomem pointers are marked as such.

Signed-off-by: default avatarRussell King <rmk@arm.linux.org.uk>
parent 7c9fa9ff
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
struct arxescsi_info { struct arxescsi_info {
FAS216_Info info; FAS216_Info info;
struct expansion_card *ec; struct expansion_card *ec;
void __iomem *base;
}; };
#define DMADATA_OFFSET (0x200) #define DMADATA_OFFSET (0x200)
...@@ -73,7 +74,7 @@ arxescsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -73,7 +74,7 @@ arxescsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
return fasdma_pseudo; return fasdma_pseudo;
} }
static void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned char *base) static void arxescsi_pseudo_dma_write(unsigned char *addr, void __iomem *base)
{ {
__asm__ __volatile__( __asm__ __volatile__(
" stmdb sp!, {r0-r12}\n" " stmdb sp!, {r0-r12}\n"
...@@ -115,7 +116,7 @@ arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -115,7 +116,7 @@ arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
{ {
struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata; struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata;
unsigned int length, error = 0; unsigned int length, error = 0;
unsigned char *base = info->info.scsi.io_base; void __iomem *base = info->info.scsi.io_base;
unsigned char *addr; unsigned char *addr;
length = SCp->this_residual; length = SCp->this_residual;
...@@ -283,7 +284,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -283,7 +284,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
struct Scsi_Host *host; struct Scsi_Host *host;
struct arxescsi_info *info; struct arxescsi_info *info;
unsigned long resbase, reslen; unsigned long resbase, reslen;
unsigned char *base; void __iomem *base;
int ret; int ret;
ret = ecard_request_resources(ec); ret = ecard_request_resources(ec);
...@@ -310,6 +311,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -310,6 +311,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
info = (struct arxescsi_info *)host->hostdata; info = (struct arxescsi_info *)host->hostdata;
info->ec = ec; info->ec = ec;
info->base = base;
info->info.scsi.io_base = base + 0x2000; info->info.scsi.io_base = base + 0x2000;
info->info.scsi.irq = host->irq; info->info.scsi.irq = host->irq;
...@@ -351,11 +353,12 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -351,11 +353,12 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
static void __devexit arxescsi_remove(struct expansion_card *ec) static void __devexit arxescsi_remove(struct expansion_card *ec)
{ {
struct Scsi_Host *host = ecard_get_drvdata(ec); struct Scsi_Host *host = ecard_get_drvdata(ec);
struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata;
ecard_set_drvdata(ec, NULL); ecard_set_drvdata(ec, NULL);
fas216_remove(host); fas216_remove(host);
iounmap((void *)host->base); iounmap(info->base);
fas216_release(host); fas216_release(host);
scsi_host_put(host); scsi_host_put(host);
......
/* /*
* linux/drivers/acorn/scsi/cumana_2.c * linux/drivers/acorn/scsi/cumana_2.c
* *
* Copyright (C) 1997-2002 Russell King * Copyright (C) 1997-2005 Russell King
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
...@@ -78,11 +78,8 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 }; ...@@ -78,11 +78,8 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 };
struct cumanascsi2_info { struct cumanascsi2_info {
FAS216_Info info; FAS216_Info info;
struct expansion_card *ec; struct expansion_card *ec;
void __iomem *base;
void *status; /* card status register */
void *alatch; /* Control register */
unsigned int terms; /* Terminator state */ unsigned int terms; /* Terminator state */
void *dmaarea; /* Pseudo DMA area */
struct scatterlist sg[NR_SG]; /* Scatter DMA list */ struct scatterlist sg[NR_SG]; /* Scatter DMA list */
}; };
...@@ -97,7 +94,8 @@ struct cumanascsi2_info { ...@@ -97,7 +94,8 @@ struct cumanascsi2_info {
static void static void
cumanascsi_2_irqenable(struct expansion_card *ec, int irqnr) cumanascsi_2_irqenable(struct expansion_card *ec, int irqnr)
{ {
writeb(ALATCH_ENA_INT, ec->irq_data); struct cumanascsi2_info *info = ec->irq_data;
writeb(ALATCH_ENA_INT, info->base + CUMANASCSI2_ALATCH);
} }
/* Prototype: void cumanascsi_2_irqdisable(ec, irqnr) /* Prototype: void cumanascsi_2_irqdisable(ec, irqnr)
...@@ -108,7 +106,8 @@ cumanascsi_2_irqenable(struct expansion_card *ec, int irqnr) ...@@ -108,7 +106,8 @@ cumanascsi_2_irqenable(struct expansion_card *ec, int irqnr)
static void static void
cumanascsi_2_irqdisable(struct expansion_card *ec, int irqnr) cumanascsi_2_irqdisable(struct expansion_card *ec, int irqnr)
{ {
writeb(ALATCH_DIS_INT, ec->irq_data); struct cumanascsi2_info *info = ec->irq_data;
writeb(ALATCH_DIS_INT, info->base + CUMANASCSI2_ALATCH);
} }
static const expansioncard_ops_t cumanascsi_2_ops = { static const expansioncard_ops_t cumanascsi_2_ops = {
...@@ -128,10 +127,10 @@ cumanascsi_2_terminator_ctl(struct Scsi_Host *host, int on_off) ...@@ -128,10 +127,10 @@ cumanascsi_2_terminator_ctl(struct Scsi_Host *host, int on_off)
if (on_off) { if (on_off) {
info->terms = 1; info->terms = 1;
writeb(ALATCH_ENA_TERM, info->alatch); writeb(ALATCH_ENA_TERM, info->base + CUMANASCSI2_ALATCH);
} else { } else {
info->terms = 0; info->terms = 0;
writeb(ALATCH_DIS_TERM, info->alatch); writeb(ALATCH_DIS_TERM, info->base + CUMANASCSI2_ALATCH);
} }
} }
...@@ -165,7 +164,7 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -165,7 +164,7 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
struct device *dev = scsi_get_device(host); struct device *dev = scsi_get_device(host);
int dmach = host->dma_channel; int dmach = host->dma_channel;
writeb(ALATCH_DIS_DMA, info->alatch); writeb(ALATCH_DIS_DMA, info->base + CUMANASCSI2_ALATCH);
if (dmach != NO_DMA && if (dmach != NO_DMA &&
(min_type == fasdma_real_all || SCp->this_residual >= 512)) { (min_type == fasdma_real_all || SCp->this_residual >= 512)) {
...@@ -186,11 +185,11 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -186,11 +185,11 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
disable_dma(dmach); disable_dma(dmach);
set_dma_sg(dmach, info->sg, bufs + 1); set_dma_sg(dmach, info->sg, bufs + 1);
writeb(alatch_dir, info->alatch); writeb(alatch_dir, info->base + CUMANASCSI2_ALATCH);
set_dma_mode(dmach, dma_dir); set_dma_mode(dmach, dma_dir);
enable_dma(dmach); enable_dma(dmach);
writeb(ALATCH_ENA_DMA, info->alatch); writeb(ALATCH_ENA_DMA, info->base + CUMANASCSI2_ALATCH);
writeb(ALATCH_DIS_BIT32, info->alatch); writeb(ALATCH_DIS_BIT32, info->base + CUMANASCSI2_ALATCH);
return fasdma_real_all; return fasdma_real_all;
} }
...@@ -224,7 +223,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -224,7 +223,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
#if 0 #if 0
while (length > 1) { while (length > 1) {
unsigned long word; unsigned long word;
unsigned int status = readb(info->status); unsigned int status = readb(info->base + CUMANASCSI2_STATUS);
if (status & STATUS_INT) if (status & STATUS_INT)
goto end; goto end;
...@@ -233,7 +232,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -233,7 +232,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
continue; continue;
word = *addr | *(addr + 1) << 8; word = *addr | *(addr + 1) << 8;
writew(word, info->dmaarea); writew(word, info->base + CUMANASCSI2_PSEUDODMA);
addr += 2; addr += 2;
length -= 2; length -= 2;
} }
...@@ -243,7 +242,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -243,7 +242,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
else { else {
if (transfer && (transfer & 255)) { if (transfer && (transfer & 255)) {
while (length >= 256) { while (length >= 256) {
unsigned int status = readb(info->status); unsigned int status = readb(info->base + CUMANASCSI2_STATUS);
if (status & STATUS_INT) if (status & STATUS_INT)
return; return;
...@@ -251,7 +250,8 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -251,7 +250,8 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
if (!(status & STATUS_DRQ)) if (!(status & STATUS_DRQ))
continue; continue;
readsw(info->dmaarea, addr, 256 >> 1); readsw(info->base + CUMANASCSI2_PSEUDODMA,
addr, 256 >> 1);
addr += 256; addr += 256;
length -= 256; length -= 256;
} }
...@@ -259,7 +259,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -259,7 +259,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
while (length > 0) { while (length > 0) {
unsigned long word; unsigned long word;
unsigned int status = readb(info->status); unsigned int status = readb(info->base + CUMANASCSI2_STATUS);
if (status & STATUS_INT) if (status & STATUS_INT)
return; return;
...@@ -267,7 +267,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -267,7 +267,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
if (!(status & STATUS_DRQ)) if (!(status & STATUS_DRQ))
continue; continue;
word = readw(info->dmaarea); word = readw(info->base + CUMANASCSI2_PSEUDODMA);
*addr++ = word; *addr++ = word;
if (--length > 0) { if (--length > 0) {
*addr++ = word >> 8; *addr++ = word >> 8;
...@@ -287,7 +287,7 @@ cumanascsi_2_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) ...@@ -287,7 +287,7 @@ cumanascsi_2_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp)
{ {
struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
if (host->dma_channel != NO_DMA) { if (host->dma_channel != NO_DMA) {
writeb(ALATCH_DIS_DMA, info->alatch); writeb(ALATCH_DIS_DMA, info->base + CUMANASCSI2_ALATCH);
disable_dma(host->dma_channel); disable_dma(host->dma_channel);
} }
} }
...@@ -405,7 +405,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -405,7 +405,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
struct Scsi_Host *host; struct Scsi_Host *host;
struct cumanascsi2_info *info; struct cumanascsi2_info *info;
unsigned long resbase, reslen; unsigned long resbase, reslen;
unsigned char *base; void __iomem *base;
int ret; int ret;
ret = ecard_request_resources(ec); ret = ecard_request_resources(ec);
...@@ -435,14 +435,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -435,14 +435,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
info = (struct cumanascsi2_info *)host->hostdata; info = (struct cumanascsi2_info *)host->hostdata;
info->ec = ec; info->ec = ec;
info->dmaarea = base + CUMANASCSI2_PSEUDODMA; info->base = base;
info->status = base + CUMANASCSI2_STATUS;
info->alatch = base + CUMANASCSI2_ALATCH;
ec->irqaddr = info->status;
ec->irqmask = STATUS_INT;
ec->irq_data = base + CUMANASCSI2_ALATCH;
ec->ops = &cumanascsi_2_ops;
cumanascsi_2_terminator_ctl(host, term[ec->slot_no]); cumanascsi_2_terminator_ctl(host, term[ec->slot_no]);
...@@ -461,6 +454,11 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -461,6 +454,11 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
info->info.dma.pseudo = cumanascsi_2_dma_pseudo; info->info.dma.pseudo = cumanascsi_2_dma_pseudo;
info->info.dma.stop = cumanascsi_2_dma_stop; info->info.dma.stop = cumanascsi_2_dma_stop;
ec->irqaddr = info->base + CUMANASCSI2_STATUS;
ec->irqmask = STATUS_INT;
ec->irq_data = info;
ec->ops = &cumanascsi_2_ops;
ret = fas216_init(host); ret = fas216_init(host);
if (ret) if (ret)
goto out_free; goto out_free;
...@@ -520,7 +518,7 @@ static void __devexit cumanascsi2_remove(struct expansion_card *ec) ...@@ -520,7 +518,7 @@ static void __devexit cumanascsi2_remove(struct expansion_card *ec)
free_dma(host->dma_channel); free_dma(host->dma_channel);
free_irq(host->irq, info); free_irq(host->irq, info);
iounmap((void *)host->base); iounmap(info->base);
fas216_release(host); fas216_release(host);
scsi_host_put(host); scsi_host_put(host);
......
/* /*
* linux/drivers/acorn/scsi/eesox.c * linux/drivers/acorn/scsi/eesox.c
* *
* Copyright (C) 1997-2003 Russell King * Copyright (C) 1997-2005 Russell King
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
...@@ -73,8 +73,8 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 }; ...@@ -73,8 +73,8 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 };
struct eesoxscsi_info { struct eesoxscsi_info {
FAS216_Info info; FAS216_Info info;
struct expansion_card *ec; struct expansion_card *ec;
void __iomem *base;
void *ctl_port; void __iomem *ctl_port;
unsigned int control; unsigned int control;
struct scatterlist sg[NR_SG]; /* Scatter DMA list */ struct scatterlist sg[NR_SG]; /* Scatter DMA list */
}; };
...@@ -194,11 +194,11 @@ eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -194,11 +194,11 @@ eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
return fasdma_pseudo; return fasdma_pseudo;
} }
static void eesoxscsi_buffer_in(void *buf, int length, void *base) static void eesoxscsi_buffer_in(void *buf, int length, void __iomem *base)
{ {
const void *reg_fas = base + EESOX_FAS216_OFFSET; const void __iomem *reg_fas = base + EESOX_FAS216_OFFSET;
const void *reg_dmastat = base + EESOX_DMASTAT; const void __iomem *reg_dmastat = base + EESOX_DMASTAT;
const void *reg_dmadata = base + EESOX_DMADATA; const void __iomem *reg_dmadata = base + EESOX_DMADATA;
const register unsigned long mask = 0xffff; const register unsigned long mask = 0xffff;
do { do {
...@@ -272,11 +272,11 @@ static void eesoxscsi_buffer_in(void *buf, int length, void *base) ...@@ -272,11 +272,11 @@ static void eesoxscsi_buffer_in(void *buf, int length, void *base)
} while (length); } while (length);
} }
static void eesoxscsi_buffer_out(void *buf, int length, void *base) static void eesoxscsi_buffer_out(void *buf, int length, void __iomem *base)
{ {
const void *reg_fas = base + EESOX_FAS216_OFFSET; const void __iomem *reg_fas = base + EESOX_FAS216_OFFSET;
const void *reg_dmastat = base + EESOX_DMASTAT; const void __iomem *reg_dmastat = base + EESOX_DMASTAT;
const void *reg_dmadata = base + EESOX_DMADATA; const void __iomem *reg_dmadata = base + EESOX_DMADATA;
do { do {
unsigned int status; unsigned int status;
...@@ -356,11 +356,11 @@ static void ...@@ -356,11 +356,11 @@ static void
eesoxscsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, eesoxscsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
fasdmadir_t dir, int transfer_size) fasdmadir_t dir, int transfer_size)
{ {
void *base = (void *)host->base; struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
if (dir == DMA_IN) { if (dir == DMA_IN) {
eesoxscsi_buffer_in(SCp->ptr, SCp->this_residual, base); eesoxscsi_buffer_in(SCp->ptr, SCp->this_residual, info->base);
} else { } else {
eesoxscsi_buffer_out(SCp->ptr, SCp->this_residual, base); eesoxscsi_buffer_out(SCp->ptr, SCp->this_residual, info->base);
} }
} }
...@@ -522,7 +522,7 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -522,7 +522,7 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
struct Scsi_Host *host; struct Scsi_Host *host;
struct eesoxscsi_info *info; struct eesoxscsi_info *info;
unsigned long resbase, reslen; unsigned long resbase, reslen;
unsigned char *base; void __iomem *base;
int ret; int ret;
ret = ecard_request_resources(ec); ret = ecard_request_resources(ec);
...@@ -552,15 +552,11 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -552,15 +552,11 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
info = (struct eesoxscsi_info *)host->hostdata; info = (struct eesoxscsi_info *)host->hostdata;
info->ec = ec; info->ec = ec;
info->base = base;
info->ctl_port = base + EESOX_CONTROL; info->ctl_port = base + EESOX_CONTROL;
info->control = term[ec->slot_no] ? EESOX_TERM_ENABLE : 0; info->control = term[ec->slot_no] ? EESOX_TERM_ENABLE : 0;
writeb(info->control, info->ctl_port); writeb(info->control, info->ctl_port);
ec->irqaddr = base + EESOX_DMASTAT;
ec->irqmask = EESOX_STAT_INTR;
ec->irq_data = info;
ec->ops = &eesoxscsi_ops;
info->info.scsi.io_base = base + EESOX_FAS216_OFFSET; info->info.scsi.io_base = base + EESOX_FAS216_OFFSET;
info->info.scsi.io_shift = EESOX_FAS216_SHIFT; info->info.scsi.io_shift = EESOX_FAS216_SHIFT;
info->info.scsi.irq = host->irq; info->info.scsi.irq = host->irq;
...@@ -576,6 +572,11 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -576,6 +572,11 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
info->info.dma.pseudo = eesoxscsi_dma_pseudo; info->info.dma.pseudo = eesoxscsi_dma_pseudo;
info->info.dma.stop = eesoxscsi_dma_stop; info->info.dma.stop = eesoxscsi_dma_stop;
ec->irqaddr = base + EESOX_DMASTAT;
ec->irqmask = EESOX_STAT_INTR;
ec->irq_data = info;
ec->ops = &eesoxscsi_ops;
device_create_file(&ec->dev, &dev_attr_bus_term); device_create_file(&ec->dev, &dev_attr_bus_term);
ret = fas216_init(host); ret = fas216_init(host);
...@@ -640,7 +641,7 @@ static void __devexit eesoxscsi_remove(struct expansion_card *ec) ...@@ -640,7 +641,7 @@ static void __devexit eesoxscsi_remove(struct expansion_card *ec)
device_remove_file(&ec->dev, &dev_attr_bus_term); device_remove_file(&ec->dev, &dev_attr_bus_term);
iounmap((void *)host->base); iounmap(info->base);
fas216_release(host); fas216_release(host);
scsi_host_put(host); scsi_host_put(host);
...@@ -679,4 +680,3 @@ MODULE_DESCRIPTION("EESOX 'Fast' SCSI driver for Acorn machines"); ...@@ -679,4 +680,3 @@ MODULE_DESCRIPTION("EESOX 'Fast' SCSI driver for Acorn machines");
MODULE_PARM(term, "1-8i"); MODULE_PARM(term, "1-8i");
MODULE_PARM_DESC(term, "SCSI bus termination"); MODULE_PARM_DESC(term, "SCSI bus termination");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* /*
* linux/drivers/acorn/scsi/powertec.c * linux/drivers/acorn/scsi/powertec.c
* *
* Copyright (C) 1997-2003 Russell King * Copyright (C) 1997-2005 Russell King
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
...@@ -61,7 +61,7 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 }; ...@@ -61,7 +61,7 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 };
struct powertec_info { struct powertec_info {
FAS216_Info info; FAS216_Info info;
struct expansion_card *ec; struct expansion_card *ec;
void *term_port; void __iomem *base;
unsigned int term_ctl; unsigned int term_ctl;
struct scatterlist sg[NR_SG]; struct scatterlist sg[NR_SG];
}; };
...@@ -74,7 +74,8 @@ struct powertec_info { ...@@ -74,7 +74,8 @@ struct powertec_info {
static void static void
powertecscsi_irqenable(struct expansion_card *ec, int irqnr) powertecscsi_irqenable(struct expansion_card *ec, int irqnr)
{ {
writeb(POWERTEC_INTR_ENABLE, ec->irq_data); struct powertec_info *info = ec->irq_data;
writeb(POWERTEC_INTR_ENABLE, info->base + POWERTEC_INTR_CONTROL);
} }
/* Prototype: void powertecscsi_irqdisable(ec, irqnr) /* Prototype: void powertecscsi_irqdisable(ec, irqnr)
...@@ -85,7 +86,8 @@ powertecscsi_irqenable(struct expansion_card *ec, int irqnr) ...@@ -85,7 +86,8 @@ powertecscsi_irqenable(struct expansion_card *ec, int irqnr)
static void static void
powertecscsi_irqdisable(struct expansion_card *ec, int irqnr) powertecscsi_irqdisable(struct expansion_card *ec, int irqnr)
{ {
writeb(POWERTEC_INTR_DISABLE, ec->irq_data); struct powertec_info *info = ec->irq_data;
writeb(POWERTEC_INTR_DISABLE, info->base + POWERTEC_INTR_CONTROL);
} }
static const expansioncard_ops_t powertecscsi_ops = { static const expansioncard_ops_t powertecscsi_ops = {
...@@ -104,7 +106,7 @@ powertecscsi_terminator_ctl(struct Scsi_Host *host, int on_off) ...@@ -104,7 +106,7 @@ powertecscsi_terminator_ctl(struct Scsi_Host *host, int on_off)
struct powertec_info *info = (struct powertec_info *)host->hostdata; struct powertec_info *info = (struct powertec_info *)host->hostdata;
info->term_ctl = on_off ? POWERTEC_TERM_ENABLE : 0; info->term_ctl = on_off ? POWERTEC_TERM_ENABLE : 0;
writeb(info->term_ctl, info->term_port); writeb(info->term_ctl, info->base + POWERTEC_TERM_CONTROL);
} }
/* Prototype: void powertecscsi_intr(irq, *dev_id, *regs) /* Prototype: void powertecscsi_intr(irq, *dev_id, *regs)
...@@ -315,7 +317,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -315,7 +317,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
struct Scsi_Host *host; struct Scsi_Host *host;
struct powertec_info *info; struct powertec_info *info;
unsigned long resbase, reslen; unsigned long resbase, reslen;
unsigned char *base; void __iomem *base;
int ret; int ret;
ret = ecard_request_resources(ec); ret = ecard_request_resources(ec);
...@@ -341,19 +343,12 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -341,19 +343,12 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
host->irq = ec->irq; host->irq = ec->irq;
host->dma_channel = ec->dma; host->dma_channel = ec->dma;
ec->irqaddr = base + POWERTEC_INTR_STATUS;
ec->irqmask = POWERTEC_INTR_BIT;
ec->irq_data = base + POWERTEC_INTR_CONTROL;
ec->ops = &powertecscsi_ops;
ecard_set_drvdata(ec, host); ecard_set_drvdata(ec, host);
info = (struct powertec_info *)host->hostdata; info = (struct powertec_info *)host->hostdata;
info->term_port = base + POWERTEC_TERM_CONTROL; info->base = base;
powertecscsi_terminator_ctl(host, term[ec->slot_no]); powertecscsi_terminator_ctl(host, term[ec->slot_no]);
device_create_file(&ec->dev, &dev_attr_bus_term);
info->info.scsi.io_base = base + POWERTEC_FAS216_OFFSET; info->info.scsi.io_base = base + POWERTEC_FAS216_OFFSET;
info->info.scsi.io_shift = POWERTEC_FAS216_SHIFT; info->info.scsi.io_shift = POWERTEC_FAS216_SHIFT;
info->info.scsi.irq = host->irq; info->info.scsi.irq = host->irq;
...@@ -369,6 +364,13 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -369,6 +364,13 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
info->info.dma.pseudo = NULL; info->info.dma.pseudo = NULL;
info->info.dma.stop = powertecscsi_dma_stop; info->info.dma.stop = powertecscsi_dma_stop;
ec->irqaddr = base + POWERTEC_INTR_STATUS;
ec->irqmask = POWERTEC_INTR_BIT;
ec->irq_data = info;
ec->ops = &powertecscsi_ops;
device_create_file(&ec->dev, &dev_attr_bus_term);
ret = fas216_init(host); ret = fas216_init(host);
if (ret) if (ret)
goto out_free; goto out_free;
...@@ -420,7 +422,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -420,7 +422,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
static void __devexit powertecscsi_remove(struct expansion_card *ec) static void __devexit powertecscsi_remove(struct expansion_card *ec)
{ {
struct Scsi_Host *host = ecard_get_drvdata(ec); struct Scsi_Host *host = ecard_get_drvdata(ec);
struct powertecscsi_info *info = (struct powertecscsi_info *)host->hostdata; struct powertec_info *info = (struct powertec_info *)host->hostdata;
ecard_set_drvdata(ec, NULL); ecard_set_drvdata(ec, NULL);
fas216_remove(host); fas216_remove(host);
...@@ -431,7 +433,7 @@ static void __devexit powertecscsi_remove(struct expansion_card *ec) ...@@ -431,7 +433,7 @@ static void __devexit powertecscsi_remove(struct expansion_card *ec)
free_dma(host->dma_channel); free_dma(host->dma_channel);
free_irq(host->irq, info); free_irq(host->irq, info);
iounmap((void *)host->base); iounmap(info->base);
fas216_release(host); fas216_release(host);
scsi_host_put(host); scsi_host_put(host);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment