aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/advansys.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2007-07-26 11:55:07 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-12 14:39:33 -0400
commit57ba5fe988f6e0845c459bbe75ecd6aea536805d (patch)
tree2ced010dc7e32dbcff754b0b29a9722cc3d80433 /drivers/scsi/advansys.c
parent59fcf844095a89fe5e42b4e9bfc4b49dd6909e6b (diff)
[SCSI] advansys: ioremap no longer needs page-aligned addresses
At some point during Linux 2.1 development, ioremap() gained the ability to handle addresses which weren't page-aligned. Also expand the CONFIG_PCI range to encompass that entire section of wide board initialisation, since all wide boards are PCI. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/advansys.c')
-rw-r--r--drivers/scsi/advansys.c52
1 files changed, 12 insertions, 40 deletions
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index e6619868173f..2f3707613285 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -17090,8 +17090,6 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
17090 ASC_DVC_VAR *asc_dvc_varp = NULL; 17090 ASC_DVC_VAR *asc_dvc_varp = NULL;
17091 ADV_DVC_VAR *adv_dvc_varp = NULL; 17091 ADV_DVC_VAR *adv_dvc_varp = NULL;
17092 int share_irq; 17092 int share_irq;
17093 int iolen = 0;
17094 ADV_PADDR pci_memory_address;
17095 int warn_code, err_code; 17093 int warn_code, err_code;
17096 int ret; 17094 int ret;
17097 17095
@@ -17136,13 +17134,13 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
17136 asc_dvc_varp->iop_base = iop; 17134 asc_dvc_varp->iop_base = iop;
17137 asc_dvc_varp->isr_callback = asc_isr_callback; 17135 asc_dvc_varp->isr_callback = asc_isr_callback;
17138 } else { 17136 } else {
17137#ifdef CONFIG_PCI
17139 ASC_DBG(1, "advansys_board_found: wide board\n"); 17138 ASC_DBG(1, "advansys_board_found: wide board\n");
17140 adv_dvc_varp = &boardp->dvc_var.adv_dvc_var; 17139 adv_dvc_varp = &boardp->dvc_var.adv_dvc_var;
17141 adv_dvc_varp->drv_ptr = boardp; 17140 adv_dvc_varp->drv_ptr = boardp;
17142 adv_dvc_varp->cfg = &boardp->dvc_cfg.adv_dvc_cfg; 17141 adv_dvc_varp->cfg = &boardp->dvc_cfg.adv_dvc_cfg;
17143 adv_dvc_varp->isr_callback = adv_isr_callback; 17142 adv_dvc_varp->isr_callback = adv_isr_callback;
17144 adv_dvc_varp->async_callback = adv_async_callback; 17143 adv_dvc_varp->async_callback = adv_async_callback;
17145#ifdef CONFIG_PCI
17146 if (pdev->device == PCI_DEVICE_ID_ASP_ABP940UW) { 17144 if (pdev->device == PCI_DEVICE_ID_ASP_ABP940UW) {
17147 ASC_DBG(1, "advansys_board_found: ASC-3550\n"); 17145 ASC_DBG(1, "advansys_board_found: ASC-3550\n");
17148 adv_dvc_varp->chip_type = ADV_CHIP_ASC3550; 17146 adv_dvc_varp->chip_type = ADV_CHIP_ASC3550;
@@ -17153,46 +17151,20 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
17153 ASC_DBG(1, "advansys_board_found: ASC-38C1600\n"); 17151 ASC_DBG(1, "advansys_board_found: ASC-38C1600\n");
17154 adv_dvc_varp->chip_type = ADV_CHIP_ASC38C1600; 17152 adv_dvc_varp->chip_type = ADV_CHIP_ASC38C1600;
17155 } 17153 }
17156#endif /* CONFIG_PCI */
17157 17154
17158 /* 17155 boardp->asc_n_io_port = pci_resource_len(pdev, 1);
17159 * Map the board's registers into virtual memory for 17156 boardp->ioremap_addr = ioremap(pci_resource_start(pdev, 1),
17160 * PCI slave access. Only memory accesses are used to 17157 boardp->asc_n_io_port);
17161 * access the board's registers. 17158 if (!boardp->ioremap_addr) {
17162 *
17163 * Note: The PCI register base address is not always
17164 * page aligned, but the address passed to ioremap()
17165 * must be page aligned. It is guaranteed that the
17166 * PCI register base address will not cross a page
17167 * boundary.
17168 */
17169 if (adv_dvc_varp->chip_type == ADV_CHIP_ASC3550) {
17170 iolen = ADV_3550_IOLEN;
17171 } else if (adv_dvc_varp->chip_type == ADV_CHIP_ASC38C0800) {
17172 iolen = ADV_38C0800_IOLEN;
17173 } else {
17174 iolen = ADV_38C1600_IOLEN;
17175 }
17176#ifdef CONFIG_PCI
17177 pci_memory_address = pci_resource_start(pdev, 1);
17178 ASC_DBG1(1,
17179 "advansys_board_found: pci_memory_address: 0x%lx\n",
17180 (ulong)pci_memory_address);
17181 if ((boardp->ioremap_addr =
17182 ioremap(pci_memory_address & PAGE_MASK, PAGE_SIZE)) == 0) {
17183 ASC_PRINT3 17159 ASC_PRINT3
17184 ("advansys_board_found: board %d: ioremap(%x, %d) returned NULL\n", 17160 ("advansys_board_found: board %d: ioremap(%x, %d) returned NULL\n",
17185 boardp->id, pci_memory_address, iolen); 17161 boardp->id, pci_resource_start(pdev, 1),
17162 boardp->asc_n_io_port);
17186 goto err_shost; 17163 goto err_shost;
17187 } 17164 }
17188 ASC_DBG1(1, "advansys_board_found: ioremap_addr: 0x%lx\n", 17165 adv_dvc_varp->iop_base = (AdvPortAddr)boardp->ioremap_addr
17189 (ulong)boardp->ioremap_addr);
17190 adv_dvc_varp->iop_base = (AdvPortAddr)
17191 (boardp->ioremap_addr +
17192 (pci_memory_address - (pci_memory_address & PAGE_MASK)));
17193 ASC_DBG1(1, "advansys_board_found: iop_base: 0x%lx\n", 17166 ASC_DBG1(1, "advansys_board_found: iop_base: 0x%lx\n",
17194 adv_dvc_varp->iop_base); 17167 adv_dvc_varp->iop_base);
17195#endif /* CONFIG_PCI */
17196 17168
17197 /* 17169 /*
17198 * Even though it isn't used to access wide boards, other 17170 * Even though it isn't used to access wide boards, other
@@ -17201,9 +17173,10 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
17201 */ 17173 */
17202 boardp->ioport = iop; 17174 boardp->ioport = iop;
17203 17175
17204 ASC_DBG2(1, 17176 ASC_DBG2(1, "advansys_board_found: iopb_chip_id_1 0x%x, "
17205 "advansys_board_found: iopb_chip_id_1 0x%x, iopw_chip_id_0 0x%x\n", 17177 "iopw_chip_id_0 0x%x\n", (ushort)inp(iop + 1),
17206 (ushort)inp(iop + 1), (ushort)inpw(iop)); 17178 (ushort)inpw(iop));
17179#endif /* CONFIG_PCI */
17207 } 17180 }
17208 17181
17209#ifdef CONFIG_PROC_FS 17182#ifdef CONFIG_PROC_FS
@@ -17556,7 +17529,6 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
17556 * PCI Memory Mapped I/O. 17529 * PCI Memory Mapped I/O.
17557 */ 17530 */
17558 shost->io_port = iop; 17531 shost->io_port = iop;
17559 boardp->asc_n_io_port = iolen;
17560 17532
17561 shost->this_id = adv_dvc_varp->chip_scsi_id; 17533 shost->this_id = adv_dvc_varp->chip_scsi_id;
17562 17534