Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/evbarm Rework and fleshing out of Intel IQ80310 XSc...
details: https://anonhg.NetBSD.org/src/rev/80f99474d61a
branches: trunk
changeset: 517098:80f99474d61a
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Nov 07 00:33:22 2001 +0000
description:
Rework and fleshing out of Intel IQ80310 XScale eval board support.
More work to do -- this is a snapshot of work-in-progress.
diffstat:
sys/arch/evbarm/conf/IQ80310 | 56 +--
sys/arch/evbarm/conf/files.iq80310 | 20 +-
sys/arch/evbarm/conf/std.iq80310 | 6 +-
sys/arch/evbarm/include/autoconf.h | 34 +-
sys/arch/evbarm/iq80310/com_obio.c | 55 +-
sys/arch/evbarm/iq80310/iq80310_7seg.c | 192 ++++++++++
sys/arch/evbarm/iq80310/iq80310_intr.c | 264 ++++++++++++++
sys/arch/evbarm/iq80310/iq80310_irq.S | 490 ++++++++++++++++++++++++++
sys/arch/evbarm/iq80310/iq80310_machdep.c | 557 +++++++++++------------------
sys/arch/evbarm/iq80310/iq80310_timer.c | 341 ++++++++++++++++++
sys/arch/evbarm/iq80310/iq80310map.h | 38 --
sys/arch/evbarm/iq80310/iq80310reg.h | 157 ++++++++
sys/arch/evbarm/iq80310/iq80310var.h | 54 ++
sys/arch/evbarm/iq80310/obio.c | 157 ++++++++
sys/arch/evbarm/iq80310/obio_space.c | 194 ++++++++++
sys/arch/evbarm/iq80310/obio_space_asm.S | 108 +++++
sys/arch/evbarm/iq80310/obiovar.h | 50 ++
17 files changed, 2277 insertions(+), 496 deletions(-)
diffs (truncated from 3179 to 300 lines):
diff -r 63c10d434a42 -r 80f99474d61a sys/arch/evbarm/conf/IQ80310
--- a/sys/arch/evbarm/conf/IQ80310 Wed Nov 07 00:19:13 2001 +0000
+++ b/sys/arch/evbarm/conf/IQ80310 Wed Nov 07 00:33:22 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: IQ80310,v 1.1 2001/09/05 04:53:39 matt Exp $
+# $NetBSD: IQ80310,v 1.2 2001/11/07 00:33:22 thorpej Exp $
#
# IQ80310 -- Intel IQ80310 Evaluation Board Kernel
#
@@ -131,57 +131,9 @@
# The boot cpu
cpu0 at mainbus?
-iopxs0 at mainbus? # The 80312 itself
-obio0 at iopxs0 bank 0 # On-Board I/O devices
-
-# time-of-day device via iopxs (is there even a TOD clock? :)
-#todclock0 at obio0
-
-# PCI bus via verdi
-#pci0 at iopxs? bus 0 # primary PCI bus
-pci1 at iopxs? bus 1 # secondary PCI bus
-
-# PCI bus(es) via PPBs
-ppb* at pci? dev ? function ?
-pci* at ppb?
-
-# ISA bus support
-#pcib* at pci? dev ? function ? # ISA bridge
-#isa* at pcib?
-
-
-# PCI IDE Controllers and Devices
-# PCI IDE controllers - see pciide(4) for supported hardware.
-# The 0x0001 flag force the driver to use DMA, even if the driver doesn't know
-# how to set up DMA modes for this chip. This may work, or may cause
-# a machine hang with some controllers.
-pciide* at pci? dev ? function ? flags 0x0000
-
-# IDE drives
-# Flags are used only with controllers that support DMA operations
-# and mode settings (e.g. some pciide controllers)
-# The lowest order four bits (rightmost digit) of the flags define the PIO
-# mode to use, the next set of four bits the DMA mode and the third set the
-# UltraDMA mode. For each set of four bits, the 3 lower bits define the mode
-# to use, and the last bit must be 1 for this setting to be used.
-# For DMA and UDMA, 0xf (1111) means 'disable'.
-# 0x0fac means 'use PIO mode 4, DMA mode 2, disable UltraDMA'.
-# (0xc=1100, 0xa=1010, 0xf=1111)
-# 0x0000 means "use whatever the drive claims to support".
-wd* at pciide? channel ? drive ? flags 0x0000 # the drives themselves
-
-# PCI network interfaces
-fxp* at pci? dev ? function ? # Intel PRO/100
-
-# MII/PHY support
-inphy* at mii? phy ? # ISC-890 PHYs
-ukphy* at mii? phy ? # generic unknown PHYs
-
-# OBIO Devices
-com0 at obio? instance 0 # primary com port
-com1 at obio? instance 1 # secondary com port
-clock0 at obio? instance 0 # 33.3MHz system clock via CPLD
-
+# On-board device support
+obio* at mainbus?
+com* at obio? addr ? # on-board XR 16550 UARTs
# Pseudo-Devices
diff -r 63c10d434a42 -r 80f99474d61a sys/arch/evbarm/conf/files.iq80310
--- a/sys/arch/evbarm/conf/files.iq80310 Wed Nov 07 00:19:13 2001 +0000
+++ b/sys/arch/evbarm/conf/files.iq80310 Wed Nov 07 00:33:22 2001 +0000
@@ -1,9 +1,27 @@
-# $NetBSD: files.iq80310,v 1.2 2001/11/04 03:01:19 thorpej Exp $
+# $NetBSD: files.iq80310,v 1.3 2001/11/07 00:33:22 thorpej Exp $
#
# Intel IQ80310 evaluation board configuration info
#
+# We use the Intel i80312 Companion I/O chip.
+include "arch/arm/xscale/files.i80312"
+
+file arch/evbarm/iq80310/iq80310_7seg.c
file arch/evbarm/iq80310/iq80310_machdep.c
+file arch/evbarm/iq80310/iq80310_intr.c
+file arch/evbarm/iq80310/iq80310_irq.S
+file arch/evbarm/iq80310/iq80310_timer.c
+
+# IQ80310 on-board devices (including CPLD)
+device obio {[addr = -1]}
+attach obio at mainbus
+file arch/evbarm/iq80310/obio.c obio
+file arch/evbarm/iq80310/obio_space.c obio
+file arch/evbarm/iq80310/obio_space_asm.S obio
+
+# on-board XR 16550 UARTs
+attach com at obio with com_obio
+file arch/evbarm/iq80310/com_obio.c com_obio
# IQ80310 PCI support
file arch/evbarm/iq80310/pci_machdep.c pci
diff -r 63c10d434a42 -r 80f99474d61a sys/arch/evbarm/conf/std.iq80310
--- a/sys/arch/evbarm/conf/std.iq80310 Wed Nov 07 00:19:13 2001 +0000
+++ b/sys/arch/evbarm/conf/std.iq80310 Wed Nov 07 00:33:22 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: std.iq80310,v 1.5 2001/11/04 03:01:19 thorpej Exp $
+# $NetBSD: std.iq80310,v 1.6 2001/11/07 00:33:22 thorpej Exp $
#
# standard NetBSD/evbarm for IQ80310 options
@@ -10,12 +10,10 @@
options EXEC_ELF32
options EXEC_AOUT
options EXEC_SCRIPT
-options NEWINTR
# To support easy transit to ../arch/arm/arm32
options PROG32
options ARM32
-makeoptions LOADADDRESS="0xA0200000"
-#makeoptions LINKENTRY="-e nwstart"
+makeoptions LOADADDRESS="0xa0200000"
makeoptions BOARDTYPE="iq80310"
diff -r 63c10d434a42 -r 80f99474d61a sys/arch/evbarm/include/autoconf.h
--- a/sys/arch/evbarm/include/autoconf.h Wed Nov 07 00:19:13 2001 +0000
+++ b/sys/arch/evbarm/include/autoconf.h Wed Nov 07 00:33:22 2001 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: autoconf.h,v 1.2 2001/11/07 00:33:23 thorpej Exp $ */
+
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -37,40 +39,8 @@
#ifndef _EVBARM_AUTOCONF_H_
#define _EVBARM_AUTOCONF_H_
-#include <machine/bus.h>
-
struct mainbus_attach_args {
const char *ma_name;
};
-
-/*
- * There's no DMA to/from OBIO space so there's dma tag
- */
-#define OBIO_MAXREGIONS 8
-
-struct obio_attach_args {
- const char *oa_name;
- int oa_instance;
-
- bus_space_tag_t oa_memt;
- int oa_nregions;
- bus_addr_t oa_addrs[OBIO_MAXREGIONS];
- bus_size_t oa_lens[OBIO_MAXREGIONS];
-
- int oa_irq;
- int oa_itype;
- struct intrsource *oa_isrc;
-};
-
-#ifdef _KERNEL
-
-#include "locators.h"
-#define obiocf_instance cf_loc[OBIOCF_INSTANCE]
-
-#define obio_intr_establish(oa, func, arg) \
- intr_establish((oa)->oa_isrc, (oa)->oa_irq, (oa)->oa_itype, func, arg)
-
-#endif /* _KERNEL */
-
#endif /* _EVBARM_AUTOCONF_H_ */
diff -r 63c10d434a42 -r 80f99474d61a sys/arch/evbarm/iq80310/com_obio.c
--- a/sys/arch/evbarm/iq80310/com_obio.c Wed Nov 07 00:19:13 2001 +0000
+++ b/sys/arch/evbarm/iq80310/com_obio.c Wed Nov 07 00:33:22 2001 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: com_obio.c,v 1.2 2001/11/07 00:33:23 thorpej Exp $ */
+
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -39,42 +41,50 @@
#include <sys/device.h>
#include <sys/termios.h>
-#include <machine/autoconf.h>
+#include <machine/bus.h>
+
+#include <evbarm/iq80310/iq80310var.h>
+#include <evbarm/iq80310/obiovar.h>
#include <dev/ic/comreg.h>
#include <dev/ic/comvar.h>
-static int com_obio_match (struct device *, struct cfdata *, void *);
-static void com_obio_attach (struct device *, struct device *, void *);
+struct com_obio_softc {
+ struct com_softc sc_com;
+
+ void *sc_ih;
+};
+
+int com_obio_match(struct device *, struct cfdata *, void *);
+void com_obio_attach(struct device *, struct device *, void *);
struct cfattach com_obio_ca = {
- sizeof(struct com_softc), com_obio_match, com_obio_attach
+ sizeof(struct com_obio_softc), com_obio_match, com_obio_attach
};
-extern struct cfdriver com_cd;
-
-static int
+int
com_obio_match(struct device *parent, struct cfdata *cf, void *aux)
{
- struct obio_attach_args *oa = aux;
- return strcmp(com_cd.cd_name, oa->oa_name) == 0 &&
- cf->obiocf_instance == oa->oa_instance;
+ struct obio_attach_args *oba = aux;
+
+ if (strcmp(cf->cf_driver->cd_name, oba->oba_name) == 0)
+ return (1);
+
+ return (0);
}
-static void
+void
com_obio_attach(struct device *parent, struct device *self, void *aux)
{
- struct obio_attach_args *oa = aux;
- struct com_softc *sc = (struct com_softc *) self;
+ struct obio_attach_args *oba = aux;
+ struct com_obio_softc *osc = (void *) self;
+ struct com_softc *sc = &osc->sc_com;
int error;
- KASSERT(oa->oa_nregions > 0);
-
- sc->sc_iot = oa->oa_memt;
- sc->sc_iobase = oa->oa_addrs[0];
+ sc->sc_iot = oba->oba_st;
+ sc->sc_iobase = oba->oba_addr;
sc->sc_frequency = COM_FREQ;
- error = bus_space_map(sc->sc_iot, oa->oa_addrs[0],
- oa->oa_lens[0], 0, &sc->sc_ioh);
+ error = bus_space_map(sc->sc_iot, oba->oba_addr, 8, 0, &sc->sc_ioh);
if (error) {
printf(": failed to map registers: %d\n", error);
@@ -82,5 +92,10 @@
}
com_attach_subr(sc);
- obio_intr_establish(oa, comintr, sc);
+
+ osc->sc_ih = iq80310_intr_establish(oba->oba_irq, IPL_SERIAL,
+ comintr, sc);
+ if (osc->sc_ih == NULL)
+ printf("%s: unable to establish interrupt at CPLD irq %d\n",
+ sc->sc_dev.dv_xname, oba->oba_irq);
}
diff -r 63c10d434a42 -r 80f99474d61a sys/arch/evbarm/iq80310/iq80310_7seg.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbarm/iq80310/iq80310_7seg.c Wed Nov 07 00:33:22 2001 +0000
@@ -0,0 +1,192 @@
+/* $NetBSD: iq80310_7seg.c,v 1.1 2001/11/07 00:33:23 thorpej Exp $ */
+
+/*
+ * Copyright (c) 2001 Wasabi Systems, Inc.
+ * All rights reserved.
+ *
+ * Written by Jason R. Thorpe for Wasabi Systems, Inc.
+ *
+ * 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 for the NetBSD Project by
+ * Wasabi Systems, Inc.
+ * 4. The name of Wasabi Systems, Inc. may not be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
Home |
Main Index |
Thread Index |
Old Index