apbus attachment goop, move interrupt stuff to intr.c

This commit is contained in:
macallan 2014-12-06 14:30:11 +00:00
parent 3dce8f5ad4
commit 46e2b0ded8
2 changed files with 22 additions and 23 deletions

View File

@ -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 1.1 2014/11/22 15:17:02 macallan Exp $")
#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 1.1 2014/11/22 15:17:02 macallan Exp $")
#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
}

View File

@ -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 1.1 2014/11/22 15:17:02 macallan Exp $")
#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 self, void *aux)
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