Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/next68k Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/b5a4c144b5e6
branches:  netbsd-9
changeset: 373542:b5a4c144b5e6
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Feb 15 19:28:29 2023 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #1598):

        sys/arch/next68k/next68k/nextrom.h: revision 1.13
        sys/arch/next68k/dev/nextdisplayvar.h: revision 1.6
        sys/arch/next68k/dev/intiovar.h: revision 1.8
        sys/arch/next68k/dev/nextcons.c: revision 1.12
        sys/arch/next68k/next68k/locore.s: revision 1.69
        sys/arch/next68k/dev/nextcons.c: revision 1.13
        sys/arch/next68k/dev/nextcons.c: revision 1.14
        sys/arch/next68k/include/bus_space.h: revision 1.18
        sys/arch/next68k/dev/nextdisplay.c: revision 1.30
        sys/arch/next68k/include/bus_space.h: revision 1.19
        sys/arch/next68k/stand/boot/boot.c: revision 1.13
        sys/arch/next68k/next68k/nextrom.c: revision 1.28
        sys/arch/next68k/next68k/nextrom.c: revision 1.29
        sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.46
        sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.47
        sys/arch/next68k/include/cpu.h: revision 1.52
        sys/arch/next68k/dev/intio.c: revision 1.17 (patch)
        sys/arch/next68k/dev/intio.c: revision 1.18 (patch)
        sys/arch/next68k/dev/intio.c: revision 1.19 (patch)
        sys/arch/next68k/next68k/locore.s: revision 1.72
        sys/arch/next68k/stand/boot/version: revision 1.6
        sys/arch/next68k/include/bus_space.h: revision 1.21
        sys/arch/next68k/include/bus_space.h: revision 1.22
        sys/arch/next68k/dev/nextdisplay.c: revision 1.26
        sys/arch/next68k/include/bus_space.h: revision 1.23
        sys/arch/next68k/dev/nextdisplay.c: revision 1.27
        sys/arch/next68k/dev/nextdisplay.c: revision 1.28
        sys/arch/next68k/dev/nextdisplay.c: revision 1.29

 s/impliment/implement/ in comment.

Remove cargo-culted '#if 0' code that was designed to produce a
compile-time error if any of the bus_space_*_8 functions was used,
but was documented that it produces a link-time error.

Misc KNF and cosmetics.

Use proper C99 int types.

Remove trailing spaces and TABs.

Handle NeXT Turbo VRAM regions properly.
Info from Andreas Grabher on port-next68k@:
 https://mail-index.netbsd.org/port-next68k/2023/02/06/msg000052.html

Also refactor bus_space_map(9) and fix (unused) bus_space_mmap(9).

Add and check machine type NeXT_CUBE_TURBO (type 8).
Info from Andreas Grabher on port-next68k@.

NeXT Turbo Color doesn't have NEXT_P_C16_CMD_REG.
Info from Andreas Grabher on port-next68k@.

Bump version again to denote NeXT_CUBE_TURBO support.

diffstat:

 sys/arch/next68k/dev/intio.c              |   49 +++++++++---
 sys/arch/next68k/dev/intiovar.h           |   10 +-
 sys/arch/next68k/dev/nextcons.c           |   23 +++--
 sys/arch/next68k/dev/nextdisplay.c        |  113 ++++++++++++-----------------
 sys/arch/next68k/dev/nextdisplayvar.h     |   22 ++--
 sys/arch/next68k/include/bus_space.h      |   97 +++++--------------------
 sys/arch/next68k/include/cpu.h            |   14 +--
 sys/arch/next68k/next68k/locore.s         |   32 ++++----
 sys/arch/next68k/next68k/nextrom.c        |   44 ++++++++++-
 sys/arch/next68k/next68k/nextrom.h        |    3 +-
 sys/arch/next68k/next68k/pmap_bootstrap.c |   39 ++++------
 sys/arch/next68k/stand/boot/boot.c        |    6 +-
 sys/arch/next68k/stand/boot/version       |    3 +-
 13 files changed, 216 insertions(+), 239 deletions(-)

diffs (truncated from 1101 to 300 lines):

diff -r 043de144083f -r b5a4c144b5e6 sys/arch/next68k/dev/intio.c
--- a/sys/arch/next68k/dev/intio.c      Wed Feb 15 19:19:38 2023 +0000
+++ b/sys/arch/next68k/dev/intio.c      Wed Feb 15 19:28:29 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intio.c,v 1.14 2011/06/06 16:52:18 matt Exp $  */
+/*     $NetBSD: intio.c,v 1.14.58.1 2023/02/15 19:28:29 martin Exp $   */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -34,14 +34,15 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.14 2011/06/06 16:52:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.14.58.1 2023/02/15 19:28:29 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/device.h> 
+#include <sys/device.h>
 #include <sys/reboot.h>
 
 #include <machine/autoconf.h>
+#include <machine/cpu.h>
 
 #include <next68k/dev/intiovar.h>
 
@@ -53,12 +54,6 @@
 CFATTACH_DECL_NEW(intio, 0,
     intiomatch, intioattach, NULL, NULL);
 
-#if 0
-struct cfdriver intio_cd = {
-       NULL, "intio", DV_DULL
-};
-#endif
-
 static bool intio_attached;
 
 int
@@ -66,9 +61,9 @@
 {
        /* Allow only one instance. */
        if (intio_attached)
-               return (0);
+               return 0;
 
-       return (1);
+       return 1;
 }
 
 void
@@ -91,24 +86,48 @@
        if (ia->ia_addr)
                aprint_normal(" addr %p", ia->ia_addr);
 
-       return (UNCONF);
+       return UNCONF;
 }
 
 int
 intiosearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
-       struct mainbus_attach_args *mba = (struct mainbus_attach_args *) aux;
+       struct mainbus_attach_args *mba = aux;
        struct intio_attach_args ia;
 
        do {
                ia.ia_addr = NULL;
                ia.ia_bst = NEXT68K_INTIO_BUS_SPACE;
                ia.ia_dmat = mba->mba_dmat;
-               
+
                if (config_match(parent, cf, &ia) == 0)
                        break;
                config_attach(parent, cf, &ia, intioprint);
        } while (cf->cf_fstate == FSTATE_STAR);
 
-       return (0);
+       return 0;
 }
+
+int
+bus_space_map(bus_space_tag_t bst, bus_addr_t addr, bus_size_t size,
+    int flags, bus_space_handle_t *bsh)
+{
+
+       if (addr >= INTIOBASE && (addr + size) < INTIOTOP) {
+               *bsh = IIOV(addr);
+               return 0;
+       }
+
+       return EINVAL;
+}
+
+paddr_t
+bus_space_mmap(bus_space_tag_t bst, bus_addr_t addr, off_t offset, int prot,
+    int flags)
+{
+
+       if (addr >= INTIOBASE && (addr + offset) < INTIOTOP)
+               return m68k_btop(addr + offset);
+
+       return -1;
+}
diff -r 043de144083f -r b5a4c144b5e6 sys/arch/next68k/dev/intiovar.h
--- a/sys/arch/next68k/dev/intiovar.h   Wed Feb 15 19:19:38 2023 +0000
+++ b/sys/arch/next68k/dev/intiovar.h   Wed Feb 15 19:28:29 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intiovar.h,v 1.7 2011/01/02 08:19:03 tsutsui Exp $     */
+/*     $NetBSD: intiovar.h,v 1.7.64.1 2023/02/15 19:28:29 martin Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
 
 extern vaddr_t intiobase;
 extern  vaddr_t intiolimit;
-extern vaddr_t monobase;
-extern  vaddr_t monolimit;
-extern vaddr_t colorbase;
-extern  vaddr_t colorlimit;
+extern vaddr_t fbbase;
+extern  vaddr_t fblimit;
+extern paddr_t fbbasepa;
+extern  paddr_t fblimitpa;
diff -r 043de144083f -r b5a4c144b5e6 sys/arch/next68k/dev/nextcons.c
--- a/sys/arch/next68k/dev/nextcons.c   Wed Feb 15 19:19:38 2023 +0000
+++ b/sys/arch/next68k/dev/nextcons.c   Wed Feb 15 19:28:29 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nextcons.c,v 1.11 2010/04/24 19:58:13 dbj Exp $        */
+/*     $NetBSD: nextcons.c,v 1.11.64.1 2023/02/15 19:28:29 martin Exp $        */
 
 /*
  * Copyright (c) 1999 Darrin B. Jewell
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nextcons.c,v 1.11 2010/04/24 19:58:13 dbj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nextcons.c,v 1.11.64.1 2023/02/15 19:28:29 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -63,13 +63,14 @@
 nextcnprobe(struct consdev *cp)
 {
 
-       if ((rom_machine_type == NeXT_WARP9)
-           || (rom_machine_type == NeXT_X15)
-           || (rom_machine_type == NeXT_WARP9C)
-           || (rom_machine_type == NeXT_TURBO_MONO)
-           || (rom_machine_type == NeXT_TURBO_COLOR))
+       if (rom_machine_type == NeXT_WARP9 ||
+           rom_machine_type == NeXT_X15 ||
+           rom_machine_type == NeXT_WARP9C ||
+           rom_machine_type == NeXT_TURBO_MONO ||
+           rom_machine_type == NeXT_TURBO_COLOR ||
+           rom_machine_type == NeXT_CUBE_TURBO)
                cp->cn_pri = CN_INTERNAL;
-       else 
+       else
                cp->cn_pri = CN_DEAD;
 
        cp->cn_dev = NODEV;
@@ -78,6 +79,7 @@
 void
 nextcninit(struct consdev *cp)
 {
+
        nextkbd_cnattach(NEXT68K_INTIO_BUS_SPACE);
        nextdisplay_cnattach();
 }
@@ -85,17 +87,20 @@
 int
 nextcngetc (dev_t dev)
 {
+
        return wskbd_cngetc(dev);
 }
 
 void
 nextcnputc(dev_t dev, int c)
 {
-       wsdisplay_cnputc(dev,c);        
+
+       wsdisplay_cnputc(dev,c);
 }
 
 void
 nextcnpollc(dev_t dev, int on)
 {
+
        wskbd_cnpollc(dev,on);
 }
diff -r 043de144083f -r b5a4c144b5e6 sys/arch/next68k/dev/nextdisplay.c
--- a/sys/arch/next68k/dev/nextdisplay.c        Wed Feb 15 19:19:38 2023 +0000
+++ b/sys/arch/next68k/dev/nextdisplay.c        Wed Feb 15 19:28:29 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nextdisplay.c,v 1.21.42.1 2019/11/14 15:38:03 martin Exp $ */
+/* $NetBSD: nextdisplay.c,v 1.21.42.2 2023/02/15 19:28:29 martin Exp $ */
 
 /*
  * Copyright (c) 1998 Matt DeBergalis
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nextdisplay.c,v 1.21.42.1 2019/11/14 15:38:03 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nextdisplay.c,v 1.21.42.2 2023/02/15 19:28:29 martin Exp $");
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
@@ -136,8 +136,8 @@
 static int
 nextdisplay_is_console(vaddr_t addr)
 {
-       return (nextdisplay_console_dc.isconsole
-                       && (addr == nextdisplay_consaddr));
+       return nextdisplay_console_dc.isconsole &&
+           addr == nextdisplay_consaddr;
 }
 
 int
@@ -147,10 +147,11 @@
            rom_machine_type == NeXT_X15 ||
            rom_machine_type == NeXT_WARP9C ||
            rom_machine_type == NeXT_TURBO_MONO ||
-           rom_machine_type == NeXT_TURBO_COLOR)
-               return (1);
-       else 
-               return (0);
+           rom_machine_type == NeXT_TURBO_COLOR ||
+           rom_machine_type == NeXT_CUBE_TURBO)
+               return 1;
+       else
+               return 0;
 }
 
 void
@@ -162,19 +163,13 @@
 
        /* printf("in nextdisplay_init\n"); */
 
-       if (color) {
-               dc->dc_vaddr = colorbase;
-               dc->dc_paddr = COLORBASE;
-               dc->dc_size = NEXT_P_C16_VIDEOSIZE;
-       } else {
-               dc->dc_vaddr = monobase;
-               dc->dc_paddr = MONOBASE;
-               dc->dc_size = NEXT_P_VIDEOSIZE;
-       }
+       dc->dc_vaddr = fbbase;
+       dc->dc_paddr = fbbasepa;
+       dc->dc_size = color ? NEXT_P_C16_VIDEOSIZE : NEXT_P_VIDEOSIZE;
 
        dc->dc_wid = 1120;
        dc->dc_ht = 832;
-       dc->dc_depth = color ? 16 : 2; 
+       dc->dc_depth = color ? 16 : 2;
        dc->dc_rowbytes = (turbo ? 1120 : 1152) * dc->dc_depth / 8;
 
        dc->dc_videobase = dc->dc_vaddr;
@@ -182,8 +177,8 @@
 #if 0
        printf("intiobase at: %08x\n", intiobase);
        printf("intiolimit at: %08x\n", intiolimit);
-       printf("videobase at: %08x\n", color ? colorbase : monobase);
-       printf("videolimit at: %08x\n", color ? colorlimit : monolimit);
+       printf("videobase at: %08x\n", fbbase);
+       printf("videolimit at: %08x\n", fblimit);
 
        printf("virtual fb at: %08x\n", dc->dc_vaddr);
        printf("physical fb at: %08x\n", dc->dc_paddr);
@@ -197,16 +192,16 @@
 #endif
 
        /* clear the screen */
-       for (i = 0; i < dc->dc_ht * dc->dc_rowbytes; i += sizeof(u_int32_t))
-               *(u_int32_t *)(dc->dc_videobase + i) = 
-                       (color ? 0x0 : 0xffffffff);
+       for (i = 0; i < dc->dc_ht * dc->dc_rowbytes; i += sizeof(uint32_t))
+               *(uint32_t *)(dc->dc_videobase + i) =
+                   color ? 0x0 : 0xffffffff;
 
        rap = &dc->dc_raster;
        rap->width = dc->dc_wid;
        rap->height = dc->dc_ht;
        rap->depth = color ? 16 : 2;
-       rap->linelongs = dc->dc_rowbytes / sizeof(u_int32_t);
-       rap->pixels = (u_int32_t *)dc->dc_videobase;
+       rap->linelongs = dc->dc_rowbytes / sizeof(uint32_t);
+       rap->pixels = (uint32_t *)dc->dc_videobase;
 
        /* initialize the raster console blitter */
        rcp = &dc->dc_rcons;
@@ -217,11 +212,11 @@
        rcons_init(rcp, 34, 80);
 



Home | Main Index | Thread Index | Old Index