Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcmips Support for Laser5's L-Card+ Embedded CPU B...



details:   https://anonhg.NetBSD.org/src/rev/8cc630611a7a
branches:  trunk
changeset: 546521:8cc630611a7a
user:      igy <igy%NetBSD.org@localhost>
date:      Thu May 01 07:01:58 2003 +0000

description:
Support for Laser5's L-Card+ Embedded CPU Board
===============================================

This code enables NetBSD to support for NEC VR4181 CPU and some
devices on L-Card+ board.

NEC VR4181
----------

NEC VR4181 is a embedded CPU which has MIPS processor core and
integrated I/O devices within a package.  The basic architecture of
VR4181 is similar to other VR41xx family CPU.  Some integrated devices
are compatible to another VR41xx series CPU and some are not.

VR4181 has integrated devices listed bellow:

        - Two of 16550 compatible UART
        - Compact Flash controller
        - ISA bus controller
        - Audio CODEC
        - A/D converters
        - LCD driver
        - Touch panel controller
        - General purpose I/O


L-Card+ Embedded CPU Board
--------------------------

L-Card+ is name card sized CPU board for embedded system.  It is soled
by Laser5 (http://www.laser5.co.jp/) with Linux installed.

L-Card+ has following devices:

        - 16Mbyte flash memory (Intel 28F128)
        - 16Mbyte SDRAM
        - CS8900A Ethernet controller and RJ45 port
        - RS232C line driver and external connector
        - Compact Flash socket
        - A pair of Mezzanine connector for extension board
        - Some on-board LEDs


Current Feature of This Code
----------------------------

Following devices are supported:

        - UART (used for console)
        - wi on Compact Flash socket
        - cs (CS8900A)
        - Flash memory (Intel 28F128 and Fujitsu MBM29LV160)
        - Audio Coder (limited support)

--
Naoto Shimazaki

diffstat:

 sys/arch/hpcmips/conf/LCARD                   |   76 ++
 sys/arch/hpcmips/conf/files.hpcmips           |   26 +-
 sys/arch/hpcmips/conf/majors.hpcmips          |    4 +-
 sys/arch/hpcmips/conf/std.lcard               |   37 +
 sys/arch/hpcmips/hpcmips/machdep.c            |   19 +-
 sys/arch/hpcmips/hpcmips/mainbus.c            |    5 +-
 sys/arch/hpcmips/include/loadfile_machdep.h   |   60 +
 sys/arch/hpcmips/stand/lcboot/Makefile        |   84 ++
 sys/arch/hpcmips/stand/lcboot/com.c           |  171 +++++
 sys/arch/hpcmips/stand/lcboot/dev_lc.c        |  141 ++++
 sys/arch/hpcmips/stand/lcboot/extern.h        |  108 +++
 sys/arch/hpcmips/stand/lcboot/i28f128.c       |  203 ++++++
 sys/arch/hpcmips/stand/lcboot/i28f128reg.h    |   69 ++
 sys/arch/hpcmips/stand/lcboot/lcboot.ldscript |   47 +
 sys/arch/hpcmips/stand/lcboot/main.c          |  811 ++++++++++++++++++++++++++
 sys/arch/hpcmips/stand/lcboot/opt_vr41xx.h    |    2 +
 sys/arch/hpcmips/stand/lcboot/start.S         |  510 ++++++++++++++++
 sys/arch/hpcmips/stand/lcboot/version         |   11 +
 sys/arch/hpcmips/vr/cfireg.h                  |  111 +++
 sys/arch/hpcmips/vr/cmureg.h                  |    4 +-
 sys/arch/hpcmips/vr/flash_vrip.c              |  727 +++++++++++++++++++++++
 sys/arch/hpcmips/vr/flashreg.h                |  111 +++
 sys/arch/hpcmips/vr/flashvar.h                |   75 ++
 sys/arch/hpcmips/vr/vr4181aiu.c               |  416 +++++++++++++
 sys/arch/hpcmips/vr/vr4181aiureg.h            |   92 ++
 sys/arch/hpcmips/vr/vr4181dcureg.h            |   80 ++
 sys/arch/hpcmips/vr/vr4181ecureg.h            |   49 +
 sys/arch/hpcmips/vr/vr4181giu.c               |  428 +++++++++++++
 sys/arch/hpcmips/vr/vr4181giureg.h            |  260 ++++++++-
 sys/arch/hpcmips/vr/vr4181ip.c                |  173 +++++
 sys/arch/hpcmips/vr/vr4181ipvar.h             |   40 +
 sys/arch/hpcmips/vr/vrecu.c                   |  291 +++++++++
 sys/arch/hpcmips/vr/vripif.h                  |    3 +-
 sys/arch/hpcmips/vr/vripunit.h                |    4 +-
 34 files changed, 5227 insertions(+), 21 deletions(-)

diffs (truncated from 5535 to 300 lines):

diff -r de71ace8753a -r 8cc630611a7a sys/arch/hpcmips/conf/LCARD
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpcmips/conf/LCARD       Thu May 01 07:01:58 2003 +0000
@@ -0,0 +1,76 @@
+#
+#      $NetBSD: LCARD,v 1.1 2003/05/01 07:01:58 igy Exp $
+#
+include                "arch/hpcmips/conf/std.lcard"
+
+#options       INCLUDE_CONFIG_FILE     # embed config file in kernel binary
+
+maxusers       8
+
+#options               VRRTCDEBUG      # Debugging use
+#options               VRRTCDEBUG_CONF=1       # Debugging use
+
+options                DEBUG
+options                DIAGNOSTIC
+options                VRCMU_VERBOSE
+
+options                MEMSIZE=16              # memory size, in MB
+
+options        MEMORY_DISK_HOOKS
+options        MEMORY_DISK_IS_ROOT     # force root on memory disk
+options        MEMORY_DISK_SERVER=0    # no userspace memory disk support
+options                MEMORY_DISK_ROOT_SIZE=8192      # Size in blocks
+
+options        DDB                     # in-kernel debugger
+
+#options       WINCE_DEFAULT_SETTING   # Debugging use
+options        DUMP_GIU_LEVEL2_INTR    # Debugging use
+#options       DEBUG_FIND_PCIC         # Debugging use XXX harmful don't define until read source.
+#options       DEBUG_FIND_PCIC_I82365SL_ONLY
+#makeoptions   DEFWARNINGS=no  # override DEFWARNINGS?=yes
+
+file-system    FFS             # fast filesystem with user and group quotas
+options        COMPAT_386BSD_MBRPART # recognize old partition ID
+
+options        INET            # IP + ICMP + TCP + UDP
+
+# compile options
+makeoptions    DEFGP="-G 18"
+
+config         netbsd          root on ? type ?
+
+vr4181giu*     at vr4181ip? addr 0x0b000300 size 0x100 unit VRGIU
+vr4181aiu*     at vr4181ip? unit VRAIU
+
+# must reserve isa mem 0x0-0x100000 and isa I/O 0x0-0x10000 for ECU
+vrisab*        at vr4181giu? isamemoffset 0x100000 isaportoffset 0x10000
+isa*   at vrisab?
+
+com1   at vr4181ip? addr 0x0c000000 size 0x10 unit VRSIU
+pcic0  at vr4181ip? addr 0x0b0008e0 unit VRECU
+
+#
+# hpcmips isa? bus irq locator means:
+#
+# 0x0000000f ISA IRQ#
+# 0x00ff0000 GPIO port#
+# 0x01000000 interrupt signal hold/through     (1:hold/0:though)
+# 0x02000000 interrupt detection level         (1:low /0:high  )
+# 0x04000000 interrupt detection trigger       (1:edge/0:level )
+# 0x08000000 interrupt rising edge             (1:use /0:nouse )
+# 0x10000000 interrupt falling edge            (1:use /0:nouse )
+
+cs0    at isa? port 0x300 irq 0x0d04000a       # CS8900 Ethernet
+pcmcia*        at pcic? controller 0 socket 0
+
+wi*    at pcmcia? function ?           # Lucent WaveLan IEEE (802.11)
+
+flash0 at vr4181ip? addr 0x1f800000 size 0x800000
+flash1 at vr4181ip? addr 0x1e000000 size 0x800000
+
+pseudo-device  md              1       # memory disk device (ramdisk)
+pseudo-device  rnd                     # /dev/random and in-kernel generator
+
+# network pseudo-devices
+pseudo-device  bpfilter        2       # Berkeley packet filter
+pseudo-device  loop                    # network loopback
diff -r de71ace8753a -r 8cc630611a7a sys/arch/hpcmips/conf/files.hpcmips
--- a/sys/arch/hpcmips/conf/files.hpcmips       Thu May 01 06:20:19 2003 +0000
+++ b/sys/arch/hpcmips/conf/files.hpcmips       Thu May 01 07:01:58 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.hpcmips,v 1.89 2002/12/15 09:24:25 takemura Exp $
+#      $NetBSD: files.hpcmips,v 1.90 2003/05/01 07:01:58 igy Exp $
 
 # maxpartitions must be first item in files.${ARCH}.
 maxpartitions 8
@@ -57,10 +57,13 @@
 file   arch/hpcmips/hpcmips/kloader_machdep.c  kloader
 file   arch/hpcmips/hpcmips/kloader_vr41.S     vr41xx & kloader
 file   arch/hpcmips/hpcmips/kloader_tx39.S     tx39xx & kloader
+defflag        opt_no_symbolsz_entry.h         NO_SYMBOLSZ_ENTRY
 defflag        opt_kloader.h                   KLOADER
 defflag        debug_kloader.h                 KLOADER_DEBUG
 defparam opt_kloader_kernel_path.h     KLOADER_KERNEL_PATH
 
+defparam opt_memsize.h                 MEMSIZE
+
 #
 # H/PC Platform common files.
 #
@@ -112,6 +115,9 @@
 device vr4122ip: vripif
 attach vr4122ip at mainbus: vrip_common
 file arch/hpcmips/vr/vr4122ip.c                vr4122ip
+device vr4181ip: vripif
+attach vr4181ip at mainbus: vrip_common
+file arch/hpcmips/vr/vr4181ip.c                vr4181ip
 
 device vrbcu
 attach vrbcu at vripif
@@ -132,6 +138,10 @@
 attach vrgiu at vripif
 file arch/hpcmips/vr/vrgiu.c                   vrgiu
 
+device vr4181giu: vrisabif, hpcioif
+attach vr4181giu at vripif
+file arch/hpcmips/vr/vr4181giu.c               vr4181giu
+
 device vrisab: isabus
 attach vrisab at vrisabif
 file arch/hpcmips/isa/isa_machdep.c            vrisab
@@ -388,6 +398,10 @@
 file   dev/isa/i82365_isa.c                    pcic_isa
 file   dev/isa/i82365_isasubr.c                pcic_isa
 
+# PCIC pcmcia controller on vrip bus.
+attach pcic at vripif with pcic_vrip
+file   arch/hpcmips/vr/vrecu.c                 pcic_vrip
+
 #
 # Machine-independent PCMCIA drivers
 #
@@ -420,4 +434,14 @@
 attach vraiu at vripif
 file arch/hpcmips/vr/vraiu.c   vraiu
 
+# VR4181 Audio Interface Unit
+device vr4181aiu
+attach vr4181aiu at vripif
+file arch/hpcmips/vr/vr4181aiu.c       vr4181aiu       needs-flag
+
+# Flash memory on L-card+      XXX should not be here
+device flash
+attach flash at vripif with flash_vrip
+file arch/hpcmips/vr/flash_vrip.c      flash_vrip      needs-flag
+
 include "arch/hpcmips/conf/majors.hpcmips"
diff -r de71ace8753a -r 8cc630611a7a sys/arch/hpcmips/conf/majors.hpcmips
--- a/sys/arch/hpcmips/conf/majors.hpcmips      Thu May 01 06:20:19 2003 +0000
+++ b/sys/arch/hpcmips/conf/majors.hpcmips      Thu May 01 07:01:58 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: majors.hpcmips,v 1.7 2003/04/25 21:10:53 ragge Exp $
+#      $NetBSD: majors.hpcmips,v 1.8 2003/05/01 07:01:58 igy Exp $
 #
 # Device majors for hpcmips
 #
@@ -59,3 +59,5 @@
 device-major   sequencer       char 53                 sequencer
 device-major   pci             char 54                 pci
 device-major   ksyms           char 55                 ksyms
+device-major   flash           char 100                flash
+device-major   vr4181aiu       char 101                vr4181aiu
diff -r de71ace8753a -r 8cc630611a7a sys/arch/hpcmips/conf/std.lcard
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpcmips/conf/std.lcard   Thu May 01 07:01:58 2003 +0000
@@ -0,0 +1,37 @@
+#      $NetBSD: std.lcard,v 1.1 2003/05/01 07:01:58 igy Exp $
+# standard, required hpcmips info
+
+machine hpcmips mips
+
+options        NOFPU                   # No FPU
+options        SOFTFLOAT               # emulate FPU insn
+
+options        MIPS3                   # R4000/R4400/R4600 CPUs
+options        MIPS3_4100              # VR4100 core
+options        VR41XX                  # NEC VR41xx series
+options        MIPS3_L2CACHE_ABSENT
+options        MIPS3_NO_PV_UNCACHED
+options                NO_SYMBOLSZ_ENTRY
+
+options        VR4181                  # NEC VR4181
+
+options                YBASE=2000
+options                EPOCHYEAR=1970
+
+mainbus0       at root
+cpu*   at mainbus0
+vr4181ip*      at mainbus0 platform GENERIC_MIPS_VR_4181
+vrbcu* at vr4181ip? addr 0x0a000000 size 0x20
+#vrcmu*        at vrip? addr 0x0a000004 size 0x2
+vrdsu* at vr4181ip? addr 0x0b0000e0 size 0x08
+vrrtc* at vr4181ip? addr 0x0b0000c0 size 0x20 unit VRRTC
+options        CONSPEED=115200
+com0   at vr4181ip? addr 0x0c000010 size 0x10 unit VRSIU pwctl PWCTL_COM0
+
+# Standard exec-package options
+options        EXEC_ELF32              # native exec format
+options        EXEC_SCRIPT             # may be unsafe
+
+makeoptions    DEFTEXTADDR="0x80040000"
+makeoptions    MACHINE_ARCH="mipsel"
+makeoptions    DEFCOPTS="-Os -mmemcpy"
diff -r de71ace8753a -r 8cc630611a7a sys/arch/hpcmips/hpcmips/machdep.c
--- a/sys/arch/hpcmips/hpcmips/machdep.c        Thu May 01 06:20:19 2003 +0000
+++ b/sys/arch/hpcmips/hpcmips/machdep.c        Thu May 01 07:01:58 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.81 2003/04/26 11:05:13 ragge Exp $       */
+/*     $NetBSD: machdep.c,v 1.82 2003/05/01 07:01:59 igy Exp $ */
 
 /*-
  * Copyright (c) 1999 Shin Takemura, All rights reserved.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.81 2003/04/26 11:05:13 ragge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.82 2003/05/01 07:01:59 igy Exp $");
 
 #include "opt_vr41xx.h"
 #include "opt_tx39xx.h"
@@ -89,6 +89,8 @@
 #include "opt_kloader_kernel_path.h"
 #include "debug_hpc.h"
 #include "opt_md.h"
+#include "opt_memsize.h"
+#include "opt_no_symbolsz_entry.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -240,10 +242,13 @@
        if (memcmp(eh->e_ident, ELFMAG, SELFMAG) == 0 &&
            eh->e_ident[EI_CLASS] == ELFCLASS) {
                esym = end;
+#ifndef NO_SYMBOLSZ_ENTRY
                if (eh->e_entry != 0) {
                        /* pbsdboot */
                        symbolsz = eh->e_entry;
-               } else {
+               } else
+#endif
+               {
                        /* hpcboot */
                        Elf_Shdr *sh = (void *)(end + eh->e_shoff);
                        for(i = 0; i < eh->e_shnum; i++, sh++)
@@ -442,7 +447,15 @@
 #endif /* DDB || KGDB */
 
        /* Find physical memory regions. */
+#ifdef MEMSIZE
+       mem_clusters[0].start = 0;
+       mem_clusters[0].size = (paddr_t) kernend - MIPS_KSEG0_START;
+       mem_clusters[1].start = (paddr_t) kernend - MIPS_KSEG0_START;
+       mem_clusters[1].size = MEMSIZE * 0x100000 - mem_clusters[1].start;
+       mem_cluster_cnt = 2;
+#else
        (*platform.mem_init)((paddr_t)kernend - MIPS_KSEG0_START);
+#endif
        /* 
         *  Clear currently unused D-RAM area 
         *  (For reboot Windows CE clearly)
diff -r de71ace8753a -r 8cc630611a7a sys/arch/hpcmips/hpcmips/mainbus.c
--- a/sys/arch/hpcmips/hpcmips/mainbus.c        Thu May 01 06:20:19 2003 +0000
+++ b/sys/arch/hpcmips/hpcmips/mainbus.c        Thu May 01 07:01:58 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.23 2002/10/02 05:26:48 thorpej Exp $     */
+/*     $NetBSD: mainbus.c,v 1.24 2003/05/01 07:02:00 igy Exp $ */
 
 /*-
  * Copyright (c) 1999
@@ -72,7 +72,8 @@
 {
        static const char *devnames[] = {       /* ATTACH ORDER */
                "cpu",                          /* 1. CPU */
-               "vrip", "vr4102ip", "vr4122ip", /* 2. System BUS */
+               "vrip", "vr4102ip", "vr4122ip",
+               "vr4181ip",                     /* 2. System BUS */
                "txsim",                        
                "bivideo", "btnmgr", "hpcapm",  /* 3. misc */
        };
diff -r de71ace8753a -r 8cc630611a7a sys/arch/hpcmips/include/loadfile_machdep.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpcmips/include/loadfile_machdep.h       Thu May 01 07:01:58 2003 +0000
@@ -0,0 +1,60 @@
+/* $NetBSD: loadfile_machdep.h,v 1.1 2003/05/01 07:02:00 igy Exp $ */
+
+/*
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the



Home | Main Index | Thread Index | Old Index