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 clockport(4) layer, which provides suppor...
details: https://anonhg.NetBSD.org/src/rev/df9daad136b8
branches: trunk
changeset: 778854:df9daad136b8
user: rkujawa <rkujawa%NetBSD.org@localhost>
date: Tue Apr 17 09:59:03 2012 +0000
description:
Add clockport(4) layer, which provides support for expansion bus present on
Amiga-style clockports. Also add a1k2cp(4) backend driver and the first
clockport device driver com_ss, that supports com(4) on clockport(4)
(particurarly Individual Computers SilverSurfer). Disabled by default,
since probe procedure is not written yet.
diffstat:
sys/arch/amiga/amiga/autoconf.c | 6 +-
sys/arch/amiga/clockport/a1k2cp.c | 109 ++++++++++++++++++++++++++++
sys/arch/amiga/clockport/clockport.c | 100 +++++++++++++++++++++++++
sys/arch/amiga/clockport/clockport_common.c | 65 ++++++++++++++++
sys/arch/amiga/clockport/clockportvar.h | 53 +++++++++++++
sys/arch/amiga/clockport/com_ss.c | 81 ++++++++++++++++++++
sys/arch/amiga/clockport/files.clockport | 26 ++++++
sys/arch/amiga/conf/GENERIC.in | 9 +-
sys/arch/amiga/conf/files.amiga | 4 +-
9 files changed, 448 insertions(+), 5 deletions(-)
diffs (truncated from 532 to 300 lines):
diff -r 58d4a554d9e6 -r df9daad136b8 sys/arch/amiga/amiga/autoconf.c
--- a/sys/arch/amiga/amiga/autoconf.c Tue Apr 17 09:33:31 2012 +0000
+++ b/sys/arch/amiga/amiga/autoconf.c Tue Apr 17 09:59:03 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.110 2012/02/12 16:34:06 matt Exp $ */
+/* $NetBSD: autoconf.c,v 1.111 2012/04/17 09:59:03 rkujawa Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.110 2012/02/12 16:34:06 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.111 2012/04/17 09:59:03 rkujawa Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -295,6 +295,8 @@
config_found(dp, __UNCONST("ahsc"), simple_devprint);
if (is_a600() || is_a1200())
config_found(dp, __UNCONST("pccard"), simple_devprint);
+ if (is_a1200())
+ config_found(dp, __UNCONST("a1k2cp"), simple_devprint);
#ifdef DRACO
if (!is_draco())
#endif
diff -r 58d4a554d9e6 -r df9daad136b8 sys/arch/amiga/clockport/a1k2cp.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amiga/clockport/a1k2cp.c Tue Apr 17 09:59:03 2012 +0000
@@ -0,0 +1,109 @@
+/* $NetBSD: a1k2cp.c,v 1.1 2012/04/17 09:59:03 rkujawa Exp $ */
+
+/*-
+ * Copyright (c) 2012 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.
+ */
+
+/* Driver for A1200 on-board clockport. */
+
+#include <sys/cdefs.h>
+
+#include <sys/systm.h>
+#include <sys/types.h>
+#include <sys/device.h>
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/kmem.h>
+
+#include <machine/cpu.h>
+
+#include <amiga/amiga/device.h>
+
+#include <amiga/dev/zbusvar.h>
+
+#include <amiga/clockport/clockportvar.h>
+
+/* #define A1K2CP_DEBUG 1 */
+
+#define A1K2CP_BASE 0xD80001
+
+static int a1k2cp_match(struct device *pdp, struct cfdata *cfp, void *aux);
+static void a1k2cp_attach(device_t parent, device_t self, void *aux);
+
+struct a1k2cp_softc {
+ device_t sc_dev;
+};
+
+CFATTACH_DECL_NEW(a1k2cp, sizeof(struct a1k2cp_softc),
+ a1k2cp_match, a1k2cp_attach, NULL, NULL);
+
+static int
+a1k2cp_match(struct device *pdp, struct cfdata *cfp, void *aux)
+{
+
+ static int a1k2cp_matched = 0;
+
+ if (!matchname("a1k2cp", aux))
+ return 0;
+
+ if (a1k2cp_matched)
+ return 0;
+
+ if (!is_a1200())
+ return 0;
+
+ a1k2cp_matched = 1;
+ return 1;
+}
+
+static void
+a1k2cp_attach(device_t parent, device_t self, void *aux)
+{
+ struct a1k2cp_softc *sc;
+ struct clockportbus_attach_args a1k2cp_aa;
+ struct bus_space_tag a1k2cp_bst;
+
+ sc = device_private(self);
+ sc->sc_dev = self;
+
+ aprint_normal(": A1200 on-board clockport\n");
+
+ a1k2cp_bst.base = (bus_addr_t) __UNVOLATILE(ztwomap(A1K2CP_BASE));
+ a1k2cp_bst.absm = &amiga_bus_stride_4;
+
+ a1k2cp_aa.cp_iot = &a1k2cp_bst;
+ a1k2cp_aa.cp_intr_establish = clockport_generic_intr_establish;
+
+#ifdef A1K2CP_DEBUG
+ aprint_normal_dev(sc->sc_dev, "pa %d va %p",
+ A1K2CP_BASE, (void*) a1k2cp_bst.base);
+#endif /* A1K2CP_DEBUG */
+
+ config_found(sc->sc_dev, &a1k2cp_aa, 0);
+}
+
diff -r 58d4a554d9e6 -r df9daad136b8 sys/arch/amiga/clockport/clockport.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amiga/clockport/clockport.c Tue Apr 17 09:59:03 2012 +0000
@@ -0,0 +1,100 @@
+/* $NetBSD: clockport.c,v 1.1 2012/04/17 09:59:03 rkujawa Exp $ */
+
+/*-
+ * Copyright (c) 2012 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.
+ */
+
+#include <sys/cdefs.h>
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <sys/termios.h>
+
+#include <sys/bus.h>
+#include <sys/intr.h>
+
+#include <amiga/clockport/clockportvar.h>
+
+static int clockport_match(device_t, cfdata_t , void *);
+static void clockport_attach(device_t, device_t, void *);
+static int clockport_print(struct clockport_attach_args *a,
+ const char *str);
+static int clockport_submatch(device_t cpbus, cfdata_t dev,
+ const int *ldesc, void *aux);
+
+CFATTACH_DECL_NEW(clockport, sizeof(struct clockportbus_softc),
+ clockport_match, clockport_attach, NULL, NULL);
+
+static int
+clockport_match(device_t parent, cfdata_t cf, void *aux)
+{
+ return 1;
+}
+
+static void
+clockport_attach(device_t parent, device_t self, void *aux)
+{
+ struct clockportbus_softc *sc;
+
+ sc = (struct clockportbus_softc *) self;
+ sc->cpb_aa = (struct clockportbus_attach_args *) aux;
+
+ config_search_ia(clockport_submatch, self, "clockport", 0);
+}
+
+static int
+clockport_submatch(device_t cpbus, cfdata_t dev, const int *ldesc, void *aux)
+{
+ struct clockportbus_softc *sc;
+ struct clockport_attach_args a;
+
+ sc = device_private(cpbus);
+
+ /* XXX: copy bus_space_tag and intr routine for now... */
+ a.cp_iot = sc->cpb_aa->cp_iot;
+ a.cp_intr_establish = sc->cpb_aa->cp_intr_establish;
+
+ if(config_match(cpbus, dev, &a)) {
+ config_attach(cpbus, dev, &a, (cfprint_t) clockport_print);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+clockport_print(struct clockport_attach_args *a, const char *str)
+{
+ if (str == NULL)
+ return 0;
+
+ printf("%s ", str);
+
+ return 0;
+}
+
diff -r 58d4a554d9e6 -r df9daad136b8 sys/arch/amiga/clockport/clockport_common.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amiga/clockport/clockport_common.c Tue Apr 17 09:59:03 2012 +0000
@@ -0,0 +1,65 @@
+/* $NetBSD: clockport_common.c,v 1.1 2012/04/17 09:59:03 rkujawa Exp $ */
+
+/*-
+ * Copyright (c) 2012 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.
+ */
+
+/*
+ * Routines for generic clockports, shared among all backend drivers.
+ * TODO: implement clockport_intr_disestablish.
+ */
+
+#include <sys/cdefs.h>
+
+#include <sys/systm.h>
+#include <sys/types.h>
+#include <sys/bus.h>
+#include <sys/kmem.h>
+
+#include <machine/cpu.h>
+
+#include <amiga/clockport/clockportvar.h>
+
+#define CLOCKPORT_GENERIC_IPL 6
+
+void *
+clockport_generic_intr_establish(int (*isr)(void *), void *arg)
+{
Home |
Main Index |
Thread Index |
Old Index