Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcsh SH4 support. my target is HITACHI PERSONA HPW...



details:   https://anonhg.NetBSD.org/src/rev/13019425758a
branches:  trunk
changeset: 522121:13019425758a
user:      uch <uch%NetBSD.org@localhost>
date:      Mon Feb 11 17:32:35 2002 +0000

description:
SH4 support. my target is HITACHI PERSONA HPW650PA

diffstat:

 sys/arch/hpcsh/conf/HPW650PA           |   82 +++++
 sys/arch/hpcsh/conf/files.hpcsh        |   27 +-
 sys/arch/hpcsh/hpcsh/clock.c           |    7 +-
 sys/arch/hpcsh/hpcsh/console.c         |   42 ++-
 sys/arch/hpcsh/hpcsh/kloader_machdep.c |  136 ++++-----
 sys/arch/hpcsh/hpcsh/locore.s          |   70 +----
 sys/arch/hpcsh/hpcsh/machdep.c         |   55 ++-
 sys/arch/hpcsh/hpcsh/mainbus.c         |    5 +-
 sys/arch/hpcsh/hpcsh/shb.c             |  475 +++++++++++---------------------
 sys/arch/hpcsh/include/bus.h           |   58 +++-
 10 files changed, 457 insertions(+), 500 deletions(-)

diffs (truncated from 1538 to 300 lines):

diff -r f7ee0ec3984b -r 13019425758a sys/arch/hpcsh/conf/HPW650PA
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpcsh/conf/HPW650PA      Mon Feb 11 17:32:35 2002 +0000
@@ -0,0 +1,82 @@
+#      $NetBSD: HPW650PA,v 1.1 2002/02/11 17:32:35 uch Exp $
+#
+#      HITACHI PERSONA HPW650PA
+#
+
+include        "arch/hpcsh/conf/std.hpcsh"
+
+maxusers       32                      # estimated number of users
+
+options        KLOADER_KERNEL_PATH="\"/netbsd\""
+options                KLOADER_DEBUG
+
+options        SH7750
+options        SH4
+
+options                INTERRUPT_MONITOR
+
+options        DDB                     # in-kernel debugger
+options        DIAGNOSTIC              # extra kernel debugging checks
+options        DEBUG                   # extra kernel debugging support
+options        KTRACE                  # system call tracing support
+options        MSGBUFSIZE=65534
+
+options                PIPE_SOCKETPAIR         # smaller, but slower pipe(2)
+
+# Executable format options
+options        EXEC_COFF       # 32-bit COFF executables
+options        EXEC_ELF32      # 32-bit ELF executables
+
+# File systems
+file-system    FFS             # UFS
+file-system    MSDOSFS         # MS-DOS file system
+file-system    NFS             # Sun NFS-compatible filesystem client
+
+# Networking options
+options        INET            # IP + ICMP + TCP + UDP
+options        INET6           # IPV6
+options        NFS_BOOT_DHCP
+
+# Kernel root file system and dump configuration.
+config         netbsd  root on ? type ?
+
+options        WSEMUL_VT100
+options        WSDISPLAY_DEFAULTSCREENS=1
+options        FONT_VT220L8x10
+options        WS_KERNEL_FG=WSCOL_BROWN
+options        WS_KERNEL_BG=WSCOL_BLUE
+
+#
+# Device configuration
+#
+mainbus0 at root
+
+bivideo*       at mainbus0
+hpcfb*         at bivideo?
+wsdisplay*     at hpcfb?
+
+shb0           at mainbus?
+
+hd64465if*     at shb0 irq 11
+com*           at hd64465if?
+hd64465pcmcia* at hd64465if?
+
+# PCMCIA bus support
+pcmcia* at hd64465pcmcia? controller ? socket ?
+
+# PCMCIA network interfaces
+ne*    at pcmcia? function ?           # NE2000-compatible Ethernet
+ukphy* at mii? phy ?                   # generic unknown PHYs
+
+# PCMCIA IDE disk
+wdc*   at pcmcia? function ?
+wd*    at wdc? channel ? drive ? flags 0x0000
+
+# Pseudo-Devices
+pseudo-device  biconsdev       1       # build-in console device
+pseudo-device  pty                     # pseudo-terminals
+
+pseudo-device  bpfilter        1       # Berkeley packet filter
+pseudo-device  loop                    # network loopback
+pseudo-device  gif             1       # IPv[46] over IPv[46] tunnel (RFC1933)
+pseudo-device  rnd                     # /dev/random and in-kernel generator
diff -r f7ee0ec3984b -r 13019425758a sys/arch/hpcsh/conf/files.hpcsh
--- a/sys/arch/hpcsh/conf/files.hpcsh   Mon Feb 11 17:30:44 2002 +0000
+++ b/sys/arch/hpcsh/conf/files.hpcsh   Mon Feb 11 17:32:35 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.hpcsh,v 1.16 2002/01/29 18:44:25 uch Exp $
+#      $NetBSD: files.hpcsh,v 1.17 2002/02/11 17:32:35 uch Exp $
 #
 maxpartitions 8
 
@@ -15,6 +15,7 @@
 file   arch/hpcsh/hpcsh/console.c
 file   arch/hpcsh/hpcsh/autoconf.c
 file   arch/hpcsh/hpcsh/bus_space.c
+#file  arch/hpcsh/hpcsh/bus_dma.c
 file   arch/hpcsh/hpcsh/procfs_machdep.c       procfs
 
 file   arch/hpc/hpc/kloader.c
@@ -93,11 +94,25 @@
 file   arch/hpcsh/dev/hd64461/hd64461video.c   hd64461video    needs-flag
 file   dev/hpc/video_subr.c                    hd64461video
 
-# network devices MII bus
-include        "dev/mii/files.mii"
+#
+# HD64465
+#
+define hd64465if {}
+device hd64465if: hd64465if
+attach hd64465if at shb
+file   arch/hpcsh/dev/hd64465/hd64465.c        hd64465if
 
-#
-# Workstation Console
-#
+attach com at hd64465if with hd64465uart
+file   arch/hpcsh/dev/hd64465/hd64465uart.c    hd64465uart
+
+device hd64465pcmcia: pcmciabus
+attach hd64465pcmcia at hd64465if
+file   arch/hpcsh/dev/hd64465/hd64465pcmcia.c  hd64465pcmcia
+
+#attach        ohci at hd64465if with hd64465ohci
+#file  arch/hpcsh/dev/hd64465/hd64465ohci.c    hd64465ohci
+
+include        "dev/mii/files.mii"
+include "dev/usb/files.usb"
 include        "dev/wscons/files.wscons"
 
diff -r f7ee0ec3984b -r 13019425758a sys/arch/hpcsh/hpcsh/clock.c
--- a/sys/arch/hpcsh/hpcsh/clock.c      Mon Feb 11 17:30:44 2002 +0000
+++ b/sys/arch/hpcsh/hpcsh/clock.c      Mon Feb 11 17:32:35 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.4 2002/02/01 17:52:55 uch Exp $    */
+/*     $NetBSD: clock.c,v 1.5 2002/02/11 17:32:35 uch Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -44,6 +44,7 @@
 #include <sh3/tmureg.h>
 
 #include <machine/shbvar.h>
+#include <machine/debug.h>
 
 #include <hpcsh/hpcsh/clockvar.h>
 
@@ -139,6 +140,9 @@
        DELAY_LOOP(10000000);
        t0 = TMU_ELAPSED(0);
        __cpuclock = (100000000 / t0) * RTC_CLOCK;
+#ifdef SH4
+       __cpuclock >>= 1;       /* two-issue */
+#endif
        __cnt_delay = (RTC_CLOCK * 10) / t0;
 
        /*
@@ -242,6 +246,7 @@
        /* clear underflow status */
        SHREG_TCR1 &= ~TCR_UNF;
 
+       __dbg_heart_beat(HEART_BEAT_WHITE);
        hardclock(arg);
 
        return (1);
diff -r f7ee0ec3984b -r 13019425758a sys/arch/hpcsh/hpcsh/console.c
--- a/sys/arch/hpcsh/hpcsh/console.c    Mon Feb 11 17:30:44 2002 +0000
+++ b/sys/arch/hpcsh/hpcsh/console.c    Mon Feb 11 17:32:35 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: console.c,v 1.6 2002/01/27 05:15:37 uch Exp $  */
+/*     $NetBSD: console.c,v 1.7 2002/02/11 17:32:35 uch Exp $  */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -36,14 +36,18 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_kgdb.h"
+
 #include "biconsdev.h"
 #include "hpcfb.h"
-#include "pfckbd.h"
 #include "sci.h"
 #include "scif.h"
 #include "com.h"
 #include "hd64461video.h"
 
+#include "wskbd.h"
+#include "pfckbd.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/conf.h>
@@ -51,6 +55,12 @@
 
 #include <machine/bootinfo.h>
 
+#if !defined(NBICONSDEV) || !defined(NHPCFB) || !defined(NPFCKBD) ||   \
+       !defined(NHD64461VIDEO) || !defined(NSCI) || !defined(NSCIF) || \
+       !defined(NCOM)
+#error
+#endif
+
 #if NBICONSDEV > 0
 #include <dev/hpc/biconsvar.h>
 #include <dev/hpc/bicons.h>
@@ -61,6 +71,7 @@
 #include <dev/rasops/rasops.h>
 #include <dev/hpc/hpcfbvar.h>
 #endif
+
 #if NPFCKBD > 0
 #include <hpcsh/dev/pfckbdvar.h>
 #endif
@@ -82,6 +93,7 @@
 #if NHD64461VIDEO > 0
 cons_decl(hd64461video_);
 #if NWSKBD > 0
+#include <dev/wscons/wskbdvar.h>
 #define hd64461video_cngetc    wskbd_cngetc
 #else
 int
@@ -110,19 +122,27 @@
 #if NSCIF > 0
        cons_init(scif),
 #endif
-#if NHD64461IF > 0 && NCOM > 0
+#if NCOM > 0
        cons_init(com),
 #endif
        { 0 } /* terminator */
 };
 #define CN_ENABLE(x)   set_console(x ## cnputc, x ## cnprobe)
 
+#ifdef KGDB
+#ifndef KGDB_DEVNAME
+#define KGDB_DEVNAME "nodev"
+#endif
+const char kgdb_devname[] = KGDB_DEVNAME;
+#endif
 static int initialized;
-static int attach_kbd = 1;
+static int attach_kbd  __attribute__((__unused__)) = 1;
 static void set_console(void (*)(dev_t, int), void (*)(struct consdev *));
 static void disable_console(void);
 static void cn_nonprobe(struct consdev *);
+#if NBICONSDEV > 0
 static void enable_bicons(void);
+#endif
 
 void
 consinit()
@@ -155,20 +175,24 @@
                CN_ENABLE(scif);
 #endif
                break;
+       case BI_CNUSE_HD64465COM:
+               /* FALLTHROUGH */
        case BI_CNUSE_HD64461COM:
-#if NHD64461IF > 0 && NCOM > 0
+#if NCOM > 0
                CN_ENABLE(com);
 #endif
                break;
        }
 
 #if NBICONSDEV > 0
-       if (!initialized) /* use builtin console instead */
+       if (!initialized) { /* use builtin console instead */
                enable_bicons();
+       }
 #endif
 
-       if (initialized)
+       if (initialized) {
                cninit();
+       }
 
 #if NPFCKBD > 0
        if (attach_kbd)
@@ -208,6 +232,7 @@
 static void
 cn_nonprobe(struct consdev *cp)
 {
+
        cp->cn_pri = CN_DEAD;
 }
 
@@ -215,9 +240,10 @@
 static void
 enable_bicons()
 {
+
        bootinfo->bi_cnuse = BI_CNUSE_BUILTIN;
        bicons_set_priority(CN_INTERNAL);



Home | Main Index | Thread Index | Old Index