Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amiga Add driver for Prometheus PCI bridge.



details:   https://anonhg.NetBSD.org/src/rev/d3f338f97834
branches:  trunk
changeset: 769669:d3f338f97834
user:      rkujawa <rkujawa%NetBSD.org@localhost>
date:      Sat Sep 17 16:55:34 2011 +0000

description:
Add driver for Prometheus PCI bridge.
Change approved by phx.

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      |    6 +-
 sys/arch/amiga/dev/zbus.c            |    6 +-
 sys/arch/amiga/include/pci_machdep.h |    7 +-
 sys/arch/amiga/pci/mppb.c            |  299 +++++++++++++++++++++++++++++++++++
 sys/arch/amiga/pci/mppbreg.h         |   52 ++++++
 9 files changed, 386 insertions(+), 18 deletions(-)

diffs (truncated from 561 to 300 lines):

diff -r 7d5248119f67 -r d3f338f97834 sys/arch/amiga/conf/DRACO
--- a/sys/arch/amiga/conf/DRACO Sat Sep 17 16:54:39 2011 +0000
+++ b/sys/arch/amiga/conf/DRACO Sat Sep 17 16:55:34 2011 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: DRACO,v 1.140 2011/08/04 17:48:50 rkujawa Exp $
+# $NetBSD: DRACO,v 1.141 2011/09/17 16:55:34 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.81 2011/07/01 15:46:30 rkujawa Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.82 2011/08/04 17:48:51 rkujawa Exp $
 #
 ##
 # GENERIC machine description file
@@ -29,7 +29,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.140 $"
+#ident                 "GENERIC-$Revision: 1.141 $"
 
 
 maxusers       8
diff -r 7d5248119f67 -r d3f338f97834 sys/arch/amiga/conf/GENERIC
--- a/sys/arch/amiga/conf/GENERIC       Sat Sep 17 16:54:39 2011 +0000
+++ b/sys/arch/amiga/conf/GENERIC       Sat Sep 17 16:55:34 2011 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: GENERIC,v 1.270 2011/08/04 17:48:51 rkujawa Exp $
+# $NetBSD: GENERIC,v 1.271 2011/09/17 16:55:34 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.81 2011/07/01 15:46:30 rkujawa Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.82 2011/08/04 17:48:51 rkujawa Exp $
 #
 ##
 # GENERIC machine description file
@@ -29,7 +29,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.270 $"
+#ident                 "GENERIC-$Revision: 1.271 $"
 
 
 maxusers       8
@@ -468,6 +468,10 @@
 #options       PCI_CONFIG_DUMP
 p5pb0          at zbus0                # Phase5 PCI bridge (CVPPC/BVPPC)
 pci*           at p5pb0
+mppb*           at zbus0                # Matay Prometheus Zorro-PCI bridge
+pci*            at mppb?
+
+ne*             at pci?                 # NE2000 Ethernet
 
 # Bluetooth Controller and Device support
 # tested only with btuart on an A1200
diff -r 7d5248119f67 -r d3f338f97834 sys/arch/amiga/conf/GENERIC.in
--- a/sys/arch/amiga/conf/GENERIC.in    Sat Sep 17 16:54:39 2011 +0000
+++ b/sys/arch/amiga/conf/GENERIC.in    Sat Sep 17 16:55:34 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC.in,v 1.82 2011/08/04 17:48:51 rkujawa Exp $
+# $NetBSD: GENERIC.in,v 1.83 2011/09/17 16:55:34 rkujawa Exp $
 #
 ##
 # GENERIC machine description file
@@ -57,7 +57,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.82 $"
+#ident                 "GENERIC-$Revision: 1.83 $"
 
 m4_ifdef(`INSTALL_CONFIGURATION', `m4_dnl
 makeoptions    COPTS="-Os"
@@ -575,6 +575,10 @@
 #options       PCI_CONFIG_DUMP
 p5pb0          at zbus0                # Phase5 PCI bridge (CVPPC/BVPPC)
 pci*           at p5pb0
+mppb*           at zbus0                # Matay Prometheus Zorro-PCI bridge
+pci*            at mppb?
+
+ne*             at pci?                 # NE2000 Ethernet
 
 # Bluetooth Controller and Device support
 # tested only with btuart on an A1200
diff -r 7d5248119f67 -r d3f338f97834 sys/arch/amiga/conf/INSTALL
--- a/sys/arch/amiga/conf/INSTALL       Sat Sep 17 16:54:39 2011 +0000
+++ b/sys/arch/amiga/conf/INSTALL       Sat Sep 17 16:55:34 2011 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: INSTALL,v 1.92 2011/08/04 17:48:51 rkujawa Exp $
+# $NetBSD: INSTALL,v 1.93 2011/09/17 16:55:34 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.81 2011/07/01 15:46:30 rkujawa Exp $
+# Created from: # NetBSD: GENERIC.in,v 1.82 2011/08/04 17:48:51 rkujawa Exp $
 #
 ##
 # GENERIC machine description file
@@ -29,7 +29,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.92 $"
+#ident                 "GENERIC-$Revision: 1.93 $"
 
 makeoptions    COPTS="-Os"
 
@@ -412,6 +412,10 @@
 #options       PCI_CONFIG_DUMP
 p5pb0          at zbus0                # Phase5 PCI bridge (CVPPC/BVPPC)
 pci*           at p5pb0
+mppb*           at zbus0                # Matay Prometheus Zorro-PCI bridge
+pci*            at mppb?
+
+ne*             at pci?                 # NE2000 Ethernet
 
 # Bluetooth Controller and Device support
 # tested only with btuart on an A1200
diff -r 7d5248119f67 -r d3f338f97834 sys/arch/amiga/conf/files.amiga
--- a/sys/arch/amiga/conf/files.amiga   Sat Sep 17 16:54:39 2011 +0000
+++ b/sys/arch/amiga/conf/files.amiga   Sat Sep 17 16:55:34 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.amiga,v 1.146 2011/08/04 17:48:51 rkujawa Exp $
+#      $NetBSD: files.amiga,v 1.147 2011/09/17 16:55:34 rkujawa Exp $
 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 16                       # NOTE THAT AMIGA IS SPECIAL!
@@ -495,10 +495,14 @@
 
 # PCI bus
 file   arch/amiga/pci/p5pb.c           pci
+file   arch/amiga/pci/mppb.c           pci
 
 device p5pb: pcibus
 attach p5pb at zbus
 
+device mppb: pcibus
+attach mppb at zbus
+
 include        "dev/i2o/files.i2o"
 include        "dev/pci/files.pci"
 #include "dev/wsfb/files.wsfb"
diff -r 7d5248119f67 -r d3f338f97834 sys/arch/amiga/dev/zbus.c
--- a/sys/arch/amiga/dev/zbus.c Sat Sep 17 16:54:39 2011 +0000
+++ b/sys/arch/amiga/dev/zbus.c Sat Sep 17 16:55:34 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zbus.c,v 1.64 2011/08/04 17:48:51 rkujawa Exp $ */
+/*     $NetBSD: zbus.c,v 1.65 2011/09/17 16:55:34 rkujawa Exp $ */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.64 2011/08/04 17:48:51 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.65 2011/09/17 16:55:34 rkujawa Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -189,7 +189,7 @@
        { "hyper4+",    5001,   6},     /* Hypercom4+ */
        { "hyper3+",    5001,   7},     /* Hypercom3+ */
        /* Matay Grzegorz Kraszewski */
-       { "Prometheus", 44359,  1}      /* Prometheus PCI bridge */
+       { "mppb",       44359,  1}      /* Prometheus PCI bridge */
 };
 static int naconfent = sizeof(aconftab) / sizeof(struct aconfdata);
 
diff -r 7d5248119f67 -r d3f338f97834 sys/arch/amiga/include/pci_machdep.h
--- a/sys/arch/amiga/include/pci_machdep.h      Sat Sep 17 16:54:39 2011 +0000
+++ b/sys/arch/amiga/include/pci_machdep.h      Sat Sep 17 16:55:34 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.h,v 1.1 2011/08/04 17:48:51 rkujawa Exp $ */
+/*     $NetBSD: pci_machdep.h,v 1.2 2011/09/17 16:55:34 rkujawa Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -66,6 +66,9 @@
                            int);
        void            (*pc_conf_write)(pci_chipset_tag_t, pcitag_t, int, 
                            pcireg_t);
+       int             (*pc_conf_hook)(pci_chipset_tag_t, int, int, int, 
+                           pcireg_t);
+       void            *pc_intr_v;
        int             (*pc_intr_map)(const struct pci_attach_args *, 
                            pci_intr_handle_t *);
        const char      *(*pc_intr_string)(pci_chipset_tag_t, 
@@ -75,8 +78,6 @@
        void            (*pc_intr_disestablish)(pci_chipset_tag_t, void *);
        void            (*pc_conf_interrupt)(pci_chipset_tag_t, int, int, int,
                            int, int *);
-       int             (*pc_conf_hook)(pci_chipset_tag_t, int, int, int, 
-                           pcireg_t);
 
        bus_space_tag_t pci_conf_iot;
        bus_space_handle_t pci_conf_ioh;
diff -r 7d5248119f67 -r d3f338f97834 sys/arch/amiga/pci/mppb.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amiga/pci/mppb.c Sat Sep 17 16:55:34 2011 +0000
@@ -0,0 +1,299 @@
+/*     $NetBSD: mppb.c,v 1.1 2011/09/17 16:55:34 rkujawa Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Radoslaw Kujawa.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Matay Prometheus Zorro-PCI bridge driver. */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/systm.h>
+#include <sys/errno.h>
+#include <sys/device.h>
+#include <sys/malloc.h>
+#include <sys/extent.h>
+#include <sys/kmem.h>
+
+#include <uvm/uvm_extern.h>
+
+#include <machine/bus.h>
+#include <machine/cpu.h>
+
+#include <m68k/bus_dma.h>
+#include <amiga/dev/zbusvar.h>
+#include <amiga/pci/mppbreg.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcidevs.h>
+#include <dev/pci/pciconf.h>
+
+/* Zorro IDs */
+#define ZORRO_MANID_MATAY      44359
+#define ZORRO_PRODID_PROMETHEUS        1
+
+struct mppb_softc {
+       device_t sc_dev;
+       volatile char *ba;
+       struct bus_space_tag pci_conf_area;
+       struct bus_space_tag pci_io_area;
+       struct bus_space_tag pci_mem_area;
+       struct amiga_pci_chipset apc;   
+};
+
+static int     mppb_match(struct device *, struct cfdata *, void *);
+static void    mppb_attach(struct device *, struct device *, void *);
+pcireg_t       mppb_pci_conf_read(pci_chipset_tag_t, pcitag_t, int);
+void           mppb_pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
+int            mppb_pci_bus_maxdevs(pci_chipset_tag_t pc, int busno); 
+int            mppb_pci_conf_hook(pci_chipset_tag_t pct, int bus, int dev, 
+                   int func, pcireg_t id);
+void           mppb_pci_attach_hook (struct device *parent, 
+                   struct device *self, struct pcibus_attach_args *pba);
+pcitag_t       mppb_pci_make_tag(pci_chipset_tag_t pc, int bus, int device, 
+                   int function);
+void           mppb_pci_decompose_tag(pci_chipset_tag_t pc, pcitag_t tag, 
+                   int *bp, int *dp, int *fp);
+
+void *         mppb_pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t
+                   ih, int level, int (*ih_fun)(void *), void *ih_arg);
+void           mppb_pci_intr_disestablish(pci_chipset_tag_t pc, void *cookie);
+int            mppb_pci_intr_map(const struct pci_attach_args *pa, 
+                   pci_intr_handle_t *ihp);
+const char *   mppb_pci_intr_string(pci_chipset_tag_t pc,
+                   pci_intr_handle_t ih);
+const struct evcnt * mppb_pci_intr_evcnt(pci_chipset_tag_t pc, 
+                   pci_intr_handle_t ih);
+



Home | Main Index | Thread Index | Old Index