Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Add Au1550 PCI support (Au1500 not yet, coming shor...



details:   https://anonhg.NetBSD.org/src/rev/d82648bc30b9
branches:  trunk
changeset: 588132:d82648bc30b9
user:      gdamore <gdamore%NetBSD.org@localhost>
date:      Thu Feb 09 00:26:39 2006 +0000

description:
Add Au1550 PCI support (Au1500 not yet, coming shortly).
Closes PR port-evbmips/32087.
Reviewed by simonb@ (Also, earlier, matt@, and tsutsui@.)

diffstat:

 sys/arch/evbmips/alchemy/machdep.c        |   17 +-
 sys/arch/evbmips/alchemy/pciide_machdep.c |   65 ++++
 sys/arch/evbmips/conf/ALCHEMY             |    7 +-
 sys/arch/evbmips/conf/DBAU1550            |   27 +-
 sys/arch/evbmips/conf/files.alchemy       |    9 +-
 sys/arch/evbmips/conf/std.alchemy         |    3 +-
 sys/arch/mips/alchemy/au1500.c            |    6 +-
 sys/arch/mips/alchemy/au1550.c            |    6 +-
 sys/arch/mips/alchemy/dev/aupci.c         |  463 ++++++++++++++++++++++++++++++
 sys/arch/mips/alchemy/dev/aupcireg.h      |  101 ++++++
 sys/arch/mips/alchemy/dev/aupcivar.h      |   46 ++
 sys/arch/mips/alchemy/include/aureg.h     |   11 +-
 sys/arch/mips/alchemy/include/auvar.h     |   22 +-
 sys/arch/mips/conf/files.alchemy          |    8 +-
 14 files changed, 769 insertions(+), 22 deletions(-)

diffs (truncated from 995 to 300 lines):

diff -r 928924445841 -r d82648bc30b9 sys/arch/evbmips/alchemy/machdep.c
--- a/sys/arch/evbmips/alchemy/machdep.c        Wed Feb 08 23:09:15 2006 +0000
+++ b/sys/arch/evbmips/alchemy/machdep.c        Thu Feb 09 00:26:39 2006 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.24 2006/02/08 09:04:01 gdamore Exp $ */
+/* $NetBSD: machdep.c,v 1.25 2006/02/09 00:26:39 gdamore Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -107,7 +107,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.24 2006/02/08 09:04:01 gdamore Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.25 2006/02/09 00:26:39 gdamore Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -146,6 +146,7 @@
 #include <machine/yamon.h>
 
 #include <evbmips/alchemy/board.h>
+#include <mips/alchemy/dev/aupcivar.h>
 #include <mips/alchemy/include/aureg.h>
 #include <mips/alchemy/include/auvar.h>
 #include <mips/alchemy/include/aubusvar.h>
@@ -507,16 +508,16 @@
        /*NOTREACHED*/
 }
 
-#if 0
-/* add this when we add PCI support */
+/*
+ * Export our interrupt map function so aupci can find it.
+ */
 int
-machdep_pci_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
+aupci_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
 {
-       struct alchemy_board *board;
+       const struct alchemy_board *board;
 
        board = board_info();
        if (board->ab_pci_intr_map != NULL)
                return (board->ab_pci_intr_map(pa, ihp));
-       return 0;
+       return 1;
 }
-#endif
diff -r 928924445841 -r d82648bc30b9 sys/arch/evbmips/alchemy/pciide_machdep.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/alchemy/pciide_machdep.c Thu Feb 09 00:26:39 2006 +0000
@@ -0,0 +1,65 @@
+/*     $NetBSD: pciide_machdep.c,v 1.1 2006/02/09 00:26:39 gdamore Exp $       */
+
+/*
+ * Copyright (c) 1998 Christopher G. Demetriou.  All rights reserved.
+ *
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by Christopher G. Demetriou
+ *     for the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ */
+
+/*
+ * PCI IDE controller driver (alchemy machine-dependent portion).
+ *
+ * Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD
+ * sys/dev/pci/ppb.c, revision 1.16).
+ *
+ * See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the
+ * PCI SIG.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.1 2006/02/09 00:26:39 gdamore Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pciidereg.h>
+#include <dev/pci/pciidevar.h>
+
+void *
+pciide_machdep_compat_intr_establish(struct device *dev,
+    struct pci_attach_args *pa, int chan, int (*func)(void *), void *arg)
+{
+       pci_chipset_tag_t pc = pa->pa_pc;
+
+       if (pc->pc_pciide_compat_intr_establish == NULL)
+               return (NULL);
+       return (mips_pciide_compat_intr_establish(pc, dev, pa, chan,
+           func, arg));
+}
diff -r 928924445841 -r d82648bc30b9 sys/arch/evbmips/conf/ALCHEMY
--- a/sys/arch/evbmips/conf/ALCHEMY     Wed Feb 08 23:09:15 2006 +0000
+++ b/sys/arch/evbmips/conf/ALCHEMY     Thu Feb 09 00:26:39 2006 +0000
@@ -1,11 +1,11 @@
-#      $NetBSD: ALCHEMY,v 1.4 2006/02/08 09:04:01 gdamore Exp $
+#      $NetBSD: ALCHEMY,v 1.5 2006/02/09 00:26:39 gdamore Exp $
 #
 # Kernel config for the Alchemy Semiconductor (AMD) PB1000, PB1500,
 # DBAu1000 and DBAu1500 evaluation boards.
 
 include        "arch/evbmips/conf/std.alchemy"
 
-#ident                 "ALCHEMY-$Revision: 1.4 $"
+#ident                 "ALCHEMY-$Revision: 1.5 $"
 
 maxusers       32
 
@@ -151,8 +151,11 @@
 # MII/PHY support
 amhphy*                at mii? phy ?                   # AMD 79c901 Ethernet PHYs
 bmtphy*                at mii? phy ?                   # Broadcom BCM5201/BCM5202 PHYs
+brgphy*                at mii? phy ?                   # Broadcom BCM5400-family PHYs
 sqphy*         at mii? phy ?                   # Seeq 80220/80221/80223 PHYs
 acphy*         at mii? phy ?                   # AMD/Altima AC101 PHYs
+rlphy*         at mii? phy ?                   # RealTek 8139/8201L PHYs
+ukphy*         at mii? phy ?                   # Catch-all PHYs
 
 # USB
 ohci*          at aubus? addr ?                # USB Open Host Controller
diff -r 928924445841 -r d82648bc30b9 sys/arch/evbmips/conf/DBAU1550
--- a/sys/arch/evbmips/conf/DBAU1550    Wed Feb 08 23:09:15 2006 +0000
+++ b/sys/arch/evbmips/conf/DBAU1550    Thu Feb 09 00:26:39 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: DBAU1550,v 1.2 2006/02/08 17:02:05 gdamore Exp $
+#      $NetBSD: DBAU1550,v 1.3 2006/02/09 00:26:39 gdamore Exp $
 #
 # Kernel config for the AMD Alchemy DBAu1550 evaluation board.
 
@@ -14,3 +14,28 @@
 
 options                ALCHEMY_AU1550
 options                ALCHEMY_DBAU1550
+options                PCI_NETBSD_CONFIGURE
+
+aupci* at aubus? addr ?
+pci*   at aupci?
+
+# Note that this is just fairly random selection of PCI devices.
+# Only the hptide controller is actually on-board.
+
+bge*           at pci? dev ? function ?        # Broadcom GigE
+wi*            at pci? dev ? function ?        # Intersil PRISM WLAN
+ral*           at pci? dev ? function ?        # Ralink WLAN
+re*            at pci? dev ? function ?        # Realtek 8169 GigE
+tlp*           at pci? dev ? function ?        # DEC Tulip Ethernet
+vge*           at pci? dev ? function ?        # VIA GigE
+rtk*           at pci? dev ? function ?        # Realtek 8129/8139
+hptide*                at pci? dev ? function ?        # Triones/HighPoint IDE
+
+atabus*                at ata?
+wd*            at atabus? drive ? flags 0x0000
+
+atapibus*      at atabus?
+cd*            at atapibus? drive ? flags 0x0000       # ATAPI CD-ROM drives
+sd*            at atapibus? drive ? flags 0x0000       # ATAPI disk drives
+uk*            at atapibus? drive ? flags 0x0000       # ATAPI unknown
+
diff -r 928924445841 -r d82648bc30b9 sys/arch/evbmips/conf/files.alchemy
--- a/sys/arch/evbmips/conf/files.alchemy       Wed Feb 08 23:09:15 2006 +0000
+++ b/sys/arch/evbmips/conf/files.alchemy       Thu Feb 09 00:26:39 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.alchemy,v 1.1 2006/02/08 09:04:01 gdamore Exp $
+#      $NetBSD: files.alchemy,v 1.2 2006/02/09 00:26:39 gdamore Exp $
 
 # Platform support - select just one, please
 defflag                opt_alchemy.h   ALCHEMY_GENERIC
@@ -13,6 +13,7 @@
 file   arch/evbmips/alchemy/genericbd.c        alchemy_generic
 file   arch/evbmips/alchemy/dbau1500.c         alchemy_dbau1500
 file   arch/evbmips/alchemy/dbau1550.c         alchemy_dbau1550
+file   arch/evbmips/alchemy/pciide_machdep.c   pciide_common
 
 file   arch/mips/mips/bus_dma.c
 file   arch/evbmips/evbmips/clock.c
@@ -54,6 +55,12 @@
 # Machine-independent USB device support
 include "dev/usb/files.usb"
 
+# Machine-independent I2O drivers
+include "dev/i2o/files.i2o"
+
+# Machine-independent PCI drivers
+include "dev/pci/files.pci"
+
 # Machine-independent PCMCIA drivers
 device fdc {drive = -1}        # files.pcmcia requires.
 include "dev/pcmcia/files.pcmcia"
diff -r 928924445841 -r d82648bc30b9 sys/arch/evbmips/conf/std.alchemy
--- a/sys/arch/evbmips/conf/std.alchemy Wed Feb 08 23:09:15 2006 +0000
+++ b/sys/arch/evbmips/conf/std.alchemy Thu Feb 09 00:26:39 2006 +0000
@@ -1,9 +1,10 @@
-# $NetBSD: std.alchemy,v 1.1 2006/02/08 09:04:01 gdamore Exp $
+# $NetBSD: std.alchemy,v 1.2 2006/02/09 00:26:39 gdamore Exp $
 
 machine evbmips mips
 include                "conf/std"      # MI standard options
 
 options MIPS3_ENABLE_CLOCK_INTR
+options        ENABLE_MIPS3_WIRED_MAP
 
 options        EXEC_ELF32      # exec ELF32 binaries
 options        EXEC_SCRIPT     # exec #! scripts
diff -r 928924445841 -r d82648bc30b9 sys/arch/mips/alchemy/au1500.c
--- a/sys/arch/mips/alchemy/au1500.c    Wed Feb 08 23:09:15 2006 +0000
+++ b/sys/arch/mips/alchemy/au1500.c    Thu Feb 09 00:26:39 2006 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: au1500.c,v 1.1 2006/02/06 23:23:53 gdamore Exp $ */
+/* $NetBSD: au1500.c,v 1.2 2006/02/09 00:26:40 gdamore Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: au1500.c,v 1.1 2006/02/06 23:23:53 gdamore Exp $");
+__KERNEL_RCSID(0, "$NetBSD: au1500.c,v 1.2 2006/02/09 00:26:40 gdamore Exp $");
 
 #include <sys/param.h>
 #include <machine/bus.h>
@@ -181,8 +181,8 @@
        { "aumac",      { AU1500_MAC1_BASE, AU1500_MAC1_ENABLE,
                          MAC1_DMA_BASE },                         { 29, -1 }},
        { "ohci",       { USBH_BASE, USBH_ENABLE, USBH_SIZE },     { 26, -1 }},
+       { "aupci",      { PCI_BASE },                              { -1, -1 }},
 #if 0
-       { "aupci",      { PCI_BASE },                              { -1, -1 }},
        { "auaudio",    { AC97_BASE },                             { 27, 31 }},
        { "usbd",       { USBD_BASE },                             { 24, 25 }},
        { "gpio",       { SYS_BASE },                              { -1, -1 }},
diff -r 928924445841 -r d82648bc30b9 sys/arch/mips/alchemy/au1550.c
--- a/sys/arch/mips/alchemy/au1550.c    Wed Feb 08 23:09:15 2006 +0000
+++ b/sys/arch/mips/alchemy/au1550.c    Thu Feb 09 00:26:39 2006 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: au1550.c,v 1.1 2006/02/06 23:23:53 gdamore Exp $ */
+/* $NetBSD: au1550.c,v 1.2 2006/02/09 00:26:40 gdamore Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: au1550.c,v 1.1 2006/02/06 23:23:53 gdamore Exp $");
+__KERNEL_RCSID(0, "$NetBSD: au1550.c,v 1.2 2006/02/09 00:26:40 gdamore Exp $");
 
 #include <sys/param.h>
 #include <machine/bus.h>
@@ -181,8 +181,8 @@
        { "aumac",      { MAC1_BASE, MAC1_ENABLE, MAC1_DMA_BASE }, { 28, -1 }},
        { "ohci",       { AU1550_USBH_BASE, AU1550_USBH_ENABLE, 
                          AU1550_USBH_SIZE },                      { 26, -1 }},
+       { "aupci",      { PCI_BASE },                              { -1, -1 }},
 #if 0
-       { "aupci",      { PCI_BASE },                              { -1, -1 }},
        { "usbd",       { USBD_BASE },                             { 24, 25 }},
        { "aupsc",      { PSC0_BASE },                             { 10, -1 }},
        { "aupsc",      { PSC1_BASE },                             { 11, -1 }},
diff -r 928924445841 -r d82648bc30b9 sys/arch/mips/alchemy/dev/aupci.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/mips/alchemy/dev/aupci.c Thu Feb 09 00:26:39 2006 +0000
@@ -0,0 +1,463 @@
+/* $NetBSD: aupci.c,v 1.1 2006/02/09 00:26:40 gdamore Exp $ */
+
+/*-
+ * Copyright (c) 2006 Itronix Inc.
+ * All rights reserved.
+ *
+ * Written by Garrett D'Amore for Itronix Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions



Home | Main Index | Thread Index | Old Index