Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Bring forward from matt-nb5-mips64. Support for Ra...
details: https://anonhg.NetBSD.org/src/rev/94a52a11cfb4
branches: trunk
changeset: 767732:94a52a11cfb4
user: matt <matt%NetBSD.org@localhost>
date: Thu Jul 28 15:38:48 2011 +0000
description:
Bring forward from matt-nb5-mips64. Support for Ralink RT3883 MIPS 74K SoC
from CradlePoint Technology.
diffstat:
sys/arch/evbppc/conf/P2020DS | 5 +-
sys/arch/evbppc/conf/P2020RDB | 8 +-
sys/arch/mips/conf/files.ralink | 39 +
sys/arch/mips/ralink/ralink_bus.c | 112 ++
sys/arch/mips/ralink/ralink_com.c | 315 +++++
sys/arch/mips/ralink/ralink_debug.h | 117 ++
sys/arch/mips/ralink/ralink_ehci.c | 249 ++++
sys/arch/mips/ralink/ralink_eth.c | 1737 ++++++++++++++++++++++++++++++++
sys/arch/mips/ralink/ralink_gpio.c | 1404 +++++++++++++++++++++++++
sys/arch/mips/ralink/ralink_gpio.h | 353 ++++++
sys/arch/mips/ralink/ralink_i2c.c | 370 ++++++
sys/arch/mips/ralink/ralink_intr.c | 306 +++++
sys/arch/mips/ralink/ralink_mainbus.c | 158 ++
sys/arch/mips/ralink/ralink_ohci.c | 197 +++
sys/arch/mips/ralink/ralink_reg.h | 976 +++++++++++++++++
sys/arch/mips/ralink/ralink_usbhcvar.h | 47 +
sys/arch/mips/ralink/ralink_var.h | 65 +
sys/arch/mips/ralink/ralink_wdog.c | 282 +++++
18 files changed, 6736 insertions(+), 4 deletions(-)
diffs (truncated from 6846 to 300 lines):
diff -r 99e6f0ff060c -r 94a52a11cfb4 sys/arch/evbppc/conf/P2020DS
--- a/sys/arch/evbppc/conf/P2020DS Thu Jul 28 15:36:47 2011 +0000
+++ b/sys/arch/evbppc/conf/P2020DS Thu Jul 28 15:38:48 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: P2020DS,v 1.6 2011/07/16 22:16:59 matt Exp $
+# $NetBSD: P2020DS,v 1.7 2011/07/28 15:38:48 matt Exp $
#
# P2020DS -- everything that's currently supported
#
@@ -8,7 +8,7 @@
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-ident "P2020DS-$Revision: 1.6 $"
+ident "P2020DS-$Revision: 1.7 $"
maxusers 32
@@ -19,6 +19,7 @@
options PIXIS
#options SYS_CLK=100000000
#options HZ=1000
+options MEMSIZE=0x40000000
makeoptions NEED_BINARY="yes"
makeoptions NEED_UBOOTIMAGE="yes"
diff -r 99e6f0ff060c -r 94a52a11cfb4 sys/arch/evbppc/conf/P2020RDB
--- a/sys/arch/evbppc/conf/P2020RDB Thu Jul 28 15:36:47 2011 +0000
+++ b/sys/arch/evbppc/conf/P2020RDB Thu Jul 28 15:38:48 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: P2020RDB,v 1.8 2011/07/20 13:20:26 matt Exp $
+# $NetBSD: P2020RDB,v 1.9 2011/07/28 15:38:48 matt Exp $
#
# P2020RBD -- everything that's currently supported
#
@@ -7,7 +7,7 @@
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-ident "P2020RBD-$Revision: 1.8 $"
+ident "P2020RBD-$Revision: 1.9 $"
maxusers 32
@@ -182,6 +182,10 @@
ppb* at pci? dev ? function ? # PCI-PCI bridges
pci* at ppb?
+ahcisata* at pci? dev ? function ?
+atabus* at ahcisata? channel ?
+wd* at atabus? drive ?
+
ehci* at cpunode? # usb
usb* at ehci?
uhub* at usb?
diff -r 99e6f0ff060c -r 94a52a11cfb4 sys/arch/mips/conf/files.ralink
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/mips/conf/files.ralink Thu Jul 28 15:38:48 2011 +0000
@@ -0,0 +1,39 @@
+# $NetBSD: files.ralink,v 1.2 2011/07/28 15:38:48 matt Exp $
+
+file arch/mips/ralink/ralink_intr.c
+file arch/mips/ralink/ralink_bus.c
+
+# Ralink Watchdog Driver
+defparam rwdog.h RA_WDOG_DEFAULT_PERIOD
+defparam rwdog.h RA_WDOG_DEFAULT_MODE
+device rwdog: sysmon_wdog
+attach rwdog at mainbus
+file arch/mips/ralink/ralink_wdog.c rwdog
+
+# On-chip UART device as generic com
+attach com at mainbus with ralink_com
+file arch/mips/ralink/ralink_com.c ralink_com
+options COM_REGMAP
+
+# Ralink GPIO Controller
+device rgpio: gpiobus
+attach rgpio at mainbus
+file arch/mips/ralink/ralink_gpio.c rgpio
+
+# Ralink I2C Controller
+device ri2c: i2cbus
+attach ri2c at mainbus
+file arch/mips/ralink/ralink_i2c.c ri2c
+
+# USB OHCI Host Controller
+attach ohci at mainbus with ralink_ohci
+file arch/mips/ralink/ralink_ohci.c ralink_ohci
+
+# USB EHCI Host Controller
+attach ehci at mainbus with ralink_ehci
+file arch/mips/ralink/ralink_ehci.c ralink_ehci
+
+# Ralink Ethernet Controller
+device reth: ether, ifnet, arp, mii
+attach reth at mainbus
+file arch/mips/ralink/ralink_eth.c reth
diff -r 99e6f0ff060c -r 94a52a11cfb4 sys/arch/mips/ralink/ralink_bus.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/mips/ralink/ralink_bus.c Thu Jul 28 15:38:48 2011 +0000
@@ -0,0 +1,112 @@
+/* $NetBSD: ralink_bus.c,v 1.2 2011/07/28 15:38:49 matt Exp $ */
+/*-
+ * Copyright (c) 2011 CradlePoint Technology, Inc.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CRADLEPOINT TECHNOLOGY, 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 AUTHOR 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.
+ */
+/*
+ * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
+ * Copyright (c) 2006 Garrett D'Amore.
+ * All rights reserved.
+ *
+ * This code was written by Garrett D'Amore for the Champaign-Urbana
+ * Community Wireless Network Project.
+ *
+ * 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 acknowledgements:
+ * This product includes software developed by the Urbana-Champaign
+ * Independent Media Center.
+ * This product includes software developed by Garrett D'Amore.
+ * 4. Urbana-Champaign Independent Media Center's name and Garrett
+ * D'Amore's name may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE URBANA-CHAMPAIGN INDEPENDENT
+ * MEDIA CENTER AND GARRETT D'AMORE ``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 URBANA-CHAMPAIGN INDEPENDENT
+ * MEDIA CENTER OR GARRETT D'AMORE 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.
+ */
+
+#include "locators.h"
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: ralink_bus.c,v 1.2 2011/07/28 15:38:49 matt Exp $");
+#define _MIPS_BUS_DMA_PRIVATE
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/device.h>
+#include <sys/extent.h>
+#include <sys/malloc.h>
+#include <sys/systm.h>
+
+#include <mips/ralink/ralink_reg.h>
+#include <mips/ralink/ralink_var.h>
+
+static void ra_bus_bus_mem_init(bus_space_tag_t, void *);
+
+struct mips_bus_space ra_bus_memt;
+struct mips_bus_dma_tag ra_bus_dmat = {
+ ._dmamap_ops = _BUS_DMAMAP_OPS_INITIALIZER,
+ ._dmamem_ops = _BUS_DMAMEM_OPS_INITIALIZER,
+ ._dmatag_ops = _BUS_DMATAG_OPS_INITIALIZER,
+};
+
+void
+ra_bus_init(void)
+{
+ ra_bus_bus_mem_init(&ra_bus_memt, NULL);
+}
+
+/*
+ * CPU memory/register stuff
+ * defines ra_bus_bus_mem_init, which encompasses all of memory
+ */
+
+#define CHIP ra_bus
+#define CHIP_MEM /* defined */
+#define CHIP_W1_BUS_START(v) 0x00000000UL
+#define CHIP_W1_BUS_END(v) 0x1fffffffUL
+#define CHIP_W1_SYS_START(v) CHIP_W1_BUS_START(v)
+#define CHIP_W1_SYS_END(v) CHIP_W1_BUS_END(v)
+
+#include <mips/mips/bus_space_alignstride_chipdep.c>
diff -r 99e6f0ff060c -r 94a52a11cfb4 sys/arch/mips/ralink/ralink_com.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/mips/ralink/ralink_com.c Thu Jul 28 15:38:48 2011 +0000
@@ -0,0 +1,315 @@
+/* $NetBSD: ralink_com.c,v 1.2 2011/07/28 15:38:49 matt Exp $ */
+/*-
+ * Copyright (c) 2011 CradlePoint Technology, Inc.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CRADLEPOINT TECHNOLOGY, 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 AUTHOR 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.
+ */
+
+/*-
+ * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
+ * Copyright (c) 2006 Garrett D'Amore.
+ * All rights reserved.
+ *
+ * Portions of this code were written by Garrett D'Amore for the
+ * Champaign-Urbana Community Wireless Network Project.
+ *
+ * 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 acknowledgements:
+ * This product includes software developed by the Urbana-Champaign
+ * Independent Media Center.
+ * This product includes software developed by Garrett D'Amore.
+ * 4. Urbana-Champaign Independent Media Center's name and Garrett
+ * D'Amore's name may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE URBANA-CHAMPAIGN INDEPENDENT
+ * MEDIA CENTER AND GARRETT D'AMORE ``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 URBANA-CHAMPAIGN INDEPENDENT
+ * MEDIA CENTER OR GARRETT D'AMORE 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.
+ */
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles M. Hannum.
+ *
+ * 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
Home |
Main Index |
Thread Index |
Old Index