Module Name:    src
Committed By:   macallan
Date:           Sat Dec  6 14:30:11 UTC 2014

Modified Files:
        src/sys/arch/evbmips/ingenic: machdep.c mainbus.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbmips/ingenic/machdep.c \
    src/sys/arch/evbmips/ingenic/mainbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbmips/ingenic/machdep.c
diff -u src/sys/arch/evbmips/ingenic/machdep.c:1.1 src/sys/arch/evbmips/ingenic/machdep.c:1.2
--- src/sys/arch/evbmips/ingenic/machdep.c:1.1	Sat Nov 22 15:17:02 2014
+++ src/sys/arch/evbmips/ingenic/machdep.c	Sat Dec  6 14:30:11 2014
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #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 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #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 @@ mach_init(void)
 	 */
 	mips_init_lwp0_uarea();
 
+	apbus_init();
 	/*
 	 * Initialize debuggers, and break into them, if appropriate.
 	 */
@@ -278,7 +281,7 @@ cpu_reboot(int howto, char *bootstr)
 	if (boothowto & RB_DUMP)
 		dumpsys();
 
- haltsys:
+haltsys:
 	/* Run any shutdown hooks. */
 	doshutdownhooks();
 
@@ -328,19 +331,3 @@ ingenic_reset(void)
 	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
-}
Index: src/sys/arch/evbmips/ingenic/mainbus.c
diff -u src/sys/arch/evbmips/ingenic/mainbus.c:1.1 src/sys/arch/evbmips/ingenic/mainbus.c:1.2
--- src/sys/arch/evbmips/ingenic/mainbus.c:1.1	Sat Nov 22 15:17:02 2014
+++ src/sys/arch/evbmips/ingenic/mainbus.c	Sat Dec  6 14:30:11 2014
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 
 #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 {
 struct mainbusdev mainbusdevs[] = {
 	{ "cpu",	},
 	{ "com",	},
+	{ "apbus",	},
 	{ NULL,		}
 };
 
@@ -80,6 +83,15 @@ mainbus_attach(device_t parent, device_t
 		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

Reply via email to