summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2011-11-01 17:57:21 +0000
committermarius <marius@FreeBSD.org>2011-11-01 17:57:21 +0000
commit58500f4f41654b7adbb7b919fddd1d701d328e50 (patch)
treebf54ea3252298ee3374b5a6da1d4f30f5695667c /sys/dev/ata
parent1cbd492c701121efac4aff68c9ce3759acde3be0 (diff)
downloadFreeBSD-src-58500f4f41654b7adbb7b919fddd1d701d328e50.zip
FreeBSD-src-58500f4f41654b7adbb7b919fddd1d701d328e50.tar.gz
In r225931 I've missed the only other driver using the pointer returned
by rman_get_virtual(9) to access device registers sparc64 currently cares about. Ideally ata(4) should just be converted to access these using bus_space(9) read/write functions instead as there's really no reason to do it the former way. However, this part of ata-siliconimage.c should go away in favor of siis(4) sooner or later anyway and I don't have the hardware to actually test the SX4 bits of ata-promise.c. Also ideally the other architectures should also properly handle the BUS_SPACE_MAP_LINEAR flag of bus_space_map(9) so this code wouldn't need to be #ifdef'ed.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/ata-pci.c16
-rw-r--r--sys/dev/ata/chipsets/ata-promise.c9
-rw-r--r--sys/dev/ata/chipsets/ata-siliconimage.c13
3 files changed, 31 insertions, 7 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index b0359e6..26b3628 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -153,10 +153,20 @@ ata_pci_detach(device_t dev)
}
if (ctlr->chipdeinit != NULL)
ctlr->chipdeinit(dev);
- if (ctlr->r_res2)
+ if (ctlr->r_res2) {
+#ifdef __sparc64__
+ bus_space_unmap(rman_get_bustag(ctlr->r_res2),
+ rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2));
+#endif
bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2);
- if (ctlr->r_res1)
+ }
+ if (ctlr->r_res1) {
+#ifdef __sparc64__
+ bus_space_unmap(rman_get_bustag(ctlr->r_res1),
+ rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1));
+#endif
bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, ctlr->r_res1);
+ }
return 0;
}
@@ -775,7 +785,6 @@ driver_t ata_pcichannel_driver = {
DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, 0, 0);
-
/*
* misc support fucntions
*/
@@ -936,4 +945,3 @@ ata_mode2idx(int mode)
return (mode & ATA_MODE_MASK) + 5;
return (mode & ATA_MODE_MASK) - ATA_PIO0;
}
-
diff --git a/sys/dev/ata/chipsets/ata-promise.c b/sys/dev/ata/chipsets/ata-promise.c
index 2f8b2a5..6f2f57c 100644
--- a/sys/dev/ata/chipsets/ata-promise.c
+++ b/sys/dev/ata/chipsets/ata-promise.c
@@ -94,7 +94,6 @@ static void ata_promise_next_hpkt(struct ata_pci_controller *ctlr);
#define PR_SATA 0x40
#define PR_SATA2 0x80
-
/*
* Promise chipset support functions
*/
@@ -250,6 +249,14 @@ ata_promise_chipinit(device_t dev)
&ctlr->r_rid1, RF_ACTIVE)))
goto failnfree;
+#ifdef __sparc64__
+ if (ctlr->chip->cfg2 == PR_SX4X &&
+ !bus_space_map(rman_get_bustag(ctlr->r_res1),
+ rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1),
+ BUS_SPACE_MAP_LINEAR, NULL))
+ goto failnfree;
+#endif
+
ctlr->r_type2 = SYS_RES_MEMORY;
ctlr->r_rid2 = PCIR_BAR(3);
if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
diff --git a/sys/dev/ata/chipsets/ata-siliconimage.c b/sys/dev/ata/chipsets/ata-siliconimage.c
index 2882b17..52eae96 100644
--- a/sys/dev/ata/chipsets/ata-siliconimage.c
+++ b/sys/dev/ata/chipsets/ata-siliconimage.c
@@ -80,7 +80,6 @@ static void ata_siiprb_dmainit(device_t dev);
#define SII_BUG 0x04
#define SII_4CH 0x08
-
/*
* Silicon Image Inc. (SiI) (former CMD) chipset support functions
*/
@@ -141,6 +140,17 @@ ata_sii_chipinit(device_t dev)
bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1,ctlr->r_res1);
return ENXIO;
}
+#ifdef __sparc64__
+ if (!bus_space_map(rman_get_bustag(ctlr->r_res2),
+ rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2),
+ BUS_SPACE_MAP_LINEAR, NULL)) {
+ bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1,
+ ctlr->r_res1);
+ bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2,
+ ctlr->r_res2);
+ return (ENXIO);
+ }
+#endif
ctlr->ch_attach = ata_siiprb_ch_attach;
ctlr->ch_detach = ata_siiprb_ch_detach;
ctlr->reset = ata_siiprb_reset;
@@ -432,7 +442,6 @@ ata_sii_setmode(device_t dev, int target, int mode)
return (mode);
}
-
struct ata_siiprb_dma_prdentry {
u_int64_t addr;
u_int32_t count;
OpenPOWER on IntegriCloud