Allow algor kernels to be built under either algor/algor64 or

evbmips-el/evbmips64-el.  Note that MAXMAPARITITONS and majors numbers
differ between the two ports which is why two kernels are still needed.
This commit is contained in:
matt 2011-07-09 16:03:00 +00:00
parent 0343546951
commit f5439ed7d3
37 changed files with 323 additions and 577 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: interrupt.c,v 1.16 2011/02/20 07:51:21 matt Exp $ */
/* $NetBSD: algor_intr.c,v 1.1 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.16 2011/02/20 07:51:21 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: algor_intr.c,v 1.1 2011/07/09 16:03:00 matt Exp $");
#define __INTR_PRIVATE
#include "opt_algor_p4032.h"
@ -42,10 +42,8 @@ __KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.16 2011/02/20 07:51:21 matt Exp $");
#include <sys/intr.h>
#include <sys/cpu.h>
//#include <uvm/uvm_extern.h>
#include <machine/autoconf.h>
#include <machine/locore.h>
#include <algor/autoconf.h>
#include <mips/locore.h>
#include <mips/mips3_clock.h>
#ifdef ALGOR_P4032
@ -85,7 +83,11 @@ static const struct ipl_sr_map algor_ipl_sr_map = {
};
void
#ifdef evbmips
evbmips_intr_init(void)
#else
intr_init(void)
#endif
{
ipl_sr_map = algor_ipl_sr_map;
@ -98,6 +100,25 @@ intr_init(void)
#endif
}
#ifdef evbmips
void
evbmips_iointr(int ipl, vaddr_t pc, uint32_t pending)
{
(*algor_iointr)(ipl, pc, pending);
}
void *
evbmips_intr_establish(int irq, int (*func)(void *), void *arg)
{
return (*algor_intr_establish)(irq, func, arg);
}
void
evbmips_intr_disestablish(void *cookie)
{
(*algor_intr_disestablish)(cookie);
}
#else
void
cpu_intr(int ppl, vaddr_t pc, uint32_t status)
{
@ -125,3 +146,4 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t status)
(void)splhigh();
}
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: algor_p4032_bus_io.c,v 1.6 2011/07/08 18:48:55 matt Exp $ */
/* $NetBSD: algor_p4032_bus_io.c,v 1.7 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: algor_p4032_bus_io.c,v 1.6 2011/07/08 18:48:55 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: algor_p4032_bus_io.c,v 1.7 2011/07/09 16:03:00 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -44,7 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: algor_p4032_bus_io.c,v 1.6 2011/07/08 18:48:55 matt
#include <uvm/uvm_extern.h>
#include <machine/locore.h>
#include <mips/locore.h>
#include <algor/algor/algor_p4032reg.h>
#include <algor/algor/algor_p4032var.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: algor_p4032_bus_locio.c,v 1.5 2011/07/08 18:48:55 matt Exp $ */
/* $NetBSD: algor_p4032_bus_locio.c,v 1.6 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: algor_p4032_bus_locio.c,v 1.5 2011/07/08 18:48:55 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: algor_p4032_bus_locio.c,v 1.6 2011/07/09 16:03:00 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -44,7 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: algor_p4032_bus_locio.c,v 1.5 2011/07/08 18:48:55 ma
#include <uvm/uvm_extern.h>
#include <machine/locore.h>
#include <mips/locore.h>
#include <algor/algor/algor_p4032reg.h>
#include <algor/algor/algor_p4032var.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: algor_p4032_intr.c,v 1.23 2011/07/01 18:30:36 dyoung Exp $ */
/* $NetBSD: algor_p4032_intr.c,v 1.24 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -38,22 +38,22 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: algor_p4032_intr.c,v 1.23 2011/07/01 18:30:36 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: algor_p4032_intr.c,v 1.24 2011/07/09 16:03:00 matt Exp $");
#include "opt_ddb.h"
#define __INTR_PRIVATE
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/malloc.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/cpu.h>
#include <sys/bus.h>
#include <machine/autoconf.h>
#include <machine/intr.h>
#include <sys/cpu.h>
#include <sys/device.h>
#include <sys/intr.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/queue.h>
#include <sys/systm.h>
#include <algor/autoconf.h>
#include <mips/locore.h>
@ -201,7 +201,7 @@ struct p4032_intrhead p4032_intrtab[NIRQMAPS];
struct p4032_cpuintr {
LIST_HEAD(, algor_intrhand) cintr_list;
LIST_HEAD(, evbmips_intrhand) cintr_list;
struct evcnt cintr_count;
};
@ -345,7 +345,7 @@ void *
algor_p4032_intr_establish(int irq, int (*func)(void *), void *arg)
{
const struct p4032_irqmap *irqmap;
struct algor_intrhand *ih;
struct evbmips_intrhand *ih;
int s;
irqmap = &p4032_irqmap[irq];
@ -387,7 +387,7 @@ void
algor_p4032_intr_disestablish(void *cookie)
{
const struct p4032_irqmap *irqmap;
struct algor_intrhand *ih = cookie;
struct evbmips_intrhand *ih = cookie;
int s;
irqmap = ih->ih_irqmap;
@ -418,7 +418,7 @@ void
algor_p4032_iointr(int ipl, vaddr_t pc, u_int32_t ipending)
{
const struct p4032_irqmap *irqmap;
struct algor_intrhand *ih;
struct evbmips_intrhand *ih;
int level, i;
u_int32_t irr[NIRQREG];

View File

@ -1,4 +1,4 @@
/* $NetBSD: algor_p5064_bus_io.c,v 1.6 2011/07/08 18:48:55 matt Exp $ */
/* $NetBSD: algor_p5064_bus_io.c,v 1.7 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: algor_p5064_bus_io.c,v 1.6 2011/07/08 18:48:55 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: algor_p5064_bus_io.c,v 1.7 2011/07/09 16:03:00 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -44,7 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: algor_p5064_bus_io.c,v 1.6 2011/07/08 18:48:55 matt
#include <uvm/uvm_extern.h>
#include <machine/locore.h>
#include <mips/locore.h>
#include <algor/algor/algor_p5064reg.h>
#include <algor/algor/algor_p5064var.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: algor_p5064_bus_mem.c,v 1.5 2011/07/08 18:48:55 matt Exp $ */
/* $NetBSD: algor_p5064_bus_mem.c,v 1.6 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: algor_p5064_bus_mem.c,v 1.5 2011/07/08 18:48:55 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: algor_p5064_bus_mem.c,v 1.6 2011/07/09 16:03:00 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -44,7 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: algor_p5064_bus_mem.c,v 1.5 2011/07/08 18:48:55 matt
#include <uvm/uvm_extern.h>
#include <machine/locore.h>
#include <mips/locore.h>
#include <algor/algor/algor_p5064reg.h>
#include <algor/algor/algor_p5064var.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: algor_p5064_intr.c,v 1.26 2011/07/01 18:30:36 dyoung Exp $ */
/* $NetBSD: algor_p5064_intr.c,v 1.27 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -38,22 +38,22 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: algor_p5064_intr.c,v 1.26 2011/07/01 18:30:36 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: algor_p5064_intr.c,v 1.27 2011/07/09 16:03:00 matt Exp $");
#include "opt_ddb.h"
#define __INTR_PRIVATE
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/malloc.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/cpu.h>
#include <sys/bus.h>
#include <machine/autoconf.h>
#include <machine/intr.h>
#include <sys/cpu.h>
#include <sys/device.h>
#include <sys/intr.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/queue.h>
#include <sys/systm.h>
#include <algor/autoconf.h>
#include <mips/locore.h>
@ -270,7 +270,7 @@ struct p5064_intrhead p5064_intrtab[NIRQMAPS];
#define NINTRS 3 /* MIPS INT0 - INT2 */
struct p5064_cpuintr {
LIST_HEAD(, algor_intrhand) cintr_list;
LIST_HEAD(, evbmips_intrhand) cintr_list;
struct evcnt cintr_count;
};
@ -438,7 +438,7 @@ void *
algor_p5064_intr_establish(int irq, int (*func)(void *), void *arg)
{
const struct p5064_irqmap *irqmap;
struct algor_intrhand *ih;
struct evbmips_intrhand *ih;
int s;
irqmap = &p5064_irqmap[irq];
@ -480,7 +480,7 @@ void
algor_p5064_intr_disestablish(void *cookie)
{
const struct p5064_irqmap *irqmap;
struct algor_intrhand *ih = cookie;
struct evbmips_intrhand *ih = cookie;
int s;
irqmap = ih->ih_irqmap;
@ -511,7 +511,7 @@ void
algor_p5064_iointr(int ipl, vaddr_t pc, uint32_t ipending)
{
const struct p5064_irqmap *irqmap;
struct algor_intrhand *ih;
struct evbmips_intrhand *ih;
int level, i;
uint32_t irr[NIRQREG];
@ -706,7 +706,7 @@ void *
algor_p5064_isa_intr_establish(void *v, int iirq, int type, int level,
int (*func)(void *), void *arg)
{
struct algor_intrhand *ih;
struct evbmips_intrhand *ih;
int irqidx;
if (iirq > 15 || type == IST_NONE)
@ -726,7 +726,7 @@ algor_p5064_isa_intr_establish(void *v, int iirq, int type, int level,
void
algor_p5064_isa_intr_disestablish(void *v, void *cookie)
{
struct algor_intrhand *ih = cookie;
struct evbmips_intrhand *ih = cookie;
/* Translate the IRQ back to our domain. */
ih->ih_irq = p5064_isa_to_irqmap[ih->ih_irq];

View File

@ -1,4 +1,4 @@
/* $NetBSD: algor_p6032_bus_io.c,v 1.5 2011/07/08 18:48:56 matt Exp $ */
/* $NetBSD: algor_p6032_bus_io.c,v 1.6 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: algor_p6032_bus_io.c,v 1.5 2011/07/08 18:48:56 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: algor_p6032_bus_io.c,v 1.6 2011/07/09 16:03:00 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -44,7 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: algor_p6032_bus_io.c,v 1.5 2011/07/08 18:48:56 matt
#include <uvm/uvm_extern.h>
#include <machine/locore.h>
#include <mips/locore.h>
#include <algor/algor/algor_p6032reg.h>
#include <algor/algor/algor_p6032var.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: algor_p6032_bus_mem.c,v 1.5 2011/07/08 18:48:56 matt Exp $ */
/* $NetBSD: algor_p6032_bus_mem.c,v 1.6 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: algor_p6032_bus_mem.c,v 1.5 2011/07/08 18:48:56 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: algor_p6032_bus_mem.c,v 1.6 2011/07/09 16:03:00 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -44,7 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: algor_p6032_bus_mem.c,v 1.5 2011/07/08 18:48:56 matt
#include <uvm/uvm_extern.h>
#include <machine/locore.h>
#include <mips/locore.h>
#include <algor/algor/algor_p6032reg.h>
#include <algor/algor/algor_p6032var.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: algor_p6032_intr.c,v 1.20 2011/07/01 18:30:36 dyoung Exp $ */
/* $NetBSD: algor_p6032_intr.c,v 1.21 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,22 +37,22 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: algor_p6032_intr.c,v 1.20 2011/07/01 18:30:36 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: algor_p6032_intr.c,v 1.21 2011/07/09 16:03:00 matt Exp $");
#include "opt_ddb.h"
#define __INTR_PRIVATE
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/malloc.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/cpu.h>
#include <sys/bus.h>
#include <machine/autoconf.h>
#include <machine/intr.h>
#include <sys/cpu.h>
#include <sys/device.h>
#include <sys/intr.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/queue.h>
#include <sys/systm.h>
#include <algor/autoconf.h>
#include <mips/locore.h>
@ -162,7 +162,7 @@ struct p6032_intrhead p6032_intrtab[NIRQMAPS];
#define NINTRS 2 /* MIPS INT0 - INT1 */
struct p6032_cpuintr {
LIST_HEAD(, algor_intrhand) cintr_list;
LIST_HEAD(, evbmips_intrhand) cintr_list;
struct evcnt cintr_count;
};
@ -306,7 +306,7 @@ void *
algor_p6032_intr_establish(int irq, int (*func)(void *), void *arg)
{
const struct p6032_irqmap *irqmap;
struct algor_intrhand *ih;
struct evbmips_intrhand *ih;
int s;
irqmap = &p6032_irqmap[irq];
@ -347,7 +347,7 @@ void
algor_p6032_intr_disestablish(void *cookie)
{
const struct p6032_irqmap *irqmap;
struct algor_intrhand *ih = cookie;
struct evbmips_intrhand *ih = cookie;
int s;
irqmap = ih->ih_irqmap;
@ -375,7 +375,7 @@ void
algor_p6032_iointr(int ipl, vaddr_t pc, uint32_t ipending)
{
const struct p6032_irqmap *irqmap;
struct algor_intrhand *ih;
struct evbmips_intrhand *ih;
int level;
uint32_t isr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.19 2011/07/01 18:30:36 dyoung Exp $ */
/* $NetBSD: autoconf.c,v 1.20 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -30,26 +30,26 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.19 2011/07/01 18:30:36 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.20 2011/07/09 16:03:00 matt Exp $");
#include "opt_algor_p4032.h"
#include "opt_algor_p5064.h"
#include "opt_algor_p6032.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/reboot.h>
#include <sys/device.h>
#include <sys/intr.h>
#include <sys/reboot.h>
#include <sys/systm.h>
#include <dev/pci/pcivar.h>
#include <net/if.h>
#include <net/if_ether.h>
#include <sys/bus.h>
#include <machine/autoconf.h>
#include <machine/intr.h>
#include <algor/autoconf.h>
#ifdef ALGOR_P4032
#include <algor/algor/algor_p4032var.h>

View File

@ -1,231 +0,0 @@
/* $NetBSD: disksubr.c,v 1.17 2008/01/02 11:48:20 ad Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Authors: Keith Bostic, Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.17 2008/01/02 11:48:20 ad Exp $");
#include <sys/param.h>
#include <sys/buf.h>
#include <sys/ioccom.h>
#include <sys/device.h>
#include <sys/disklabel.h>
#include <sys/disk.h>
#include <sys/systm.h>
#include <machine/cpu.h>
#include <machine/autoconf.h>
/*
* Attempt to read a disk label from a device
* using the indicated strategy routine.
* The label must be partly set up before this:
* secpercyl and anything required in the strategy routine
* (e.g., sector size) must be filled in before calling us.
* Returns null on success and an error string on failure.
*/
const char *
readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
struct cpu_disklabel *clp)
{
struct buf *bp;
struct disklabel *dlp;
struct dkbad *bdp;
const char *msg = NULL;
int i;
/* minimal requirements for archtypal disk label */
if (lp->d_secsize == 0)
lp->d_secsize = DEV_BSIZE;
if (lp->d_secperunit == 0)
lp->d_secperunit = 0x1fffffff;
lp->d_npartitions = RAW_PART + 1;
if (lp->d_partitions[RAW_PART].p_size == 0)
lp->d_partitions[RAW_PART].p_size = lp->d_secperunit;
lp->d_partitions[RAW_PART].p_offset = 0;
/* obtain buffer to probe drive with */
bp = geteblk((int)lp->d_secsize);
/* next, dig out disk label */
bp->b_dev = dev;
bp->b_blkno = LABELSECTOR;
bp->b_cylinder = 0;
bp->b_bcount = lp->d_secsize;
bp->b_flags |= B_READ;
(*strat)(bp);
/* if successful, locate disk label within block and validate */
if (biowait(bp)) {
msg = "disk label read error";
goto done;
}
dlp = (struct disklabel *)((char*)bp->b_data + LABELOFFSET);
if (dlp->d_magic == DISKMAGIC) {
if (dkcksum(dlp))
msg = "NetBSD disk label corrupted";
else
*lp = *dlp;
} else
msg = "no disk label";
if (msg)
goto done;
/* obtain bad sector table if requested and present */
if (clp && (bdp = &clp->bad) != NULL && (lp->d_flags & D_BADSECT)) {
struct dkbad *db;
i = 0;
do {
/* read a bad sector table */
bp->b_oflags &= ~(BO_DONE);
bp->b_flags |= B_READ;
bp->b_blkno = lp->d_secperunit - lp->d_nsectors + i;
if (lp->d_secsize > DEV_BSIZE)
bp->b_blkno *= lp->d_secsize / DEV_BSIZE;
else
bp->b_blkno /= DEV_BSIZE / lp->d_secsize;
bp->b_bcount = lp->d_secsize;
bp->b_cylinder = lp->d_ncylinders - 1;
(*strat)(bp);
/* if successful, validate, otherwise try another */
if (biowait(bp)) {
msg = "bad sector table I/O error";
} else {
db = (struct dkbad *)(bp->b_data);
#define DKBAD_MAGIC 0x4321
if (db->bt_mbz == 0
&& db->bt_flag == DKBAD_MAGIC) {
msg = NULL;
*bdp = *db;
break;
} else
msg = "bad sector table corrupted";
}
} while (bp->b_error != 0 && (i += 2) < 10 &&
i < lp->d_nsectors);
}
done:
brelse(bp, 0);
return (msg);
}
/*
* Check new disk label for sensibility before setting it.
*/
int
setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_long openmask,
struct cpu_disklabel *clp)
{
int i;
struct partition *opp, *npp;
/* sanity clause */
if (nlp->d_secpercyl == 0 || nlp->d_secsize == 0 ||
(nlp->d_secsize % DEV_BSIZE) != 0)
return(EINVAL);
#ifdef notdef
/* XXX WHY WAS THIS HERE?! */
/* special case to allow disklabel to be invalidated */
if (nlp->d_magic == 0xffffffff) {
*olp = *nlp;
return (0);
}
#endif
if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
dkcksum(nlp) != 0)
return (EINVAL);
while ((i = ffs(openmask)) != 0) {
i--;
openmask &= ~(1 << i);
if (nlp->d_npartitions <= i)
return (EBUSY);
opp = &olp->d_partitions[i];
npp = &nlp->d_partitions[i];
if (npp->p_offset != opp->p_offset || npp->p_size < opp->p_size)
return (EBUSY);
/*
* Copy internally-set partition information
* if new label doesn't include it. XXX
*/
if (npp->p_fstype == FS_UNUSED && opp->p_fstype != FS_UNUSED) {
npp->p_fstype = opp->p_fstype;
npp->p_fsize = opp->p_fsize;
npp->p_frag = opp->p_frag;
npp->p_cpg = opp->p_cpg;
}
}
nlp->d_checksum = 0;
nlp->d_checksum = dkcksum(nlp);
*olp = *nlp;
return (0);
}
/*
* Write disk label back to device after modification.
* this means write out the Rigid disk blocks to represent the
* label. Hope the user was carefull.
*/
int
writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
struct cpu_disklabel *clp)
{
struct buf *bp;
struct disklabel *dlp;
int error = 0;
bp = geteblk((int)lp->d_secsize);
bp->b_dev = dev;
bp->b_blkno = LABELSECTOR;
bp->b_cylinder = 0;
bp->b_bcount = lp->d_secsize;
bp->b_flags |= B_READ; /* get current label */
(*strat)(bp);
if ((error = biowait(bp)) != 0)
goto done;
dlp = (struct disklabel *)((char*)bp->b_data + LABELOFFSET);
*dlp = *lp; /* struct assignment */
bp->b_oflags &= ~(BO_DONE);
bp->b_flags &= ~(B_READ);
bp->b_flags |= B_WRITE;
(*strat)(bp);
error = biowait(bp);
done:
brelse(bp, 0);
return (error);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: led.c,v 1.6 2008/04/28 20:23:10 martin Exp $ */
/* $NetBSD: led.c,v 1.7 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: led.c,v 1.6 2008/04/28 20:23:10 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: led.c,v 1.7 2011/07/09 16:03:00 matt Exp $");
#include "opt_algor_p4032.h"
#include "opt_algor_p5064.h"
@ -38,7 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: led.c,v 1.6 2008/04/28 20:23:10 martin Exp $");
#include <sys/param.h>
#include <machine/autoconf.h>
#include <algor/autoconf.h>
#ifdef ALGOR_P4032
#include <algor/algor/algor_p4032reg.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.50 2011/07/01 18:30:36 dyoung Exp $ */
/* $NetBSD: machdep.c,v 1.51 2011/07/09 16:03:00 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.50 2011/07/01 18:30:36 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.51 2011/07/09 16:03:00 matt Exp $");
#include "opt_algor_p4032.h"
#include "opt_algor_p5064.h"
@ -81,17 +81,18 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.50 2011/07/01 18:30:36 dyoung Exp $");
#include "opt_ethaddr.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/mount.h>
#include <sys/kcore.h>
#include <sys/boot_flag.h>
#include <sys/termios.h>
#include <sys/ksyms.h>
#include <sys/buf.h>
#include <sys/bus.h>
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/kcore.h>
#include <sys/ksyms.h>
#include <sys/lwp.h>
#include <sys/mount.h>
#include <sys/reboot.h>
#include <sys/systm.h>
#include <sys/termios.h>
#include <net/if.h>
#include <net/if_ether.h>
@ -101,16 +102,15 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.50 2011/07/01 18:30:36 dyoung Exp $");
#include <dev/cons.h>
#include <mips/locore.h>
#include <mips/pcb.h>
#ifdef DDB
#include <machine/db_machdep.h>
#include <mips/db_machdep.h>
#include <ddb/db_extern.h>
#endif
#include <sys/bus.h>
#include <machine/autoconf.h>
#include <machine/pmon.h>
#include <machine/pcb.h>
#include <algor/autoconf.h>
#include <algor/pci/vtpbcvar.h>

View File

@ -1,7 +1,8 @@
# $NetBSD: files.algor,v 1.28 2011/07/08 18:48:57 matt Exp $
# $NetBSD: files.algor,v 1.29 2011/07/09 16:03:01 matt Exp $
# Algorithmics evaluation board specific configuration info.
ifndef evbmips
# maxpartitions must be the first item in files.${ARCH}
maxpartitions 8
@ -15,6 +16,7 @@ defflag ALGOR_P6032 # Algorithmics P-6032
# Various items that a buggy PMON might not provide us.
defparam MEMSIZE
defparam ETHADDR
endif
# Platform support files
file arch/algor/algor/algor_p4032_bus_io.c algor_p4032
@ -34,12 +36,16 @@ file arch/algor/algor/algor_p6032_dma.c algor_p6032
file arch/algor/algor/algor_p6032_intr.c algor_p6032
file arch/algor/algor/autoconf.c
file arch/algor/algor/disksubr.c
file arch/algor/algor/interrupt.c
file arch/algor/algor/algor_intr.c
file arch/algor/algor/led.c
file arch/algor/algor/machdep.c
file arch/algor/algor/pmon.c
ifdef evbmips
file arch/evbmips/evbmips/interrupt.c
endif
file arch/evbmips/evbmips/disksubr.c
file arch/mips/mips/bus_dma.c
file arch/mips/mips/mips3_clock.c
file arch/mips/mips/mips3_clockintr.c
@ -88,7 +94,9 @@ include "dev/usb/files.usb"
file dev/md_root.c memory_disk_hooks
# Console glue.
ifndef evbmips
file dev/cons.c
endif
include "dev/pci/files.pci"
include "dev/isa/files.isa"
@ -110,7 +118,7 @@ attach pcib at pci
file arch/algor/pci/pcib.c pcib & (algor_p5064 |
algor_p6032)
file arch/algor/pci/pciide_machdep.c pciide_common
file arch/mips/pci/pciide_machdep.c pciide_common
#
# ISA bus support.
@ -171,4 +179,6 @@ file arch/algor/dev/com_mainbus.c com_mainbus & algor_p4032
attach lpt at mainbus with lpt_mainbus
file arch/algor/dev/lpt_mainbus.c lpt_mainbus & algor_p4032
ifndef evbmips
include "arch/algor/conf/majors.algor"
endif

View File

@ -1,7 +1,9 @@
# $NetBSD: std.algor,v 1.8 2005/12/11 12:16:08 christos Exp $
# $NetBSD: std.algor,v 1.9 2011/07/09 16:03:01 matt Exp $
machine algor mips
ifndef evbmips
machine algor mips
include "conf/std" # MI standard options
makeoptions MACHINE_ARCH="mipsel"
# Standard exec-package options
@ -11,4 +13,7 @@ options EXEC_SCRIPT # exec of #! scripts
options MIPS3 # All supported Algor boards are MIPS3
options MIPS3_ENABLE_CLOCK_INTR
options AUTOCONF_IMPL="<algor/autoconf.h>"
makeoptions DEFTEXTADDR="0x80100000"
endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: bonito_mainbus.c,v 1.13 2011/07/01 18:31:31 dyoung Exp $ */
/* $NetBSD: bonito_mainbus.c,v 1.14 2011/07/09 16:03:01 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -30,18 +30,18 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bonito_mainbus.c,v 1.13 2011/07/01 18:31:31 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: bonito_mainbus.c,v 1.14 2011/07/09 16:03:01 matt Exp $");
#include "opt_algor_p6032.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/reboot.h>
#include <sys/device.h>
#include <sys/bus.h>
#include <machine/autoconf.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/reboot.h>
#include <sys/systm.h>
#include <algor/autoconf.h>
#include <mips/bonito/bonitoreg.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: com_mainbus.c,v 1.13 2011/07/01 18:31:31 dyoung Exp $ */
/* $NetBSD: com_mainbus.c,v 1.14 2011/07/09 16:03:01 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -33,25 +33,24 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: com_mainbus.c,v 1.13 2011/07/01 18:31:31 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: com_mainbus.c,v 1.14 2011/07/09 16:03:01 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/tty.h>
#include <sys/proc.h>
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/uio.h>
#include <sys/kernel.h>
#include <sys/syslog.h>
#include <sys/types.h>
#include <sys/device.h>
#include <machine/autoconf.h>
#include <machine/intr.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/file.h>
#include <sys/intr.h>
#include <sys/ioctl.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/select.h>
#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/tty.h>
#include <sys/uio.h>
#include <algor/autoconf.h>
#include <dev/ic/comreg.h>
#include <dev/ic/comvar.h>
@ -63,9 +62,8 @@ struct com_mainbus_softc {
void *sc_ih; /* interrupt handler */
};
int com_mainbus_match(device_t, cfdata_t , void *);
void com_mainbus_attach(device_t, device_t, void *);
void com_mainbus_cleanup(void *);
static int com_mainbus_match(device_t, cfdata_t , void *);
static void com_mainbus_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(com_mainbus, sizeof(struct com_mainbus_softc),
com_mainbus_match, com_mainbus_attach, NULL, NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: lpt_mainbus.c,v 1.11 2011/07/01 18:31:31 dyoung Exp $ */
/* $NetBSD: lpt_mainbus.c,v 1.12 2011/07/09 16:03:01 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -31,25 +31,17 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: lpt_mainbus.c,v 1.11 2011/07/01 18:31:31 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: lpt_mainbus.c,v 1.12 2011/07/09 16:03:01 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/tty.h>
#include <sys/proc.h>
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/uio.h>
#include <sys/kernel.h>
#include <sys/syslog.h>
#include <sys/types.h>
#include <sys/device.h>
#include <machine/autoconf.h>
#include <machine/intr.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/intr.h>
#include <sys/ioctl.h>
#include <sys/systm.h>
#include <algor/autoconf.h>
#include <dev/ic/lptreg.h>
#include <dev/ic/lptvar.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: mainbus.c,v 1.24 2011/07/08 18:48:58 matt Exp $ */
/* $NetBSD: mainbus.c,v 1.25 2011/07/09 16:03:01 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.24 2011/07/08 18:48:58 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.25 2011/07/09 16:03:01 matt Exp $");
#include "opt_algor_p4032.h"
#include "opt_algor_p5064.h"
@ -39,15 +39,15 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.24 2011/07/08 18:48:58 matt Exp $");
#include "opt_pci.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/reboot.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/extent.h>
#include <sys/bus.h>
#include <machine/autoconf.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/extent.h>
#include <sys/malloc.h>
#include <sys/reboot.h>
#include <sys/systm.h>
#include <algor/autoconf.h>
#include <mips/cache.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: mcclock_mainbus.c,v 1.11 2011/07/01 18:31:31 dyoung Exp $ */
/* $NetBSD: mcclock_mainbus.c,v 1.12 2011/07/09 16:03:01 matt Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -29,17 +29,18 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: mcclock_mainbus.c,v 1.11 2011/07/01 18:31:31 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: mcclock_mainbus.c,v 1.12 2011/07/09 16:03:01 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <machine/autoconf.h>
#include <sys/bus.h>
#include <algor/autoconf.h>
#include <dev/clock_subr.h>
#include <dev/ic/mc146818reg.h>
#include <dev/ic/mc146818var.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: vtpbc_mainbus.c,v 1.17 2011/07/01 18:31:31 dyoung Exp $ */
/* $NetBSD: vtpbc_mainbus.c,v 1.18 2011/07/09 16:03:01 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -30,19 +30,19 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vtpbc_mainbus.c,v 1.17 2011/07/01 18:31:31 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: vtpbc_mainbus.c,v 1.18 2011/07/09 16:03:01 matt Exp $");
#include "opt_algor_p4032.h"
#include "opt_algor_p5064.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/reboot.h>
#include <sys/device.h>
#include <sys/bus.h>
#include <machine/autoconf.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/reboot.h>
#include <sys/systm.h>
#include <algor/autoconf.h>
#include <algor/pci/vtpbcvar.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.h,v 1.6 2011/07/01 21:02:15 dyoung Exp $ */
/* $NetBSD: autoconf.h,v 1.7 2011/07/09 16:03:01 matt Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@ -45,7 +45,10 @@ struct mainbus_attach_args {
#ifdef _KERNEL
extern char algor_ethaddr[];
void (*algor_iointr)(int, vaddr_t, uint32_t);
extern void (*algor_iointr)(int, vaddr_t, uint32_t);
extern void * (*algor_intr_establish)(int, int (*)(void *), void *);
extern void (*algor_intr_disestablish)(void *);
void led_display(uint8_t, uint8_t, uint8_t, uint8_t);
#endif /* _KERNEL */

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.h,v 1.14 2011/02/20 07:51:21 matt Exp $ */
/* $NetBSD: intr.h,v 1.15 2011/07/09 16:03:01 matt Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -39,12 +39,13 @@
#ifdef _KERNEL
struct algor_intrhand {
LIST_ENTRY(algor_intrhand) ih_q;
struct evbmips_intrhand {
LIST_ENTRY(evbmips_intrhand) ih_q;
const void *ih_irqmap;
int (*ih_func)(void *);
void *ih_arg;
int ih_irq; /* mostly for ISA */
int ih_ipl;
};
extern struct evcnt mips_int5_evcnt;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcib.c,v 1.23 2011/07/08 18:48:59 matt Exp $ */
/* $NetBSD: pcib.c,v 1.24 2011/07/09 16:03:01 matt Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -31,19 +31,20 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.23 2011/07/08 18:48:59 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.24 2011/07/09 16:03:01 matt Exp $");
#include "opt_algor_p5064.h"
#include "opt_algor_p6032.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <machine/intr.h>
#include <sys/bus.h>
#include <sys/device.h>
#include <sys/intr.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/systm.h>
#include <algor/autoconf.h>
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
@ -82,13 +83,13 @@ const char * const pcib_intrnames[16] = {
};
struct pcib_intrhead {
LIST_HEAD(, algor_intrhand) intr_q;
LIST_HEAD(, evbmips_intrhand) intr_q;
struct evcnt intr_count;
int intr_type;
};
struct pcib_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh_icu1;
@ -111,19 +112,18 @@ struct pcib_softc {
void *sc_ih;
};
int pcib_match(struct device *, struct cfdata *, void *);
void pcib_attach(struct device *, struct device *, void *);
int pcib_match(device_t, cfdata_t, void *);
void pcib_attach(device_t, device_t, void *);
CFATTACH_DECL(pcib, sizeof(struct pcib_softc),
CFATTACH_DECL_NEW(pcib, sizeof(struct pcib_softc),
pcib_match, pcib_attach, NULL, NULL);
void pcib_isa_attach_hook(struct device *, struct device *,
struct isabus_attach_args *);
void pcib_isa_attach_hook(device_t, device_t, struct isabus_attach_args *);
void pcib_isa_detach_hook(isa_chipset_tag_t, device_t);
int pcib_intr(void *);
void pcib_bridge_callback(struct device *);
void pcib_bridge_callback(device_t);
const struct evcnt *pcib_isa_intr_evcnt(void *, int);
void *pcib_isa_intr_establish(void *, int, int, int,
@ -134,7 +134,7 @@ int pcib_isa_intr_alloc(void *, int, int, int *);
void pcib_set_icus(struct pcib_softc *);
int
pcib_match(struct device *parent, struct cfdata *match, void *aux)
pcib_match(device_t parent, cfdata_t match, void *aux)
{
struct pci_attach_args *pa = aux;
@ -146,31 +146,29 @@ pcib_match(struct device *parent, struct cfdata *match, void *aux)
}
void
pcib_attach(struct device *parent, struct device *self, void *aux)
pcib_attach(device_t parent, device_t self, void *aux)
{
struct pcib_softc *sc = (void *) self;
struct pcib_softc *sc = device_private(self);
struct pci_attach_args *pa = aux;
char devinfo[256];
int i;
pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
printf(": %s (rev. 0x%02x)\n", devinfo,
aprint_normal(": %s (rev. 0x%02x)\n", devinfo,
PCI_REVISION(pa->pa_class));
sc->sc_dev = self;
sc->sc_iot = pa->pa_iot;
/*
* Map the PIC/ELCR registers.
*/
if (bus_space_map(sc->sc_iot, 0x4d0, 2, 0, &sc->sc_ioh_elcr) != 0)
printf("%s: unable to map ELCR registers\n",
sc->sc_dev.dv_xname);
aprint_error_dev(self, "unable to map ELCR registers\n");
if (bus_space_map(sc->sc_iot, IO_ICU1, 2, 0, &sc->sc_ioh_icu1) != 0)
printf("%s: unable to map ICU1 registers\n",
sc->sc_dev.dv_xname);
aprint_error_dev(self, "unable to map ICU1 registers\n");
if (bus_space_map(sc->sc_iot, IO_ICU2, 2, 0, &sc->sc_ioh_icu2) != 0)
printf("%s: unable to map ICU2 registers\n",
sc->sc_dev.dv_xname);
aprint_error_dev(self, "unable to map ICU2 registers\n");
/* All interrupts default to "masked off". */
sc->sc_imask = 0xffff;
@ -284,15 +282,15 @@ pcib_attach(struct device *parent, struct device *self, void *aux)
#endif
if (sc->sc_ih == NULL)
printf("%s: WARNING: unable to register interrupt handler\n",
sc->sc_dev.dv_xname);
device_xname(sc->sc_dev));
config_defer(self, pcib_bridge_callback);
}
void
pcib_bridge_callback(struct device *self)
pcib_bridge_callback(device_t self)
{
struct pcib_softc *sc = (struct pcib_softc *)self;
struct pcib_softc *sc = device_private(self);
struct isabus_attach_args iba;
memset(&iba, 0, sizeof(iba));
@ -319,11 +317,11 @@ pcib_bridge_callback(struct device *self)
iba.iba_ic->ic_attach_hook = pcib_isa_attach_hook;
iba.iba_ic->ic_detach_hook = pcib_isa_detach_hook;
(void) config_found_ia(&sc->sc_dev, "isabus", &iba, isabusprint);
(void) config_found_ia(sc->sc_dev, "isabus", &iba, isabusprint);
}
void
pcib_isa_attach_hook(struct device *parent, struct device *self,
pcib_isa_attach_hook(device_t parent, device_t self,
struct isabus_attach_args *iba)
{
@ -362,7 +360,7 @@ int
pcib_intr(void *v)
{
struct pcib_softc *sc = v;
struct algor_intrhand *ih;
struct evbmips_intrhand *ih;
int irq;
for (;;) {
@ -422,7 +420,7 @@ pcib_isa_intr_establish(void *v, int irq, int type, int level,
int (*func)(void *), void *arg)
{
struct pcib_softc *sc = v;
struct algor_intrhand *ih;
struct evbmips_intrhand *ih;
int s;
if (irq > 15 || irq == 2 || type == IST_NONE)
@ -484,7 +482,7 @@ void
pcib_isa_intr_disestablish(void *v, void *arg)
{
struct pcib_softc *sc = v;
struct algor_intrhand *ih = arg;
struct evbmips_intrhand *ih = arg;
int s;
#if defined(ALGOR_P5064)
@ -514,7 +512,7 @@ pcib_isa_intr_alloc(void *v, int mask, int type, int *irq)
{
struct pcib_softc *sc = v;
int i, tmp, bestirq, count;
struct algor_intrhand *ih;
struct evbmips_intrhand *ih;
if (type == IST_NONE)
panic("pcib_intr_alloc: bogus type");

View File

@ -1,65 +0,0 @@
/* $NetBSD: pciide_machdep.c,v 1.5 2011/07/08 18:49:00 matt Exp $ */
/*
* Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
*
* 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 by Christopher G. Demetriou
* for the NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* PCI IDE controller driver (Algorithmics machine-dependent portion).
*
* Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD
* sys/dev/pci/ppb.c, revision 1.16).
*
* See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the
* PCI SIG.
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.5 2011/07/08 18:49:00 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pciidereg.h>
#include <dev/pci/pciidevar.h>
void *
pciide_machdep_compat_intr_establish(device_t dev,
const struct pci_attach_args *pa, int chan, int (*func)(void *), void *arg)
{
pci_chipset_tag_t pc = pa->pa_pc;
if (pc->pc_pciide_compat_intr_establish == NULL)
return (NULL);
return ((*pc->pc_pciide_compat_intr_establish)(pc, dev, pa, chan,
func, arg));
}

View File

@ -0,0 +1,4 @@
# $NetBSD: P4032,v 1.1 2011/07/09 16:03:01 matt Exp $
include "arch/evbmips/conf/std.algor"
include "arch/algor/conf/P4032"

View File

@ -0,0 +1,4 @@
# $NetBSD: P5064,v 1.1 2011/07/09 16:03:01 matt Exp $
include "arch/evbmips/conf/std.algor"
include "arch/algor/conf/P5064"

View File

@ -0,0 +1,4 @@
# $NetBSD: P5064-64,v 1.1 2011/07/09 16:03:01 matt Exp $
include "arch/evbmips/conf/std.algor"
include "arch/algor/conf/P5064-64"

View File

@ -0,0 +1,4 @@
# $NetBSD: P6032,v 1.1 2011/07/09 16:03:01 matt Exp $
include "arch/evbmips/conf/std.algor"
include "arch/algor/conf/P6032"

View File

@ -0,0 +1,3 @@
# $NetBSD: files.algor,v 1.1 2011/07/09 16:03:01 matt Exp $
include "arch/algor/conf/files.algor"

View File

@ -1,4 +1,4 @@
# $NetBSD: files.malta,v 1.17 2011/02/20 07:48:34 matt Exp $
# $NetBSD: files.malta,v 1.18 2011/07/09 16:03:01 matt Exp $
file arch/evbmips/malta/malta_bus_io.c
file arch/evbmips/malta/malta_bus_mem.c
@ -59,7 +59,7 @@ attach gt at mainbus
file arch/evbmips/malta/dev/gt.c gt # XXX should be in arch/mips/galileo ?
file arch/evbmips/malta/pci/pci_machdep.c pci
file arch/evbmips/malta/pci/pciide_machdep.c pciide_common
file arch/mips/pci/pciide_machdep.c pciide_common
device pchb
attach pchb at pci

View File

@ -0,0 +1,16 @@
# $NetBSD: std.algor,v 1.1 2011/07/09 16:03:01 matt Exp $
machine evbmips mips algor
include "conf/std" # MI standard options
makeoptions MACHINE_ARCH="mipsel"
# Standard exec-package options
options EXEC_ELF32 # 32-bit ELF support (native format)
options EXEC_SCRIPT # exec of #! scripts
options MIPS3 # All supported Algor boards are MIPS3
options MIPS3_ENABLE_CLOCK_INTR
makeoptions DEFTEXTADDR="0x80100000"
makeoptions BOARDTYPE="algor"

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.h,v 1.18 2011/02/20 07:48:34 matt Exp $ */
/* $NetBSD: intr.h,v 1.19 2011/07/09 16:03:01 matt Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -41,6 +41,7 @@ struct evbmips_intrhand {
LIST_ENTRY(evbmips_intrhand) ih_q;
int (*ih_func)(void *);
void *ih_arg;
const void *ih_irqmap; /* for algor */
int ih_irq;
int ih_ipl;
};

View File

@ -0,0 +1,40 @@
/* $NetBSD: pmon.h,v 1.1 2011/07/09 16:03:01 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``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 THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _EVBMIPS_PMON_H_
#define _EVBMIPS_PMON_H_
#ifdef _KERNEL
void pmon_init(char *[]);
const char *pmon_getenv(const char *);
#endif /* _KERNEL */
#endif /* _EVBMIPS_PMON_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: vmparam.h,v 1.3 2011/02/20 07:48:34 matt Exp $ */
/* $NetBSD: vmparam.h,v 1.4 2011/07/09 16:03:01 matt Exp $ */
#ifndef _EVBMIPS_VMPARAM_H_
#define _EVBMIPS_VMPARAM_H_
@ -8,12 +8,13 @@
#define VM_PHYSSEG_MAX 32
#undef VM_FREELIST_MAX
#define VM_FREELIST_MAX 3
#define VM_FREELIST_MAX 4
#if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64)
#define VM_FREELIST_FIRST4G 2
#define VM_FREELIST_FIRST4G 3
#endif
#if !defined(_LP64)
#define VM_FREELIST_FIRST512M 1
#define VM_FREELIST_FIRST512M 2
#endif
#define VM_FREELIST_ISADMA 1
#endif /* !_EVBMIPS_VMPARAM_H_ */

View File

@ -1,65 +0,0 @@
/* $NetBSD: pciide_machdep.c,v 1.5 2011/04/04 20:37:49 dyoung Exp $ */
/*
* Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
*
* 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 by Christopher G. Demetriou
* for the NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* PCI IDE controller driver (malta machine-dependent portion).
*
* Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD
* sys/dev/pci/ppb.c, revision 1.16).
*
* See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the
* PCI SIG.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pciide_machdep.c,v 1.5 2011/04/04 20:37:49 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pciidereg.h>
#include <dev/pci/pciidevar.h>
void *
pciide_machdep_compat_intr_establish(device_t dev,
const struct pci_attach_args *pa, int chan, int (*func)(void *), void *arg)
{
pci_chipset_tag_t pc = pa->pa_pc;
if (pc->pc_pciide_compat_intr_establish == NULL)
return (NULL);
return (mips_pciide_compat_intr_establish(pc, dev, pa, chan,
func, arg));
}