Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbmips/ingenic apbus attachment goop, move interru...



details:   https://anonhg.NetBSD.org/src/rev/103ee1d6aed0
branches:  trunk
changeset: 804918:103ee1d6aed0
user:      macallan <macallan%NetBSD.org@localhost>
date:      Sat Dec 06 14:30:11 2014 +0000

description:
apbus attachment goop, move interrupt stuff to intr.c

diffstat:

 sys/arch/evbmips/ingenic/machdep.c |  29 ++++++++---------------------
 sys/arch/evbmips/ingenic/mainbus.c |  16 ++++++++++++++--
 2 files changed, 22 insertions(+), 23 deletions(-)

diffs (131 lines):

diff -r da15d82776ff -r 103ee1d6aed0 sys/arch/evbmips/ingenic/machdep.c
--- a/sys/arch/evbmips/ingenic/machdep.c        Sat Dec 06 14:26:40 2014 +0000
+++ b/sys/arch/evbmips/ingenic/machdep.c        Sat Dec 06 14:30:11 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.1 2014/11/22 15:17:02 macallan Exp $ */
+/*     $NetBSD: machdep.c,v 1.2 2014/12/06 14:30:11 macallan Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.1 2014/11/22 15:17:02 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.2 2014/12/06 14:30:11 macallan Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -42,13 +42,12 @@
 #include <sys/mount.h>
 #include <sys/reboot.h>
 #include <sys/cpu.h>
+#include <sys/bus.h>
 
 #include <uvm/uvm_extern.h>
 
 #include <dev/cons.h>
 
-#include <mips/ingenic/ingenic_regs.h>
-
 #include "ksyms.h"
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
@@ -60,6 +59,9 @@
 #include <mips/locore.h>
 #include <mips/cpuregs.h>
 
+#include <mips/ingenic/ingenic_regs.h>
+#include <mips/ingenic/ingenic_var.h>
+
 /* Maps for VM objects. */
 struct vm_map *phys_map = NULL;
 
@@ -178,6 +180,7 @@
         */
        mips_init_lwp0_uarea();
 
+       apbus_init();
        /*
         * Initialize debuggers, and break into them, if appropriate.
         */
@@ -278,7 +281,7 @@
        if (boothowto & RB_DUMP)
                dumpsys();
 
- haltsys:
+haltsys:
        /* Run any shutdown hooks. */
        doshutdownhooks();
 
@@ -328,19 +331,3 @@
        writereg(JZ_WDOG_TCSR, TCSR_RTC_EN | TCSR_DIV_256);
        writereg(JZ_WDOG_TCER, TCER_ENABLE);    /* fire! */     
 }
-
-void
-evbmips_intr_init(void)
-{
-#if notyet
-       (*platformsw->apsw_intr_init)();
-#endif
-}
-
-void
-evbmips_iointr(int ipl, vaddr_t pc, uint32_t ipending)
-{
-#if notyet
-       (*platformsw->apsw_intrsw->aisw_iointr)(ipl, pc, ipending);
-#endif
-}
diff -r da15d82776ff -r 103ee1d6aed0 sys/arch/evbmips/ingenic/mainbus.c
--- a/sys/arch/evbmips/ingenic/mainbus.c        Sat Dec 06 14:26:40 2014 +0000
+++ b/sys/arch/evbmips/ingenic/mainbus.c        Sat Dec 06 14:30:11 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.1 2014/11/22 15:17:02 macallan Exp $ */
+/*     $NetBSD: mainbus.c,v 1.2 2014/12/06 14:30:11 macallan Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -27,7 +27,7 @@
  */
  
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.1 2014/11/22 15:17:02 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.2 2014/12/06 14:30:11 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -36,6 +36,8 @@
 #include <mips/cache.h>
 #include <mips/cpuregs.h>
 
+#include <mips/ingenic/ingenic_regs.h>
+
 #include "locators.h"
 
 static int     mainbus_match(device_t, cfdata_t, void *);
@@ -55,6 +57,7 @@
 struct mainbusdev mainbusdevs[] = {
        { "cpu",        },
        { "com",        },
+       { "apbus",      },
        { NULL,         }
 };
 
@@ -80,6 +83,15 @@
                struct mainbusdev ma = *md;
                config_found_ia(self, "mainbus", &ma, mainbus_print);
        }
+
+#ifdef INGENIC_DEBUG
+       printf("TFR: %08x\n", readreg(JZ_TC_TFR));
+       printf("TMR: %08x\n", readreg(JZ_TC_TMR));
+
+       /* send ourselves an IPI */
+       MTC0(0x12345678, CP0_CORE_MBOX, 0);
+       delay(1000);
+#endif
 }
 
 static int



Home | Main Index | Thread Index | Old Index