Source-Changes-HG archive

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

[src/trunk]: src/sys/arch initial support for CI20 / Ingenic JZ4780



details:   https://anonhg.NetBSD.org/src/rev/0bf53995a44b
branches:  trunk
changeset: 333933:0bf53995a44b
user:      macallan <macallan%NetBSD.org@localhost>
date:      Sat Nov 22 15:17:01 2014 +0000

description:
initial support for CI20 / Ingenic JZ4780
not much there yet, it loads, attaches a serial port and you can drop into
ddb

diffstat:

 sys/arch/evbmips/conf/CI20           |  215 +++++++++++++++++++++
 sys/arch/evbmips/conf/files.ingenic  |   23 ++
 sys/arch/evbmips/conf/std.ingenic    |   15 +
 sys/arch/evbmips/evbmips/interrupt.c |    6 +-
 sys/arch/evbmips/ingenic/autoconf.c  |   69 ++++++
 sys/arch/evbmips/ingenic/clock.c     |   93 +++++++++
 sys/arch/evbmips/ingenic/machdep.c   |  346 +++++++++++++++++++++++++++++++++++
 sys/arch/evbmips/ingenic/mainbus.c   |   90 +++++++++
 sys/arch/mips/conf/files.ingenic     |    6 +
 sys/arch/mips/ingenic/ingenic_com.c  |  205 ++++++++++++++++++++
 sys/arch/mips/ingenic/ingenic_regs.h |  105 ++++++++++
 11 files changed, 1171 insertions(+), 2 deletions(-)

diffs (truncated from 1237 to 300 lines):

diff -r 0ce66d32c82a -r 0bf53995a44b sys/arch/evbmips/conf/CI20
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/conf/CI20        Sat Nov 22 15:17:01 2014 +0000
@@ -0,0 +1,215 @@
+#      $NetBSD: CI20,v 1.1 2014/11/22 15:17:02 macallan Exp $
+#
+# MIPS Creator CI20
+#
+
+# for now
+include        "arch/evbmips/conf/std.ingenic"
+
+#options       INCLUDE_CONFIG_FILE     # embed config file in kernel binary
+
+#ident                 "DB120-$Revision: 1.1 $"
+
+maxusers       32
+
+#makeoptions   COPTS="-Os"             # Optimise for space. Implies -O2
+
+options        MIPS32R2
+makeoptions    CPUFLAGS+="-mips32r2"
+makeoptions    NEED_MDSETIMAGE="yes"
+makeoptions    NEED_BINARY="yes"
+makeoptions    NEED_UBOOTIMAGE="gz"
+options        COM_16650,COM_TOLERANCE=50      # +/- 5%
+options        CONSPEED=115200 # u-boot default
+options                CONSADDR=0x10030000
+options        MEMSIZE="(256*1024*1024)"
+
+# Options for necessary to use MD
+#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=6144      # size of memory disk, in blocks
+#options       MEMORY_DISK_ROOT_SIZE=16384     # size of memory disk, in blocks
+#options       MEMORY_DISK_ROOT_SIZE=7300
+
+# Size reduction options
+#options       VNODE_OP_NOINLINE
+#options       PIPE_SOCKETPAIR
+options                SOSEND_NO_LOAN
+
+# Standard system options
+options        KTRACE          # system call tracing support
+#options       SYSVMSG         # System V message queues
+#options       SYSVSEM         # System V semaphores
+#options       SYSVSHM         # System V shared memory
+options        NTP             # network time protocol
+
+# Debugging options
+options        DIAGNOSTIC      # extra kernel sanity checking
+options        DEBUG           # extra kernel debugging support
+#options       KMEMSTATS       # kernel memory statistics (vmstat -m)
+#options       USERCONF        # userconf(4) support
+#options       SYSCTL_INCLUDE_DESCR    # Include sysctl descriptions in kernel
+options        DDB             # kernel dynamic debugger
+options        DDB_HISTORY_SIZE=100 # enable history editing in DDB
+makeoptions    DEBUG="-g"      # compile full symbol table
+makeoptions    COPY_SYMTAB=1   # size for embedded symbol table
+
+# Compatibility options
+#options       COMPAT_43       # compatibility with 4.3BSD binaries
+#options       COMPAT_09       # NetBSD 0.9,
+#options       COMPAT_10       # NetBSD 1.0,
+#options       COMPAT_11       # NetBSD 1.1,
+#options       COMPAT_12       # NetBSD 1.2,
+#options       COMPAT_13       # NetBSD 1.3,
+#options       COMPAT_14       # NetBSD 1.4,
+#options       COMPAT_15       # NetBSD 1.5,
+#options       COMPAT_16       # NetBSD 1.6,
+#options       COMPAT_20       # NetBSD 2.0,
+#options       COMPAT_30       # NetBSD 3.0, and
+#options       COMPAT_40       # NetBSD 4.0 binary compatibility.
+#options       EXEC_ECOFF      # exec ECOFF binaries
+#options       COMPAT_ULTRIX   # binary compatibility with Ultrix
+#options       COMPAT_BSDPTY   # /dev/[pt]ty?? ptys.
+
+# File systems
+file-system    FFS             # Berkeley Fast Filesystem
+file-system    MFS             # memory-based filesystem
+#file-system   EXT2FS          # second extended file system (linux)
+file-system    NFS             # Sun NFS-compatible filesystem client
+#file-system   KERNFS          # kernel data-structure filesystem
+#file-system   NULLFS          # NULL layered filesystem
+#file-system   OVERLAY         # overlay file system
+#file-system   FDESC           # user file descriptor filesystem
+#file-system   UMAPFS          # uid/gid remapping filesystem
+#file-system   LFS             # Log-based filesystem (still experimental)
+#file-system   PROCFS          # /proc
+#file-system   CD9660          # ISO 9660 + Rock Ridge file system
+#file-system   UNION           # union file system
+#file-system   MSDOSFS         # MS-DOS FAT filesystem(s).
+#file-system   CODA            # Coda File System; also needs vcoda (below)
+#file-system   PTYFS           # /dev/pts/N support
+
+# File system options
+#options       NFSSERVER       # Sun NFS-compatible filesystem server
+#options       QUOTA           # legacy UFS quotas
+#options       QUOTA2          # new, in-filesystem UFS quotas
+#options       FFS_EI          # FFS Endian Independent support
+options        WAPBL           # File system journaling support
+options        FFS_NO_SNAPSHOT # No FFS snapshot support
+#options       EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
+                               # immutable) behave as system flags.
+
+# Networking options
+#options       GATEWAY         # IP packet forwarding
+options        INET            # Internet protocols
+#options       INET6           # IPV6
+#options       IPSEC           # IP security
+#options       IPSEC_DEBUG     # debug for IP security
+#options       MROUTING        # packet forwarding of multicast packets
+#options       PIM             # Protocol Independent Multicast
+#options       NETATALK        # AppleTalk (over Ethernet) protocol
+#options       PPP_BSDCOMP     # BSD-Compress compression support for PPP
+#options       PPP_DEFLATE     # Deflate compression support for PPP
+#options       PPP_FILTER      # Active filter support for PPP (requires bpf)
+#options       IPFILTER_LOG    # ipmon(8) log support
+#options       IPFILTER_LOOKUP # ippool(8) support
+
+# Compatibility with 4.2BSD implementation of TCP/IP.  Not recommended.
+#options       TCP_COMPAT_42
+
+# JIT compiler for bpfilter
+#options       SLJIT
+#options       BPFJIT
+
+# These options enable verbose messages for several subsystems.
+# Warning, these may compile large string tables into the kernel!
+options        MIIVERBOSE      # verbose PHY autoconfig messages
+
+# Bitmask for enabling the PCI IDE channels in the southbridge.
+# Set bit 0 (0x01) for channel 0, bit 1 (0x02) for channel 1.
+#
+# Do this if your firmware (usually PMON and YAMON) doens't enable the IDE
+# channels for you (thus causing the NetBSD `pciide' driver to ignore them).
+#options       PCI_NETBSD_ENABLE_IDE=0x1
+
+options        NFS_BOOT_BOOTP
+#options       NFS_BOOT_DHCP
+#options       NFS_V2_ONLY
+
+config         netbsd  root on ? type ?
+
+mainbus0       at root
+cpu0           at mainbus?
+#wdog0         at mainbus?
+#options               COM_REGMAP
+com*           at mainbus?
+#ehci*         at arbus? addr ?
+#usb*          at ehci?
+#uhub*         at usb?
+#uhub*         at uhub? port ?
+#umass*                at uhub? port ? configuration ? interface ?
+#scsibus*      at umass? channel ?
+#sd*           at scsibus? target ? lun ?
+#ae*           at arbus? addr ?
+#ath*          at arbus? addr ?
+#athflash*     at arbus? addr ?
+#argpio*       at arbus? addr ?
+#gpio*         at argpio?
+
+# no RTC!  so fake with a stub (required to prevent evbmips panic)
+
+
+# MII/PHY support
+#acphy*                at mii? phy ?           # DAltima AC101 and AMD Am79c874 PHYs
+#amhphy*       at mii? phy ?           # AMD 79c901 Ethernet PHYs
+#dmphy*                at mii? phy ?           # Davicom DM9101 PHYs
+#glxtphy*      at mii? phy ?           # Level One LXT-1000 PHYs
+#gphyter*      at mii? phy ?           # NS83861 Gig-E PHY
+#icsphy*       at mii? phy ?           # Integrated Circuit Systems ICS1890
+#lxtphy*       at mii? phy ?           # Level One LXT-970 PHYs
+#makphy*       at mii? phy ?           # Marvell Semiconductor 88E1000 PHYs
+#nsphy*                at mii? phy ?           # NS83840 PHYs
+#nsphyter*     at mii? phy ?           # NS83843 PHYs
+#pnaphy*       at mii? phy ?           # generic HomePNA PHYs
+#qsphy*                at mii? phy ?           # Quality Semiconductor QS6612 PHYs
+#sqphy*                at mii? phy ?           # Seeq 80220/80221/80223 PHYs
+#tlphy*                at mii? phy ?           # ThunderLAN PHYs
+#tqphy*                at mii? phy ?           # TDK Semiconductor PHYs
+#rlphy*                at mii? phy ?           # RealTek PHYs
+#ukphy*                at mii? phy ?           # generic unknown PHYs
+
+
+# Pseudo-devices
+
+# Disk/mass storage pseudo-devices
+#pseudo-device ccd                             # concatenated disk devices
+#pseudo-device raid                            # RAIDframe disk driver
+#pseudo-device fss                             # file system snapshot device
+#pseudo-device md                              # memory disk device (ramdisk)
+#pseudo-device vnd                             # disk-like interface to files
+
+# Network pseudo-devices
+pseudo-device  bpfilter                        # Berkeley packet filter
+#pseudo-device ipfilter                        # IP filter (firewall) and NAT
+pseudo-device  loop                            # network loopback
+#pseudo-device ppp                             # Point-to-Point Protocol
+#pseudo-device sl                              # Serial Line IP
+#pseudo-device strip                           # Starmode Radio IP (Metricom)
+#pseudo-device tun                             # network tunneling over tty
+#pseudo-device tap                             # virtual Ethernet
+#pseudo-device gre                             # generic L3 over IP tunnel
+#pseudo-device ipip                            # RFC 2003 IP Encapsulation
+#pseudo-device gif                             # RFC1933 tunnel
+#pseudo-device faith                           # IPv[46] tcp relay translation
+#pseudo-device stf                             # 6to4 IPv6 over IPv4 encapsulation
+#pseudo-device vlan                            # IEEE 802.1q encapsulation
+#pseudo-device bridge                          # simple inter-network bridging
+
+# Miscellaneous pseudo-devices
+pseudo-device  pty                             # pseudo-terminals
+pseudo-device  clockctl                        # user control of clock subsystem
+pseudo-device  ksyms                           # /dev/ksyms
+
+# A pseudo device needed for Coda              # also needs CODA (above)
+#pseudo-device vcoda                           # coda minicache <-> venus comm.
diff -r 0ce66d32c82a -r 0bf53995a44b sys/arch/evbmips/conf/files.ingenic
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/conf/files.ingenic       Sat Nov 22 15:17:01 2014 +0000
@@ -0,0 +1,23 @@
+#      $NetBSD: files.ingenic,v 1.1 2014/11/22 15:17:02 macallan Exp $
+
+#file  arch/evbmips/ingenic/intr.c
+
+file   arch/evbmips/ingenic/autoconf.c
+file   arch/evbmips/ingenic/machdep.c
+
+file   arch/mips/mips/bus_dma.c
+file   arch/evbmips/evbmips/disksubr.c
+file   arch/evbmips/evbmips/interrupt.c
+file   arch/evbmips/ingenic/clock.c
+
+# System bus
+device mainbus { }
+attach mainbus at root
+file   arch/evbmips/ingenic/mainbus.c          mainbus
+
+device cpu
+attach cpu at mainbus
+file   arch/evbmips/evbmips/cpu.c              cpu
+
+# Memory Disk
+file   dev/md_root.c                           memory_disk_hooks
diff -r 0ce66d32c82a -r 0bf53995a44b sys/arch/evbmips/conf/std.ingenic
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/conf/std.ingenic Sat Nov 22 15:17:01 2014 +0000
@@ -0,0 +1,15 @@
+# $NetBSD: std.ingenic,v 1.1 2014/11/22 15:17:02 macallan Exp $
+
+machine evbmips mips
+include                "conf/std"      # MI standard options
+
+options                EXEC_ELF32      # exec ELF32 binaries
+options                EXEC_SCRIPT     # exec #! scripts
+
+makeoptions    CPUFLAGS+="-mips32r2"
+makeoptions    DEFTEXTADDR="0x80020000"
+makeoptions    BOARDTYPE="ingenic"
+
+include        "arch/evbmips/conf/files.ingenic"
+include        "arch/mips/conf/files.ingenic"
+
diff -r 0ce66d32c82a -r 0bf53995a44b sys/arch/evbmips/evbmips/interrupt.c
--- a/sys/arch/evbmips/evbmips/interrupt.c      Sat Nov 22 15:14:35 2014 +0000
+++ b/sys/arch/evbmips/evbmips/interrupt.c      Sat Nov 22 15:17:01 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interrupt.c,v 1.19 2013/05/14 09:16:59 macallan Exp $  */
+/*     $NetBSD: interrupt.c,v 1.20 2014/11/22 15:17:02 macallan Exp $  */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.19 2013/05/14 09:16:59 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.20 2014/11/22 15:17:02 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -79,8 +79,10 @@
                        KASSERTMSG(ipl == IPL_SCHED,
                            "%s: ipl (%d) != IPL_SCHED (%d)",
                             __func__, ipl, IPL_SCHED);
+#ifdef MIPS3_ENABLE_CLOCK_INTR
                        /* call the common MIPS3 clock interrupt handler */ 
                        mips3_clockintr(&cf);
+#endif
                        pending ^= MIPS_INT_MASK_5;
                }
 
diff -r 0ce66d32c82a -r 0bf53995a44b sys/arch/evbmips/ingenic/autoconf.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/ingenic/autoconf.c       Sat Nov 22 15:17:01 2014 +0000
@@ -0,0 +1,69 @@
+/* $NetBSD: autoconf.c,v 1.1 2014/11/22 15:17:02 macallan Exp $ */
+



Home | Main Index | Thread Index | Old Index