diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-06-28 20:07:52 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-06-28 20:07:52 +0000 |
commit | 1092c4187cc53c2efabcaf0acafa6029ce127f4b (patch) | |
tree | 603054c8a2fc9710d04d921292f6978eeac88a17 /sys/arch/sparc64/dev | |
parent | bd022abf0dad0f40dcf3536245c79ac14f6f291d (diff) |
look at "virtual-dma" property to decide where the iommu address space
is, instead of having iommu_init() decide
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r-- | sys/arch/sparc64/dev/schizo.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/sys/arch/sparc64/dev/schizo.c b/sys/arch/sparc64/dev/schizo.c index 6ea66c9ddf1..34671b78643 100644 --- a/sys/arch/sparc64/dev/schizo.c +++ b/sys/arch/sparc64/dev/schizo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: schizo.c,v 1.29 2006/06/28 20:06:32 deraadt Exp $ */ +/* $OpenBSD: schizo.c,v 1.30 2006/06/28 20:07:51 deraadt Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -311,6 +311,8 @@ void schizo_init_iommu(struct schizo_softc *sc, struct schizo_pbm *pbm) { struct iommu_state *is = &pbm->sp_is; + int *vdma = NULL, nitem, tsbsize; + u_int32_t iobase = -1; vaddr_t va; char *name; @@ -349,7 +351,31 @@ schizo_init_iommu(struct schizo_softc *sc, struct schizo_pbm *pbm) panic("couldn't malloc iommu name"); snprintf(name, 32, "%s dvma", sc->sc_dv.dv_xname); - iommu_init(name, is, 128 * 1024, -1); + /* + * Separate the men from the boys. If the `virtual-dma' + * property exists, use it. + */ + if (!getprop(sc->sc_node, "virtual-dma", sizeof(vdma), &nitem, + (void **)&vdma)) { + /* Damn. Gotta use these values. */ + iobase = vdma[0]; +#define TSBCASE(x) case 1 << ((x) + 23): tsbsize = (x); break + switch (vdma[1]) { + TSBCASE(1); TSBCASE(2); TSBCASE(3); + TSBCASE(4); TSBCASE(5); TSBCASE(6); + default: + printf("bogus tsb size %x, using 7\n", vdma[1]); + TSBCASE(7); + } +#undef TSBCASE + DPRINTF(SDB_BUSMAP, ("schizo_iommu_init: iobase=0x%x\n", iobase)); + free(vdma, M_DEVBUF); + } else { + DPRINTF(SDB_BUSMAP, ("schizo_iommu_init: getprop failed, " + "iobase=0x%x\n", iobase)); + } + + iommu_init(name, is, tsbsize, iobase); iommu_reset(is); } |