summaryrefslogtreecommitdiffstats
path: root/sys/dev/mpt/mpt_pci.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2012-02-11 12:03:44 +0000
committermarius <marius@FreeBSD.org>2012-02-11 12:03:44 +0000
commita986d587bd4ceace64bd00b8ad1e19474ad02cec (patch)
treef7bc89190c9895aaa4aa5f073c1ef597eda7019f /sys/dev/mpt/mpt_pci.c
parent790a771dba50db70470910177bff9607f056af64 (diff)
downloadFreeBSD-src-a986d587bd4ceace64bd00b8ad1e19474ad02cec.zip
FreeBSD-src-a986d587bd4ceace64bd00b8ad1e19474ad02cec.tar.gz
Flesh out support for SAS1078 and SAS1078DE (which are said to actually
be the same chip): - The I/O port resource may not be available with these. However, given that we actually only need this resource for some controllers that require their firmware to be up- and downloaded (which excludes the SAS1078{,DE}) just handle failure to allocate this resource gracefully when possible. While at it, generally put non-fatal resource allocation failures under bootverbose. - SAS1078{,DE} use a different hard reset protocol. - Add workarounds for the 36GB physical address limitation of scatter/ gather elements of these controllers. Tested by: Slawa Olhovchenkov PR: 149220 (remaining part)
Diffstat (limited to 'sys/dev/mpt/mpt_pci.c')
-rw-r--r--sys/dev/mpt/mpt_pci.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/sys/dev/mpt/mpt_pci.c b/sys/dev/mpt/mpt_pci.c
index 7e3211b..72b5891 100644
--- a/sys/dev/mpt/mpt_pci.c
+++ b/sys/dev/mpt/mpt_pci.c
@@ -438,6 +438,10 @@ mpt_pci_attach(device_t dev)
case PCI_PRODUCT_LSI_FC7X04X:
mpt->is_fc = 1;
break;
+ case PCI_PRODUCT_LSI_SAS1078:
+ case PCI_PRODUCT_LSI_SAS1078DE:
+ mpt->is_1078 = 1;
+ /* FALLTHROUGH */
case PCI_PRODUCT_LSI_SAS1064:
case PCI_PRODUCT_LSI_SAS1064A:
case PCI_PRODUCT_LSI_SAS1064E:
@@ -445,8 +449,6 @@ mpt_pci_attach(device_t dev)
case PCI_PRODUCT_LSI_SAS1066E:
case PCI_PRODUCT_LSI_SAS1068:
case PCI_PRODUCT_LSI_SAS1068E:
- case PCI_PRODUCT_LSI_SAS1078:
- case PCI_PRODUCT_LSI_SAS1078DE:
mpt->is_sas = 1;
break;
default:
@@ -527,23 +529,31 @@ mpt_pci_attach(device_t dev)
mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
&mpt_io_bar, RF_ACTIVE);
if (mpt->pci_pio_reg == NULL) {
- device_printf(dev, "unable to map registers in PIO mode\n");
- goto bad;
+ if (bootverbose) {
+ device_printf(dev,
+ "unable to map registers in PIO mode\n");
+ }
+ } else {
+ mpt->pci_pio_st = rman_get_bustag(mpt->pci_pio_reg);
+ mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg);
}
- mpt->pci_pio_st = rman_get_bustag(mpt->pci_pio_reg);
- mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg);
/* Allocate kernel virtual memory for the 9x9's Mem0 region */
mpt_mem_bar = PCIR_BAR(mpt_mem_bar);
mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
&mpt_mem_bar, RF_ACTIVE);
if (mpt->pci_reg == NULL) {
- device_printf(dev, "Unable to memory map registers.\n");
- if (mpt->is_sas) {
+ if (bootverbose || mpt->is_sas || mpt->pci_pio_reg == NULL) {
+ device_printf(dev,
+ "Unable to memory map registers.\n");
+ }
+ if (mpt->is_sas || mpt->pci_pio_reg == NULL) {
device_printf(dev, "Giving Up.\n");
goto bad;
}
- device_printf(dev, "Falling back to PIO mode.\n");
+ if (bootverbose) {
+ device_printf(dev, "Falling back to PIO mode.\n");
+ }
mpt->pci_st = mpt->pci_pio_st;
mpt->pci_sh = mpt->pci_pio_sh;
} else {
OpenPOWER on IntegriCloud