Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x68k/dev Explicitly specify a proper FDC data regis...
details: https://anonhg.NetBSD.org/src/rev/cd6a22af5713
branches: trunk
changeset: 779234:cd6a22af5713
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sat May 12 15:29:22 2012 +0000
description:
Explicitly specify a proper FDC data register address for HD63450 DMAC
to avoid confusion.
Previous one (fdc->sc_addr + fddata) wasn't a right address for
the FDC's data register but one for the command register by accident,
but FDC ignores A0 address input (connected to A1 of x68k address bus)
during DMA xfer (i.e. when DACK is asserted) so it happened to work
as expected on the real X680x0 hardware, but caused trouble on emulators.
The inconsistency was found by Y.Sugahara during debugging XM6i emulator
(and it will be fixed in the next release).
FDC behavior during DMA is confirmed by uPD72068 hardware application note.
XXX: There is no proper MI API to specify DMA address for DMA controller
(like MC68450) to access devices mapped to memory space by bus_space(9).
diffstat:
sys/arch/x68k/dev/fd.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diffs (46 lines):
diff -r 3b29b4e78098 -r cd6a22af5713 sys/arch/x68k/dev/fd.c
--- a/sys/arch/x68k/dev/fd.c Sat May 12 15:17:15 2012 +0000
+++ b/sys/arch/x68k/dev/fd.c Sat May 12 15:29:22 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.97 2012/05/06 19:46:18 tsutsui Exp $ */
+/* $NetBSD: fd.c,v 1.98 2012/05/12 15:29:22 tsutsui Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.97 2012/05/06 19:46:18 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.98 2012/05/12 15:29:22 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_m68k_arch.h"
@@ -316,6 +316,18 @@
bus_dmamap_sync(fdc->sc_dmat, fdc->sc_dmamap, 0, count,
read?BUS_DMASYNC_PREREAD:BUS_DMASYNC_PREWRITE);
+ /*
+ * Note 1:
+ * uPD72065 ignores A0 input (connected to x68k bus A1)
+ * during DMA xfer access, but it's better to explicitly
+ * specify FDC data register address for clarification.
+ * Note 2:
+ * FDC is connected to LSB 8 bits of X68000 16 bit bus
+ * (as BUS_SPACE_MAP_SHIFTED_ODD defined in bus.h)
+ * so each FDC regsiter is mapped at sparse odd address.
+ *
+ * XXX: No proper API to get DMA address of FDC register for DMAC.
+ */
fdc->sc_xfer = dmac_prepare_xfer(fdc->sc_dmachan, fdc->sc_dmat,
fdc->sc_dmamap,
(read?
@@ -323,7 +335,7 @@
(DMAC_SCR_MAC_COUNT_UP|
DMAC_SCR_DAC_NO_COUNT),
(u_int8_t*) (fdc->sc_addr +
- fddata)); /* XXX */
+ fddata * 2 + 1));
fdc->sc_read = read;
dmac_start_xfer(fdc->sc_dmachan->ch_softc, fdc->sc_xfer);
Home |
Main Index |
Thread Index |
Old Index