Source-Changes-HG archive

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

[src/rmind-uvmplock]: src/sys sync with head (and fix few botches with this)



details:   https://anonhg.NetBSD.org/src/rev/a224223d5fc6
branches:  rmind-uvmplock
changeset: 753068:a224223d5fc6
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sun Mar 06 00:26:56 2011 +0000

description:
sync with head (and fix few botches with this)

diffstat:

 sys/arch/algor/algor/algor_p6032_intr.c                  |     10 +-
 sys/arch/algor/algor/algor_p6032var.h                    |      4 +-
 sys/arch/algor/conf/P6032                                |      6 +-
 sys/arch/arm/marvell/files.marvell                       |      7 +-
 sys/arch/arm/marvell/mvsoc.c                             |      7 +-
 sys/arch/arm/marvell/mvsocrtc.c                          |    177 +
 sys/arch/arm/marvell/mvsocrtcreg.h                       |     57 +
 sys/arch/evbarm/conf/SHEEVAPLUG                          |      7 +-
 sys/arch/m68k/include/param.h                            |      6 +-
 sys/arch/mips/conf/kern.ldscript                         |     31 +-
 sys/arch/mips/include/mips_param.h                       |     11 +-
 sys/arch/next68k/next68k/machdep.c                       |      6 +-
 sys/arch/powerpc/include/param.h                         |      6 +-
 sys/arch/powerpc/powerpc/bus_space.c                     |      7 +-
 sys/arch/sgimips/conf/GENERIC32_IP12                     |     10 +-
 sys/arch/sgimips/conf/GENERIC32_IP2x                     |     10 +-
 sys/arch/sgimips/conf/GENERIC32_IP3x                     |     10 +-
 sys/arch/x86/acpi/acpi_cpu_md.c                          |    219 +-
 sys/arch/xen/xen/xbdback_xenbus.c                        |      7 +-
 sys/compat/darwin/darwin_exec.h                          |      3 +-
 sys/compat/darwin/darwin_sysctl.c                        |      8 +-
 sys/compat/mach/mach_exec.h                              |      3 +-
 sys/compat/osf1/osf1_exec.h                              |      3 +-
 sys/dev/acpi/acpi_cpu.c                                  |      6 +-
 sys/dev/acpi/acpi_cpu.h                                  |      7 +-
 sys/dev/acpi/acpi_cpu_pstate.c                           |     16 +-
 sys/dev/ic/nslm7x.c                                      |      9 +-
 sys/dev/marvell/if_mvgbe.c                               |     33 +-
 sys/dev/nand/nand.h                                      |      8 +-
 sys/dev/pci/pcidevs                                      |      4 +-
 sys/dev/pci/pcidevs.h                                    |      6 +-
 sys/dev/pci/pcidevs_data.h                               |  10064 ++++++------
 sys/dist/ipf/netinet/ip_rcmd_pxy.c                       |      6 +-
 sys/external/bsd/acpica/dist/include/platform/acnetbsd.h |      4 +-
 sys/external/bsd/drm/dist/bsd-core/drm_irq.c             |      2 +
 sys/external/isc/atheros_hal/conf/files.ath_hal          |      3 +-
 sys/lib/libkern/libkern.h                                |      4 +-
 sys/modules/radeondrm/Makefile                           |      4 +-
 sys/rump/dev/lib/librnd/component.c                      |     13 +-
 sys/rump/dev/lib/libucom/ucom_at_usb.c                   |     24 +-
 40 files changed, 5582 insertions(+), 5246 deletions(-)

diffs (truncated from 14655 to 300 lines):

diff -r 5f75acd26cd9 -r a224223d5fc6 sys/arch/algor/algor/algor_p6032_intr.c
--- a/sys/arch/algor/algor/algor_p6032_intr.c   Sat Mar 05 20:49:03 2011 +0000
+++ b/sys/arch/algor/algor/algor_p6032_intr.c   Sun Mar 06 00:26:56 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: algor_p6032_intr.c,v 1.16.20.1 2011/03/05 20:49:07 rmind Exp $ */
+/*     $NetBSD: algor_p6032_intr.c,v 1.16.20.2 2011/03/06 00:26:56 rmind Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: algor_p6032_intr.c,v 1.16.20.1 2011/03/05 20:49:07 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: algor_p6032_intr.c,v 1.16.20.2 2011/03/06 00:26:56 rmind Exp $");
 
 #include "opt_ddb.h"
 #define        __INTR_PRIVATE
@@ -85,7 +85,7 @@
 
 #define        NIRQMAPS        10
 
-const char *p6032_intrnames[NIRQMAPS] = {
+const char * const p6032_intrnames[NIRQMAPS] = {
        "gpin 0",
        "gpin 1",
        "gpin 2",
@@ -167,7 +167,7 @@
 };
 
 struct p6032_cpuintr p6032_cpuintrs[NINTRS];
-const char *p6032_cpuintrnames[NINTRS] = {
+const char * const p6032_cpuintrnames[NINTRS] = {
        "int 0 (pci)",
        "int 1 (isa)",
 };
@@ -198,7 +198,7 @@
                    EVCNT_TYPE_INTR, NULL, "mips", p6032_cpuintrnames[i]);
        }
 
-       for (i = 0; i <= NIRQMAPS; i++) {
+       for (i = 0; i < __arraycount(p6032_irqmap); i++) {
                irqmap = &p6032_irqmap[i];
 
                evcnt_attach_dynamic(&p6032_intrtab[i].intr_count,
diff -r 5f75acd26cd9 -r a224223d5fc6 sys/arch/algor/algor/algor_p6032var.h
--- a/sys/arch/algor/algor/algor_p6032var.h     Sat Mar 05 20:49:03 2011 +0000
+++ b/sys/arch/algor/algor/algor_p6032var.h     Sun Mar 06 00:26:56 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: algor_p6032var.h,v 1.2 2008/04/28 20:23:10 martin Exp $        */
+/*     $NetBSD: algor_p6032var.h,v 1.2.22.1 2011/03/06 00:26:56 rmind Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
 
 void   algor_p6032_intr_init(struct p6032_config *);
 
-void   algor_p6032_iointr(u_int32_t, u_int32_t, u_int32_t, u_int32_t);
+void   algor_p6032_iointr(int, vaddr_t, uint32_t);
 
 void   algor_p6032_cal_timer(bus_space_tag_t, bus_space_handle_t);
 #endif /* _KERNEL */
diff -r 5f75acd26cd9 -r a224223d5fc6 sys/arch/algor/conf/P6032
--- a/sys/arch/algor/conf/P6032 Sat Mar 05 20:49:03 2011 +0000
+++ b/sys/arch/algor/conf/P6032 Sun Mar 06 00:26:56 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: P6032,v 1.51.2.2 2011/03/05 20:49:08 rmind Exp $
+#      $NetBSD: P6032,v 1.51.2.3 2011/03/06 00:26:56 rmind Exp $
 #
 # Algorithmics P-6032 kernel.
 #
@@ -7,7 +7,7 @@
 
 #options       INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "P6032-$Revision: 1.51.2.2 $"
+#ident                 "P6032-$Revision: 1.51.2.3 $"
 
 maxusers 32
 
@@ -25,7 +25,7 @@
 options        DDB                     # kernel debugger
 makeoptions    DEBUG="-g"
 #makeoptions   DEBUGLIST="pattern1 pattern2 ..."
-options        SYMTAB_SPACE=360000
+options        SYMTAB_SPACE=370000
 
 # File systems
 file-system    FFS             # Fast file system
diff -r 5f75acd26cd9 -r a224223d5fc6 sys/arch/arm/marvell/files.marvell
--- a/sys/arch/arm/marvell/files.marvell        Sat Mar 05 20:49:03 2011 +0000
+++ b/sys/arch/arm/marvell/files.marvell        Sun Mar 06 00:26:56 2011 +0000
@@ -1,4 +1,4 @@
-#       $NetBSD: files.marvell,v 1.3.2.2 2011/03/05 20:49:37 rmind Exp $
+#       $NetBSD: files.marvell,v 1.3.2.3 2011/03/06 00:26:57 rmind Exp $
 #
 # Configuration info for Marvell System on Chip support
 #
@@ -29,6 +29,11 @@
 file   arch/arm/marvell/mvsoctmr.c             mvsoctmr
 
 
+# RTC
+device mvsocrtc
+attach mvsocrtc at mvsoc
+file   arch/arm/marvell/mvsocrtc.c             mvsocrtc
+
 # PCI Express Interface
 attach mvpex at mvsoc with mvpex_mbus
 
diff -r 5f75acd26cd9 -r a224223d5fc6 sys/arch/arm/marvell/mvsoc.c
--- a/sys/arch/arm/marvell/mvsoc.c      Sat Mar 05 20:49:03 2011 +0000
+++ b/sys/arch/arm/marvell/mvsoc.c      Sun Mar 06 00:26:56 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mvsoc.c,v 1.2.2.2 2011/03/05 20:49:37 rmind Exp $      */
+/*     $NetBSD: mvsoc.c,v 1.2.2.3 2011/03/06 00:26:57 rmind Exp $      */
 /*
  * Copyright (c) 2007, 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.2.2.2 2011/03/05 20:49:37 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsoc.c,v 1.2.2.3 2011/03/06 00:26:57 rmind Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_mvsoc.h"
@@ -301,6 +301,7 @@
 #if defined(KIRKWOOD)
     { KIRKWOOD(88F6180),"mvsoctmr",0, MVSOC_TMR_BASE,  IRQ_DEFAULT },
     { KIRKWOOD(88F6180),"mvsocgpp",0, MVSOC_GPP_BASE,  KIRKWOOD_IRQ_GPIOLO7_0},
+    { KIRKWOOD(88F6180),"mvsocrtc",0, KIRKWOOD_RTC_BASE,IRQ_DEFAULT },
     { KIRKWOOD(88F6180),"com",     0, MVSOC_COM0_BASE, KIRKWOOD_IRQ_UART0INT },
     { KIRKWOOD(88F6180),"com",     1, MVSOC_COM1_BASE, KIRKWOOD_IRQ_UART1INT },
     { KIRKWOOD(88F6180),"ehci",    0, KIRKWOOD_USB_BASE,KIRKWOOD_IRQ_USB0CNT },
@@ -313,6 +314,7 @@
 
     { KIRKWOOD(88F6192),"mvsoctmr",0, MVSOC_TMR_BASE,  IRQ_DEFAULT },
     { KIRKWOOD(88F6192),"mvsocgpp",0, MVSOC_GPP_BASE,  KIRKWOOD_IRQ_GPIOLO7_0},
+    { KIRKWOOD(88F6192),"mvsocrtc",0, KIRKWOOD_RTC_BASE,IRQ_DEFAULT },
     { KIRKWOOD(88F6192),"com",     0, MVSOC_COM0_BASE, KIRKWOOD_IRQ_UART0INT },
     { KIRKWOOD(88F6192),"com",     1, MVSOC_COM1_BASE, KIRKWOOD_IRQ_UART1INT },
     { KIRKWOOD(88F6192),"ehci",    0, KIRKWOOD_USB_BASE,KIRKWOOD_IRQ_USB0CNT },
@@ -327,6 +329,7 @@
 
     { KIRKWOOD(88F6281),"mvsoctmr",0, MVSOC_TMR_BASE,  IRQ_DEFAULT },
     { KIRKWOOD(88F6281),"mvsocgpp",0, MVSOC_GPP_BASE,  KIRKWOOD_IRQ_GPIOLO7_0},
+    { KIRKWOOD(88F6281),"mvsocrtc",0, KIRKWOOD_RTC_BASE,IRQ_DEFAULT },
     { KIRKWOOD(88F6281),"com",     0, MVSOC_COM0_BASE, KIRKWOOD_IRQ_UART0INT },
     { KIRKWOOD(88F6281),"com",     1, MVSOC_COM1_BASE, KIRKWOOD_IRQ_UART1INT },
     { KIRKWOOD(88F6281),"ehci",    0, KIRKWOOD_USB_BASE,KIRKWOOD_IRQ_USB0CNT },
diff -r 5f75acd26cd9 -r a224223d5fc6 sys/arch/arm/marvell/mvsocrtc.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/marvell/mvsocrtc.c   Sun Mar 06 00:26:56 2011 +0000
@@ -0,0 +1,177 @@
+/*     $NetBSD: mvsocrtc.c,v 1.1.2.2 2011/03/06 00:26:57 rmind Exp $   */
+
+/*-
+ * Copyright (c) 2010 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
+ *    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.
+ */
+
+/*
+ * Driver for real time clock unit on Marvell kirkwood and possibly other
+ * SoCs.  Supports only the time/date keeping functions.  No support for
+ * the rtc unit alarm / interrupt functions.
+ *
+ * Written 10/2010 by Brett Slager -- all rights assigned to the NetBSD
+ * Foundation.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: mvsocrtc.c,v 1.1.2.2 2011/03/06 00:26:57 rmind Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <sys/kernel.h>
+
+#include <dev/clock_subr.h>
+
+#include <machine/bus.h>
+
+#include <arm/marvell/mvsocrtcreg.h>
+#include <dev/marvell/marvellvar.h>
+
+struct mvsocrtc_softc {
+       device_t                sc_dev;
+       bus_space_tag_t         sc_iot;
+       bus_space_handle_t      sc_ioh;
+       struct todr_chip_handle sc_todr;
+};
+
+static int mvsocrtc_match(device_t, cfdata_t, void *);
+static void mvsocrtc_attach(device_t, device_t, void *);
+static int mvsocrtc_todr_gettime(todr_chip_handle_t, struct clock_ymdhms *);
+static int mvsocrtc_todr_settime(todr_chip_handle_t, struct clock_ymdhms *);
+
+CFATTACH_DECL_NEW(mvsocrtc, sizeof(struct mvsocrtc_softc), mvsocrtc_match,
+    mvsocrtc_attach, NULL, NULL);
+
+static int
+mvsocrtc_match(device_t parent, cfdata_t cf, void *aux)
+{
+       struct marvell_attach_args * const mva = aux;
+
+       if (strcmp(mva->mva_name, cf->cf_name) != 0)
+               return 0;
+       if (mva->mva_offset == MVA_OFFSET_DEFAULT)
+               return 0;
+
+       mva->mva_size = MVSOCRTC_SIZE;
+       return 1;
+}
+
+static void
+mvsocrtc_attach(device_t parent, device_t self, void *aux)
+{
+       struct mvsocrtc_softc * const sc = device_private(self);
+       struct marvell_attach_args * const mva = aux;
+
+       sc->sc_dev = self;
+       sc->sc_iot = mva->mva_iot;
+
+       aprint_normal(": Marvell SoC Real Time Clock\n");
+       aprint_naive("\n");
+
+       if (bus_space_subregion(mva->mva_iot, mva->mva_ioh, mva->mva_offset,
+          mva->mva_size, &sc->sc_ioh)) {
+               aprint_error_dev(self, "failed to subregion register space\n");
+               return;
+       }
+
+       sc->sc_todr.cookie = sc;
+       sc->sc_todr.todr_gettime = NULL;
+       sc->sc_todr.todr_settime = NULL;
+       sc->sc_todr.todr_gettime_ymdhms = mvsocrtc_todr_gettime;
+       sc->sc_todr.todr_settime_ymdhms = mvsocrtc_todr_settime;
+       sc->sc_todr.todr_setwen = NULL;
+
+       todr_attach(&sc->sc_todr);
+}
+
+static int
+mvsocrtc_todr_gettime(todr_chip_handle_t ch, struct clock_ymdhms *dt)
+{
+       struct mvsocrtc_softc * const sc = ch->cookie;
+       bool tried = false;
+       uint32_t rtcdate, rtctime;
+       uint8_t rtcday, rtchour, rtcmin, rtcmonth, rtcsec, rtcyear;
+
+again:
+       /* read the rtc date and time registers */
+       rtcdate = bus_space_read_4(sc->sc_iot, sc->sc_ioh, MVSOCRTC_DATE);
+       rtctime = bus_space_read_4(sc->sc_iot, sc->sc_ioh, MVSOCRTC_TIME);
+
+       rtcyear = (rtcdate >> MVSOCRTC_YEAR_OFFSET) & MVSOCRTC_YEAR_MASK;
+       rtcmonth = (rtcdate >> MVSOCRTC_MONTH_OFFSET) & MVSOCRTC_MONTH_MASK;
+       rtcday = (rtcdate >> MVSOCRTC_DAY_OFFSET) & MVSOCRTC_DAY_MASK;
+
+       rtchour = (rtctime >> MVSOCRTC_HOUR_OFFSET) & MVSOCRTC_HOUR_MASK;
+       rtcmin = (rtctime >> MVSOCRTC_MINUTE_OFFSET) & MVSOCRTC_MINUTE_MASK;
+       rtcsec = (rtctime >> MVSOCRTC_SECOND_OFFSET) & MVSOCRTC_SECOND_MASK;
+
+       /*
+        * if seconds == 0, we may have read while the registers were
+        * updating.  Read again to get consistant data.
+        */
+       if (rtcsec == 0 && !tried) {
+               tried = true;
+               goto again;
+       }
+
+       /*
+        * Assume year "00" to be year 2000.
+        * XXXX this assumption will fail in 2100, but somehow I don't think
+        * I or the hardware will be functioning to see it.



Home | Main Index | Thread Index | Old Index