From owner-svn-src-all@FreeBSD.ORG Wed Mar 17 20:01:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1821106564A; Wed, 17 Mar 2010 20:01:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0F448FC18; Wed, 17 Mar 2010 20:01:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2HK113Q002085; Wed, 17 Mar 2010 20:01:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2HK11OZ002082; Wed, 17 Mar 2010 20:01:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003172001.o2HK11OZ002082@svn.freebsd.org> From: Marius Strobl Date: Wed, 17 Mar 2010 20:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205254 - head/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2010 20:01:01 -0000 Author: marius Date: Wed Mar 17 20:01:01 2010 New Revision: 205254 URL: http://svn.freebsd.org/changeset/base/205254 Log: - 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. Modified: head/sys/sparc64/pci/schizo.c head/sys/sparc64/pci/schizovar.h Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Wed Mar 17 20:00:22 2010 (r205253) +++ head/sys/sparc64/pci/schizo.c Wed Mar 17 20:01:01 2010 (r205254) @@ -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; Modified: head/sys/sparc64/pci/schizovar.h ============================================================================== --- head/sys/sparc64/pci/schizovar.h Wed Mar 17 20:00:22 2010 (r205253) +++ head/sys/sparc64/pci/schizovar.h Wed Mar 17 20:01:01 2010 (r205254) @@ -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;