Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/dev Add code to attach ofpci.



details:   https://anonhg.NetBSD.org/src/rev/30406ab40291
branches:  trunk
changeset: 526599:30406ab40291
user:      eeh <eeh%NetBSD.org@localhost>
date:      Mon May 06 22:29:22 2002 +0000

description:
Add code to attach ofpci.

diffstat:

 sys/arch/sparc64/dev/psycho.c |  29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diffs (87 lines):

diff -r b20c48662f13 -r 30406ab40291 sys/arch/sparc64/dev/psycho.c
--- a/sys/arch/sparc64/dev/psycho.c     Mon May 06 22:28:18 2002 +0000
+++ b/sys/arch/sparc64/dev/psycho.c     Mon May 06 22:29:22 2002 +0000
@@ -1,6 +1,7 @@
-/*     $NetBSD: psycho.c,v 1.45 2002/03/20 18:54:47 eeh Exp $  */
+/*     $NetBSD: psycho.c,v 1.46 2002/05/06 22:29:22 eeh Exp $  */
 
 /*
+ * Copyright (c) 2001, 2002 Eduardo E. Horvath
  * Copyright (c) 1999, 2000 Matthew R. Green
  * All rights reserved.
  *
@@ -62,6 +63,8 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcireg.h>
 
+#include <sparc64/dev/ofpcivar.h>
+
 #include <sparc64/dev/iommureg.h>
 #include <sparc64/dev/iommuvar.h>
 #include <sparc64/dev/psychoreg.h>
@@ -69,6 +72,7 @@
 #include <sparc64/sparc64/cache.h>
 
 #include "ioconf.h"
+#include "ofpci.h"
 
 static pci_chipset_tag_t psycho_alloc_chipset __P((struct psycho_pbm *, int,
                                                   pci_chipset_tag_t));
@@ -224,7 +228,7 @@
        struct psycho_softc *sc = (struct psycho_softc *)self;
        struct psycho_softc *osc = NULL;
        struct psycho_pbm *pp;
-       struct pcibus_attach_args pba;
+       struct ofpcibus_attach_args pba;
        struct mainbus_attach_args *ma = aux;
        bus_space_handle_t bh;
        u_int64_t csr;
@@ -396,7 +400,7 @@
        /* get the bus-range for the psycho */
        psycho_get_bus_range(sc->sc_node, psycho_br);
 
-       pba.pba_bus = psycho_br[0];
+       pba.opba_pba.pba_bus = psycho_br[0];
 
        printf("bus range %u to %u", psycho_br[0], psycho_br[1]);
        printf("; PCI bus %d", psycho_br[0]);
@@ -414,7 +418,7 @@
        pp->pp_pc = psycho_alloc_chipset(pp, sc->sc_node, &_sparc_pci_chipset);
 
        /* setup the rest of the psycho pbm */
-       pba.pba_pc = psycho_alloc_chipset(pp, sc->sc_node, pp->pp_pc);
+       pba.opba_pba.pba_pc = psycho_alloc_chipset(pp, sc->sc_node, pp->pp_pc);
 
        printf("\n");
 
@@ -529,11 +533,16 @@
        /*
         * attach the pci.. note we pass PCI A tags, etc., for the sabre here.
         */
-       pba.pba_busname = "pci";
-       pba.pba_flags = sc->sc_psycho_this->pp_flags;
-       pba.pba_dmat = sc->sc_psycho_this->pp_dmat;
-       pba.pba_iot = sc->sc_psycho_this->pp_iot;
-       pba.pba_memt = sc->sc_psycho_this->pp_memt;
+#if NOFPCI > 0
+       pba.opba_pba.pba_busname = "ofpci";
+#else
+       pba.opba_pba.pba_busname = "pci";
+#endif
+       pba.opba_pba.pba_flags = sc->sc_psycho_this->pp_flags;
+       pba.opba_pba.pba_dmat = sc->sc_psycho_this->pp_dmat;
+       pba.opba_pba.pba_iot = sc->sc_psycho_this->pp_iot;
+       pba.opba_pba.pba_memt = sc->sc_psycho_this->pp_memt;
+       pba.opba_node = sc->sc_node;
 
        config_found(self, &pba, psycho_print);
 }
@@ -645,7 +654,7 @@
        /*
         * It's uncorrectable.  Dump the regs and panic.
         */
-       printf("%s: uncorrectable DMA error AFAR %llx pa %llx AFSR %llx:\n%s",
+       printf("%s: uncorrectable DMA error AFAR %llx pa %llx AFSR %llx:\n%s\n",
                sc->sc_dev.dv_xname, afar, 
                (long long)iommu_extract(is, (vaddr_t)afar), afsr,
                bitmask_snprintf(afsr, PSYCHO_UE_AFSR_BITS,



Home | Main Index | Thread Index | Old Index