Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/luna68k - Make SCSI work; by kludges of machine/bus...



details:   https://anonhg.NetBSD.org/src/rev/030813990655
branches:  trunk
changeset: 480230:030813990655
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Fri Jan 07 05:13:08 2000 +0000

description:
- Make SCSI work; by kludges of machine/bus.h. TEAC streamer tape drive
found to be tweaked.  Need extensive verifications.
- Add wsmouse node under ws; not useful this moment.

diffstat:

 sys/arch/luna68k/dev/lcd.c         |  12 +++++-----
 sys/arch/luna68k/dev/lunaws.c      |  45 ++++++++++++++++++++++++++++++++-----
 sys/arch/luna68k/dev/siotty.c      |  14 +++++-----
 sys/arch/luna68k/include/bus.h     |  27 +++++----------------
 sys/arch/luna68k/luna68k/mainbus.c |   9 +++----
 5 files changed, 63 insertions(+), 44 deletions(-)

diffs (271 lines):

diff -r dbf58758082c -r 030813990655 sys/arch/luna68k/dev/lcd.c
--- a/sys/arch/luna68k/dev/lcd.c        Fri Jan 07 05:11:43 2000 +0000
+++ b/sys/arch/luna68k/dev/lcd.c        Fri Jan 07 05:13:08 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lcd.c,v 1.1 2000/01/05 08:48:55 nisimura Exp $ */
+/* $NetBSD: lcd.c,v 1.2 2000/01/07 05:13:08 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>         /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lcd.c,v 1.1 2000/01/05 08:48:55 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lcd.c,v 1.2 2000/01/07 05:13:08 nisimura Exp $");
 
 /*
  * XXX
@@ -71,10 +71,10 @@
 #define LCD_LOCATE(X, Y)       (((Y) & 1 ? 0xc0 : 0x80) | ((X) & 0x0f))
 
 struct pio {
-       u_int8_t portA;
-       u_int8_t portB;
-       u_int8_t portC;
-       u_int8_t cntrl;
+       volatile u_int8_t portA;
+       volatile u_int8_t portB;
+       volatile u_int8_t portC;
+       volatile u_int8_t cntrl;
 };
 
 void lcdbusywait __P((void));
diff -r dbf58758082c -r 030813990655 sys/arch/luna68k/dev/lunaws.c
--- a/sys/arch/luna68k/dev/lunaws.c     Fri Jan 07 05:11:43 2000 +0000
+++ b/sys/arch/luna68k/dev/lunaws.c     Fri Jan 07 05:13:08 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lunaws.c,v 1.1 2000/01/05 08:48:56 nisimura Exp $ */
+/* $NetBSD: lunaws.c,v 1.2 2000/01/07 05:13:08 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.1 2000/01/05 08:48:56 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.2 2000/01/07 05:13:08 nisimura Exp $");
 
 #include "wsmouse.h"
 
@@ -115,6 +115,10 @@
 
 static int  wsmatch __P((struct device *, struct cfdata *, void *));
 static void wsattach __P((struct device *, struct device *, void *));
+static int  ws_submatch_kbd __P((struct device *, struct cfdata *, void *));
+#if NWSMOUSE > 0
+static int  ws_submatch_mouse __P((struct device *, struct cfdata *, void *));
+#endif
 
 const struct cfattach ws_ca = {
        sizeof(struct ws_softc), wsmatch, wsattach
@@ -167,18 +171,48 @@
        a.keymap = &omkbd_keymapdata;
        a.accessops = &omkbd_accessops;
        a.accesscookie = (void *)sc;
-       sc->sc_wskbddev = config_found(self, &a, wskbddevprint);
+       sc->sc_wskbddev = config_found_sm(self, &a, wskbddevprint,
+                                       ws_submatch_kbd);
 
 #if NWSMOUSE > 0
        {
        struct wsmousedev_attach_args b;
        b.accessops = &omms_accessops;
        b.accesscookie = (void *)sc;    
-       sc->sc_wsmousedev = config_found(self, &b, wsmousedevprint);
+       sc->sc_wsmousedev = config_found_sm(self, &b, wsmousedevprint,
+                                       ws_submatch_mouse);
        }
 #endif
 }
 
+static int
+ws_submatch_kbd(parent, cf, aux)
+        struct device *parent;
+        struct cfdata *cf;
+        void *aux;
+{
+
+        if (strcmp(cf->cf_driver->cd_name, "wskbd"))
+                return (0);
+        return ((*cf->cf_attach->ca_match)(parent, cf, aux));
+}
+
+#if NWSMOUSE > 0
+
+static int
+ws_submatch_mouse(parent, cf, aux)
+        struct device *parent;
+        struct cfdata *cf;
+        void *aux;
+{
+
+        if (strcmp(cf->cf_driver->cd_name, "wsmouse"))
+                return (0);
+        return ((*cf->cf_attach->ca_match)(parent, cf, aux));
+}
+
+#endif
+
 /*ARGSUSED*/
 static void
 wsintr(chan)
@@ -188,7 +222,6 @@
        struct sioreg *sio = sc->sc_ctl;
        u_int code;
        int rr;
-       extern int getsiocsr __P((struct sioreg *));
 
        rr = getsiocsr(sio);
        if (rr & RR_RXRDY) {
@@ -405,7 +438,7 @@
 #if 0
        syscnputc((dev_t)1, 0x10); /* kana LED on */
        syscnputc((dev_t)1, 0x00); /* kana LED off */
-       syscnputc((dev_t)1, 0x11); /* caps LED off */
+       syscnputc((dev_t)1, 0x11); /* caps LED on */
        syscnputc((dev_t)1, 0x01); /* caps LED off */
 #endif
 }
diff -r dbf58758082c -r 030813990655 sys/arch/luna68k/dev/siotty.c
--- a/sys/arch/luna68k/dev/siotty.c     Fri Jan 07 05:11:43 2000 +0000
+++ b/sys/arch/luna68k/dev/siotty.c     Fri Jan 07 05:13:08 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: siotty.c,v 1.1 2000/01/05 08:48:55 nisimura Exp $ */
+/* $NetBSD: siotty.c,v 1.2 2000/01/07 05:13:08 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.1 2000/01/05 08:48:55 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.2 2000/01/07 05:13:08 nisimura Exp $");
 
 #include "opt_ddb.h"
 
@@ -164,11 +164,6 @@
        tp = sc->sc_tty;
        sio = sc->sc_ctl;
        rr = getsiocsr(sio);
-#if defined(DDB)
-       if ((rr && RR_BREAK) && tp != NULL && tp->t_dev == cn_tab->cn_dev)
-               cpu_Debugger();
-       else
-#endif
        if (rr & RR_RXRDY) {
                do {
                        code = sio->sio_data;
@@ -181,6 +176,11 @@
                        }
                        if (tp == NULL || (tp->t_state & TS_ISOPEN) == 0)
                                continue;
+#if 0 && defined(DDB)
+                       if ((rr && RR_BREAK) && tp->t_dev == cn_tab->cn_dev)
+                               cpu_Debugger();
+                       else
+#endif
                        (*linesw[tp->t_line].l_rint)(code, tp);
                } while ((rr = getsiocsr(sio)) & RR_RXRDY);
        }
diff -r dbf58758082c -r 030813990655 sys/arch/luna68k/include/bus.h
--- a/sys/arch/luna68k/include/bus.h    Fri Jan 07 05:11:43 2000 +0000
+++ b/sys/arch/luna68k/include/bus.h    Fri Jan 07 05:13:08 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.1 2000/01/05 08:49:01 nisimura Exp $ */
+/*     $NetBSD: bus.h,v 1.2 2000/01/07 05:13:08 nisimura Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -141,19 +141,6 @@
            bus_size_t size));
 
 /*
- *     int mac68k_bus_space_probe __P((bus_space_tag_t t,
- *         bus_space_handle_t bsh, bus_size_t offset, int sz));
- *
- * Probe the bus at t/bsh/offset, using sz as the size of the load.
- *
- * This is a machine-dependent extension, and is not to be used by
- * machine-independent code.
- */
-
-int    mac68k_bus_space_probe __P((bus_space_tag_t t,
-           bus_space_handle_t bsh, bus_size_t offset, int sz));
-
-/*
  *     u_intN_t bus_space_read_N __P((bus_space_tag_t tag,
  *         bus_space_handle_t bsh, bus_size_t offset));
  *
@@ -162,13 +149,13 @@
  */
 
 #define        bus_space_read_1(t, h, o)                                       \
-    ((void) t, (*(volatile u_int8_t *)((h) + (o))))
+    ((void) t, (*(volatile u_int8_t *)((h) + 4*(o))))
 
 #define        bus_space_read_2(t, h, o)                                       \
-    ((void) t, (*(volatile u_int16_t *)((h) + (o))))
+    ((void) t, (*(volatile u_int16_t *)((h) + 4*(o))))
 
 #define        bus_space_read_4(t, h, o)                                       \
-    ((void) t, (*(volatile u_int32_t *)((h) + (o))))
+    ((void) t, (*(volatile u_int32_t *)((h) + 4*(o))))
 
 #if 0  /* Cause a link error for bus_space_read_8 */
 #define        bus_space_read_8(t, h, o)       !!! bus_space_read_8 unimplemented !!!
@@ -295,13 +282,13 @@
  */
 
 #define        bus_space_write_1(t, h, o, v)                                   \
-    ((void) t, ((void)(*(volatile u_int8_t *)((h) + (o)) = (v))))
+    ((void) t, ((void)(*(volatile u_int8_t *)((h) + 4*(o)) = (v))))
 
 #define        bus_space_write_2(t, h, o, v)                                   \
-    ((void) t, ((void)(*(volatile u_int16_t *)((h) + (o)) = (v))))
+    ((void) t, ((void)(*(volatile u_int16_t *)((h) + 4*(o)) = (v))))
 
 #define        bus_space_write_4(t, h, o, v)                                   \
-    ((void) t, ((void)(*(volatile u_int32_t *)((h) + (o)) = (v))))
+    ((void) t, ((void)(*(volatile u_int32_t *)((h) + 4*(o)) = (v))))
 
 #if 0  /* Cause a link error for bus_space_write_8 */
 #define        bus_space_write_8       !!! bus_space_write_8 not implemented !!!
diff -r dbf58758082c -r 030813990655 sys/arch/luna68k/luna68k/mainbus.c
--- a/sys/arch/luna68k/luna68k/mainbus.c        Fri Jan 07 05:11:43 2000 +0000
+++ b/sys/arch/luna68k/luna68k/mainbus.c        Fri Jan 07 05:13:08 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mainbus.c,v 1.1 2000/01/05 08:49:04 nisimura Exp $ */
+/* $NetBSD: mainbus.c,v 1.2 2000/01/07 05:13:08 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,23 +38,22 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.1 2000/01/05 08:49:04 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.2 2000/01/07 05:13:08 nisimura Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
 
+#include <machine/cpu.h>
 #include <machine/autoconf.h>
 
-extern int machtype;
-
 static struct mainbus_attach_args devs[] = {
        { "clock",  0x45000000, -1 },   /* Mostek/Dallas TimeKeeper */
        { "le",     0xf1000000, 3 },    /* Am7990 */
        { "sio",    0x51000000, 6 },    /* uPD7201A */
        { "fb",     0xc1100000, -1 },   /* BrookTree RAMDAC */
+       { "spc",    0xe1000000, 2 },    /* MB89352 */
 #if 0
-       { "spc",    0xe1000000, 2 },    /* MB89352 */
        { "spc",    0xe1000040, 2 },    /* ditto */
 #endif
 };



Home | Main Index | Thread Index | Old Index