From: pefo Date: Sun, 16 Feb 1997 22:31:22 +0000 (+0000) Subject: Some changes for WG testing. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4c06997893b8673dd17dcb4c05d31ad510f83876;p=openbsd Some changes for WG testing. --- diff --git a/sys/arch/wgrisc/dev/dma.h b/sys/arch/wgrisc/dev/dma.h index beb49e3beb0..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.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 b990c5e3e03..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.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. @@ -61,6 +61,8 @@ static __inline CAT3(u_int,m,_t) \ CAT(bus_space_read_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ bus_addr_t ba) \ { \ + wbflush(); \ + wbflush(); \ wbflush(); \ wbflush(); \ wbflush(); \ @@ -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 8fd0d5a1844..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.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.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 7c529aa6e2a..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.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) {