Switch ibm4xx ports to common powerpc bus_space/bus_dma code.
XXX: Walnut PCI support is broken. This will be addressed shortly.
This commit is contained in:
parent
f0f724e255
commit
0b0e493eff
@ -1,4 +1,4 @@
|
||||
# $NetBSD: files.ev64260,v 1.3 2003/03/24 17:07:16 matt Exp $
|
||||
# $NetBSD: files.ev64260,v 1.4 2003/07/25 11:44:18 scw Exp $
|
||||
#
|
||||
# Marvell (Galileo) "EV64260" evaluation board's specific configuration info
|
||||
#
|
||||
@ -13,8 +13,6 @@ file arch/evbppc/ev64260/machdep.c
|
||||
|
||||
#file arch/powerpc/marvell/bus_dma.c
|
||||
file arch/powerpc/marvell/extintr.c
|
||||
file arch/powerpc/powerpc/bus_dma.c
|
||||
file arch/powerpc/powerpc/bus_space.c
|
||||
|
||||
include "dev/marvell/files.discovery"
|
||||
|
||||
|
@ -1,14 +1,15 @@
|
||||
# $NetBSD: files.evbppc,v 1.3 2003/03/05 05:43:42 matt Exp $
|
||||
# $NetBSD: files.evbppc,v 1.4 2003/07/25 11:44:18 scw Exp $
|
||||
|
||||
# maxpartitions must be first item in files.${ARCH}
|
||||
maxpartitions 16
|
||||
|
||||
maxusers 2 8 64
|
||||
|
||||
file arch/evbppc/evbppc/bus_dma.c ppc_ibm4xx
|
||||
file arch/evbppc/evbppc/disksubr.c disk
|
||||
file arch/evbppc/evbppc/evbppc_machdep.c ppc_ibm4xx
|
||||
|
||||
file arch/powerpc/powerpc/bus_dma.c
|
||||
file arch/powerpc/powerpc/bus_space.c
|
||||
file arch/powerpc/powerpc/procfs_machdep.c procfs
|
||||
file dev/cons.c
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: files.walnut,v 1.2 2003/03/04 07:50:57 matt Exp $
|
||||
# $NetBSD: files.walnut,v 1.3 2003/07/25 11:44:18 scw Exp $
|
||||
#
|
||||
# walnut-specific configuration info
|
||||
|
||||
@ -6,8 +6,6 @@ file arch/evbppc/walnut/autoconf.c
|
||||
file arch/evbppc/walnut/consinit.c
|
||||
file arch/evbppc/walnut/machdep.c
|
||||
|
||||
#file arch/evbppc/evbppc/bus_dma.c
|
||||
|
||||
# Memory Disk for install kernel
|
||||
file dev/md_root.c memory_disk_hooks
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: evbppc_machdep.c,v 1.3 2003/07/15 01:37:36 lukem Exp $ */
|
||||
/* $NetBSD: evbppc_machdep.c,v 1.4 2003/07/25 11:44:19 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001, 2002 Wasabi Systems, Inc.
|
||||
@ -67,7 +67,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: evbppc_machdep.c,v 1.3 2003/07/15 01:37:36 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: evbppc_machdep.c,v 1.4 2003/07/25 11:44:19 scw Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -76,6 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: evbppc_machdep.c,v 1.3 2003/07/15 01:37:36 lukem Exp
|
||||
|
||||
#include <uvm/uvm_extern.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
#include <machine/bus.h>
|
||||
#include <machine/pmap.h>
|
||||
|
||||
@ -85,7 +86,7 @@ int fake_mapiodev = 1;
|
||||
* Allocate vm space and mapin the I/O address
|
||||
*/
|
||||
void *
|
||||
mapiodev(paddr_t pa, psize_t len, int flags)
|
||||
mapiodev(paddr_t pa, psize_t len)
|
||||
{
|
||||
paddr_t faddr;
|
||||
vaddr_t taddr, va;
|
||||
@ -112,6 +113,6 @@ mapiodev(paddr_t pa, psize_t len, int flags)
|
||||
faddr += PAGE_SIZE;
|
||||
taddr += PAGE_SIZE;
|
||||
}
|
||||
|
||||
pmap_update(pmap_kernel());
|
||||
return (void *)(va + off);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: consinit.c,v 1.3 2003/07/15 01:37:36 lukem Exp $ */
|
||||
/* $NetBSD: consinit.c,v 1.4 2003/07/25 11:44:19 scw Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.3 2003/07/15 01:37:36 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.4 2003/07/25 11:44:19 scw Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -60,6 +60,8 @@ __KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.3 2003/07/15 01:37:36 lukem Exp $");
|
||||
#endif
|
||||
#include "pckbd.h"
|
||||
|
||||
#include <evbppc/explora/dev/elbvar.h>
|
||||
|
||||
#include "opt_explora.h"
|
||||
|
||||
#ifndef COM_CONSOLE_SPEED
|
||||
@ -81,7 +83,7 @@ consinit(void)
|
||||
done = 1;
|
||||
|
||||
#ifdef COM_IS_CONSOLE
|
||||
tag = MAKE_BUS_TAG(BASE_COM);
|
||||
tag = elb_get_bus_space_tag(BASE_COM);
|
||||
comcnattach(tag, BASE_COM, COM_CONSOLE_SPEED,
|
||||
COM_FREQ, COM_TYPE_NORMAL,
|
||||
(TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8);
|
||||
@ -89,9 +91,9 @@ consinit(void)
|
||||
/* Clear VRam */
|
||||
memset((void *)BASE_FB, 0, SIZE_FB);
|
||||
|
||||
tag = MAKE_BUS_TAG(BASE_FB);
|
||||
tag = elb_get_bus_space_tag(BASE_FB);
|
||||
fb_cnattach(tag, BASE_FB2, (void *)BASE_FB);
|
||||
tag = MAKE_BUS_TAG(BASE_PCKBC);
|
||||
tag = elb_get_bus_space_tag(BASE_PCKBC);
|
||||
pckbc_cnattach(tag, BASE_PCKBC, BASE_PCKBC2-BASE_PCKBC, PCKBC_KBD_SLOT);
|
||||
#endif
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: elb.c,v 1.2 2003/07/15 01:37:36 lukem Exp $ */
|
||||
/* $NetBSD: elb.c,v 1.3 2003/07/25 11:44:20 scw Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
@ -37,15 +37,16 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: elb.c,v 1.2 2003/07/15 01:37:36 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: elb.c,v 1.3 2003/07/25 11:44:20 scw Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/extent.h>
|
||||
|
||||
#include <machine/explora.h>
|
||||
#define _IBM4XX_BUS_DMA_PRIVATE
|
||||
#define _POWERPC_BUS_DMA_PRIVATE
|
||||
#include <machine/bus.h>
|
||||
|
||||
#include <powerpc/ibm4xx/dcr403cgx.h>
|
||||
@ -57,19 +58,62 @@ struct elb_dev {
|
||||
int elb_addr;
|
||||
int elb_addr2;
|
||||
int elb_irq;
|
||||
bus_space_tag_t elb_bt;
|
||||
};
|
||||
|
||||
static int elb_match(struct device *, struct cfdata *, void *);
|
||||
static void elb_attach(struct device *, struct device *, void *);
|
||||
static int elb_print(void *, const char *);
|
||||
|
||||
static struct powerpc_bus_space elb_tag = {
|
||||
_BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_MEM_TYPE | 1, /* stride 1 */
|
||||
0x00000000,
|
||||
BASE_PCKBC,
|
||||
BASE_PCKBC + 0x6ff
|
||||
};
|
||||
static char elb_ex_storage[EXTENT_FIXED_STORAGE_SIZE(8)]
|
||||
__attribute__((aligned(8)));
|
||||
static int elb_tag_init_done;
|
||||
|
||||
static struct powerpc_bus_space elb_fb_tag = {
|
||||
_BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_MEM_TYPE,
|
||||
0x00000000,
|
||||
BASE_FB,
|
||||
BASE_FB2 + SIZE_FB - 1
|
||||
};
|
||||
static char elbfb_ex_storage[EXTENT_FIXED_STORAGE_SIZE(8)]
|
||||
__attribute__((aligned(8)));
|
||||
static int elbfb_tag_init_done;
|
||||
|
||||
/*
|
||||
* DMA struct, nothing special.
|
||||
*/
|
||||
static struct powerpc_bus_dma_tag elb_bus_dma_tag = {
|
||||
0, /* _bounce_thresh */
|
||||
_bus_dmamap_create,
|
||||
_bus_dmamap_destroy,
|
||||
_bus_dmamap_load,
|
||||
_bus_dmamap_load_mbuf,
|
||||
_bus_dmamap_load_uio,
|
||||
_bus_dmamap_load_raw,
|
||||
_bus_dmamap_unload,
|
||||
_bus_dmamap_sync,
|
||||
_bus_dmamem_alloc,
|
||||
_bus_dmamem_free,
|
||||
_bus_dmamem_map,
|
||||
_bus_dmamem_unmap,
|
||||
_bus_dmamem_mmap,
|
||||
_bus_dma_phys_to_bus_mem_generic,
|
||||
_bus_dma_bus_mem_to_phys_generic,
|
||||
};
|
||||
|
||||
static struct elb_dev elb_devs[] = {
|
||||
{ "cpu", 0, 0, -1 },
|
||||
{ "pckbc", BASE_PCKBC, BASE_PCKBC2, 31 },
|
||||
{ "com", BASE_COM, 0, 30 },
|
||||
{ "lpt", BASE_LPT, 0, -1 },
|
||||
{ "fb", BASE_FB, BASE_FB2, -1 },
|
||||
{ "le", BASE_LE, 0, 28 },
|
||||
{ "cpu", 0, 0, -1, NULL },
|
||||
{ "pckbc", BASE_PCKBC, BASE_PCKBC2, 31, &elb_tag },
|
||||
{ "com", BASE_COM, 0, 30, &elb_tag },
|
||||
{ "lpt", BASE_LPT, 0, -1, &elb_tag },
|
||||
{ "fb", BASE_FB, BASE_FB2, -1, &elb_fb_tag },
|
||||
{ "le", BASE_LE, 0, 28, &elb_fb_tag },
|
||||
};
|
||||
|
||||
CFATTACH_DECL(elb, sizeof(struct device),
|
||||
@ -96,8 +140,8 @@ elb_attach(struct device *parent, struct device *self, void *aux)
|
||||
printf("\n");
|
||||
for (i = 0; i < sizeof(elb_devs)/sizeof(elb_devs[0]); i++) {
|
||||
eaa.elb_name = elb_devs[i].elb_name;
|
||||
eaa.elb_bt = MAKE_BUS_TAG(elb_devs[i].elb_addr);
|
||||
eaa.elb_dmat = &ibm4xx_default_bus_dma_tag;
|
||||
eaa.elb_bt = elb_get_bus_space_tag(elb_devs[i].elb_addr);
|
||||
eaa.elb_dmat = &elb_bus_dma_tag;
|
||||
eaa.elb_base = elb_devs[i].elb_addr;
|
||||
eaa.elb_base2 = elb_devs[i].elb_addr2;
|
||||
eaa.elb_irq = elb_devs[i].elb_irq;
|
||||
@ -118,3 +162,28 @@ elb_print(void *aux, const char *pnp)
|
||||
|
||||
return (UNCONF);
|
||||
}
|
||||
|
||||
bus_space_tag_t
|
||||
elb_get_bus_space_tag(bus_addr_t addr)
|
||||
{
|
||||
|
||||
if ((addr & 0xff000000) == 0x74000000) {
|
||||
if (!elb_tag_init_done) {
|
||||
if (bus_space_init(&elb_tag, "elbtag",
|
||||
elb_ex_storage, sizeof(elb_ex_storage)))
|
||||
panic("elb_get_bus_space_tag: elb_tag");
|
||||
|
||||
elb_tag_init_done = 1;
|
||||
}
|
||||
return (&elb_tag);
|
||||
} else {
|
||||
if (!elbfb_tag_init_done) {
|
||||
if (bus_space_init(&elb_fb_tag, "elbfbtag",
|
||||
elbfb_ex_storage, sizeof(elbfb_ex_storage)))
|
||||
panic("elb_get_bus_space_tag: elb_fb_tag");
|
||||
|
||||
elbfb_tag_init_done = 1;
|
||||
}
|
||||
return (&elb_fb_tag);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: elbvar.h,v 1.1 2003/03/11 10:57:57 hannken Exp $ */
|
||||
/* $NetBSD: elbvar.h,v 1.2 2003/07/25 11:44:20 scw Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
@ -44,3 +44,5 @@ struct elb_attach_args {
|
||||
u_int elb_base2;
|
||||
int elb_irq;
|
||||
};
|
||||
|
||||
extern bus_space_tag_t elb_get_bus_space_tag(bus_addr_t);
|
||||
|
@ -1,20 +1,3 @@
|
||||
/* $NetBSD: bus.h,v 1.4 2003/03/16 07:07:19 matt Exp $ */
|
||||
|
||||
/*
|
||||
* This is a total hack to workaround the fact that we have
|
||||
* a needless proliferation of subtly incompatible bus_space(9)
|
||||
* implementations.
|
||||
*/
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_ppcarch.h"
|
||||
#endif
|
||||
|
||||
#ifdef PPC_IBM4XX
|
||||
#include <powerpc/ibm4xx/bus.h>
|
||||
#else
|
||||
#define PHYS_TO_BUS_MEM(t, addr) (addr) /* XXX */
|
||||
#define BUS_MEM_TO_PHYS(t, addr) (addr) /* XXX */
|
||||
/* $NetBSD: bus.h,v 1.5 2003/07/25 11:44:20 scw Exp $ */
|
||||
|
||||
#include <powerpc/bus.h>
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu.h,v 1.2 2003/03/04 07:50:59 matt Exp $ */
|
||||
/* $NetBSD: cpu.h,v 1.3 2003/07/25 11:44:20 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2002 Wasabi Systems, Inc.
|
||||
@ -45,6 +45,9 @@
|
||||
|
||||
#ifdef PPC_IBM4XX
|
||||
#include <powerpc/ibm4xx/cpu.h>
|
||||
#ifdef _KERNEL
|
||||
extern int fake_mapiodev;
|
||||
#endif
|
||||
#else
|
||||
#ifdef MULTIPROCESSOR
|
||||
#define CPU_MAXNUM 2
|
||||
|
@ -15,9 +15,6 @@
|
||||
|
||||
#define SIZE_FB (2*1024*1024)
|
||||
|
||||
#define MAKE_BUS_TAG(a) ibm4xx_make_bus_space_tag(0, \
|
||||
((a)&0xff000000) == 0x74000000 ? 1 : 0)
|
||||
|
||||
void consinit(void);
|
||||
|
||||
#endif /* _EVBPPC_EXPLORA_H_ */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: consinit.c,v 1.3 2003/07/15 01:37:37 lukem Exp $ */
|
||||
/* $NetBSD: consinit.c,v 1.4 2003/07/25 11:44:21 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998
|
||||
@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.3 2003/07/15 01:37:37 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.4 2003/07/25 11:44:21 scw Exp $");
|
||||
|
||||
#include "opt_kgdb.h"
|
||||
|
||||
@ -37,6 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.3 2003/07/15 01:37:37 lukem Exp $");
|
||||
#include <machine/bus.h>
|
||||
|
||||
#include <powerpc/ibm4xx/ibm405gp.h>
|
||||
#include <powerpc/ibm4xx/dev/opbvar.h>
|
||||
|
||||
#include "com.h"
|
||||
#if (NCOM > 0)
|
||||
@ -110,13 +111,13 @@ consinit(void)
|
||||
initted = 1;
|
||||
|
||||
#if (NCOM > 0)
|
||||
tag = ibm4xx_make_bus_space_tag(0, 0);
|
||||
/* We *know* the com-console attaches to opb */
|
||||
tag = opb_get_bus_space_tag();
|
||||
|
||||
if (comcnattach(tag, CONADDR, CONSPEED, COM_FREQ*6,
|
||||
COM_TYPE_NORMAL, comcnmode))
|
||||
panic("can't init serial console @%x", CONADDR);
|
||||
else
|
||||
return;
|
||||
#endif
|
||||
panic("console device missing -- serial console not in kernel");
|
||||
/* Of course, this is moot if there is no console... */
|
||||
@ -128,7 +129,7 @@ kgdb_port_init(void)
|
||||
{
|
||||
#if (NCOM > 0)
|
||||
if(!strcmp(kgdb_devname, "com")) {
|
||||
bus_space_tag_t tag = ibm4xx_make_bus_space_tag(0, 2);
|
||||
bus_space_tag_t tag = opb_get_bus_space_tag();
|
||||
com_kgdb_attach(tag, comkgdbaddr, comkgdbrate, COM_FREQ * 6,
|
||||
COM_TYPE_NORMAL, comkgdbmode);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ds1743.c,v 1.2 2003/07/15 01:37:38 lukem Exp $ */
|
||||
/* $NetBSD: ds1743.c,v 1.3 2003/07/25 11:44:21 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001-2002 Wasabi Sysetms, Inc.
|
||||
@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ds1743.c,v 1.2 2003/07/15 01:37:38 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ds1743.c,v 1.3 2003/07/25 11:44:21 scw Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -96,29 +96,29 @@ dsrtcmatch(struct device *parent, struct cfdata *cf, void *aux)
|
||||
if (strcmp(paa->pb_name, cf->cf_name) != 0)
|
||||
return 0;
|
||||
|
||||
if (bus_space_map(0, paa->pb_addr, DS_SIZE, 0, &h)) {
|
||||
if (bus_space_map(paa->pb_bt, paa->pb_addr, DS_SIZE, 0, &h)) {
|
||||
printf("%s: can't map i/o space\n", paa->pb_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Read one byte of what's supposed to be NVRAM */
|
||||
x = bus_space_read_1(0, h, DS_SCRATCH_ADDR);
|
||||
bus_space_write_1(0, h, DS_SCRATCH_ADDR, 0xAA);
|
||||
if (bus_space_read_1(0, h, DS_SCRATCH_ADDR) != 0xAA) {
|
||||
x = bus_space_read_1(paa->pb_bt, h, DS_SCRATCH_ADDR);
|
||||
bus_space_write_1(paa->pb_bt, h, DS_SCRATCH_ADDR, 0xAA);
|
||||
if (bus_space_read_1(paa->pb_bt, h, DS_SCRATCH_ADDR) != 0xAA) {
|
||||
retval = 0;
|
||||
goto done;
|
||||
}
|
||||
|
||||
bus_space_write_1(0, h, DS_SCRATCH_ADDR, 0x55);
|
||||
if (bus_space_read_1(0, h, DS_SCRATCH_ADDR) != 0x55) {
|
||||
bus_space_write_1(paa->pb_bt, h, DS_SCRATCH_ADDR, 0x55);
|
||||
if (bus_space_read_1(paa->pb_bt, h, DS_SCRATCH_ADDR) != 0x55) {
|
||||
retval = 0;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Restore scratch byte value */
|
||||
bus_space_write_1(0, h, DS_SCRATCH_ADDR, x);
|
||||
bus_space_write_1(paa->pb_bt, h, DS_SCRATCH_ADDR, x);
|
||||
done:
|
||||
bus_space_unmap(0, h, DS_SIZE);
|
||||
bus_space_unmap(paa->pb_bt, h, DS_SIZE);
|
||||
|
||||
return retval;
|
||||
}
|
||||
@ -138,8 +138,7 @@ dsrtcattach(struct device *parent, struct device *self, void *aux)
|
||||
|
||||
ds1743found = 1;
|
||||
|
||||
sc->sc_iot = 0;
|
||||
sc->sc_ioh = paa->pb_addr;
|
||||
sc->sc_iot = paa->pb_bt;
|
||||
if (bus_space_map(sc->sc_iot, paa->pb_addr, DS_SIZE, 0, &sc->sc_ioh)) {
|
||||
printf(": can't map i/o space\n");
|
||||
return;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pbus.c,v 1.4 2003/07/16 08:06:10 simonb Exp $ */
|
||||
/* $NetBSD: pbus.c,v 1.5 2003/07/25 11:44:21 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
@ -66,7 +66,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pbus.c,v 1.4 2003/07/16 08:06:10 simonb Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pbus.c,v 1.5 2003/07/25 11:44:21 scw Exp $");
|
||||
|
||||
#include "locators.h"
|
||||
#include "pckbc.h"
|
||||
@ -104,6 +104,13 @@ static int pbus_print(void *, const char *);
|
||||
CFATTACH_DECL(pbus, sizeof(struct device),
|
||||
pbus_match, pbus_attach, NULL, NULL);
|
||||
|
||||
static struct powerpc_bus_space pbus_tag = {
|
||||
_BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_MEM_TYPE,
|
||||
0x00000000,
|
||||
NVRAM_BASE,
|
||||
NVRAM_BASE + 0x0300010 /* Cover from NVRAM_BASE -> FPGA_BASE */
|
||||
};
|
||||
|
||||
/*
|
||||
* Probe for the peripheral bus.
|
||||
*/
|
||||
@ -142,17 +149,20 @@ pbus_attach(struct device *parent, struct device *self, void *aux)
|
||||
int i;
|
||||
#if NPCKBC > 0
|
||||
bus_space_handle_t ioh_fpga;
|
||||
bus_space_tag_t iot_fpga = paa->plb_bt;
|
||||
bus_space_tag_t iot_fpga = &pbus_tag;
|
||||
uint8_t fpga_reg;
|
||||
#endif
|
||||
|
||||
printf("\n");
|
||||
|
||||
if (bus_space_init(&pbus_tag, "pbus", NULL, 0))
|
||||
panic("pbus_attach: can't init tag");
|
||||
|
||||
for (i = 0; pbus_devs[i].name != NULL; i++) {
|
||||
pba.pb_name = pbus_devs[i].name;
|
||||
pba.pb_addr = pbus_devs[i].addr;
|
||||
pba.pb_irq = pbus_devs[i].irq;
|
||||
pba.pb_bt = paa->plb_bt;
|
||||
pba.pb_bt = &pbus_tag;
|
||||
pba.pb_dmat = paa->plb_dmat;
|
||||
|
||||
(void) config_found_sm(self, &pba, pbus_print, pbus_submatch);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.15 2003/07/16 01:00:33 simonb Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.16 2003/07/25 11:44:21 scw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001, 2002 Wasabi Systems, Inc.
|
||||
@ -67,7 +67,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.15 2003/07/16 01:00:33 simonb Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.16 2003/07/25 11:44:21 scw Exp $");
|
||||
|
||||
#include "opt_compat_netbsd.h"
|
||||
#include "opt_ddb.h"
|
||||
@ -331,7 +331,6 @@ initppc(u_int startkernel, u_int endkernel, char *args, void *info_block)
|
||||
if (boothowto & RB_KDB)
|
||||
ipkdb_connect(0);
|
||||
#endif
|
||||
fake_mapiodev = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -485,6 +484,12 @@ cpu_startup(void)
|
||||
if (board_info_set("processor-frequency", &board_data.processor_speed,
|
||||
sizeof(&board_data.processor_speed), PROP_CONST, 0))
|
||||
panic("setting processor-frequency");
|
||||
|
||||
/*
|
||||
* Now that we have VM, malloc()s are OK in bus_space.
|
||||
*/
|
||||
bus_space_mallocok();
|
||||
fake_mapiodev = 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user