Source-Changes-HG archive

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

[src/trunk]: src Add FriendlyARM Mini2440 support.



details:   https://anonhg.NetBSD.org/src/rev/f14e8d56e524
branches:  trunk
changeset: 773260:f14e8d56e524
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Mon Jan 30 03:28:33 2012 +0000

description:
Add FriendlyARM Mini2440 support.
- new code for Samsung S3C2440 SoC.
- update for other S3C2xx0.
This port was done by Paul Fleischer.

diffstat:

 distrib/evbarm/Makefile                      |    10 +-
 distrib/sets/lists/base/md.evbarm            |     3 +-
 doc/CHANGES                                  |     6 +-
 etc/etc.evbarm/Makefile.inc                  |     6 +-
 sys/arch/arm/s3c2xx0/files.s3c2440           |    51 +
 sys/arch/arm/s3c2xx0/s3c2410.c               |     8 +-
 sys/arch/arm/s3c2xx0/s3c2410_extint.c        |    12 +-
 sys/arch/arm/s3c2xx0/s3c2440.c               |   320 +++++
 sys/arch/arm/s3c2xx0/s3c2440_dma.c           |   681 ++++++++++++
 sys/arch/arm/s3c2xx0/s3c2440_dma.h           |   124 ++
 sys/arch/arm/s3c2xx0/s3c2440_extint.c        |   329 ++++++
 sys/arch/arm/s3c2xx0/s3c2440_i2s.c           |   534 +++++++++
 sys/arch/arm/s3c2xx0/s3c2440_i2s.h           |   112 ++
 sys/arch/arm/s3c2xx0/s3c2440_intr.c          |   419 +++++++
 sys/arch/arm/s3c2xx0/s3c2440_intr.h          |    68 +
 sys/arch/arm/s3c2xx0/s3c2440_sdi.c           |   873 ++++++++++++++++
 sys/arch/arm/s3c2xx0/s3c2440_spi.c           |   355 ++++++
 sys/arch/arm/s3c2xx0/s3c2440_touch.c         |   367 ++++++
 sys/arch/arm/s3c2xx0/s3c2440reg.h            |   526 +++++++++
 sys/arch/arm/s3c2xx0/s3c2440var.h            |    76 +
 sys/arch/arm/s3c2xx0/s3c24x0_clk.c           |    32 +-
 sys/arch/arm/s3c2xx0/s3c24x0_lcd.c           |    68 +-
 sys/arch/arm/s3c2xx0/s3c24x0_lcd.h           |     4 +-
 sys/arch/arm/s3c2xx0/s3c24x0_spi.h           |     7 +-
 sys/arch/arm/s3c2xx0/s3c24x0reg.h            |     8 +-
 sys/arch/arm/s3c2xx0/s3c24x0var.h            |     6 +-
 sys/arch/arm/s3c2xx0/s3c2800.c               |    10 +-
 sys/arch/arm/s3c2xx0/s3c2xx0_intr.c          |     7 +-
 sys/arch/arm/s3c2xx0/s3c2xx0_intr.h          |     9 +-
 sys/arch/arm/s3c2xx0/s3c2xx0var.h            |     5 +-
 sys/arch/arm/s3c2xx0/sscom.c                 |    40 +-
 sys/arch/arm/s3c2xx0/sscom_s3c2410.c         |     9 +-
 sys/arch/arm/s3c2xx0/sscom_s3c2440.c         |   196 +++
 sys/arch/arm/s3c2xx0/sscom_var.h             |    26 +-
 sys/arch/evbarm/Makefile                     |     4 +-
 sys/arch/evbarm/conf/MINI2440                |   395 +++++++
 sys/arch/evbarm/conf/MINI2440_INSTALL        |     7 +
 sys/arch/evbarm/conf/files.mini2440          |    33 +
 sys/arch/evbarm/conf/mk.mini2440             |    16 +
 sys/arch/evbarm/conf/std.mini2440            |    28 +
 sys/arch/evbarm/include/loadfile_machdep.h   |    18 +
 sys/arch/evbarm/mini2440/audio_mini2440.c    |   519 +++++++++
 sys/arch/evbarm/mini2440/if_dm_mini2440.c    |   155 ++
 sys/arch/evbarm/mini2440/mini2440_bootinfo.h |    86 +
 sys/arch/evbarm/mini2440/mini2440_lcd.c      |   412 +++++++
 sys/arch/evbarm/mini2440/mini2440_machdep.c  |  1141 +++++++++++++++++++++
 sys/arch/evbarm/mini2440/mini2440_start.S    |    87 +
 sys/arch/evbarm/smdk2xx0/smdk2410_lcd.c      |     9 +-
 sys/arch/evbarm/stand/Makefile               |     3 +-
 sys/arch/evbarm/stand/boot2440/Makefile      |    66 +
 sys/arch/evbarm/stand/boot2440/dev_net.c     |   127 ++
 sys/arch/evbarm/stand/boot2440/dev_sdmmc.c   |  1403 ++++++++++++++++++++++++++
 sys/arch/evbarm/stand/boot2440/dev_sdmmc.h   |   170 +++
 sys/arch/evbarm/stand/boot2440/devopen.c     |   136 ++
 sys/arch/evbarm/stand/boot2440/dm9k.c        |   436 ++++++++
 sys/arch/evbarm/stand/boot2440/dm9k.h        |    37 +
 sys/arch/evbarm/stand/boot2440/entry.S       |   166 +++
 sys/arch/evbarm/stand/boot2440/main.c        |   536 +++++++++
 sys/arch/evbarm/stand/boot2440/netif.c       |   161 ++
 sys/arch/evbarm/stand/boot2440/s3csdi.c      |   453 ++++++++
 sys/arch/evbarm/stand/boot2440/s3csdi.h      |    43 +
 sys/arch/evbarm/stand/boot2440/version       |     5 +
 62 files changed, 11879 insertions(+), 80 deletions(-)

diffs (truncated from 12800 to 300 lines):

diff -r bde60a690785 -r f14e8d56e524 distrib/evbarm/Makefile
--- a/distrib/evbarm/Makefile   Mon Jan 30 01:56:47 2012 +0000
+++ b/distrib/evbarm/Makefile   Mon Jan 30 03:28:33 2012 +0000
@@ -1,11 +1,19 @@
-#      $NetBSD: Makefile,v 1.8 2007/03/06 21:56:58 bouyer Exp $
+#      $NetBSD: Makefile,v 1.9 2012/01/30 03:28:35 nisimura Exp $
 
 .include <bsd.own.mk>
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
+.include <bsd.kernobj.mk>
+
 SUBDIR=                gzboot instkernel cdroms
 TARGETS+=      release
 
+BOOTOBJ!=      cd ${KERNSRCDIR}/arch/evbarm/stand/boot2440 && ${PRINTOBJDIR}
+MDECBOOT=      ${BOOTOBJ}/bootmini2440 
+
+release: check_RELEASEDIR .WAIT ${MDECBOOT}
+       ${RELEASE_INSTALL} ${MDECBOOT} ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation
+
 iso_image:
        ${MAKEDIRTARGET} cdroms iso_image
 
diff -r bde60a690785 -r f14e8d56e524 distrib/sets/lists/base/md.evbarm
--- a/distrib/sets/lists/base/md.evbarm Mon Jan 30 01:56:47 2012 +0000
+++ b/distrib/sets/lists/base/md.evbarm Mon Jan 30 03:28:33 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: md.evbarm,v 1.9 2008/11/29 17:57:33 tsutsui Exp $
+# $NetBSD: md.evbarm,v 1.10 2012/01/30 03:28:35 nisimura Exp $
 ./usr/mdec/gzboot_ADI_BRH_0x00140000.bin       base-sysutil-bin
 ./usr/mdec/gzboot_GEMINI_0x01600000.bin                base-sysutil-bin
 ./usr/mdec/gzboot_IQ80310_0x00080000.bin       base-sysutil-bin
@@ -7,3 +7,4 @@
 ./usr/mdec/gzboot_SMDK2800_0x00000000.bin      base-sysutil-bin
 ./usr/mdec/gzboot_SMDK2800_0x00100000.bin      base-sysutil-bin
 ./usr/mdec/gzboot_TS7200_0x60660000.bin                base-sysutil-bin
+./usr/mdec/bootmini2440                                base-sysutil-bin
diff -r bde60a690785 -r f14e8d56e524 doc/CHANGES
--- a/doc/CHANGES       Mon Jan 30 01:56:47 2012 +0000
+++ b/doc/CHANGES       Mon Jan 30 03:28:33 2012 +0000
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:                   <$Revision: 1.1660 $>
+# LIST OF CHANGES FROM LAST RELEASE:                   <$Revision: 1.1661 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1224,5 +1224,7 @@
        ifconfig(8): When invoked without arguments, ifconfig(8) shows a list
                of all network interfaces in the system instead of the
                usage [mbalmer 20120128]
-       zaurus: Add PXA25x based Zaurus SL-C700/750/760/860 suuport
+       zaurus: Add PXA25x based Zaurus SL-C700/750/760/860 support
                ported by TOYOKURA Atsushi. [tsutsui 20120129]
+       evbarm: Add FrindlyARM Mini2440 support. Code was written by Paul
+               Fleisher. [nisimura 20120130]
diff -r bde60a690785 -r f14e8d56e524 etc/etc.evbarm/Makefile.inc
--- a/etc/etc.evbarm/Makefile.inc       Mon Jan 30 01:56:47 2012 +0000
+++ b/etc/etc.evbarm/Makefile.inc       Mon Jan 30 03:28:33 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.24 2011/11/28 06:15:48 sekiya Exp $
+#      $NetBSD: Makefile.inc,v 1.25 2012/01/30 03:28:34 nisimura Exp $
 #
 #      etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets
 #
@@ -9,8 +9,8 @@
 .if ${MACHINE_ARCH} == "arm"
 # Little endian platforms
 EVBARM_BOARDS=         ADI_BRH CP3100 GEMINI GUMSTIX INTEGRATOR \
-                       IQ80310 IQ80321 SHEEVAPLUG SMDK2410 SMDK2800 \
-                       TEAMASA_NPWR TISDP2420 TS7200 TWINTAIL
+                       IQ80310 IQ80321 SHEEVAPLUG MINI2440 SMDK2410
+                       SMDK2800 TEAMASA_NPWR TISDP2420 TS7200 TWINTAIL
 .else
 # Big endian platforms
 EVBARM_BOARDS=         ADI_BRH
diff -r bde60a690785 -r f14e8d56e524 sys/arch/arm/s3c2xx0/files.s3c2440
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/s3c2xx0/files.s3c2440        Mon Jan 30 03:28:33 2012 +0000
@@ -0,0 +1,51 @@
+#      $NetBSD: files.s3c2440,v 1.1 2012/01/30 03:28:33 nisimura Exp $
+#
+# Configuration info for Samsung S3C2440
+#
+
+# Pull in common info for s3c2800/2400X/2410X
+include arch/arm/s3c2xx0/files.s3c2xx0
+
+
+file   arch/arm/s3c2xx0/s3c2440_intr.c
+file   arch/arm/s3c2xx0/s3c24x0_clk.c
+file   arch/arm/s3c2xx0/s3c2440.c
+file    arch/arm/s3c2xx0/s3c2440_dma.c  # DMA Controller
+
+device ssextio { [index=-1], [addr=0], [size=0], [intr=-1] } : bus_space_generic
+attach ssextio at ssio
+# maximum external interrupt. defaults to 23 to allow all external
+# interrupts. valid values are 4..23.
+defparam opt_s3c2440.h S3C2440_MAX_EXTINT
+file   arch/arm/s3c2xx0/s3c2440_extint.c       ssextio
+
+# UART
+file   arch/arm/s3c2xx0/sscom_s3c2440.c        sscom
+
+# OHCI USB controller
+attach ohci at ssio with ohci_ssio
+file   arch/arm/s3c2xx0/ohci_s3c24x0.c         ohci_ssio
+
+# LCD controller
+device lcd: wsemuldisplaydev, rasops16, rasops8
+file arch/arm/s3c2xx0/s3c24x0_lcd.c            lcd needs-flag
+
+# SPI port
+#  intr locator is for an additional interrupt other than SPI[01] interrupts.
+#device        ssspi {[intr=-1]}
+#attach        ssspi at ssio
+#file  arch/arm/s3c2xx0/s3c2440_spi.c          ssspi
+
+# SDI controller
+device sssdi: sdmmcbus
+attach sssdi at ssio
+file   arch/arm/s3c2xx0/s3c2440_sdi.c          sssdi
+
+device ssiis {}
+attach ssiis at ssio
+file   arch/arm/s3c2xx0/s3c2440_i2s.c          ssiis
+
+# Touchscreen Controller
+device sstouch: wsmousedev, tpcalib
+attach sstouch at ssio
+file   arch/arm/s3c2xx0/s3c2440_touch.c        sstouch
diff -r bde60a690785 -r f14e8d56e524 sys/arch/arm/s3c2xx0/s3c2410.c
--- a/sys/arch/arm/s3c2xx0/s3c2410.c    Mon Jan 30 01:56:47 2012 +0000
+++ b/sys/arch/arm/s3c2xx0/s3c2410.c    Mon Jan 30 03:28:33 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: s3c2410.c,v 1.11 2011/07/01 20:31:39 dyoung Exp $ */
+/*     $NetBSD: s3c2410.c,v 1.12 2012/01/30 03:28:33 nisimura Exp $ */
 
 /*
  * Copyright (c) 2003, 2005  Genetec corporation.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: s3c2410.c,v 1.11 2011/07/01 20:31:39 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: s3c2410.c,v 1.12 2012/01/30 03:28:33 nisimura Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -93,7 +93,7 @@
 void
 s3c2410_attach(struct device *parent, struct device *self, void *aux)
 {
-       struct s3c24x0_softc *sc = (struct s3c24x0_softc *) self;
+       struct s3c24x0_softc *sc = device_private(self);
        bus_space_tag_t iot;
        const char *which_registers;    /* for panic message */
 
@@ -179,7 +179,7 @@
 s3c2410_search(struct device * parent, struct cfdata * cf,
               const int *ldesc, void *aux)
 {
-       struct s3c24x0_softc *sc = (struct s3c24x0_softc *) parent;
+       struct s3c24x0_softc *sc = device_private(parent);
        struct s3c2xx0_attach_args aa;
 
        aa.sa_sc = sc;
diff -r bde60a690785 -r f14e8d56e524 sys/arch/arm/s3c2xx0/s3c2410_extint.c
--- a/sys/arch/arm/s3c2xx0/s3c2410_extint.c     Mon Jan 30 01:56:47 2012 +0000
+++ b/sys/arch/arm/s3c2xx0/s3c2410_extint.c     Mon Jan 30 03:28:33 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: s3c2410_extint.c,v 1.11 2011/07/01 20:31:39 dyoung Exp $ */
+/* $NetBSD: s3c2410_extint.c,v 1.12 2012/01/30 03:28:33 nisimura Exp $ */
 
 /*
  * Copyright (c) 2003  Genetec corporation.  All rights reserved.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: s3c2410_extint.c,v 1.11 2011/07/01 20:31:39 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: s3c2410_extint.c,v 1.12 2012/01/30 03:28:33 nisimura Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -68,7 +68,7 @@
 #define        N_EXTINT        (S3C2410_EXTINT_MAX - EXTINT_CASCADE_MIN +1)
 
 struct ssextio_softc {
-       struct device   sc_dev;
+       device_t        sc_dev;
 
        bus_space_tag_t sc_iot;
        bus_space_handle_t sc_ioh;
@@ -143,7 +143,7 @@
 ssextio_attach(struct device *parent, struct device *self, void *aux)
 {
        struct ssextio_softc *sc = (struct ssextio_softc*)self;
-       struct s3c24x0_softc *cpuc = (struct s3c24x0_softc *)parent;
+       struct s3c24x0_softc *cpuc = ((struct s3c2xx0_attach_args *)aux)->sa_sc;
 
        aprint_normal("\n");
 
@@ -171,8 +171,8 @@
 ssextio_search(struct device *parent, struct cfdata *cf,
               const int *ldesc, void *aux)
 {
-       struct ssextio_softc *sc = (struct ssextio_softc *)parent;
-       struct s3c24x0_softc *cpuc =(struct s3c24x0_softc *) device_parent(&sc->sc_dev);
+       struct ssextio_softc *sc = device_private(parent);
+       struct s3c24x0_softc *cpuc =(struct s3c24x0_softc *) device_private(device_parent(sc->sc_dev));
        struct s3c2xx0_attach_args sa;
 
        sa.sa_sc = sc;
diff -r bde60a690785 -r f14e8d56e524 sys/arch/arm/s3c2xx0/s3c2440.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/s3c2xx0/s3c2440.c    Mon Jan 30 03:28:33 2012 +0000
@@ -0,0 +1,320 @@
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Fleischer <paul%xpg.dk@localhost>
+ *
+ * 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
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Derived from s3c2410.c */
+/*
+ * Copyright (c) 2003, 2005  Genetec corporation.  All rights reserved.
+ * Written by Hiroyuki Bessho for Genetec corporation.
+ *
+ * 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
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of Genetec corporation may not be used to endorse
+ *    or promote products derived from this software without specific prior
+ *    written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GENETEC CORP. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GENETEC CORP.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: s3c2440.c,v 1.1 2012/01/30 03:28:33 nisimura Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <sys/kernel.h>
+#include <sys/reboot.h>
+
+#include <machine/cpu.h>
+#include <sys/bus.h>
+
+#include <arm/cpufunc.h>
+#include <arm/mainbus/mainbus.h>
+#include <arm/s3c2xx0/s3c2440reg.h>
+#include <arm/s3c2xx0/s3c2440var.h>
+#include <arm/s3c2xx0/s3c2440_dma.h>
+
+#include "locators.h"
+#include "opt_cpuoptions.h"
+
+/* prototypes */
+static int     s3c2440_match(struct device *, struct cfdata *, void *);



Home | Main Index | Thread Index | Old Index