Some changes for WG testing.
authorpefo <pefo@openbsd.org>
Sun, 16 Feb 1997 22:31:22 +0000 (22:31 +0000)
committerpefo <pefo@openbsd.org>
Sun, 16 Feb 1997 22:31:22 +0000 (22:31 +0000)
sys/arch/wgrisc/dev/dma.h
sys/arch/wgrisc/include/bus.h
sys/arch/wgrisc/wgrisc/machdep.c
sys/arch/wgrisc/wgrisc/mem.c

index beb49e3..3011b06 100644 (file)
@@ -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)); \
index b990c5e..64f484f 100644 (file)
@@ -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)
index 8fd0d5a..a0ab1bd 100644 (file)
@@ -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:
index 7c529aa..557bf23 100644 (file)
@@ -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) {