Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys/arch/x68k Pull up following revision(s) (requested by...
details: https://anonhg.NetBSD.org/src/rev/853d19fb751b
branches: netbsd-6
changeset: 774083:853d19fb751b
user: riz <riz%NetBSD.org@localhost>
date: Wed May 09 20:01:51 2012 +0000
description:
Pull up following revision(s) (requested by tsutsui in ticket #236):
sys/arch/x68k/x68k/machdep.c: revision 1.182
sys/arch/x68k/dev/fd.c: revision 1.97
Make x68k's floppy driver actually work with proper bounce buffer xfer ops
on machines with extended high memories:
- dev/fd.c:
- add missing bus_dmamap_sync(9) POSTREAD/POSTWRITE ops
- x68k/machdep.c:
- update avail_end variable (which is used to check DMA'able memory range
in intio.c) properly per probed extended memory regions
The problem was found during debugging XM6i's FDC emulation by
Y.Sugahara, isaki@, and me.
Should be pulled up to netbsd-6.
diffstat:
sys/arch/x68k/dev/fd.c | 10 ++++++++--
sys/arch/x68k/x68k/machdep.c | 19 +++++++++++++++----
2 files changed, 23 insertions(+), 6 deletions(-)
diffs (108 lines):
diff -r 7d00665cf8c5 -r 853d19fb751b sys/arch/x68k/dev/fd.c
--- a/sys/arch/x68k/dev/fd.c Wed May 09 19:58:27 2012 +0000
+++ b/sys/arch/x68k/dev/fd.c Wed May 09 20:01:51 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.96 2012/02/02 19:43:01 tls Exp $ */
+/* $NetBSD: fd.c,v 1.96.2.1 2012/05/09 20:01:51 riz Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.96 2012/02/02 19:43:01 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.96.2.1 2012/05/09 20:01:51 riz Exp $");
#include "opt_ddb.h"
#include "opt_m68k_arch.h"
@@ -148,6 +148,7 @@
u_int8_t *sc_addr; /* physical address */
struct dmac_channel_stat *sc_dmachan; /* intio DMA channel */
struct dmac_dma_xfer *sc_xfer; /* DMA transfer */
+ int sc_read;
struct fd_softc *sc_fd[4]; /* pointers to children */
TAILQ_HEAD(drivehead, fd_softc) sc_drives;
@@ -324,6 +325,7 @@
(u_int8_t*) (fdc->sc_addr +
fddata)); /* XXX */
+ fdc->sc_read = read;
dmac_start_xfer(fdc->sc_dmachan->ch_softc, fdc->sc_xfer);
}
@@ -332,6 +334,10 @@
{
struct fdc_softc *fdc = arg;
+ bus_dmamap_sync(fdc->sc_dmat, fdc->sc_dmamap,
+ 0, fdc->sc_dmamap->dm_mapsize,
+ fdc->sc_read ?
+ BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(fdc->sc_dmat, fdc->sc_dmamap);
return 0;
diff -r 7d00665cf8c5 -r 853d19fb751b sys/arch/x68k/x68k/machdep.c
--- a/sys/arch/x68k/x68k/machdep.c Wed May 09 19:58:27 2012 +0000
+++ b/sys/arch/x68k/x68k/machdep.c Wed May 09 20:01:51 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.181 2012/01/29 12:43:00 isaki Exp $ */
+/* $NetBSD: machdep.c,v 1.181.2.1 2012/05/09 20:01:51 riz Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.181 2012/01/29 12:43:00 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.181.2.1 2012/05/09 20:01:51 riz Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -174,6 +174,7 @@
x68k_init(void)
{
u_int i;
+ paddr_t msgbuf_pa;
/*
* Tell the VM system about available physical memory.
@@ -181,17 +182,25 @@
uvm_page_physload(atop(avail_start), atop(avail_end),
atop(avail_start), atop(avail_end),
VM_FREELIST_MAINMEM);
+
+ /*
+ * avail_end was pre-decremented in pmap_bootstrap to compensate
+ * for msgbuf pages, but avail_end is also used to check DMA'able
+ * memory range for intio devices and it would be updated per
+ * probed extended memories, so explicitly save msgbuf address here.
+ */
+ msgbuf_pa = avail_end;
+
#ifdef EXTENDED_MEMORY
setmemrange();
#endif
/*
* Initialize error message buffer (at end of core).
- * avail_end was pre-decremented in pmap_bootstrap to compensate.
*/
for (i = 0; i < btoc(MSGBUFSIZE); i++)
pmap_kenter_pa((vaddr_t)msgbufaddr + i * PAGE_SIZE,
- avail_end + i * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, 0);
+ msgbuf_pa + i * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, 0);
pmap_update(pmap_kernel());
initmsgbuf(msgbufaddr, m68k_round_page(MSGBUFSIZE));
}
@@ -1146,6 +1155,8 @@
atop(mlist[i].base), atop(h),
VM_FREELIST_HIGHMEM);
mem_size += h - (u_long) mlist[i].base;
+ if (avail_end < h)
+ avail_end = h;
}
}
Home |
Main Index |
Thread Index |
Old Index