summaryrefslogtreecommitdiff
path: root/sys/arch/sgi
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-04-05 21:45:52 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-04-05 21:45:52 +0000
commitec9c61131c40de44f175e55faa2689208371a093 (patch)
tree67ea7a301a9c5752f4f5ce3cb56f130347ec05ef /sys/arch/sgi
parent3e8899e9ae184d1808ca24e1856315f3f0bf1642 (diff)
DMA descriptors only need to be aligned on 8-byte boundaries, and the struct
layout is enough to enforce this. Don't request DMA page boundary alignment when allocating them.
Diffstat (limited to 'sys/arch/sgi')
-rw-r--r--sys/arch/sgi/hpc/hpc.c4
-rw-r--r--sys/arch/sgi/hpc/hpcvar.h109
-rw-r--r--sys/arch/sgi/hpc/if_sq.c11
3 files changed, 59 insertions, 65 deletions
diff --git a/sys/arch/sgi/hpc/hpc.c b/sys/arch/sgi/hpc/hpc.c
index 9656b8672a4..fd32060120c 100644
--- a/sys/arch/sgi/hpc/hpc.c
+++ b/sys/arch/sgi/hpc/hpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hpc.c,v 1.2 2012/04/03 21:17:35 miod Exp $ */
+/* $OpenBSD: hpc.c,v 1.3 2012/04/05 21:45:51 miod Exp $ */
/* $NetBSD: hpc.c,v 1.66 2011/07/01 18:53:46 dyoung Exp $ */
/* $NetBSD: ioc.c,v 1.9 2011/07/01 18:53:47 dyoung Exp $ */
@@ -312,7 +312,6 @@ static struct hpc_values hpc1_values = {
.enetr_fifo_size = HPC1_ENETR_FIFO_SIZE,
.enetx_fifo = HPC1_ENETX_FIFO,
.enetx_fifo_size = HPC1_ENETX_FIFO_SIZE,
- .enet_dma_boundary = 4096,
.enet_devregs = HPC1_ENET_DEVREGS,
.enet_devregs_size = HPC1_ENET_DEVREGS_SIZE,
.pbus_fifo = 0,
@@ -372,7 +371,6 @@ static struct hpc_values hpc3_values = {
.enetr_fifo_size = HPC3_ENETR_FIFO_SIZE,
.enetx_fifo = HPC3_ENETX_FIFO,
.enetx_fifo_size = HPC3_ENETX_FIFO_SIZE,
- .enet_dma_boundary = 8192,
.enet_devregs = HPC3_ENET_DEVREGS,
.enet_devregs_size = HPC3_ENET_DEVREGS_SIZE,
.pbus_fifo = HPC3_PBUS_FIFO,
diff --git a/sys/arch/sgi/hpc/hpcvar.h b/sys/arch/sgi/hpc/hpcvar.h
index c79f284ff87..488940404e7 100644
--- a/sys/arch/sgi/hpc/hpcvar.h
+++ b/sys/arch/sgi/hpc/hpcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hpcvar.h,v 1.1 2012/03/28 20:44:23 miod Exp $ */
+/* $OpenBSD: hpcvar.h,v 1.2 2012/04/05 21:45:51 miod Exp $ */
/* $NetBSD: hpcvar.h,v 1.12 2011/01/25 12:21:04 tsutsui Exp $ */
/*
@@ -36,61 +36,60 @@
struct hpc_values {
int revision;
- uint32_t scsi0_regs;
- uint32_t scsi0_regs_size;
- uint32_t scsi0_cbp;
- uint32_t scsi0_ndbp;
- uint32_t scsi0_bc;
- uint32_t scsi0_ctl;
- uint32_t scsi0_gio;
- uint32_t scsi0_dev;
- uint32_t scsi0_dmacfg;
- uint32_t scsi0_piocfg;
- uint32_t scsi1_regs;
- uint32_t scsi1_regs_size;
- uint32_t scsi1_cbp;
- uint32_t scsi1_ndbp;
- uint32_t scsi1_bc;
- uint32_t scsi1_ctl;
- uint32_t scsi1_gio;
- uint32_t scsi1_dev;
- uint32_t scsi1_dmacfg;
- uint32_t scsi1_piocfg;
- uint32_t enet_regs;
- uint32_t enet_regs_size;
- uint32_t enet_intdelay;
- uint32_t enet_intdelayval;
- uint32_t enetr_cbp;
- uint32_t enetr_ndbp;
- uint32_t enetr_bc;
- uint32_t enetr_ctl;
- uint32_t enetr_ctl_active;
- uint32_t enetr_reset;
- uint32_t enetr_dmacfg;
- uint32_t enetr_piocfg;
- uint32_t enetx_cbp;
- uint32_t enetx_ndbp;
- uint32_t enetx_bc;
- uint32_t enetx_ctl;
- uint32_t enetx_ctl_active;
- uint32_t enetx_dev;
- uint32_t enetr_fifo;
- uint32_t enetr_fifo_size;
- uint32_t enetx_fifo;
- uint32_t enetx_fifo_size;
- uint32_t enet_dma_boundary;
- uint32_t enet_devregs;
- uint32_t enet_devregs_size;
- uint32_t pbus_fifo;
- uint32_t pbus_fifo_size;
- uint32_t pbus_bbram;
+ uint32_t scsi0_regs;
+ uint32_t scsi0_regs_size;
+ uint32_t scsi0_cbp;
+ uint32_t scsi0_ndbp;
+ uint32_t scsi0_bc;
+ uint32_t scsi0_ctl;
+ uint32_t scsi0_gio;
+ uint32_t scsi0_dev;
+ uint32_t scsi0_dmacfg;
+ uint32_t scsi0_piocfg;
+ uint32_t scsi1_regs;
+ uint32_t scsi1_regs_size;
+ uint32_t scsi1_cbp;
+ uint32_t scsi1_ndbp;
+ uint32_t scsi1_bc;
+ uint32_t scsi1_ctl;
+ uint32_t scsi1_gio;
+ uint32_t scsi1_dev;
+ uint32_t scsi1_dmacfg;
+ uint32_t scsi1_piocfg;
+ uint32_t enet_regs;
+ uint32_t enet_regs_size;
+ uint32_t enet_intdelay;
+ uint32_t enet_intdelayval;
+ uint32_t enetr_cbp;
+ uint32_t enetr_ndbp;
+ uint32_t enetr_bc;
+ uint32_t enetr_ctl;
+ uint32_t enetr_ctl_active;
+ uint32_t enetr_reset;
+ uint32_t enetr_dmacfg;
+ uint32_t enetr_piocfg;
+ uint32_t enetx_cbp;
+ uint32_t enetx_ndbp;
+ uint32_t enetx_bc;
+ uint32_t enetx_ctl;
+ uint32_t enetx_ctl_active;
+ uint32_t enetx_dev;
+ uint32_t enetr_fifo;
+ uint32_t enetr_fifo_size;
+ uint32_t enetx_fifo;
+ uint32_t enetx_fifo_size;
+ uint32_t enet_devregs;
+ uint32_t enet_devregs_size;
+ uint32_t pbus_fifo;
+ uint32_t pbus_fifo_size;
+ uint32_t pbus_bbram;
uint32_t scsi_dma_segs;
- uint32_t scsi_dma_segs_size;
- uint32_t scsi_dma_datain_cmd;
- uint32_t scsi_dma_dataout_cmd;
- uint32_t scsi_dmactl_flush;
- uint32_t scsi_dmactl_active;
- uint32_t scsi_dmactl_reset;
+ uint32_t scsi_dma_segs_size;
+ uint32_t scsi_dma_datain_cmd;
+ uint32_t scsi_dma_dataout_cmd;
+ uint32_t scsi_dmactl_flush;
+ uint32_t scsi_dmactl_active;
+ uint32_t scsi_dmactl_reset;
};
struct hpc_attach_args {
diff --git a/sys/arch/sgi/hpc/if_sq.c b/sys/arch/sgi/hpc/if_sq.c
index 44521062c38..5a5e02d1d2b 100644
--- a/sys/arch/sgi/hpc/if_sq.c
+++ b/sys/arch/sgi/hpc/if_sq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sq.c,v 1.1 2012/03/28 20:44:23 miod Exp $ */
+/* $OpenBSD: if_sq.c,v 1.2 2012/04/05 21:45:51 miod Exp $ */
/* $NetBSD: if_sq.c,v 1.42 2011/07/01 18:53:47 dyoung Exp $ */
/*
@@ -199,7 +199,7 @@ sq_attach(struct device *parent, struct device *self, void *aux)
if ((rc = bus_space_subregion(haa->ha_st, haa->ha_sh,
haa->ha_dmaoff, sc->hpc_regs->enet_regs_size,
&sc->sc_hpch)) != 0) {
- printf(": can't HPC DMA registers, error = %d\n", rc);
+ printf(": can't map HPC DMA registers, error = %d\n", rc);
goto fail_0;
}
@@ -214,9 +214,7 @@ sq_attach(struct device *parent, struct device *self, void *aux)
sc->sc_dmat = haa->ha_dmat;
if ((rc = bus_dmamem_alloc(sc->sc_dmat, sizeof(struct sq_control),
- sc->hpc_regs->enet_dma_boundary,
- sc->hpc_regs->enet_dma_boundary, &sc->sc_cdseg, 1,
- &sc->sc_ncdseg, BUS_DMA_NOWAIT)) != 0) {
+ 0, 0, &sc->sc_cdseg, 1, &sc->sc_ncdseg, BUS_DMA_NOWAIT)) != 0) {
printf(": unable to allocate control data, error = %d\n", rc);
goto fail_0;
}
@@ -230,8 +228,7 @@ sq_attach(struct device *parent, struct device *self, void *aux)
if ((rc = bus_dmamap_create(sc->sc_dmat,
sizeof(struct sq_control), 1, sizeof(struct sq_control),
- sc->hpc_regs->enet_dma_boundary, BUS_DMA_NOWAIT,
- &sc->sc_cdmap)) != 0) {
+ 0, BUS_DMA_NOWAIT, &sc->sc_cdmap)) != 0) {
printf(": unable to create DMA map for control data, error "
"= %d\n", rc);
goto fail_2;