Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amiga Allow 32-bit transfers for drives which suppo...
details: https://anonhg.NetBSD.org/src/rev/2332090fb3a6
branches: trunk
changeset: 770693:2332090fb3a6
user: rkujawa <rkujawa%NetBSD.org@localhost>
date: Sat Oct 29 19:25:19 2011 +0000
description:
Allow 32-bit transfers for drives which support it. Add missing bus_space methods needed for such transfers.
diffstat:
sys/arch/amiga/amiga/amiga_bus_simple_4.c | 56 +++++++++++++++++++++++++++++-
sys/arch/amiga/dev/efa.c | 18 ++++----
2 files changed, 62 insertions(+), 12 deletions(-)
diffs (149 lines):
diff -r c9f789c208d2 -r 2332090fb3a6 sys/arch/amiga/amiga/amiga_bus_simple_4.c
--- a/sys/arch/amiga/amiga/amiga_bus_simple_4.c Sat Oct 29 18:56:49 2011 +0000
+++ b/sys/arch/amiga/amiga/amiga_bus_simple_4.c Sat Oct 29 19:25:19 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amiga_bus_simple_4.c,v 1.8 2011/09/16 10:23:01 rkujawa Exp $ */
+/* $NetBSD: amiga_bus_simple_4.c,v 1.9 2011/10/29 19:25:19 rkujawa Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,10 +30,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: amiga_bus_simple_4.c,v 1.8 2011/09/16 10:23:01 rkujawa Exp $");
+__KERNEL_RCSID(1, "$NetBSD: amiga_bus_simple_4.c,v 1.9 2011/10/29 19:25:19 rkujawa Exp $");
#define AMIGA_SIMPLE_BUS_STRIDE 4 /* 1 byte per long */
#define AMIGA_SIMPLE_BUS_WORD_METHODS
+#define AMIGA_SIMPLE_BUS_LONGWORD_METHODS
#include "simple_busfuncs.c"
@@ -46,6 +47,8 @@
bsrm(oabs(bsrm2_swap_), u_int16_t);
bswm(oabs(bswm2_swap_), u_int16_t);
+bsrm(oabs(bsrm4_swap_), u_int32_t);
+bswm(oabs(bswm4_swap_), u_int32_t);
void
oabs(bsrm2_swap_)(bus_space_handle_t handle, bus_size_t offset,
@@ -78,6 +81,37 @@
}
}
+void
+oabs(bsrm4_swap_)(bus_space_handle_t handle, bus_size_t offset,
+ u_int32_t *pointer, bus_size_t count)
+{
+ volatile u_int32_t *p;
+
+ p = (volatile u_int32_t *)(handle + offset * AMIGA_SIMPLE_BUS_STRIDE);
+
+ while (count > 0) {
+ *pointer++ = bswap32(*p);
+ amiga_bus_reorder_protect();
+ --count;
+ }
+}
+
+void
+oabs(bswm4_swap_)(bus_space_handle_t handle, bus_size_t offset,
+ const u_int32_t *pointer, bus_size_t count)
+{
+ volatile u_int32_t *p;
+
+ p = (volatile u_int32_t *)(handle + offset * AMIGA_SIMPLE_BUS_STRIDE);
+
+ while (count > 0) {
+ *p = bswap32(*pointer);
+ amiga_bus_reorder_protect();
+ ++pointer;
+ --count;
+ }
+}
+
const struct amiga_bus_space_methods amiga_bus_stride_4swap = {
.bsm = oabs(bsm_),
@@ -108,5 +142,21 @@
.bsrrs2 = oabs(bsrr2_),
.bswrs2 = oabs(bswr2_),
.bssr2 = oabs(bssr2_), /* XXX swap? */
- .bscr2 = oabs(bscr2_) /* XXX swap? */
+ .bscr2 = oabs(bscr2_), /* XXX swap? */
+
+ .bsr4 = oabs(bsr4_), /* XXX swap? */
+ .bsw4 = oabs(bsw4_), /* XXX swap? */
+ .bsrs4 = oabs(bsr4_),
+ .bsws4 = oabs(bsw4_),
+ .bsrm4 = oabs(bsrm4_swap_),
+ .bswm4 = oabs(bswm4_swap_),
+ .bsrms4 = oabs(bsrm4_),
+ .bswms4 = oabs(bswm4_),
+ .bsrr4 = oabs(bsrr4_), /* XXX swap? */
+ .bswr4 = oabs(bswr4_), /* XXX swap? */
+ .bsrrs4 = oabs(bsrr4_),
+ .bswrs4 = oabs(bswr4_),
+ .bssr4 = oabs(bssr4_), /* XXX swap? */
+ .bscr4 = oabs(bscr4_) /* XXX swap? */
};
+
diff -r c9f789c208d2 -r 2332090fb3a6 sys/arch/amiga/dev/efa.c
--- a/sys/arch/amiga/dev/efa.c Sat Oct 29 18:56:49 2011 +0000
+++ b/sys/arch/amiga/dev/efa.c Sat Oct 29 19:25:19 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efa.c,v 1.2 2011/10/29 11:16:19 rkujawa Exp $ */
+/* $NetBSD: efa.c,v 1.3 2011/10/29 19:25:19 rkujawa Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
#include <amiga/dev/efareg.h>
#include <amiga/dev/efavar.h>
-/* #define EFA_32BIT_IO 1 */
+#define EFA_32BIT_IO 1
/* #define EFA_NO_INTR 1 */
/* #define EFA_DEBUG 1 */
@@ -154,11 +154,11 @@
sc->sc_wdcdev.sc_atac.atac_set_modes = efa_setup_channel;
sc->sc_wdcdev.sc_atac.atac_dev = self;
sc->sc_wdcdev.sc_atac.atac_channels = sc->sc_chanlist;
+ sc->sc_wdcdev.sc_atac.atac_cap = ATAC_CAP_DATA16;
if (sc->sc_32bit_io)
- sc->sc_wdcdev.sc_atac.atac_cap = ATAC_CAP_DATA32;
- else
- sc->sc_wdcdev.sc_atac.atac_cap = ATAC_CAP_DATA16;
+ sc->sc_wdcdev.sc_atac.atac_cap |= ATAC_CAP_DATA32;
+
/*
* The following should work for polling mode, but it does not.
* if (sc->sc_no_intr)
@@ -324,6 +324,7 @@
for (i = 0; i < FATA1_CHANNELS; i++) {
for (j = 0; j < PIO_COUNT; j++) {
sc->sc_ports[i].wdr[j].cmd_iot = &fata_cmd_iot;
+ sc->sc_ports[i].wdr[j].data32iot = &fata_cmd_iot;
sc->sc_ports[i].wdr[j].ctl_iot = &gayle_cmd_iot;
}
}
@@ -454,12 +455,11 @@
{
if (data32)
bus_space_subregion(wdr_fata->cmd_iot, wdr_fata->cmd_baseioh,
- FATA1_PION_OFF_DATA32, 8, &wdr_fata->cmd_iohs[wd_data]);
- else
- bus_space_subregion(wdr_fata->cmd_iot, wdr_fata->cmd_baseioh,
- FATA1_PION_OFF_DATA, 4, &wdr_fata->cmd_iohs[wd_data]);
+ FATA1_PION_OFF_DATA32, 8, &wdr_fata->data32ioh);
bus_space_subregion(wdr_fata->cmd_iot, wdr_fata->cmd_baseioh,
+ FATA1_PION_OFF_DATA, 4, &wdr_fata->cmd_iohs[wd_data]);
+ bus_space_subregion(wdr_fata->cmd_iot, wdr_fata->cmd_baseioh,
FATA1_PION_OFF_ERROR, 1, &wdr_fata->cmd_iohs[wd_error]);
bus_space_subregion(wdr_fata->cmd_iot, wdr_fata->cmd_baseioh,
FATA1_PION_OFF_SECCNT, 1, &wdr_fata->cmd_iohs[wd_seccnt]);
Home |
Main Index |
Thread Index |
Old Index