Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/news68k Add preliminary PROM internal function base...



details:   https://anonhg.NetBSD.org/src/rev/490b0d74d6e0
branches:  trunk
changeset: 771432:490b0d74d6e0
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Nov 20 15:38:00 2011 +0000

description:
Add preliminary PROM internal function based framebuffer console support,
which was demonstrated at Open Source Conference 2011 Kansai @ Kyoto
back in July:
http://www.NetBSD.org/gallery/events.html#opensourceconf2011-Kansai

- map 0xc0000000-0xffffffff PA region (which is mirror of PA 0x0-0x3fffffff)
  to the same VA via %tt0 and %tt1 registers and move KVA space accordingly
  (like luna68k does for its devices)
- save trap #0 vector for PROM function calls in early bootstrap
  and register it to trap #14 to call it from kernel for console output
- add dumb romcall based tty attachment taken from src/sys/dev/ofw/ofcons.c
- add rom function call stubs from news68k/stand/common/romcalls.S
- remove IIOV() macro for device registers where now mapped PA==VA via %tt1

XXX: romcons is not enabled yet because there is no generic interface
XXX: to attach wskbd(4) to non wsdisplay(4) devices like this romcons.

diffstat:

 sys/arch/news68k/conf/GENERIC             |    7 +-
 sys/arch/news68k/conf/INSTALL             |    5 +-
 sys/arch/news68k/conf/files.news68k       |    8 +-
 sys/arch/news68k/conf/majors.news68k      |    3 +-
 sys/arch/news68k/dev/if_le.c              |   10 +-
 sys/arch/news68k/dev/kb_hb.c              |    6 +-
 sys/arch/news68k/dev/si.c                 |    8 +-
 sys/arch/news68k/dev/zs.c                 |    8 +-
 sys/arch/news68k/include/cpu.h            |    3 +-
 sys/arch/news68k/include/vmparam.h        |    4 +-
 sys/arch/news68k/news68k/locore.s         |   16 +-
 sys/arch/news68k/news68k/machdep.c        |   39 +-
 sys/arch/news68k/news68k/pmap_bootstrap.c |   29 +-
 sys/arch/news68k/news68k/romcalls.S       |   86 +++++++
 sys/arch/news68k/news68k/romcons.c        |  354 ++++++++++++++++++++++++++++++
 15 files changed, 531 insertions(+), 55 deletions(-)

diffs (truncated from 925 to 300 lines):

diff -r 30a984b1dcc4 -r 490b0d74d6e0 sys/arch/news68k/conf/GENERIC
--- a/sys/arch/news68k/conf/GENERIC     Sun Nov 20 15:37:31 2011 +0000
+++ b/sys/arch/news68k/conf/GENERIC     Sun Nov 20 15:38:00 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.106 2011/03/06 17:08:28 bouyer Exp $
+# $NetBSD: GENERIC,v 1.107 2011/11/20 15:38:00 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.106 $"
+#ident                 "GENERIC-$Revision: 1.107 $"
 
 maxusers       8
 
@@ -221,6 +221,9 @@
 ss*    at scsibus? target ? lun ?              # SCSI scanners
 uk*    at scsibus? target ? lun ?              # unknown SCSI devices
 
+# PROM console support
+#romcons0 at mainbus0
+
 #
 # accept filters
 pseudo-device   accf_data              # "dataready" accept filter
diff -r 30a984b1dcc4 -r 490b0d74d6e0 sys/arch/news68k/conf/INSTALL
--- a/sys/arch/news68k/conf/INSTALL     Sun Nov 20 15:37:31 2011 +0000
+++ b/sys/arch/news68k/conf/INSTALL     Sun Nov 20 15:38:00 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: INSTALL,v 1.53 2011/03/13 12:58:02 he Exp $
+#      $NetBSD: INSTALL,v 1.54 2011/11/20 15:38:00 tsutsui Exp $
 
 #      config for bootable floppy kernel
 #
@@ -146,6 +146,9 @@
 st*    at scsibus? target ? lun ?              # SCSI tapes
 cd*    at scsibus? target ? lun ?              # SCSI CD-ROMs
 
+# PROM console support
+#romcons0 at mainbus0
+
 # Misc.
 pseudo-device  loop                    # loopback interface; required
 pseudo-device  pty             2       # pseudo-terminals (Sysinst needs two)
diff -r 30a984b1dcc4 -r 490b0d74d6e0 sys/arch/news68k/conf/files.news68k
--- a/sys/arch/news68k/conf/files.news68k       Sun Nov 20 15:37:31 2011 +0000
+++ b/sys/arch/news68k/conf/files.news68k       Sun Nov 20 15:38:00 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.news68k,v 1.32 2011/06/12 03:35:44 rmind Exp $
+#      $NetBSD: files.news68k,v 1.33 2011/11/20 15:38:00 tsutsui Exp $
 
 #      NEWS68K-specific configuration info
 
@@ -19,6 +19,7 @@
 file   arch/news68k/news68k/machdep.c
 file   arch/news68k/news68k/mainbus.c
 file   arch/news68k/news68k/pmap_bootstrap.c   compile-with "${NOPROF_C}"
+file   arch/news68k/news68k/romcalls.S
 file   arch/news68k/news68k/trap.c
 file   arch/m68k/m68k/cacheops.c
 file   arch/m68k/m68k/db_memrw.c               ddb | kgdb
@@ -99,6 +100,11 @@
 attach fd at fdc
 file arch/news68k/dev/fd.c                     fdc | fd needs-flag
 
+# PROM console support
+device romcons
+attach romcons at mainbus
+file arch/news68k/news68k/romcons.c            romcons needs-flag
+
 # Machine-independent SCSI driver
 include "dev/scsipi/files.scsipi"
 
diff -r 30a984b1dcc4 -r 490b0d74d6e0 sys/arch/news68k/conf/majors.news68k
--- a/sys/arch/news68k/conf/majors.news68k      Sun Nov 20 15:37:31 2011 +0000
+++ b/sys/arch/news68k/conf/majors.news68k      Sun Nov 20 15:38:00 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: majors.news68k,v 1.22 2011/06/30 20:09:34 wiz Exp $
+#      $NetBSD: majors.news68k,v 1.23 2011/11/20 15:38:00 tsutsui Exp $
 #
 # Device majors for news68k
 #
@@ -44,6 +44,7 @@
 device-major   cgd             char 78  block 33       cgd
 device-major   ksyms           char 79                 ksyms
 device-major   wsfont          char 80                 wsfont
+device-major   romcons         char 81                 romcons
 
 device-major   nsmb            char 98                 nsmb
 
diff -r 30a984b1dcc4 -r 490b0d74d6e0 sys/arch/news68k/dev/if_le.c
--- a/sys/arch/news68k/dev/if_le.c      Sun Nov 20 15:37:31 2011 +0000
+++ b/sys/arch/news68k/dev/if_le.c      Sun Nov 20 15:38:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le.c,v 1.18 2010/01/19 22:06:21 pooka Exp $ */
+/*     $NetBSD: if_le.c,v 1.19 2011/11/20 15:38:00 tsutsui Exp $       */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.18 2010/01/19 22:06:21 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.19 2011/11/20 15:38:00 tsutsui Exp $");
 
 #include "opt_inet.h"
 
@@ -137,7 +137,7 @@
        if (strcmp(ha->ha_name, "le"))
                return 0;
 
-       addr = IIOV(ha->ha_address);
+       addr = (ha->ha_address);
 
        if (badaddr((void *)addr, 1))
                return 0;
@@ -154,10 +154,10 @@
        const uint8_t *p;
 
        sc->sc_dev = self;
-       lesc->sc_r1 = (void *)IIOV(ha->ha_address);
+       lesc->sc_r1 = (void *)(ha->ha_address);
 
        if (ISIIOPA(ha->ha_address)) {
-               sc->sc_mem = (u_char *)IIOV(lance_mem_phys);
+               sc->sc_mem = (u_char *)(lance_mem_phys);
                p = idrom_addr + 0x10;
        } else {
                sc->sc_mem = lesc->sc_r1 - 0x10000;
diff -r 30a984b1dcc4 -r 490b0d74d6e0 sys/arch/news68k/dev/kb_hb.c
--- a/sys/arch/news68k/dev/kb_hb.c      Sun Nov 20 15:37:31 2011 +0000
+++ b/sys/arch/news68k/dev/kb_hb.c      Sun Nov 20 15:38:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kb_hb.c,v 1.12 2008/05/14 13:29:28 tsutsui Exp $       */
+/*     $NetBSD: kb_hb.c,v 1.13 2011/11/20 15:38:00 tsutsui Exp $       */
 
 /*-
  * Copyright (c) 2001 Izumi Tsutsui.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kb_hb.c,v 1.12 2008/05/14 13:29:28 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kb_hb.c,v 1.13 2011/11/20 15:38:00 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,7 +74,7 @@
        if (ha->ha_address == (u_int)-1)
                return 0;
 
-       addr = IIOV(ha->ha_address); /* XXX */
+       addr = (ha->ha_address); /* XXX */
 
        if (badaddr((void *)addr, 1))
                return 0;
diff -r 30a984b1dcc4 -r 490b0d74d6e0 sys/arch/news68k/dev/si.c
--- a/sys/arch/news68k/dev/si.c Sun Nov 20 15:37:31 2011 +0000
+++ b/sys/arch/news68k/dev/si.c Sun Nov 20 15:38:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: si.c,v 1.25 2008/06/17 18:24:21 tsutsui Exp $  */
+/*     $NetBSD: si.c,v 1.26 2011/11/20 15:38:00 tsutsui Exp $  */
 
 /*
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: si.c,v 1.25 2008/06/17 18:24:21 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: si.c,v 1.26 2011/11/20 15:38:00 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -107,7 +107,7 @@
        if (strcmp(ha->ha_name, "si"))
                return 0;
 
-       addr = IIOV(ha->ha_address);
+       addr = (ha->ha_address);
 
        if (badaddr((void *)addr, 1))
                return 0;
@@ -182,7 +182,7 @@
        ncr_sc->sc_channel.chan_id = 7;
 
        /* soft reset DMAC */
-       sc->sc_regs = (void *)IIOV(DMAC_BASE);
+       sc->sc_regs = (void *)(DMAC_BASE);
        sc->sc_regs->ctl = DC_CTL_RST;
 
        ncr5380_attach(ncr_sc);
diff -r 30a984b1dcc4 -r 490b0d74d6e0 sys/arch/news68k/dev/zs.c
--- a/sys/arch/news68k/dev/zs.c Sun Nov 20 15:37:31 2011 +0000
+++ b/sys/arch/news68k/dev/zs.c Sun Nov 20 15:38:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zs.c,v 1.30 2008/04/28 20:23:30 martin Exp $   */
+/*     $NetBSD: zs.c,v 1.31 2011/11/20 15:38:00 tsutsui Exp $  */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.30 2008/04/28 20:23:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.31 2011/11/20 15:38:00 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -166,7 +166,7 @@
        if (ha->ha_address == (u_int)-1)
                return 0;
 
-       addr = IIOV(ha->ha_address);
+       addr = (ha->ha_address);
        /* This returns -1 on a fault (bus error). */
        if (badaddr((void *)addr, 1))
                return 0;
@@ -191,7 +191,7 @@
 
        zsc->zsc_dev = self;
 
-       zs = (void *)IIOV(ha->ha_address);
+       zs = (void *)(ha->ha_address);
 
        clk = cf->cf_flags;
        if (clk < 0 || clk >= NPCLK)
diff -r 30a984b1dcc4 -r 490b0d74d6e0 sys/arch/news68k/include/cpu.h
--- a/sys/arch/news68k/include/cpu.h    Sun Nov 20 15:37:31 2011 +0000
+++ b/sys/arch/news68k/include/cpu.h    Sun Nov 20 15:38:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.39 2011/05/16 13:22:54 tsutsui Exp $ */
+/*     $NetBSD: cpu.h,v 1.40 2011/11/20 15:38:00 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -162,6 +162,7 @@
 extern u_int intrcnt[];
 
 extern void (*vectab[])(void);
+extern void *romcallvec;
 
 struct frame;
 
diff -r 30a984b1dcc4 -r 490b0d74d6e0 sys/arch/news68k/include/vmparam.h
--- a/sys/arch/news68k/include/vmparam.h        Sun Nov 20 15:37:31 2011 +0000
+++ b/sys/arch/news68k/include/vmparam.h        Sun Nov 20 15:38:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmparam.h,v 1.18 2011/02/08 20:20:20 rmind Exp $       */
+/*     $NetBSD: vmparam.h,v 1.19 2011/11/20 15:38:00 tsutsui Exp $     */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -109,7 +109,7 @@
 #define VM_MAXUSER_ADDRESS     ((vaddr_t)0xFFF00000)
 #define VM_MAX_ADDRESS         ((vaddr_t)0xFFF00000)
 #define VM_MIN_KERNEL_ADDRESS  ((vaddr_t)0)
-#define VM_MAX_KERNEL_ADDRESS  ((vaddr_t)(0-PAGE_SIZE*NPTEPG))
+#define VM_MAX_KERNEL_ADDRESS  ((vaddr_t)(0xC0000000-PAGE_SIZE*NPTEPG))
 
 /* virtual sizes (bytes) for various kernel submaps */
 #define VM_PHYS_SIZE           (USRIOSIZE*PAGE_SIZE)
diff -r 30a984b1dcc4 -r 490b0d74d6e0 sys/arch/news68k/news68k/locore.s
--- a/sys/arch/news68k/news68k/locore.s Sun Nov 20 15:37:31 2011 +0000
+++ b/sys/arch/news68k/news68k/locore.s Sun Nov 20 15:38:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.59 2011/11/15 10:57:03 tsutsui Exp $      */
+/*     $NetBSD: locore.s,v 1.60 2011/11/20 15:38:00 tsutsui Exp $      */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -148,6 +148,7 @@
 
        movc %vbr,%a0
        movl %a0@(188),_ASM_LABEL(monitor)| save trap #15 to return PROM monitor
+       movl %a0@(128),_ASM_LABEL(romcallvec)| save trap #0 to use PROM calls
 
        RELOC(esym, %a0)
 #if NKSYMS || defined(DDB) || defined(LKM)
@@ -395,11 +396,15 @@
        movc    %d0,%cacr               | turn on both caches
        jmp     Lenab1
 Lmotommu2:
-#if 0 /* XXX use %tt0 register to map I/O space temporary */
+       /* Use %tt0 register to map I/O space */
        RELOC(protott0, %a0)
-       movl    #0xe01f8550,%a0@        | use %tt0 (0xe0000000-0xffffffff)
+       movl    #0xe01f8543,%a0@        | use %tt0 (0xe0000000-0xffffffff)
        .long   0xf0100800              | pmove %a0@,%tt0
-#endif
+       /* Use %tt1 register to map RAM  to use PROM calls */
+       RELOC(protott1, %a0)
+       movl    #0xc01f8143,%a0@        | use %tt1 (0xc0000000-0xdfffffff)
+       .long   0xf0100c00              | pmove %a0@,%tt1
+



Home | Main Index | Thread Index | Old Index