From 1bcd9d3bbb8ca4cb82d255b76f68bada8f72afa4 Mon Sep 17 00:00:00 2001 From: pk Date: Sat, 19 Sep 1998 15:47:18 +0000 Subject: [PATCH] Pass the children register space in the attach arguments. --- sys/arch/sparc/sparc/iommu.c | 10 +++++++++- sys/arch/sparc/sparc/iommuvar.h | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/sys/arch/sparc/sparc/iommu.c b/sys/arch/sparc/sparc/iommu.c index aa8c898f5f08..8fd82953fe7d 100644 --- a/sys/arch/sparc/sparc/iommu.c +++ b/sys/arch/sparc/sparc/iommu.c @@ -1,4 +1,4 @@ -/* $NetBSD: iommu.c,v 1.26 1998/09/10 21:08:39 pk Exp $ */ +/* $NetBSD: iommu.c,v 1.27 1998/09/19 15:47:19 pk Exp $ */ /* * Copyright (c) 1996 @@ -329,9 +329,17 @@ iommu_attach(parent, self, aux) /* Propagate BUS & DMA tags */ ia.iom_bustag = ma->ma_bustag; ia.iom_dmatag = &iommu_dma_tag; + ia.iom_node = node; ia.iom_bp = bp; + + ia.iom_reg = NULL; + getprop(node, "reg", sizeof(struct sbus_reg), + &ia.iom_nreg, (void **)&ia.iom_reg); + (void) config_found(&sc->sc_dev, (void *)&ia, iommu_print); + if (ia.iom_reg != NULL) + free(ia.iom_reg, M_DEVBUF); } #endif } diff --git a/sys/arch/sparc/sparc/iommuvar.h b/sys/arch/sparc/sparc/iommuvar.h index 3db049e8721f..21309f831413 100644 --- a/sys/arch/sparc/sparc/iommuvar.h +++ b/sys/arch/sparc/sparc/iommuvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: iommuvar.h,v 1.3 1998/08/21 13:29:57 pk Exp $ */ +/* $NetBSD: iommuvar.h,v 1.4 1998/09/19 15:47:18 pk Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -39,11 +39,19 @@ #ifndef _IOMMU_VAR_H #define _IOMMU_VAR_H +struct iommu_reg { + u_int32_t ior_iospace; + u_int32_t ior_pa; + u_int32_t ior_size; +}; + struct iommu_attach_args { bus_space_tag_t iom_bustag; bus_dma_tag_t iom_dmatag; char *iom_name; /* PROM node name */ int iom_node; /* PROM handle */ + struct iommu_reg *iom_reg; + int iom_nreg; struct bootpath *iom_bp; /* used for locating boot device */ };