summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/wgrisc/dev/dma.h20
-rw-r--r--sys/arch/wgrisc/include/bus.h9
-rw-r--r--sys/arch/wgrisc/wgrisc/machdep.c7
-rw-r--r--sys/arch/wgrisc/wgrisc/mem.c6
4 files changed, 33 insertions, 9 deletions
diff --git a/sys/arch/wgrisc/dev/dma.h b/sys/arch/wgrisc/dev/dma.h
index dd5fb4c51b2..3011b068c8e 100644
--- a/sys/arch/wgrisc/dev/dma.h
+++ b/sys/arch/wgrisc/dev/dma.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dma.h,v 1.1 1997/02/06 16:02:42 pefo Exp $ */
+/* $OpenBSD: dma.h,v 1.2 1997/02/16 22:31:22 pefo Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -124,6 +124,10 @@ typedef struct dma_softc {
xcmd = ~(0x30 << 6); \
} \
dcmd |= (1 << 26); \
+ /* Switch direction before enable */ \
+ out32(R3715_IO_TIMING, (in32(R3715_IO_TIMING) & xcmd) | \
+ (dcmd & ~0x410)); \
+ (void)in16(RISC_STATUS); \
out32(R3715_IO_TIMING, (in32(R3715_IO_TIMING) & xcmd) | dcmd);\
}
#endif
@@ -132,9 +136,17 @@ typedef struct dma_softc {
#define DMA_DRAIN(r)
#define DMA_END(c) \
{ \
- int dcmd; \
- dcmd = ((c)->dma_ch == DMA_CH0) ? 0x10 : 0x10000; \
- out32(R3715_IO_TIMING, in32(R3715_IO_TIMING) & ~dcmd); \
+ int resudial; \
+ if((c)->dma_ch == DMA_CH0) { \
+ out32(R3715_IO_TIMING, in32(R3715_IO_TIMING) & ~0x10); \
+ resudial = in32(R3715_DMA_CNT0); \
+if(resudial) \
+printf("res: %d\n", resudial); \
+ } \
+ else { \
+ out32(R3715_IO_TIMING, in32(R3715_IO_TIMING) & ~0x400); \
+ resudial = in32(R3715_DMA_CNT1); \
+ } \
if((c)->mode == DMA_FROM_DEV) { \
int *_v = (int *)(c)->req_va; \
int *_p = (int *)PHYS_TO_UNCACHED(CACHED_TO_PHYS(dma_buffer)); \
diff --git a/sys/arch/wgrisc/include/bus.h b/sys/arch/wgrisc/include/bus.h
index eb63712fc4f..64f484f3af9 100644
--- a/sys/arch/wgrisc/include/bus.h
+++ b/sys/arch/wgrisc/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.1 1997/02/06 16:02:44 pefo Exp $ */
+/* $OpenBSD: bus.h,v 1.2 1997/02/16 22:31:25 pefo Exp $ */
/*
* Copyright (c) 1996 Niklas Hallqvist. All rights reserved.
@@ -64,6 +64,8 @@ CAT(bus_space_read_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
wbflush(); \
wbflush(); \
wbflush(); \
+ wbflush(); \
+ wbflush(); \
return *(volatile CAT3(u_int,m,_t) *)(bsh + ba); \
}
@@ -94,10 +96,13 @@ CAT(bus_space_write_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
bus_addr_t ba, CAT3(u_int,m,_t) x) \
{ \
wbflush(); \
- *(volatile CAT3(u_int,m,_t) *)(bsh + ba) = x; \
wbflush(); \
wbflush(); \
wbflush(); \
+ wbflush(); \
+ wbflush(); \
+ wbflush(); \
+ *(volatile CAT3(u_int,m,_t) *)(bsh + ba) = x; \
}
bus_space_write(1,8)
diff --git a/sys/arch/wgrisc/wgrisc/machdep.c b/sys/arch/wgrisc/wgrisc/machdep.c
index 427b4d950a4..a0ab1bdcbd5 100644
--- a/sys/arch/wgrisc/wgrisc/machdep.c
+++ b/sys/arch/wgrisc/wgrisc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.1 1997/02/06 16:02:46 pefo Exp $ */
+/* $OpenBSD: machdep.c,v 1.2 1997/02/16 22:31:26 pefo Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1992, 1993
@@ -38,7 +38,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 8.3 (Berkeley) 1/12/94
- * $Id: machdep.c,v 1.1 1997/02/06 16:02:46 pefo Exp $
+ * $Id: machdep.c,v 1.2 1997/02/16 22:31:26 pefo Exp $
*/
/* from: Utah Hdr: machdep.c 1.63 91/04/24 */
@@ -177,6 +177,9 @@ mips_init(argc, argv, code)
mem_layout[1].mem_size = 0x400000 - (int)(CACHED_TO_PHYS(sysend));
physmem = 4096 * 1024;
+ mem_layout[2].mem_start = 0x400000;
+ mem_layout[2].mem_size = 0x800000;
+ physmem += 8192 * 1024;
switch (cputype) {
case WGRISC9100:
diff --git a/sys/arch/wgrisc/wgrisc/mem.c b/sys/arch/wgrisc/wgrisc/mem.c
index b898f9546ac..557bf234431 100644
--- a/sys/arch/wgrisc/wgrisc/mem.c
+++ b/sys/arch/wgrisc/wgrisc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.1 1997/02/06 16:02:46 pefo Exp $ */
+/* $OpenBSD: mem.c,v 1.2 1997/02/16 22:31:28 pefo Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -135,6 +135,10 @@ mmrw(dev, uio, flags)
uio->uio_resid = 0;
return (0);
+ case 3:
+ mdbpanic();
+ return(0);
+
/* minor device 12 (/dev/zero) is source of nulls on read, rathole on write */
case 12:
if (uio->uio_rw == UIO_WRITE) {