summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/pci
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2010-03-17 20:01:01 +0000
committermarius <marius@FreeBSD.org>2010-03-17 20:01:01 +0000
commit0e5db580ee230ddfec7cc705eef0634383c57c3c (patch)
treecaef62b57c58ad2db193d4ded6d30b4162f2ca47 /sys/sparc64/pci
parentbf3a24dd0d8255c6f5bfeb05d19a0a82d56d604e (diff)
downloadFreeBSD-src-0e5db580ee230ddfec7cc705eef0634383c57c3c.zip
FreeBSD-src-0e5db580ee230ddfec7cc705eef0634383c57c3c.tar.gz
- Add quirk handling for Sun Fire V1280. The firmware of these machines
provides no ino-bitmap properties so forge them using the default set of controller interrupts and let schizo_setup_intr() take care of the children, hoping for non-fancy routing. - Add quirk handling for Sun Fire V890. When booting these machines from disk a Schizo comes up with PCI error residing which triggers as soon as we register schizo_pci_bus() even when clearing it from all involved registers (it's no longer indicated once we're in schizo_pci_bus() though). Thus make PCI bus errors non-fatal until we actually touch the bus. With this change schizo_pci_bus() typically triggers once during attach in this case. Obviously this approach isn't exactly race free but it's about the best we can do about this problem as we're not guaranteed that the interrupt will actually trigger on V890 either, as it certainly doesn't when for example netbooting them.
Diffstat (limited to 'sys/sparc64/pci')
-rw-r--r--sys/sparc64/pci/schizo.c29
-rw-r--r--sys/sparc64/pci/schizovar.h5
2 files changed, 29 insertions, 5 deletions
diff --git a/sys/sparc64/pci/schizo.c b/sys/sparc64/pci/schizo.c
index f783b23..9e133e7 100644
--- a/sys/sparc64/pci/schizo.c
+++ b/sys/sparc64/pci/schizo.c
@@ -402,9 +402,22 @@ schizo_attach(device_t dev)
*/
i = OF_getprop(node, "ino-bitmap", (void *)prop_array,
sizeof(prop_array));
- if (i == -1)
- panic("%s: could not get ino-bitmap", __func__);
- ino_bitmap = ((uint64_t)prop_array[1] << 32) | prop_array[0];
+ if (i != -1)
+ ino_bitmap = ((uint64_t)prop_array[1] << 32) | prop_array[0];
+ else {
+ /*
+ * If the ino-bitmap property is missing, just provide the
+ * default set of interrupts for this controller and let
+ * schizo_setup_intr() take care of child interrupts.
+ */
+ if (sc->sc_half == 0)
+ ino_bitmap = (1ULL << STX_UE_INO) |
+ (1ULL << STX_CE_INO) |
+ (1ULL << STX_PCIERR_A_INO) |
+ (1ULL << STX_BUS_INO);
+ else
+ ino_bitmap = 1ULL << STX_PCIERR_B_INO;
+ }
for (i = 0; i <= STX_MAX_INO; i++) {
if ((ino_bitmap & (1ULL << i)) == 0)
continue;
@@ -684,6 +697,14 @@ schizo_attach(device_t dev)
ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(ofw_pci_intr_t));
+ /*
+ * At least when booting Fire V890 from disk a Schizo comes up with
+ * a PCI bus error residing which triggers as soon as we register
+ * schizo_pci_bus() even when clearing it from all involved registers
+ * beforehand (but is quiet once it has fired). Thus we make PCI bus
+ * errors non-fatal until we actually touch the bus.
+ */
+ sc->sc_flags |= SCHIZO_FLAGS_ARMED;
device_add_child(dev, "pci", -1);
return (bus_generic_attach(dev));
}
@@ -787,6 +808,8 @@ schizo_pci_bus(void *arg)
iommu = SCHIZO_PCI_READ_8(sc, STX_PCI_IOMMU);
status = PCIB_READ_CONFIG(sc->sc_dev, sc->sc_pci_secbus,
STX_CS_DEVICE, STX_CS_FUNC, PCIR_STATUS, 2);
+ if ((sc->sc_flags & SCHIZO_FLAGS_ARMED) == 0)
+ goto clear_error;
if ((csr & STX_PCI_CTRL_MMU_ERR) != 0) {
if ((iommu & TOM_PCI_IOMMU_ERR) == 0)
goto clear_error;
diff --git a/sys/sparc64/pci/schizovar.h b/sys/sparc64/pci/schizovar.h
index 144ace7..964ab37 100644
--- a/sys/sparc64/pci/schizovar.h
+++ b/sys/sparc64/pci/schizovar.h
@@ -44,8 +44,9 @@ struct schizo_softc {
#define SCHIZO_MODE_XMS 2
u_int sc_flags;
-#define SCHIZO_FLAGS_BSWAR (1 << 0)
-#define SCHIZO_FLAGS_CDMA (1 << 1)
+#define SCHIZO_FLAGS_ARMED (1 << 0)
+#define SCHIZO_FLAGS_BSWAR (1 << 1)
+#define SCHIZO_FLAGS_CDMA (1 << 2)
bus_addr_t sc_cdma_clr;
uint32_t sc_cdma_state;
OpenPOWER on IntegriCloud