Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Revamp / rework the Atheros MIPS SoC support. Add ...



details:   https://anonhg.NetBSD.org/src/rev/6605cd273159
branches:  trunk
changeset: 767014:6605cd273159
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jul 07 05:06:44 2011 +0000

description:
Revamp / rework the Atheros MIPS SoC support.  Add initial support for the
AR71xx (MIPS 24K core) SoC and the AR9344 (MIPS 74K core) SoC.  Force use
of -mips32 for all Atheros kernels.  Make code much more common.

diffstat:

 sys/arch/evbmips/atheros/autoconf.c       |   14 +-
 sys/arch/evbmips/atheros/mach_intr.c      |   10 +-
 sys/arch/evbmips/atheros/machdep.c        |   21 +-
 sys/arch/evbmips/atheros/wdog.c           |   16 +-
 sys/arch/evbmips/conf/DB120               |  215 +++++++++++++
 sys/arch/evbmips/conf/RB433UAH            |  212 +++++++++++++
 sys/arch/evbmips/conf/std.atheros         |    9 +-
 sys/arch/evbmips/conf/std.meraki          |    3 +-
 sys/arch/evbmips/evbmips/interrupt.c      |    8 +-
 sys/arch/mips/atheros/ar5312.c            |  364 ++++++++++++----------
 sys/arch/mips/atheros/ar5312_board.c      |   47 +-
 sys/arch/mips/atheros/ar5312_console.c    |  167 ----------
 sys/arch/mips/atheros/ar5312_intr.c       |  299 -------------------
 sys/arch/mips/atheros/ar5315.c            |  303 ++++++++++--------
 sys/arch/mips/atheros/ar5315_board.c      |   37 +-
 sys/arch/mips/atheros/ar5315_console.c    |  168 ----------
 sys/arch/mips/atheros/ar5315_intr.c       |  296 -------------------
 sys/arch/mips/atheros/ar7100.c            |  281 ++++++++++++++++++
 sys/arch/mips/atheros/ar9344.c            |  465 ++++++++++++++++++++++++++++++
 sys/arch/mips/atheros/ar_conf.c           |  214 +++++++++++++
 sys/arch/mips/atheros/ar_console.c        |  131 ++++++++
 sys/arch/mips/atheros/ar_intr.c           |  305 +++++++++++++++++++
 sys/arch/mips/atheros/arbus.c             |   64 ++--
 sys/arch/mips/atheros/dev/arpci.c         |  329 +++++++++++++++++++++
 sys/arch/mips/atheros/dev/arspi.c         |    5 +-
 sys/arch/mips/atheros/dev/com_arbus.c     |   15 +-
 sys/arch/mips/atheros/dev/if_ath_arbus.c  |    8 +-
 sys/arch/mips/atheros/dev/ohci_arbus.c    |  133 ++++++++
 sys/arch/mips/atheros/include/ar5312reg.h |  136 ++++----
 sys/arch/mips/atheros/include/ar5315reg.h |   23 +-
 sys/arch/mips/atheros/include/ar531xvar.h |   96 ------
 sys/arch/mips/atheros/include/ar9344reg.h |  407 ++++++++++++++++++++++++++
 sys/arch/mips/atheros/include/platform.h  |  218 ++++++++++++++
 sys/arch/mips/conf/files.atheros          |   46 ++-
 34 files changed, 3498 insertions(+), 1567 deletions(-)

diffs (truncated from 5954 to 300 lines):

diff -r c16baecbd653 -r 6605cd273159 sys/arch/evbmips/atheros/autoconf.c
--- a/sys/arch/evbmips/atheros/autoconf.c       Thu Jul 07 02:07:31 2011 +0000
+++ b/sys/arch/evbmips/atheros/autoconf.c       Thu Jul 07 05:06:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.9 2008/04/28 20:23:17 martin Exp $ */
+/* $NetBSD: autoconf.c,v 1.10 2011/07/07 05:06:44 matt Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,15 +30,15 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.9 2008/04/28 20:23:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.10 2011/07/07 05:06:44 matt Exp $");
 
 #include <sys/param.h>
-#include <sys/systm.h>
+#include <sys/bus.h>
 #include <sys/conf.h>
 #include <sys/device.h>
-#include <sys/bus.h>
+#include <sys/systm.h>
 
-#include <mips/atheros/include/ar531xvar.h>
+#include <mips/atheros/include/platform.h>
 #include <mips/atheros/include/arbusvar.h>
 
 /*
@@ -71,7 +71,7 @@
 }
 
 void
-device_register(struct device *dev, void *aux)
+device_register(device_t dev, void *aux)
 {
-       ar531x_device_register(dev, aux);
+       (*platformsw->apsw_device_register)(dev, aux);
 }
diff -r c16baecbd653 -r 6605cd273159 sys/arch/evbmips/atheros/mach_intr.c
--- a/sys/arch/evbmips/atheros/mach_intr.c      Thu Jul 07 02:07:31 2011 +0000
+++ b/sys/arch/evbmips/atheros/mach_intr.c      Thu Jul 07 05:06:44 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_intr.c,v 1.4 2011/07/01 18:45:36 dyoung Exp $     */
+/*     $NetBSD: mach_intr.c,v 1.5 2011/07/07 05:06:44 matt Exp $       */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_intr.c,v 1.4 2011/07/01 18:45:36 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_intr.c,v 1.5 2011/07/07 05:06:44 matt Exp $");
 
 #include "opt_ddb.h"
 
@@ -48,17 +48,17 @@
 #include <machine/intr.h>
 
 #include <mips/locore.h>
-#include <mips/atheros/include/ar531xvar.h>
+#include <mips/atheros/include/platform.h>
 
 void
 evbmips_intr_init(void)
 {
-       ar531x_intr_init();
+       (*platformsw->apsw_intr_init)();
 }
 
 void
 evbmips_iointr(int ipl, vaddr_t pc, uint32_t ipending)
 {
 
-       ar531x_cpuintr(ipl, pc, ipending);
+       (*platformsw->apsw_intrsw->aisw_iointr)(ipl, pc, ipending);
 }
diff -r c16baecbd653 -r 6605cd273159 sys/arch/evbmips/atheros/machdep.c
--- a/sys/arch/evbmips/atheros/machdep.c        Thu Jul 07 02:07:31 2011 +0000
+++ b/sys/arch/evbmips/atheros/machdep.c        Thu Jul 07 05:06:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.25 2011/02/20 07:48:33 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.26 2011/07/07 05:06:44 matt Exp $ */
 
 /*
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -110,7 +110,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.25 2011/02/20 07:48:33 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.26 2011/07/07 05:06:44 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -143,7 +143,7 @@
 #include <mips/locore.h>
 #include <mips/cpuregs.h>
 
-#include <mips/atheros/include/ar531xvar.h>
+#include <mips/atheros/include/platform.h>
 #include <mips/atheros/include/arbusvar.h>
 
 /* Maps for VM objects. */
@@ -162,7 +162,7 @@
 {
        uint32_t        cntfreq;
 
-       cntfreq = curcpu()->ci_cpu_freq = ar531x_cpu_freq();
+       cntfreq = curcpu()->ci_cpu_freq = atheros_get_cpu_freq();
        
        /* MIPS 4Kc CP0 counts every other clock */
        if (mips_options.mips_cpu_flags & CPU_MIPS_DOUBLE_COUNT)
@@ -189,10 +189,10 @@
        memset(edata, 0, (char *)kernend - edata);
 
        /* setup early console */
-       ar531x_early_console();
+       atheros_set_platformsw();
 
        /* set CPU model info for sysctl_hw */
-       snprintf(cpu_model, 64, "%s", ar531x_cpuname());
+       snprintf(cpu_model, 64, "Atheros %s", atheros_get_cpuname());
 
        /*
         * Set up the exception vectors and CPU-specific function
@@ -235,7 +235,7 @@
         * Note: Reserve the first page!  That's where the trap
         * vectors are located.
         */
-       memsize = ar531x_memsize();
+       memsize = atheros_get_memsize();
 
        printf("Memory size: 0x%08x\n", memsize);
        physmem = btoc(memsize);
@@ -269,13 +269,13 @@
        /*
         * Initialize busses.
         */
-       ar531x_businit();
+       atheros_bus_init();
 
        /*
         * Turn off (ignore) the hardware watchdog.  If we got this
         * far, then we shouldn't need it anymore.
         */
-       ar531x_wdog(0);
+       atheros_wdog_reload(0);
 
        /*
         * Turn off watchpoint that may have been enabled by the
@@ -303,7 +303,7 @@
         * Everything related to console initialization is done
         * in mach_init().
         */
-       ar531x_consinit();
+       atheros_consinit();
 }
 
 void
@@ -416,6 +416,7 @@
        printf("reseting board...\n\n");
        mips_icache_sync_all();
        mips_dcache_wbinv_all();
+       atheros_reset();
        __asm volatile("jr      %0" :: "r"(MIPS_RESET_EXC_VEC));
        printf("Oops, back from reset\n\nSpinning...");
        for (;;)
diff -r c16baecbd653 -r 6605cd273159 sys/arch/evbmips/atheros/wdog.c
--- a/sys/arch/evbmips/atheros/wdog.c   Thu Jul 07 02:07:31 2011 +0000
+++ b/sys/arch/evbmips/atheros/wdog.c   Thu Jul 07 05:06:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdog.c,v 1.5 2008/02/11 20:27:01 dyoung Exp $ */
+/* $NetBSD: wdog.c,v 1.6 2011/07/07 05:06:44 matt Exp $ */
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdog.c,v 1.5 2008/02/11 20:27:01 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdog.c,v 1.6 2011/07/07 05:06:44 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -88,7 +88,7 @@
 
 #include <machine/cpu.h>
 
-#include <mips/atheros/include/ar531xvar.h>
+#include <mips/atheros/include/platform.h>
 
 #include <dev/sysmon/sysmonvar.h>
 
@@ -96,7 +96,7 @@
 #define        WDOG_DEFAULT_PERIOD     5
 #endif
 
-static int wdog_match(device_t, struct cfdata *, void *);
+static int wdog_match(device_t, cfdata_t, void *);
 static void wdog_attach(device_t, device_t, void *);
 static int wdog_tickle(struct sysmon_wdog *);
 static int wdog_setmode(struct sysmon_wdog *);
@@ -124,7 +124,7 @@
 {
        struct wdog_softc *sc = device_private(self);
 
-       sc->sc_mult = ar531x_bus_freq();
+       sc->sc_mult = atheros_get_bus_freq();
        sc->sc_wdog_period = WDOG_DEFAULT_PERIOD;
        sc->sc_wdog_max = 0xffffffffU / sc->sc_mult;
        sc->sc_wdog_reload = sc->sc_wdog_period * sc->sc_mult;
@@ -147,7 +147,7 @@
 {
        struct wdog_softc *sc = smw->smw_cookie;
 
-       ar531x_wdog(sc->sc_wdog_reload);
+       atheros_wdog_reload(sc->sc_wdog_reload);
        return (0);
 }
 
@@ -157,7 +157,7 @@
        struct wdog_softc *sc = smw->smw_cookie;
 
        if ((smw->smw_mode & WDOG_MODE_MASK) == WDOG_MODE_DISARMED) {
-               ar531x_wdog(0);
+               atheros_wdog_reload(0);
        } else {
 
                if (smw->smw_period == WDOG_PERIOD_DEFAULT)
@@ -174,7 +174,7 @@
                        sc->sc_wdog_reload = sc->sc_wdog_period * sc->sc_mult;
                }
 
-               ar531x_wdog(sc->sc_wdog_reload);
+               atheros_wdog_reload(sc->sc_wdog_reload);
        }
 
        return (0);
diff -r c16baecbd653 -r 6605cd273159 sys/arch/evbmips/conf/DB120
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/conf/DB120       Thu Jul 07 05:06:44 2011 +0000
@@ -0,0 +1,215 @@
+#      $NetBSD: DB120,v 1.1 2011/07/07 05:06:44 matt Exp $
+#
+# Qualcomm Atheros AR9344 DB120 evaluation board.
+#
+
+include        "arch/evbmips/conf/std.atheros"
+
+#options       INCLUDE_CONFIG_FILE     # embed config file in kernel binary
+
+#ident                 "DB120-$Revision: 1.1 $"
+
+maxusers       32
+
+#makeoptions   COPTS="-Os"             # Optimise for space. Implies -O2
+
+options        MIPS32R2
+makeoptions    CPUFLAGS+="-mips32r2"
+options        NOFPU           # No FPU
+options        FPEMUL          # emulate FPU insn
+options                WISOC_AR9344    # WiSoC select
+
+# Options for necessary to use MD
+#options       MEMORY_DISK_HOOKS
+#options       MEMORY_DISK_IS_ROOT     # force root on memory disk
+#options       MEMORY_DISK_SERVER=0    # no userspace memory disk support
+#options       MEMORY_DISK_ROOT_SIZE=6144      # size of memory disk, in blocks
+#options       MEMORY_DISK_ROOT_SIZE=16384     # size of memory disk, in blocks
+#options       MEMORY_DISK_ROOT_SIZE=7300
+
+# Size reduction options
+#options       VNODE_OP_NOINLINE
+#options       PIPE_SOCKETPAIR
+options                SOSEND_NO_LOAN
+
+# Standard system options
+options        KTRACE          # system call tracing support
+#options       SYSVMSG         # System V message queues
+#options       SYSVSEM         # System V semaphores
+#options       SYSVSHM         # System V shared memory
+options        NTP             # network time protocol
+
+# Debugging options
+options        DIAGNOSTIC      # extra kernel sanity checking
+options        DEBUG           # extra kernel debugging support
+#options       KMEMSTATS       # kernel memory statistics (vmstat -m)
+#options       USERCONF        # userconf(4) support
+#options       SYSCTL_INCLUDE_DESCR    # Include sysctl descriptions in kernel
+options        DDB             # kernel dynamic debugger
+options        DDB_HISTORY_SIZE=100 # enable history editing in DDB
+makeoptions    DEBUG="-g"      # compile full symbol table
+options        SYMTAB_SPACE=350000     # size for embedded symbol table
+
+# Compatibility options
+#options       COMPAT_43       # compatibility with 4.3BSD binaries
+#options       COMPAT_09       # NetBSD 0.9 binary compatibility



Home | Main Index | Thread Index | Old Index