Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amiga Tons of enchancements to MD PCI code:



details:   https://anonhg.NetBSD.org/src/rev/36ba053ef1f5
branches:  trunk
changeset: 772861:36ba053ef1f5
user:      rkujawa <rkujawa%NetBSD.org@localhost>
date:      Thu Jan 19 00:14:08 2012 +0000

description:
Tons of enchancements to MD PCI code:
- The G-REX 4000 and G-REX 1200 are now really supported and working (still only 1st slot but the rest are a matter of time).
- Add bridge identification to p5pb, simplifies the driver and make it more user-friendly.
- Retire P5PB_GENFB and P5PB_OLD_FIRMWARE options, these are now handled automatically, depending on used hardware and firmware.
- Add PCI bus reconfiguration support to p5pb (PCI_NETBSD_CONFIGURE), allows using G-REX without boot to AmigaOS.
- Bring p5pb registers desription up to date with my knowledge.
- Add a lot of debugging code to p5pb (enabled by P5PB_DEBUG kernel option).
- Fix PCI_NETBSD_CONFIGURE in mppb (now it really works).
- Fix quirk handling in zbus.
- Update GENERIC.in and regen the kernel configs.
- Misc cleanup.

diffstat:

 sys/arch/amiga/conf/DRACO            |    6 +-
 sys/arch/amiga/conf/GENERIC          |   10 +-
 sys/arch/amiga/conf/GENERIC.in       |    8 +-
 sys/arch/amiga/conf/INSTALL          |   10 +-
 sys/arch/amiga/conf/files.amiga      |    4 +-
 sys/arch/amiga/dev/p5bus.c           |   17 +-
 sys/arch/amiga/dev/zbus.c            |   16 +-
 sys/arch/amiga/include/pci_machdep.h |    4 +-
 sys/arch/amiga/pci/mppb.c            |   30 +-
 sys/arch/amiga/pci/p5membar.c        |    4 +-
 sys/arch/amiga/pci/p5pb.c            |  444 ++++++++++++++++++++++++++--------
 sys/arch/amiga/pci/p5pbreg.h         |   52 ++-
 sys/arch/amiga/pci/p5pbvar.h         |   16 +-
 13 files changed, 425 insertions(+), 196 deletions(-)

diffs (truncated from 1098 to 300 lines):

diff -r 333a1cc1ed2a -r 36ba053ef1f5 sys/arch/amiga/conf/DRACO
--- a/sys/arch/amiga/conf/DRACO Wed Jan 18 23:12:21 2012 +0000
+++ b/sys/arch/amiga/conf/DRACO Thu Jan 19 00:14:08 2012 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: DRACO,v 1.150 2012/01/11 17:04:29 rkujawa Exp $
+# $NetBSD: DRACO,v 1.151 2012/01/19 00:14:08 rkujawa Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.91 2012/01/10 20:29:50 rkujawa Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.92 2012/01/11 17:04:29 rkujawa Exp $
 #
 ##
 # GENERIC machine description file
@@ -29,7 +29,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.150 $"
+#ident                 "GENERIC-$Revision: 1.151 $"
 
 
 maxusers       8
diff -r 333a1cc1ed2a -r 36ba053ef1f5 sys/arch/amiga/conf/GENERIC
--- a/sys/arch/amiga/conf/GENERIC       Wed Jan 18 23:12:21 2012 +0000
+++ b/sys/arch/amiga/conf/GENERIC       Thu Jan 19 00:14:08 2012 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: GENERIC,v 1.280 2012/01/11 17:04:29 rkujawa Exp $
+# $NetBSD: GENERIC,v 1.281 2012/01/19 00:14:08 rkujawa Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.91 2012/01/10 20:29:50 rkujawa Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.92 2012/01/11 17:04:29 rkujawa Exp $
 #
 ##
 # GENERIC machine description file
@@ -29,7 +29,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.280 $"
+#ident                 "GENERIC-$Revision: 1.281 $"
 
 
 maxusers       8
@@ -470,12 +470,10 @@
 # PCI bus support
 options                PCIVERBOSE              # verbose PCI device autoconfig messages
 #options       PCI_CONFIG_DUMP
-options                PCI_NETBSD_CONFIGURE    # used only by mppb(4)
+options                PCI_NETBSD_CONFIGURE    # supported by mppb(4) and p5pb(4)
 
 p5pb0          at p5bus0               # Phase5 PCI bridge (CVPPC/BVPPC/G-REX)
 p5membar*      at zbus0                # Phase5 PCI bridge autoconfiguring BARs
-#options       P5PB_OLD_FIRMWARE       # enable support for p5pb with old fw
-#options       P5PB_GENFB              # enable genfb support for CVPPC/BVPPC
 #options       P5PB_DEBUG              # enable excessive debug for p5pb
 pci*           at p5pb0
 
diff -r 333a1cc1ed2a -r 36ba053ef1f5 sys/arch/amiga/conf/GENERIC.in
--- a/sys/arch/amiga/conf/GENERIC.in    Wed Jan 18 23:12:21 2012 +0000
+++ b/sys/arch/amiga/conf/GENERIC.in    Thu Jan 19 00:14:08 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC.in,v 1.92 2012/01/11 17:04:29 rkujawa Exp $
+# $NetBSD: GENERIC.in,v 1.93 2012/01/19 00:14:08 rkujawa Exp $
 #
 ##
 # GENERIC machine description file
@@ -52,7 +52,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.92 $"
+#ident                 "GENERIC-$Revision: 1.93 $"
 
 m4_ifdef(`INSTALL_CONFIGURATION', `m4_dnl
 makeoptions    COPTS="-Os"
@@ -557,12 +557,10 @@
 # PCI bus support
 options                PCIVERBOSE              # verbose PCI device autoconfig messages
 #options       PCI_CONFIG_DUMP
-options                PCI_NETBSD_CONFIGURE    # used only by mppb(4)
+options                PCI_NETBSD_CONFIGURE    # supported by mppb(4) and p5pb(4)
 
 p5pb0          at p5bus0               # Phase5 PCI bridge (CVPPC/BVPPC/G-REX)
 p5membar*      at zbus0                # Phase5 PCI bridge autoconfiguring BARs
-#options       P5PB_OLD_FIRMWARE       # enable support for p5pb with old fw
-#options       P5PB_GENFB              # enable genfb support for CVPPC/BVPPC
 #options       P5PB_DEBUG              # enable excessive debug for p5pb
 pci*           at p5pb0
 
diff -r 333a1cc1ed2a -r 36ba053ef1f5 sys/arch/amiga/conf/INSTALL
--- a/sys/arch/amiga/conf/INSTALL       Wed Jan 18 23:12:21 2012 +0000
+++ b/sys/arch/amiga/conf/INSTALL       Thu Jan 19 00:14:08 2012 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: INSTALL,v 1.102 2012/01/11 17:04:29 rkujawa Exp $
+# $NetBSD: INSTALL,v 1.103 2012/01/19 00:14:08 rkujawa Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
 #
-# Created from: # NetBSD: GENERIC.in,v 1.91 2012/01/10 20:29:50 rkujawa Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.92 2012/01/11 17:04:29 rkujawa Exp $
 #
 ##
 # GENERIC machine description file
@@ -29,7 +29,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.102 $"
+#ident                 "GENERIC-$Revision: 1.103 $"
 
 makeoptions    COPTS="-Os"
 
@@ -414,12 +414,10 @@
 # PCI bus support
 options                PCIVERBOSE              # verbose PCI device autoconfig messages
 #options       PCI_CONFIG_DUMP
-options                PCI_NETBSD_CONFIGURE    # used only by mppb(4)
+options                PCI_NETBSD_CONFIGURE    # supported by mppb(4) and p5pb(4)
 
 p5pb0          at p5bus0               # Phase5 PCI bridge (CVPPC/BVPPC/G-REX)
 p5membar*      at zbus0                # Phase5 PCI bridge autoconfiguring BARs
-#options       P5PB_OLD_FIRMWARE       # enable support for p5pb with old fw
-#options       P5PB_GENFB              # enable genfb support for CVPPC/BVPPC
 #options       P5PB_DEBUG              # enable excessive debug for p5pb
 pci*           at p5pb0
 
diff -r 333a1cc1ed2a -r 36ba053ef1f5 sys/arch/amiga/conf/files.amiga
--- a/sys/arch/amiga/conf/files.amiga   Wed Jan 18 23:12:21 2012 +0000
+++ b/sys/arch/amiga/conf/files.amiga   Thu Jan 19 00:14:08 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.amiga,v 1.152 2012/01/11 17:04:29 rkujawa Exp $
+#      $NetBSD: files.amiga,v 1.153 2012/01/19 00:14:08 rkujawa Exp $
 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 16                       # NOTE THAT AMIGA IS SPECIAL!
@@ -33,8 +33,6 @@
 defflag                                LEV6_DEFER
 defflag                                DEVRELOAD
 
-defflag opt_p5pb.h             P5PB_GENFB
-defflag opt_p5pb.h             P5PB_OLD_FIRMWARE
 defflag opt_p5pb.h             P5PB_DEBUG
 
 defparam                       IOBZCLOCK
diff -r 333a1cc1ed2a -r 36ba053ef1f5 sys/arch/amiga/dev/p5bus.c
--- a/sys/arch/amiga/dev/p5bus.c        Wed Jan 18 23:12:21 2012 +0000
+++ b/sys/arch/amiga/dev/p5bus.c        Thu Jan 19 00:14:08 2012 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: p5bus.c,v 1.1 2012/01/10 20:29:50 rkujawa Exp $ */
+/*      $NetBSD: p5bus.c,v 1.2 2012/01/19 00:14:08 rkujawa Exp $ */
 
 /*-
  * Copyright (c) 2011, 2012 The NetBSD Foundation, Inc.
@@ -64,10 +64,6 @@
        uint8_t         sc_has_ppc;
 #define P5BUS_PPC_NONE         0       /* CS Mk-III only */
 #define P5BUS_PPC_OK           1       /* has working PPC CPU */
-       uint8_t         sc_has_pci;
-#define P5BUS_PCI_NONE         0
-#define P5BUS_PCI_CVPPC        1       /* CyberVisionPPC / BlizzardVisionPPC */
-#define P5BUS_PCI_GREX         2       /* G-REX (not yet) */
 };
 
 CFATTACH_DECL_NEW(p5bus, sizeof(struct p5bus_softc),
@@ -126,7 +122,7 @@
        
        } else if (zap->prodid == ZORRO_PRODID_BPPC) {
 
-               if (sn[0] == 'I') {     /* only "+" model has SCSI */
+               if (sn[0] != 'I') {     /* only "+" model has SCSI */
                        aprint_normal_dev(sc->sc_dev, 
                            "BlizzardPPC 603e (sn %s)\n", sn);
                        sc->sc_has_scsi = P5BUS_SCSI_NONE;
@@ -141,8 +137,6 @@
 
        }
 
-       sc->sc_has_pci = P5BUS_PCI_CVPPC; /* XXX: insert probe here? */
-
        p5baa.p5baa_cardtype = sc->sc_cardtype;
 
        /* Attach the SCSI host adapters. */
@@ -177,10 +171,9 @@
        sc = device_private(self);
        p5baa.p5baa_cardtype = sc->sc_cardtype;
 
-       if (sc->sc_has_pci) {
-               strcpy(p5baa.p5baa_name, "p5pb");
-               config_found_ia(sc->sc_dev, "p5bus", &p5baa, p5bus_print);
-       }
+       /* p5pb is always found, probe is inside of p5pb driver */
+       strcpy(p5baa.p5baa_name, "p5pb");
+       config_found_ia(sc->sc_dev, "p5bus", &p5baa, p5bus_print);
 }
 
 /* Get serial number of the card. */
diff -r 333a1cc1ed2a -r 36ba053ef1f5 sys/arch/amiga/dev/zbus.c
--- a/sys/arch/amiga/dev/zbus.c Wed Jan 18 23:12:21 2012 +0000
+++ b/sys/arch/amiga/dev/zbus.c Thu Jan 19 00:14:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zbus.c,v 1.67 2011/09/21 12:40:25 rkujawa Exp $ */
+/*     $NetBSD: zbus.c,v 1.68 2012/01/19 00:14:08 rkujawa Exp $ */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.67 2011/09/21 12:40:25 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.68 2012/01/19 00:14:08 rkujawa Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -244,6 +244,7 @@
  * given a manufacturer id and product id, find quirks
  * for this board.
  */
+
 static uint8_t
 quirkslookup(int mid, int pid)
 {
@@ -251,7 +252,7 @@
 
        eqdp = &quirkstab[nquirksent];
        for (qdp = quirkstab; qdp < eqdp; qdp++)
-               if (qdp->manid == mid && qdp->prodid == pid)
+               if (qdp->manid == mid && qdp->prodid == pid) 
                        return(qdp->quirks);
        return(0);
 }
@@ -335,6 +336,11 @@
 
                za.pa = cdp->addr;
                za.size = cdp->size;
+               za.manid = cdp->rom.manid;
+               za.prodid = cdp->rom.prodid;
+               za.serno = cdp->rom.serno;
+               za.slot = (((u_long)za.pa >> 16) & 0xF) - 0x9;
+
                if (amiga_realconfig && pcp < epcp && pcp->vaddr)
                        za.va = pcp->vaddr;
                else {
@@ -349,10 +355,6 @@
                        if (amiga_realconfig == 0)
                                pcp->vaddr = za.va;
                }
-               za.manid = cdp->rom.manid;
-               za.prodid = cdp->rom.prodid;
-               za.serno = cdp->rom.serno;
-               za.slot = (((u_long)za.pa >> 16) & 0xF) - 0x9;
                amiga_config_found(early_cfdata, dp, &za, zbusprint);
        }
 }
diff -r 333a1cc1ed2a -r 36ba053ef1f5 sys/arch/amiga/include/pci_machdep.h
--- a/sys/arch/amiga/include/pci_machdep.h      Wed Jan 18 23:12:21 2012 +0000
+++ b/sys/arch/amiga/include/pci_machdep.h      Thu Jan 19 00:14:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.h,v 1.3 2011/09/19 19:15:29 rkujawa Exp $ */
+/*     $NetBSD: pci_machdep.h,v 1.4 2012/01/19 00:14:08 rkujawa Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -38,6 +38,8 @@
 
 #include <m68k/bus_dma.h>
 
+/* #define __HAVE_PCI_CONF_HOOK */
+
 /*
  * Forward declarations.
  */
diff -r 333a1cc1ed2a -r 36ba053ef1f5 sys/arch/amiga/pci/mppb.c
--- a/sys/arch/amiga/pci/mppb.c Wed Jan 18 23:12:21 2012 +0000
+++ b/sys/arch/amiga/pci/mppb.c Thu Jan 19 00:14:08 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mppb.c,v 1.4 2012/01/13 13:41:25 rkujawa Exp $ */
+/*     $NetBSD: mppb.c,v 1.5 2012/01/19 00:14:08 rkujawa Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,6 +55,8 @@
 #include <dev/pci/pcidevs.h>
 #include <dev/pci/pciconf.h>
 
+#include "opt_pci.h"
+
 /* Zorro IDs */
 #define ZORRO_MANID_MATAY      44359
 #define ZORRO_PRODID_PROMETHEUS        1
@@ -100,11 +102,6 @@
        if (zap->prodid != ZORRO_PRODID_PROMETHEUS)
                return 0;
                



Home | Main Index | Thread Index | Old Index