CVS commit: src/sys/arch/arm/imx

2012-09-19 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Wed Sep 19 07:28:39 UTC 2012

Modified Files:
src/sys/arch/arm/imx: imx51_ccm.c

Log Message:
make Netwalker kernel compile again.
from Kenichi Hashimoto.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx51_ccm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx51_ccm.c
diff -u src/sys/arch/arm/imx/imx51_ccm.c:1.2 src/sys/arch/arm/imx/imx51_ccm.c:1.3
--- src/sys/arch/arm/imx/imx51_ccm.c:1.2	Sat Sep  1 00:07:32 2012
+++ src/sys/arch/arm/imx/imx51_ccm.c	Wed Sep 19 07:28:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx51_ccm.c,v 1.2 2012/09/01 00:07:32 matt Exp $	*/
+/*	$NetBSD: imx51_ccm.c,v 1.3 2012/09/19 07:28:38 bsh Exp $	*/
 /*
  * Copyright (c) 2010, 2011, 2012  Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: imx51_ccm.c,v 1.2 2012/09/01 00:07:32 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: imx51_ccm.c,v 1.3 2012/09/19 07:28:38 bsh Exp $);
 
 #include sys/types.h
 #include sys/time.h
@@ -141,7 +141,7 @@ imx51_get_clock(enum imx51_clock clk)
 	bus_space_tag_t iot = ccm_softc-sc_iot;
 	bus_space_handle_t ioh = ccm_softc-sc_ioh;
 
-	u_int freq;
+	u_int freq = 0;
 	u_int sel;
 	uint32_t cacrr;	/* ARM clock root register */
 	uint32_t ccsr;
@@ -164,17 +164,17 @@ imx51_get_clock(enum imx51_clock clk)
 		/* FALLTHROUGH */
 	case IMX51CLK_PLL1STEP:
 		ccsr = bus_space_read_4(iot, ioh, CCMC_CCSR);
-		switch (__SHIFTOUT(ccsr, CCSR_STEP_SEL)) {
+		switch (__SHIFTOUT(ccsr, CCSR_STEP_SEL_MASK)) {
 		case 0:
 			return imx51_get_clock(IMX51CLK_LP_APM);
 		case 1:
 			return 0; /* XXX PLL bypass clock */
 		case 2:
 			return ccm_softc-sc_pll[2-1].pll_freq /
-			(1 + __SHIFTOUT(ccsr, CCSR_PLL2_DIV_PODF));
+			(1 + __SHIFTOUT(ccsr, CCSR_PLL2_DIV_PODF_MASK));
 		case 3:
 			return ccm_softc-sc_pll[3-1].pll_freq /
-			(1 + __SHIFTOUT(ccsr  CCSR_PLL3_DIV_PODF))
+			(1 + __SHIFTOUT(ccsr, CCSR_PLL3_DIV_PODF_MASK));
 		}
 		/*NOTREACHED*/
 	case IMX51CLK_PLL2SW:
@@ -204,9 +204,8 @@ imx51_get_clock(enum imx51_clock clk)
 		if ((cbcdr  CBCDR_PERIPH_CLK_SEL) == 0)
 			freq = imx51_get_clock(IMX51CLK_PLL2SW);
 		else {
-			freq = 0;
 			cbcmr = bus_space_read_4(iot, ioh,  CCMC_CBCMR);
-			switch (__SHIFTOUT(cbcmr, CBCMR_PERIPH_APM_SEL)) {
+			switch (__SHIFTOUT(cbcmr, CBCMR_PERIPH_APM_SEL_MASK)) {
 			case 0:
 freq = imx51_get_clock(IMX51CLK_PLL1SW);
 break;
@@ -225,16 +224,15 @@ imx51_get_clock(enum imx51_clock clk)
 	case IMX51CLK_MAIN_BUS_CLK:
 		freq = imx51_get_clock(IMX51CLK_MAIN_BUS_CLK_SRC);
 		cdcr = bus_space_read_4(iot, ioh, CCMC_CDCR);
-		return freq / __SHIFTOUT(cdcr, CDCR_PERIPH_CLK_DVFS_PODF);
+		return freq / __SHIFTOUT(cdcr, CDCR_PERIPH_CLK_DVFS_PODF_MASK);
 	case IMX51CLK_AHB_CLK_ROOT:
 		freq = imx51_get_clock(IMX51CLK_MAIN_BUS_CLK);
 		cbcdr = bus_space_read_4(iot, ioh, CCMC_CBCDR);
-		return freq / (1 + __SHIFTOUT(cbcdr, CBCDR_AHB_PODF));
+		return freq / (1 + __SHIFTOUT(cbcdr, CBCDR_AHB_PODF_MASK));
 	case IMX51CLK_IPG_CLK_ROOT:
 		freq = imx51_get_clock(IMX51CLK_AHB_CLK_ROOT);
 		cbcdr = bus_space_read_4(iot, ioh, CCMC_CBCDR);
-		return freq / (1 + __SHIFTOUT(cbcdr, CBCDR_IPG_PODF));
-
+		return freq / (1 + __SHIFTOUT(cbcdr, CBCDR_IPG_PODF_MASK));
 	case IMX51CLK_PERCLK_ROOT:
 		cbcmr = bus_space_read_4(iot, ioh, CCMC_CBCMR);
 		if (cbcmr  CBCMR_PERCLK_IPG_SEL)
@@ -243,15 +241,16 @@ imx51_get_clock(enum imx51_clock clk)
 			freq = imx51_get_clock(IMX51CLK_LP_APM);
 		else
 			freq = imx51_get_clock(IMX51CLK_MAIN_BUS_CLK_SRC);
+
 		cbcdr = bus_space_read_4(iot, ioh, CCMC_CBCDR);
 
 #ifdef IMXCCMDEBUG
 		printf(cbcmr=%x cbcdr=%x\n, cbcmr, cbcdr);
 #endif
 
-		freq /= 1 + __SHIFTOUT(cbcdr  CBCDR_PERCLK_PRED1);
-		freq /= 1 + __SHIFTOUT(cbcdr  CBCDR_PERCLK_PRED2);
-		freq /= 1 + __SHIFTOUT(cbcdr  CBCDR_PERCLK_PODF);
+		freq /= 1 + __SHIFTOUT(cbcdr, CBCDR_PERCLK_PRED1_MASK);
+		freq /= 1 + __SHIFTOUT(cbcdr, CBCDR_PERCLK_PRED2_MASK);
+		freq /= 1 + __SHIFTOUT(cbcdr, CBCDR_PERCLK_PODF_MASK);
 		return freq;
 	case IMX51CLK_UART_CLK_ROOT:
 		cscdr1 = bus_space_read_4(iot, ioh, CCMC_CSCDR1);
@@ -261,9 +260,8 @@ imx51_get_clock(enum imx51_clock clk)
 		printf(cscdr1=%x cscmr1=%x\n, cscdr1, cscmr1);
 #endif
 
-		sel = __SHIFTOUT(cscmr1  CSCMR1_UART_CLK_SEL);
+		sel = __SHIFTOUT(cscmr1, CSCMR1_UART_CLK_SEL_MASK);
 
-		freq = 0; /* shut up GCC */
 		switch (sel) {
 		case 0:
 		case 1:
@@ -275,12 +273,11 @@ imx51_get_clock(enum imx51_clock clk)
 			break;
 		}
 
-		return freq / (1 + __SHIFTOUT(cscdr1. CSCDR1_UART_CLK_PRED));
-			/ (1 + __SHIFTOUT(cscdr1, CSCDR1_UART_CLK_PODF));
+		return freq / (1 + __SHIFTOUT(cscdr1, CSCDR1_UART_CLK_PRED_MASK)) /
+		(1 + __SHIFTOUT(cscdr1, CSCDR1_UART_CLK_PODF_MASK));
 	case IMX51CLK_IPU_HSP_CLK_ROOT:
-		freq = 0;
 		cbcmr = 

CVS commit: src/sys/dev

2012-05-03 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Thu May  3 21:21:09 UTC 2012

Modified Files:
src/sys/dev: ldvar.h

Log Message:
use uint64_t for sc_disksize512.
fixed the problem with ataraid volumes larger than 2 TiB.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ldvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ldvar.h
diff -u src/sys/dev/ldvar.h:1.20 src/sys/dev/ldvar.h:1.21
--- src/sys/dev/ldvar.h:1.20	Thu Feb  2 19:43:01 2012
+++ src/sys/dev/ldvar.h	Thu May  3 21:21:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldvar.h,v 1.20 2012/02/02 19:43:01 tls Exp $	*/
+/*	$NetBSD: ldvar.h,v 1.21 2012/05/03 21:21:08 bsh Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@ struct ld_softc {
 	int	sc_ncylinders;		/* # cylinders */
 	int	sc_nheads;		/* # heads */
 	int	sc_nsectors;		/* # sectors per track */
-	int	sc_disksize512;
+	uint64_t	sc_disksize512;
 
 	/*
 	 * The following are filled by hardware specific attachment code.



CVS commit: src/sys/arch/evbarm/conf

2012-04-26 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Thu Apr 26 06:51:06 UTC 2012

Modified Files:
src/sys/arch/evbarm/conf: std.netwalker

Log Message:
fix the clock frequency for delay().
from Kenichi Hashimoto.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/std.netwalker

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/std.netwalker
diff -u src/sys/arch/evbarm/conf/std.netwalker:1.2 src/sys/arch/evbarm/conf/std.netwalker:1.3
--- src/sys/arch/evbarm/conf/std.netwalker:1.2	Sun Apr 15 08:57:16 2012
+++ src/sys/arch/evbarm/conf/std.netwalker	Thu Apr 26 06:51:05 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: std.netwalker,v 1.2 2012/04/15 08:57:16 bsh Exp $
+#	$NetBSD: std.netwalker,v 1.3 2012/04/26 06:51:05 bsh Exp $
 #
 # standard NetBSD/evbarm options for Sharp NetWalker
 
@@ -19,7 +19,7 @@ makeoptions	CPUFLAGS=-mcpu=cortex-a8
 # To support easy transit to ../arch/arm/arm32
 options 	ARM32
 options 	CORTEX_PMC
-options 	CORTEX_CCNT_HZ=72000
+options 	CORTEX_PMC_CCNT_HZ=8
 
 makeoptions	LOADADDRESS=0x9010
 makeoptions	BOARDTYPE=netwalker



CVS commit: src/sys/arch

2012-04-19 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Thu Apr 19 09:53:53 UTC 2012

Modified Files:
src/sys/arch/arm/imx: files.imx51
src/sys/arch/evbarm/conf: NETWALKER
Added Files:
src/sys/arch/arm/imx: imx51_esdhc.c

Log Message:
support SD/MMC on Netwalker.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/files.imx51
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/imx/imx51_esdhc.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/conf/NETWALKER

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/files.imx51
diff -u src/sys/arch/arm/imx/files.imx51:1.4 src/sys/arch/arm/imx/files.imx51:1.5
--- src/sys/arch/arm/imx/files.imx51:1.4	Tue Apr 17 10:19:57 2012
+++ src/sys/arch/arm/imx/files.imx51	Thu Apr 19 09:53:53 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: files.imx51,v 1.4 2012/04/17 10:19:57 bsh Exp $
+#	$NetBSD: files.imx51,v 1.5 2012/04/19 09:53:53 bsh Exp $
 #
 # Configuration info for the Freescale i.MX51
 #
@@ -87,8 +87,8 @@ file   arch/arm/imx/imxusb.c			imxehci
 # file	arch/arm/imx/wdc_axi.c			wdc_axi
 
 # SD host controller for SD/MMC
-# device	imxmci: sdmmcbus
-# file	arch/arm/imx/imx51_mci.c		imxmci
+attach	sdhc at axi with sdhc_axi
+file	arch/arm/imx/imx51_esdhc.c		sdhc_axi
 
 # iic Controler
 # device	imxi2c: i2cbus

Index: src/sys/arch/evbarm/conf/NETWALKER
diff -u src/sys/arch/evbarm/conf/NETWALKER:1.11 src/sys/arch/evbarm/conf/NETWALKER:1.12
--- src/sys/arch/evbarm/conf/NETWALKER:1.11	Tue Apr 17 10:19:57 2012
+++ src/sys/arch/evbarm/conf/NETWALKER	Thu Apr 19 09:53:53 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: NETWALKER,v 1.11 2012/04/17 10:19:57 bsh Exp $
+#	$NetBSD: NETWALKER,v 1.12 2012/04/19 09:53:53 bsh Exp $
 #
 #	NETWALKER -- http://www.sharp.co.jp/netwalker/
 #
@@ -194,6 +194,14 @@ imxgpio1	at axi? addr 0x73f88000
 imxgpio2	at axi? addr 0x73f8c000
 imxgpio3	at axi? addr 0x73f9
 
+# SD/MMC
+sdhc0	at axi? addr 0x70004000 irq 1	 # eSDHC1
+#sdhc1   	at axi? addr 0x70008000 irq 2	 # eSDHC2
+sdmmc*		at sdhc?
+ld*		at sdmmc?			# MMC/SD card
+#options 	SDHC_DEBUG
+#options 	SDMMC_DEBUG
+
 # USB
 imxusbc0  at axi?  addr 0x73f8
 ehci0	  at imxusbc0	unit 0	irq 18 # OTG

Added files:

Index: src/sys/arch/arm/imx/imx51_esdhc.c
diff -u /dev/null src/sys/arch/arm/imx/imx51_esdhc.c:1.1
--- /dev/null	Thu Apr 19 09:53:54 2012
+++ src/sys/arch/arm/imx/imx51_esdhc.c	Thu Apr 19 09:53:53 2012
@@ -0,0 +1,128 @@
+/*	$NetBSD: imx51_esdhc.c,v 1.1 2012/04/19 09:53:53 bsh Exp $ */
+
+/*-
+ * Copyright (c) 2012  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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS
+ * 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.
+ */
+
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: imx51_esdhc.c,v 1.1 2012/04/19 09:53:53 bsh Exp $);
+
+#include sys/param.h
+#include sys/device.h
+#include sys/systm.h
+#include sys/bus.h
+#include sys/pmf.h
+
+#include machine/intr.h
+
+#include dev/sdmmc/sdhcvar.h
+#include dev/sdmmc/sdmmcvar.h
+
+#include arm/imx/imx51reg.h
+#include arm/imx/imx51var.h
+#include arm/imx/imx51_ccmvar.h
+
+struct sdhc_axi_softc {
+	struct sdhc_softc  sc_sdhc;
+	/* we have only one slot */
+	struct sdhc_host *sc_hosts[1];
+
+	void *sc_ih;
+};
+
+static int sdhc_match(device_t, cfdata_t, void *);
+static void sdhc_attach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(sdhc_axi, sizeof(struct sdhc_axi_softc),
+sdhc_match, sdhc_attach, NULL, NULL);
+
+static int
+sdhc_match(device_t parent, cfdata_t cf, void *aux)
+{
+
+	struct axi_attach_args *aa = aux;
+
+	switch (aa-aa_addr) {
+	case ESDHC1_BASE:
+	case ESDHC2_BASE:
+		return 1;
+	}
+
+	return 0

CVS commit: src/sys/arch/evbarm/conf

2012-04-17 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Tue Apr 17 07:43:21 UTC 2012

Modified Files:
src/sys/arch/evbarm/conf: NETWALKER

Log Message:
fix comment


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/NETWALKER

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/NETWALKER
diff -u src/sys/arch/evbarm/conf/NETWALKER:1.8 src/sys/arch/evbarm/conf/NETWALKER:1.9
--- src/sys/arch/evbarm/conf/NETWALKER:1.8	Sat Apr  7 03:25:00 2012
+++ src/sys/arch/evbarm/conf/NETWALKER	Tue Apr 17 07:43:21 2012
@@ -1,6 +1,6 @@
-#	$NetBSD: NETWALKER,v 1.8 2012/04/07 03:25:00 tsutsui Exp $
+#	$NetBSD: NETWALKER,v 1.9 2012/04/17 07:43:21 bsh Exp $
 #
-#	NETWALKER -- Sharp
+#	NETWALKER -- http://www.sharp.co.jp/netwalker/
 #
 
 include	arch/evbarm/conf/std.netwalker
@@ -17,7 +17,7 @@ options 	RTC_OFFSET=0	# hardware clock i
 #options 	NTP		# NTP phase/frequency locked loop
 
 # CPU options
-options 	CPU_CORTEXA8	# Support the ARM11 core
+options 	CPU_CORTEXA8	# Support the ARM-v7a core
 options 	IMX51
 options 	PMAPCOUNTERS
 



CVS commit: src/sys/arch/arm/imx

2012-04-17 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Tue Apr 17 09:12:08 UTC 2012

Modified Files:
src/sys/arch/arm/imx: imxepitreg.h

Log Message:
add bit definitions for i.MX51 EPIT


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imxepitreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imxepitreg.h
diff -u src/sys/arch/arm/imx/imxepitreg.h:1.1 src/sys/arch/arm/imx/imxepitreg.h:1.2
--- src/sys/arch/arm/imx/imxepitreg.h:1.1	Sat Nov 13 06:51:37 2010
+++ src/sys/arch/arm/imx/imxepitreg.h	Tue Apr 17 09:12:08 2012
@@ -1,6 +1,6 @@
-/*	$NetBSD: imxepitreg.h,v 1.1 2010/11/13 06:51:37 bsh Exp $ */
+/*	$NetBSD: imxepitreg.h,v 1.2 2012/04/17 09:12:08 bsh Exp $ */
 /*
- * Copyright (c) 2009, 2010  Genetec corp.  All rights reserved.
+ * Copyright (c) 2009, 2010, 2012  Genetec corp.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec corp.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -37,11 +37,15 @@
 #define	 EPITCR_IOVW	__BIT(17)
 #define	 EPITCR_DBGEN	__BIT(18)
 #define	 EPITCR_WAITEN	__BIT(19)
-#define	 EPITCR_DOZEN	__BIT(20)
+#define	 EPITCR_DOZEN	__BIT(20)	/* not in iMX51 */
 #define	 EPITCR_STOPEN	__BIT(21)
 #define	 EPITCR_OM	__BITS(22,23)
-#define	 EPITCR_CLKSRC_MASK	__BITS(24,25)
-#define	 EPITCR_CLKSRC_HIGH	(0x2  24)
+#define	 EPITCR_CLKSRC_SHIFT	24
+#define	 EPITCR_CLKSRC_MASK	__BITS(25, EPITCR_CLKSRC_SHIFT)
+#define	 EPITCR_CLKSRC_IPG	(1  EPITCR_CLKSRC_SHIFT)
+#define	 EPITCR_CLKSRC_IPGHIGH	(2  EPITCR_CLKSRC_SHIFT)
+#define	 EPITCR_CLKSRC_IPG32K	(3  EPITCR_CLKSRC_SHIFT)
+#define	 EPITCR_CLKSRC_HIGH	(2  EPITCR_CLKSRC_SHIFT)
 
 #define	EPIT_EPITSR	0x0004
 #define	EPIT_EPITLR	0x0008



CVS commit: src/sys/arch

2012-04-17 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Tue Apr 17 09:33:31 UTC 2012

Modified Files:
src/sys/arch/arm/imx: imx51_axi.c imx51_clock.c imxclock.c
imxclockvar.h
src/sys/arch/evbarm/conf: NETWALKER
Added Files:
src/sys/arch/arm/imx: imx51_ccm.c imx51_ccmreg.h imx51_ccmvar.h
imx51_dpllreg.h

Log Message:
driver for i.MX51 Clock Controller Module.
from Kenichi Hashimoto.

Currently used only to get peripheral clock frequencies.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx51_axi.c \
src/sys/arch/arm/imx/imx51_clock.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/imx/imx51_ccm.c \
src/sys/arch/arm/imx/imx51_ccmreg.h src/sys/arch/arm/imx/imx51_ccmvar.h \
src/sys/arch/arm/imx/imx51_dpllreg.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/imxclock.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imxclockvar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/NETWALKER

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx51_axi.c
diff -u src/sys/arch/arm/imx/imx51_axi.c:1.2 src/sys/arch/arm/imx/imx51_axi.c:1.3
--- src/sys/arch/arm/imx/imx51_axi.c:1.2	Tue Nov 30 13:05:27 2010
+++ src/sys/arch/arm/imx/imx51_axi.c	Tue Apr 17 09:33:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx51_axi.c,v 1.2 2010/11/30 13:05:27 bsh Exp $	*/
+/*	$NetBSD: imx51_axi.c,v 1.3 2012/04/17 09:33:31 bsh Exp $	*/
 
 /*-
  * Copyright (c) 2010 SHIMIZU Ryo r...@nerv.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: imx51_axi.c,v 1.2 2010/11/30 13:05:27 bsh Exp $);
+__KERNEL_RCSID(0, $NetBSD: imx51_axi.c,v 1.3 2012/04/17 09:33:31 bsh Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -38,6 +38,7 @@ __KERNEL_RCSID(0, $NetBSD: imx51_axi.c,
 #include arm/imx/imx51reg.h
 #include arm/imx/imx51var.h
 
+#include bus_dma_generic.h
 #include locators.h
 
 struct axi_softc {
@@ -102,6 +103,7 @@ axi_critical_search(device_t parent, str
 
 	if ((strcmp(cf-cf_name, tzic) != 0) 
 	(strcmp(cf-cf_name, imxuart) != 0) 
+	(strcmp(cf-cf_name, imxccm) != 0) 
 	(strcmp(cf-cf_name, imxgpio) != 0))
 		return 0;
 
Index: src/sys/arch/arm/imx/imx51_clock.c
diff -u src/sys/arch/arm/imx/imx51_clock.c:1.2 src/sys/arch/arm/imx/imx51_clock.c:1.3
--- src/sys/arch/arm/imx/imx51_clock.c:1.2	Fri Jul  1 20:27:50 2011
+++ src/sys/arch/arm/imx/imx51_clock.c	Tue Apr 17 09:33:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx51_clock.c,v 1.2 2011/07/01 20:27:50 dyoung Exp $ */
+/*	$NetBSD: imx51_clock.c,v 1.3 2012/04/17 09:33:31 bsh Exp $ */
 /*
  * Copyright (c) 2009  Genetec corp.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec corp.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: imx51_clock.c,v 1.2 2011/07/01 20:27:50 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: imx51_clock.c,v 1.3 2012/04/17 09:33:31 bsh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -48,7 +48,7 @@ __KERNEL_RCSID(0, $NetBSD: imx51_clock.
 #include arm/imx/imx51reg.h
 #include arm/imx/imx51var.h
 #include arm/imx/imxepitreg.h
-//#include arm/imx/imx51_ccmvar.h notyet
+#include arm/imx/imx51_ccmvar.h
 #include arm/imx/imxclockvar.h
 
 #include imxccm.h	/* if CCM driver is configured into the kernel */
@@ -90,8 +90,6 @@ imxclock_attach(device_t parent, device_
 	sc-sc_iot = aa-aa_iot;
 	sc-sc_intr = aa-aa_irq;
 
-	KASSERT((sc-sc_intr == IRQ_EPIT1) || (sc-sc_intr == IRQ_EPIT2));
-
 	switch ( aa-aa_addr ) {
 	case EPIT1_BASE:
 		epit1_sc = sc;
@@ -106,6 +104,8 @@ imxclock_attach(device_t parent, device_
 
 	if (bus_space_map(aa-aa_iot, aa-aa_addr, aa-aa_size, 0, sc-sc_ioh))
 		panic(%s: Cannot map registers, device_xname(self));
+
+	sc-sc_clksrc = EPITCR_CLKSRC_IPG;
 }
 
 int
@@ -113,11 +113,7 @@ imxclock_get_timerfreq(struct imxclock_s
 {
 	unsigned int ipg_freq;
 #if NIMXCCM  0
-	struct imx51_clocks clk;
-
-	imx51_get_clocks(clk);
-
-	ipg_freq = clk.ipg_clk;
+	ipg_freq = imx51_get_clock(IMX51CLK_IPG_CLK_ROOT);
 #else
 #ifndef	IMX51_IPGCLK_FREQ
 #error	IMX51_IPGCLK_FREQ need to be defined.

Index: src/sys/arch/arm/imx/imxclock.c
diff -u src/sys/arch/arm/imx/imxclock.c:1.4 src/sys/arch/arm/imx/imxclock.c:1.5
--- src/sys/arch/arm/imx/imxclock.c:1.4	Fri Jul  1 20:27:50 2011
+++ src/sys/arch/arm/imx/imxclock.c	Tue Apr 17 09:33:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: imxclock.c,v 1.4 2011/07/01 20:27:50 dyoung Exp $ */
+/*	$NetBSD: imxclock.c,v 1.5 2012/04/17 09:33:31 bsh Exp $ */
 /*
  * Copyright (c) 2009, 2010  Genetec corp.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec corp.
@@ -70,7 +70,7 @@ void
 cpu_initclocks(void)
 {
 	uint32_t reg;
-	int freq;
+	u_int freq;
 
 	if (!epit1_sc) {
 		panic(%s: driver has not been initialized!, __FUNCTION__);
@@ -80,6 +80,9 @@ cpu_initclocks(void)
 	imx_epit_timecounter.tc_frequency = freq;
 	tc_init(imx_epit_timecounter);
 
+	

CVS commit: src/sys/arch/arm/imx

2012-04-17 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Wed Apr 18 05:54:08 UTC 2012

Modified Files:
src/sys/arch/arm/imx: imx31_clock.c

Log Message:
adapt to imxclock.c rev 1.5.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx31_clock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx31_clock.c
diff -u src/sys/arch/arm/imx/imx31_clock.c:1.3 src/sys/arch/arm/imx/imx31_clock.c:1.4
--- src/sys/arch/arm/imx/imx31_clock.c:1.3	Fri Jul  1 20:27:50 2011
+++ src/sys/arch/arm/imx/imx31_clock.c	Wed Apr 18 05:54:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx31_clock.c,v 1.3 2011/07/01 20:27:50 dyoung Exp $ */
+/*	$NetBSD: imx31_clock.c,v 1.4 2012/04/18 05:54:07 bsh Exp $ */
 /*
  * Copyright (c) 2009,2010  Genetec corp.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec corp.
@@ -106,6 +106,8 @@ imxclock_attach(device_t parent, device_
 		aipsa-aipsa_size, 0, sc-sc_ioh)) {
 		panic(%s: Cannot map registers, device_xname(self));
 	}
+
+	sc-sc_clksrc = EPITCR_CLKSRC_HIGH;
 }
 
 int



CVS commit: src/sys/dev/usb

2012-04-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Apr 15 07:17:38 UTC 2012

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
add USB keyboard found on Netwalker.


To generate a diff of this commit:
cvs rdiff -u -r1.611 -r1.612 src/sys/dev/usb/usbdevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.611 src/sys/dev/usb/usbdevs:1.612
--- src/sys/dev/usb/usbdevs:1.611	Sat Apr  7 11:54:34 2012
+++ src/sys/dev/usb/usbdevs	Sun Apr 15 07:17:38 2012
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.611 2012/04/07 11:54:34 jakllsch Exp $
+$NetBSD: usbdevs,v 1.612 2012/04/15 07:17:38 bsh Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -2497,6 +2497,7 @@ product SHARP C750		0x9031	C750
 product SHARP RUITZ1016YCZZ	0x90fd	WS003SH WLAN
 product SHARP WS007SH		0x9123	WS007SH
 product SHARP WS011SH		0x91ac	WS011SH
+product SHARP NWKBD		0x92E7	NetWalker Keyboard
 
 /* Shuttle Technology products */
 product SHUTTLE EUSB		0x0001	E-USB Bridge



CVS commit: src/sys/dev/usb

2012-04-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Apr 15 07:19:18 UTC 2012

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.604 -r1.605 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.605 -r1.606 src/sys/dev/usb/usbdevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.604 src/sys/dev/usb/usbdevs.h:1.605
--- src/sys/dev/usb/usbdevs.h:1.604	Sat Apr  7 11:56:27 2012
+++ src/sys/dev/usb/usbdevs.h	Sun Apr 15 07:19:17 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.604 2012/04/07 11:56:27 jakllsch Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.605 2012/04/15 07:19:17 bsh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.611 2012/04/07 11:54:34 jakllsch Exp
+ *	NetBSD: usbdevs,v 1.612 2012/04/15 07:17:38 bsh Exp
  */
 
 /*
@@ -2504,6 +2504,7 @@
 #define	USB_PRODUCT_SHARP_RUITZ1016YCZZ	0x90fd		/* WS003SH WLAN */
 #define	USB_PRODUCT_SHARP_WS007SH	0x9123		/* WS007SH */
 #define	USB_PRODUCT_SHARP_WS011SH	0x91ac		/* WS011SH */
+#define	USB_PRODUCT_SHARP_NWKBD	0x92E7		/* NetWalker Keyboard */
 
 /* Shuttle Technology products */
 #define	USB_PRODUCT_SHUTTLE_EUSB	0x0001		/* E-USB Bridge */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.605 src/sys/dev/usb/usbdevs_data.h:1.606
--- src/sys/dev/usb/usbdevs_data.h:1.605	Sat Apr  7 11:56:27 2012
+++ src/sys/dev/usb/usbdevs_data.h	Sun Apr 15 07:19:17 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.605 2012/04/07 11:56:27 jakllsch Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.606 2012/04/15 07:19:17 bsh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.611 2012/04/07 11:54:34 jakllsch Exp
+ *	NetBSD: usbdevs,v 1.612 2012/04/15 07:17:38 bsh Exp
  */
 
 /*
@@ -7495,6 +7495,10 @@ const struct usb_product usb_products[] 
 	WS011SH,
 	},
 	{
+	USB_VENDOR_SHARP, USB_PRODUCT_SHARP_NWKBD,
+	NetWalker Keyboard,
+	},
+	{
 	USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSB,
 	E-USB Bridge,
 	},
@@ -8835,4 +8839,4 @@ const struct usb_product usb_products[] 
 	Prestige,
 	},
 };
-const int usb_nproducts = 1696;
+const int usb_nproducts = 1697;



CVS commit: src/sys/arch/evbarm/conf

2012-04-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Apr 15 08:17:42 UTC 2012

Modified Files:
src/sys/arch/evbarm/conf: NETWALKER_MD

Log Message:
fix comment.
remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/NETWALKER_MD

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/NETWALKER_MD
diff -u src/sys/arch/evbarm/conf/NETWALKER_MD:1.2 src/sys/arch/evbarm/conf/NETWALKER_MD:1.3
--- src/sys/arch/evbarm/conf/NETWALKER_MD:1.2	Tue Nov 23 11:13:56 2010
+++ src/sys/arch/evbarm/conf/NETWALKER_MD	Sun Apr 15 08:17:42 2012
@@ -1,6 +1,6 @@
-#   $NetBSD: NETWALKER_MD,v 1.2 2010/11/23 11:13:56 hannken Exp $
+#   $NetBSD: NETWALKER_MD,v 1.3 2012/04/15 08:17:42 bsh Exp $
 #
-#	M2ID -- i.MX51 evaluation board
+#	NETWALKER_MD -- Sharp Netwalker kernel with a ramdisk.
 #
 
 include arch/evbarm/conf/NETWALKER
@@ -11,5 +11,5 @@ options 	MEMORY_DISK_ROOT_SIZE=8192	# Si
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 
 # disk/mass storage pseudo-devices
-pseudo-device	md	
+pseudo-device	md
 



CVS commit: src/sys/arch/evbarm/conf

2012-04-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Apr 15 08:57:16 UTC 2012

Modified Files:
src/sys/arch/evbarm/conf: std.netwalker

Log Message:
compile netwalker kernel with -mcpu=cortex-a8


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/std.netwalker

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/std.netwalker
diff -u src/sys/arch/evbarm/conf/std.netwalker:1.1 src/sys/arch/evbarm/conf/std.netwalker:1.2
--- src/sys/arch/evbarm/conf/std.netwalker:1.1	Sat Nov 13 07:31:32 2010
+++ src/sys/arch/evbarm/conf/std.netwalker	Sun Apr 15 08:57:16 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: std.netwalker,v 1.1 2010/11/13 07:31:32 bsh Exp $
+#	$NetBSD: std.netwalker,v 1.2 2012/04/15 08:57:16 bsh Exp $
 #
 # standard NetBSD/evbarm options for Sharp NetWalker
 
@@ -14,7 +14,7 @@ options 	NETWALKER
 options 	EXEC_ELF32
 options 	EXEC_SCRIPT
 options 	KERNEL_BASE_EXT=0xc000
-makeoptions	CPUFLAGS=-mcpu=arm1136j-s
+makeoptions	CPUFLAGS=-mcpu=cortex-a8
 
 # To support easy transit to ../arch/arm/arm32
 options 	ARM32



CVS commit: src/sys/arch/arm/imx

2012-04-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Apr 15 09:51:31 UTC 2012

Modified Files:
src/sys/arch/arm/imx: imx51_iomux.c

Log Message:
delete unused reference.
delete trailing whitespace, and NKF.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx51_iomux.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx51_iomux.c
diff -u src/sys/arch/arm/imx/imx51_iomux.c:1.2 src/sys/arch/arm/imx/imx51_iomux.c:1.3
--- src/sys/arch/arm/imx/imx51_iomux.c:1.2	Fri Jul  1 20:27:50 2011
+++ src/sys/arch/arm/imx/imx51_iomux.c	Sun Apr 15 09:51:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx51_iomux.c,v 1.2 2011/07/01 20:27:50 dyoung Exp $	*/
+/*	$NetBSD: imx51_iomux.c,v 1.3 2012/04/15 09:51:31 bsh Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010  Genetec Corporation.  All rights reserved.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: imx51_iomux.c,v 1.2 2011/07/01 20:27:50 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: imx51_iomux.c,v 1.3 2012/04/15 09:51:31 bsh Exp $);
 
 #define	_INTR_PRIVATE
 
@@ -56,8 +56,6 @@ struct iomux_softc {
 	bus_space_handle_t iomux_memh;
 };
 
-extern struct cfdriver imxiomux_cd;
-
 #define	IOMUX_READ(iomux, reg) \
 	bus_space_read_4((iomux)-iomux_memt, (iomux)-iomux_memh, (reg))
 #define	IOMUX_WRITE(iomux, reg, val) \
@@ -68,10 +66,8 @@ static void iomux_attach(device_t, devic
 
 static struct iomux_softc *iomuxsc = NULL;
 
-CFATTACH_DECL(imxiomux,
-	  sizeof(struct iomux_softc),
-	  iomux_match, iomux_attach,
-	  NULL, NULL);
+CFATTACH_DECL_NEW(imxiomux, sizeof(struct iomux_softc),
+iomux_match, iomux_attach, NULL, NULL);
 
 int
 iomux_match(device_t parent, cfdata_t cfdata, void *aux)
@@ -160,7 +156,7 @@ iomux_mux_config(const struct iomux_conf
 
 	for (i = 0; conflist[i].pin != IOMUX_CONF_EOT; i++) {
 		iomux_set_pad_sub(iomuxsc, conflist[i].pin, conflist[i].pad);
-		iomux_set_function_sub(iomuxsc, conflist[i].pin, 
+		iomux_set_function_sub(iomuxsc, conflist[i].pin,
 		conflist[i].mux);
 	}
 }
@@ -172,7 +168,7 @@ iomux_input_config(const struct iomux_in
 	int i;
 
 	for (i = 0; conflist[i].inout != -1; i++) {
-		iomux_set_inout(iomuxsc, conflist[i].inout, 
+		iomux_set_inout(iomuxsc, conflist[i].inout,
 		conflist[i].inout_mode);
 	}
 }



CVS commit: src/sys/arch/arm/imx

2012-04-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Apr 15 10:09:58 UTC 2012

Modified Files:
src/sys/arch/arm/imx: imx51reg.h

Log Message:
add HVE bit definition in iomux PAD_CTL register.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx51reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx51reg.h
diff -u src/sys/arch/arm/imx/imx51reg.h:1.2 src/sys/arch/arm/imx/imx51reg.h:1.3
--- src/sys/arch/arm/imx/imx51reg.h:1.2	Tue Nov 30 13:05:27 2010
+++ src/sys/arch/arm/imx/imx51reg.h	Sun Apr 15 10:09:58 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: imx51reg.h,v 1.2 2010/11/30 13:05:27 bsh Exp $ */
+/* $NetBSD: imx51reg.h,v 1.3 2012/04/15 10:09:58 bsh Exp $ */
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -185,6 +185,7 @@
 #define	IOMUXC_SIZE	0x4000
 
 #define	IOMUXC_MUX_CTL		0x001c		/* multiprex control */
+#define	 IOMUX_CONFIG_SION	__BIT(4)
 #define	 IOMUX_CONFIG_ALT0	(0)
 #define	 IOMUX_CONFIG_ALT1	(1)
 #define	 IOMUX_CONFIG_ALT2	(2)
@@ -193,8 +194,8 @@
 #define	 IOMUX_CONFIG_ALT5	(5)
 #define	 IOMUX_CONFIG_ALT6	(6)
 #define	 IOMUX_CONFIG_ALT7	(7)
-#define	 IOMUX_CONFIG_SION	__BIT(4)
 #define	IOMUXC_PAD_CTL		0x03f0		/* pad control */
+#define	 PAD_CTL_HVE		__BIT(13)
 #define	 PAD_CTL_DDR_INPUT	__BIT(9)
 #define	 PAD_CTL_HYS		__BIT(8)
 #define	 PAD_CTL_PKE		__BIT(7)



CVS commit: src/sys/arch

2012-04-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Apr 15 10:16:37 UTC 2012

Modified Files:
src/sys/arch/arm/imx: imx51_iomuxreg.h
src/sys/arch/evbarm/netwalker: netwalker_usb.c

Log Message:
delete many definitions like MUX_PIN_foo.
use MUX_PIN(foo) instead.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx51_iomuxreg.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/netwalker/netwalker_usb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx51_iomuxreg.h
diff -u src/sys/arch/arm/imx/imx51_iomuxreg.h:1.1 src/sys/arch/arm/imx/imx51_iomuxreg.h:1.2
--- src/sys/arch/arm/imx/imx51_iomuxreg.h:1.1	Sat Nov 13 07:11:02 2010
+++ src/sys/arch/arm/imx/imx51_iomuxreg.h	Sun Apr 15 10:16:37 2012
@@ -658,996 +658,25 @@
 
 /* MUX  PAD Control */
 
-#define MUX_PIN_AUD3_BB_CK \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_AUD3_BB_CK, \
-	IOMUXC_SW_PAD_CTL_PAD_AUD3_BB_CK)
-#define MUX_PIN_AUD3_BB_FS \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_AUD3_BB_FS, \
-	IOMUXC_SW_PAD_CTL_PAD_AUD3_BB_FS)
-#define MUX_PIN_AUD3_BB_RXD \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_AUD3_BB_RXD, \
-	IOMUXC_SW_PAD_CTL_PAD_AUD3_BB_RXD)
-#define MUX_PIN_AUD3_BB_TXD \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_AUD3_BB_TXD, \
-	IOMUXC_SW_PAD_CTL_PAD_AUD3_BB_TXD)
-#define MUX_PIN_BOOT_MODE0 \
-	IOMUX_PIN(IOMUX_MUX_NONE, IOMUXC_SW_PAD_CTL_PAD_BOOT_MODE0)
-#define MUX_PIN_BOOT_MODE1 \
-	IOMUX_PIN(IOMUX_MUX_NONE, IOMUXC_SW_PAD_CTL_PAD_BOOT_MODE1)
-#define MUX_PIN_CKIL \
-	IOMUX_PIN(IOMUX_MUX_NONE, IOMUXC_SW_PAD_CTL_PAD_CKIL)
-#define MUX_PIN_CLK_SS \
-	IOMUX_PIN(IOMUX_MUX_NONE, IOMUXC_SW_PAD_CTL_PAD_CLK_SS)
-#define MUX_PIN_CSI1_D10 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D10, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D10)
-#define MUX_PIN_CSI1_D11 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D11, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D11)
-#define MUX_PIN_CSI1_D12 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D12, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D12)
-#define MUX_PIN_CSI1_D13 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D13, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D13)
-#define MUX_PIN_CSI1_D14 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D14, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D14)
-#define MUX_PIN_CSI1_D15 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D15, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D15)
-#define MUX_PIN_CSI1_D16 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D16, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D16)
-#define MUX_PIN_CSI1_D17 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D17, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D17)
-#define MUX_PIN_CSI1_D18 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D18, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D18)
-#define MUX_PIN_CSI1_D19 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D19, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D19)
-#define MUX_PIN_CSI1_D8 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D8, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D8)
-#define MUX_PIN_CSI1_D9 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_D9, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_D9)
-#define MUX_PIN_CSI1_HSYNC \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_HSYNC, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_HSYNC)
-#define MUX_PIN_CSI1_MCLK \
-	IOMUX_PIN(IOMUX_MUX_NONE, IOMUXC_SW_PAD_CTL_PAD_CSI1_MCLK)
-#define MUX_PIN_CSI1_PIXCLK \
-	IOMUX_PIN(IOMUX_MUX_NONE, IOMUXC_SW_PAD_CTL_PAD_CSI1_PIXCLK)
-#define MUX_PIN_CSI1_VSYNC \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI1_VSYNC, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI1_VSYNC)
-#define MUX_PIN_CSI2_D12 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI2_D12, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI2_D12)
-#define MUX_PIN_CSI2_D13 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI2_D13, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI2_D13)
-#define MUX_PIN_CSI2_D14 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI2_D14, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI2_D14)
-#define MUX_PIN_CSI2_D15 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI2_D15, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI2_D15)
-#define MUX_PIN_CSI2_D16 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI2_D16, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI2_D16)
-#define MUX_PIN_CSI2_D17 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI2_D17, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI2_D17)
-#define MUX_PIN_CSI2_D18 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI2_D18, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI2_D18)
-#define MUX_PIN_CSI2_D19 \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI2_D19, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI2_D19)
-#define MUX_PIN_CSI2_HSYNC \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI2_HSYNC, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI2_HSYNC)
-#define MUX_PIN_CSI2_PIXCLK \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI2_PIXCLK, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI2_PIXCLK)
-#define MUX_PIN_CSI2_VSYNC \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSI2_VSYNC, \
-	IOMUXC_SW_PAD_CTL_PAD_CSI2_VSYNC)
-#define MUX_PIN_CSPI1_MISO \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSPI1_MISO, \
-	IOMUXC_SW_PAD_CTL_PAD_CSPI1_MISO)
-#define MUX_PIN_CSPI1_MOSI \
-	IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_CSPI1_MOSI, \
-	IOMUXC_SW_PAD_CTL_PAD_CSPI1_MOSI)
-#define 

CVS commit: src/sys/arch/evbarm/netwalker

2012-04-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Apr 15 10:19:47 UTC 2012

Modified Files:
src/sys/arch/evbarm/netwalker: netwalker_usb.c

Log Message:
initialize one more pin for USB Host1.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/netwalker/netwalker_usb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/netwalker/netwalker_usb.c
diff -u src/sys/arch/evbarm/netwalker/netwalker_usb.c:1.2 src/sys/arch/evbarm/netwalker/netwalker_usb.c:1.3
--- src/sys/arch/evbarm/netwalker/netwalker_usb.c:1.2	Sun Apr 15 10:16:37 2012
+++ src/sys/arch/evbarm/netwalker/netwalker_usb.c	Sun Apr 15 10:19:47 2012
@@ -25,7 +25,7 @@
  *
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netwalker_usb.c,v 1.2 2012/04/15 10:16:37 bsh Exp $);
+__KERNEL_RCSID(0, $NetBSD: netwalker_usb.c,v 1.3 2012/04/15 10:19:47 bsh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -274,6 +274,13 @@ const struct iomux_conf iomux_usb1_confi
 		.mux = IOMUX_CONFIG_ALT0,
 		.pad = (PAD_CTL_DSE_HIGH | PAD_CTL_SRE),
 	},
+	{
+		/* 26M_OSC pin settings */
+		.pin = MUX_PIN(DI1_PIN12),
+		.mux = IOMUX_CONFIG_ALT4,
+		.pad = (PAD_CTL_DSE_HIGH | PAD_CTL_KEEPER |
+		PAD_CTL_SRE),
+	},
 
 	/* end of table */
 	{.pin = IOMUX_CONF_EOT}



CVS commit: src/sys/arch/evbarm/netwalker

2012-04-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Apr 15 10:34:14 UTC 2012

Modified Files:
src/sys/arch/evbarm/netwalker: netwalker_machdep.c

Log Message:
set same values to IOMUX registers as the linux kernel does.
make it a bit simpler. (we can treat MUX and PAD registers in the same
way here)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/netwalker/netwalker_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/netwalker/netwalker_machdep.c
diff -u src/sys/arch/evbarm/netwalker/netwalker_machdep.c:1.5 src/sys/arch/evbarm/netwalker/netwalker_machdep.c:1.6
--- src/sys/arch/evbarm/netwalker/netwalker_machdep.c:1.5	Fri Jul  1 20:42:37 2011
+++ src/sys/arch/evbarm/netwalker/netwalker_machdep.c	Sun Apr 15 10:34:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: netwalker_machdep.c,v 1.5 2011/07/01 20:42:37 dyoung Exp $	*/
+/*	$NetBSD: netwalker_machdep.c,v 1.6 2012/04/15 10:34:14 bsh Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005, 2010  Genetec Corporation. 
@@ -102,7 +102,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netwalker_machdep.c,v 1.5 2011/07/01 20:42:37 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: netwalker_machdep.c,v 1.6 2012/04/15 10:34:14 bsh Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -922,49 +922,264 @@ init_clocks(void)
 }
 
 struct iomux_setup {
-	size_t  	pad_ctl_reg;
-	uint32_t	pad_ctl_val;
-	size_t  	mux_ctl_reg;
-	uint32_t	mux_ctl_val;
+	/* iomux registers are 32-bit wide, but upper 16 bits are not
+	 * used. */
+	uint16_t	reg;
+	uint16_t	val;
 };
 
-#define	IOMUX_DATA(padname, mux, pad)	\
-	IOMUX_DATA2(__CONCAT(IOMUXC_SW_MUX_CTL_PAD_,padname), mux, \
-		__CONCAT(IOMUXC_SW_PAD_CTL_PAD_,padname), pad)
-		
-	
-#define	IOMUX_DATA2(muxreg, muxval, padreg, padval)	\
-	{		\
-		.pad_ctl_reg = (padreg),		\
-		.pad_ctl_val = (padval),		\
-		.mux_ctl_reg = (muxreg),		\
-		.mux_ctl_val = (muxval)			\
+#define	IOMUX_M(padname, mux)		\
+	IOMUX_DATA(__CONCAT(IOMUXC_SW_MUX_CTL_PAD_,padname), mux)
+
+#define	IOMUX_P(padname, pad)		\
+	IOMUX_DATA(__CONCAT(IOMUXC_SW_PAD_CTL_PAD_,padname), pad)
+
+#define	IOMUX_MP(padname, mux, pad)	\
+	IOMUX_M(padname, mux), \
+	IOMUX_P(padname, pad)
+
+
+#define	IOMUX_DATA(offset, value)	\
+	{\
+		.reg = (offset),	\
+		.val = (value),		\
 	}
 
 
+/* 
+ * set same values to IOMUX registers as linux kernel does 
+ */
 const struct iomux_setup iomux_setup_data[] = {
-
-	/* left buttons */
-	IOMUX_DATA(EIM_EB2, IOMUX_CONFIG_ALT1,
-		   PAD_CTL_HYS),
-	/* right buttons */
-	IOMUX_DATA(EIM_EB3, IOMUX_CONFIG_ALT1,
-		   PAD_CTL_HYS),
+#define	HYS	PAD_CTL_HYS
+#define	ODE	PAD_CTL_ODE
+#define	DSEHIGH	PAD_CTL_DSE_HIGH
+#define	DSEMID	PAD_CTL_DSE_MID
+#define	DSELOW	PAD_CTL_DSE_LOW
+#define	DSEMAX	PAD_CTL_DSE_MAX
+#define	SRE	PAD_CTL_SRE
+#define	KEEPER	PAD_CTL_KEEPER
+#define	PULL	PAD_CTL_PULL
+#define	PU_22K	PAD_CTL_PUS_22K_PU
+#define	PU_47K	PAD_CTL_PUS_47K_PU
+#define	PU_100K	PAD_CTL_PUS_100K_PU
+#define	PD_100K	PAD_CTL_PUS_100K_PD
+#define	HVE	PAD_CTL_HVE	/* Low output voltage */
+
+#define	ALT0	IOMUX_CONFIG_ALT0
+#define	ALT1	IOMUX_CONFIG_ALT1
+#define	ALT2	IOMUX_CONFIG_ALT2
+#define	ALT3	IOMUX_CONFIG_ALT3
+#define	ALT4	IOMUX_CONFIG_ALT4
+#define	ALT5	IOMUX_CONFIG_ALT5
+#define	ALT6	IOMUX_CONFIG_ALT6
+#define	ALT7	IOMUX_CONFIG_ALT7
+#define	SION	IOMUX_CONFIG_SION
+
+	/* left button */
+	IOMUX_MP(EIM_EB2, ALT1, HYS),
+	/* right button */
+	IOMUX_MP(EIM_EB3, ALT1, HYS),
 
 	/* UART1 */
-#if 1
-	IOMUX_DATA(UART1_RXD, IOMUX_CONFIG_ALT0,
-		   PAD_CTL_DSE_HIGH | PAD_CTL_SRE),
+	IOMUX_MP(UART1_RXD, ALT0, HYS | PULL | DSEHIGH | SRE),
+	IOMUX_MP(UART1_TXD, ALT0, HYS | PULL | DSEHIGH | SRE),
+	IOMUX_MP(UART1_RTS, ALT0, HYS | PULL | DSEHIGH),
+	IOMUX_MP(UART1_CTS, ALT0, HYS | PULL | DSEHIGH),
+
+	/* LCD Display */
+	IOMUX_M(DI1_PIN2, ALT0),
+	IOMUX_M(DI1_PIN3, ALT0),
+
+	IOMUX_DATA(IOMUXC_SW_PAD_CTL_GRP_DISP1_PKE0, PAD_CTL_PKE),
+#if 0
+	IOMUX_MP(DISP1_DAT0, ALT0, SRE | DSEMAX | PULL),
+	IOMUX_MP(DISP1_DAT1, ALT0, SRE | DSEMAX | PULL),
+	IOMUX_MP(DISP1_DAT2, ALT0, SRE | DSEMAX | PULL),
+	IOMUX_MP(DISP1_DAT3, ALT0, SRE | DSEMAX | PULL),
+	IOMUX_MP(DISP1_DAT4, ALT0, SRE | DSEMAX | PULL),
+	IOMUX_MP(DISP1_DAT5, ALT0, SRE | DSEMAX | PULL),
+#endif
+	IOMUX_M(DISP1_DAT6, ALT0),
+	IOMUX_M(DISP1_DAT7, ALT0),
+	IOMUX_M(DISP1_DAT8, ALT0),
+	IOMUX_M(DISP1_DAT9, ALT0),
+	IOMUX_M(DISP1_DAT10, ALT0),
+	IOMUX_M(DISP1_DAT11, ALT0),
+	IOMUX_M(DISP1_DAT12, ALT0),
+	IOMUX_M(DISP1_DAT13, ALT0),
+	IOMUX_M(DISP1_DAT14, ALT0),
+	IOMUX_M(DISP1_DAT15, ALT0),
+	IOMUX_M(DISP1_DAT16, ALT0),
+	IOMUX_M(DISP1_DAT17, ALT0),
+	IOMUX_M(DISP1_DAT18, ALT0),
+	IOMUX_M(DISP1_DAT19, ALT0),
+	IOMUX_M(DISP1_DAT20, ALT0),
+	IOMUX_M(DISP1_DAT21, ALT0),
+	IOMUX_M(DISP1_DAT22, ALT0),
+	IOMUX_M(DISP1_DAT23, ALT0),
+
+	IOMUX_MP(DI1_D0_CS, ALT4, KEEPER | DSEHIGH | SRE), /* GPIO3_3 */
+	IOMUX_DATA(IOMUXC_GPIO3_IPP_IND_G_IN_3_SELECT_INPUT, 

CVS commit: src/sys/arch/arm/imx

2012-04-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Apr 15 16:34:11 UTC 2012

Modified Files:
src/sys/arch/arm/imx: imx51reg.h

Log Message:
add base addresses for i.MX51 IPU registers.
from Kinichi Hashimoto.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx51reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx51reg.h
diff -u src/sys/arch/arm/imx/imx51reg.h:1.3 src/sys/arch/arm/imx/imx51reg.h:1.4
--- src/sys/arch/arm/imx/imx51reg.h:1.3	Sun Apr 15 10:09:58 2012
+++ src/sys/arch/arm/imx/imx51reg.h	Sun Apr 15 16:34:11 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: imx51reg.h,v 1.3 2012/04/15 10:09:58 bsh Exp $ */
+/* $NetBSD: imx51reg.h,v 1.4 2012/04/15 16:34:11 bsh Exp $ */
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -43,9 +43,44 @@
 #define	GPU_BASE	0x3000
 #define	GPU_SIZE	0x1000
 
-/* LCD controller */
-#define	IPUEX_BASE	0x4000
-#define	IPUEX_SIZE	0x2000
+/* Image Prossasing Unit */
+#define	IPU_BASE	0x4000
+#define	IPU_CM_BASE	(IPU_BASE + 0x1e00)
+#define	IPU_CM_SIZE	0x8000
+#define	IPU_IDMAC_BASE	(IPU_BASE + 0x1e008000)
+#define	IPU_IDMAC_SIZE	0x8000
+#define	IPU_DP_BASE	(IPU_BASE + 0x1e018000)
+#define	IPU_DP_SIZE	0x8000
+#define	IPU_IC_BASE	(IPU_BASE + 0x1e02)
+#define	IPU_IC_SIZE	0x8000
+#define	IPU_IRT_BASE	(IPU_BASE + 0x1e028000)
+#define	IPU_IRT_SIZE	0x8000
+#define	IPU_CSI0_BASE	(IPU_BASE + 0x1e03)
+#define	IPU_CSI0_SIZE	0x8000
+#define	IPU_CSI1_BASE	(IPU_BASE + 0x1e038000)
+#define	IPU_CSI1_SIZE	0x8000
+#define	IPU_DI0_BASE	(IPU_BASE + 0x1e04)
+#define	IPU_DI0_SIZE	0x8000
+#define	IPU_DI1_BASE	(IPU_BASE + 0x1e048000)
+#define	IPU_DI1_SIZE	0x8000
+#define	IPU_SMFC_BASE	(IPU_BASE + 0x1e05)
+#define	IPU_SMFC_SIZE	0x8000
+#define	IPU_DC_BASE	(IPU_BASE + 0x1e058000)
+#define	IPU_DC_SIZE	0x8000
+#define	IPU_DMFC_BASE	(IPU_BASE + 0x1e06)
+#define	IPU_DMFC_SIZE	0x8000
+#define	IPU_VDI_BASE	(IPU_BASE + 0x1e068000)
+#define	IPU_VDI_SIZE	0x8000
+#define	IPU_CPMEM_BASE	(IPU_BASE + 0x1f00)
+#define	IPU_CPMEM_SIZE	0x2
+#define	IPU_LUT_BASE	(IPU_BASE + 0x1f02)
+#define	IPU_LUT_SIZE	0x2
+#define	IPU_SRM_BASE	(IPU_BASE + 0x1f04)
+#define	IPU_SRM_SIZE	0x2
+#define	IPU_TPM_BASE	(IPU_BASE + 0x1f06)
+#define	IPU_TPM_SIZE	0x2
+#define	IPU_DCTMPL_BASE	(IPU_BASE + 0x1f08)
+#define	IPU_DCTMPL_SIZE	0x2
 
 #define	DEBUGROM_BASE	0x6000
 #define	DEBUGROM_SIZE	0x1000



CVS commit: src/sys/arch/evbarm/dev

2012-04-05 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Fri Apr  6 01:35:58 UTC 2012

Modified Files:
src/sys/arch/evbarm/dev: plcomreg.h

Log Message:
don't mix #defineTAB and #defineSPACE in a file.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/dev/plcomreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/dev/plcomreg.h
diff -u src/sys/arch/evbarm/dev/plcomreg.h:1.1 src/sys/arch/evbarm/dev/plcomreg.h:1.2
--- src/sys/arch/evbarm/dev/plcomreg.h:1.1	Sat Oct 27 16:22:06 2001
+++ src/sys/arch/evbarm/dev/plcomreg.h	Fri Apr  6 01:35:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcomreg.h,v 1.1 2001/10/27 16:22:06 rearnsha Exp $	*/
+/*	$NetBSD: plcomreg.h,v 1.2 2012/04/06 01:35:58 bsh Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -34,14 +34,14 @@
 #define	PLCOM_TOLERANCE	30	/* baud rate tolerance, in 0.1% units */
 
 /* control register */
-#define CR_LBE		0x80	/* Loopback enable */
-#define CR_RTIE		0x40	/* Receive timeout interrupt enable */
-#define CR_TIE		0x20	/* Transmit interrupt enable */
-#define CR_RIE		0x10	/* Receive interrrupt enable */
-#define CR_MSIE		0x08	/* Modem status interrupt enable */
-#define CR_SIRLP	0x04	/* IrDA SIR Low power mode */
-#define CR_SIREN	0x02	/* SIR Enable */
-#define CR_UARTEN	0x01	/* Uart enable */
+#define	CR_LBE		0x80	/* Loopback enable */
+#define	CR_RTIE		0x40	/* Receive timeout interrupt enable */
+#define	CR_TIE		0x20	/* Transmit interrupt enable */
+#define	CR_RIE		0x10	/* Receive interrrupt enable */
+#define	CR_MSIE		0x08	/* Modem status interrupt enable */
+#define	CR_SIRLP	0x04	/* IrDA SIR Low power mode */
+#define	CR_SIREN	0x02	/* SIR Enable */
+#define	CR_UARTEN	0x01	/* Uart enable */
 
 /* interrupt identification register */
 #define	IIR_IMASK	0x0f
@@ -51,15 +51,15 @@
 #define	IIR_MIS		0x01
 
 /* line control register */
-#define LCR_WLEN	0x60	/* Mask of size bits */
+#define	LCR_WLEN	0x60	/* Mask of size bits */
 #define	LCR_8BITS	0x60	/* 8 bits per serial word */
 #define	LCR_7BITS	0x40	/* 7 bits */
 #define	LCR_6BITS	0x20	/* 6 bits */
 #define	LCR_5BITS	0x00	/* 5 bits */
-#define LCR_FEN		0x10	/* FIFO enable */
+#define	LCR_FEN		0x10	/* FIFO enable */
 #define	LCR_STP2	0x08	/* 2 stop bits per serial word */
-#define LCR_EPS		0x04	/* Even parity select */
-#define LCR_PEN		0x02	/* Parity enable */
+#define	LCR_EPS		0x04	/* Even parity select */
+#define	LCR_PEN		0x02	/* Parity enable */
 #define	LCR_PEVEN	(LCR_PEN | LCR_EPS)
 #define	LCR_PODD	LCR_PEN
 #define	LCR_PNONE	0x00	/* No parity */
@@ -71,10 +71,10 @@
 
 /* receive status register */
 
-#define RSR_OE		0x08	/* Overrun Error */
-#define RSR_BE		0x04	/* Break */
-#define RSR_PE		0x02	/* Parity Error */
-#define RSR_FE		0x01	/* Framing Error */
+#define	RSR_OE		0x08	/* Overrun Error */
+#define	RSR_BE		0x04	/* Break */
+#define	RSR_PE		0x02	/* Parity Error */
+#define	RSR_FE		0x01	/* Framing Error */
 
 /* flag register */
 #define	FR_TXFE		0x80	/* Transmit fifo empty */
@@ -93,17 +93,17 @@
 #define	MSR_CTS		FR_CTS
 
 /* Register offsets */
-#define plcom_dr	0x00
-#define plcom_rsr	0x04
-#define plcom_ecr	0x04
-#define plcom_lcr	0x08
-#define plcom_dlbh	0x0c
-#define plcom_dlbl	0x10
-#define plcom_cr	0x14
-#define plcom_fr	0x18
-#define plcom_iir	0x1c
-#define plcom_icr	0x1c
-#define plcom_ilpr	0x20
+#define	plcom_dr	0x00
+#define	plcom_rsr	0x04
+#define	plcom_ecr	0x04
+#define	plcom_lcr	0x08
+#define	plcom_dlbh	0x0c
+#define	plcom_dlbl	0x10
+#define	plcom_cr	0x14
+#define	plcom_fr	0x18
+#define	plcom_iir	0x1c
+#define	plcom_icr	0x1c
+#define	plcom_ilpr	0x20
 
 /* IFPGA specific */
-#define PLCOM_UART_SIZE	0x24
+#define	PLCOM_UART_SIZE	0x24



CVS commit: src/sys/arch/evbarm

2012-04-05 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Fri Apr  6 01:47:16 UTC 2012

Modified Files:
src/sys/arch/evbarm/conf: INTEGRATOR
src/sys/arch/evbarm/dev: plcom.c

Log Message:
avoid warning with options PLCOM_DEBUG for INTEGRATOR.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/evbarm/conf/INTEGRATOR
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbarm/dev/plcom.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/INTEGRATOR
diff -u src/sys/arch/evbarm/conf/INTEGRATOR:1.64 src/sys/arch/evbarm/conf/INTEGRATOR:1.65
--- src/sys/arch/evbarm/conf/INTEGRATOR:1.64	Sun Dec 18 05:49:25 2011
+++ src/sys/arch/evbarm/conf/INTEGRATOR	Fri Apr  6 01:47:15 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: INTEGRATOR,v 1.64 2011/12/18 05:49:25 dholland Exp $
+#	$NetBSD: INTEGRATOR,v 1.65 2012/04/06 01:47:15 bsh Exp $
 #
 #	GENERIC -- ARM Integrator board Generic kernel
 #
@@ -155,6 +155,7 @@ ifpga0	at mainbus?
 # PL010 uart
 plcom0		at ifpga? offset 0x0600 irq 1
 plcom1		at ifpga? offset 0x0700 irq 2
+#options 	PLCOM_DEBUG
 
 # PL030 real time clock
 plrtc0		at ifpga? offset 0x0500

Index: src/sys/arch/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.33 src/sys/arch/evbarm/dev/plcom.c:1.34
--- src/sys/arch/evbarm/dev/plcom.c:1.33	Thu Feb  2 19:42:59 2012
+++ src/sys/arch/evbarm/dev/plcom.c	Fri Apr  6 01:47:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.33 2012/02/02 19:42:59 tls Exp $	*/
+/*	$NetBSD: plcom.c,v 1.34 2012/04/06 01:47:16 bsh Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: plcom.c,v 1.33 2012/02/02 19:42:59 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: plcom.c,v 1.34 2012/04/06 01:47:16 bsh Exp $);
 
 #include opt_plcom.h
 #include opt_ddb.h
@@ -280,9 +280,9 @@ plcomspeed(long speed, long frequency)
 #ifdef PLCOM_DEBUG
 int	plcom_debug = 0;
 
-void plcomstatus (struct plcom_softc *, char *);
+void plcomstatus (struct plcom_softc *, const char *);
 void
-plcomstatus(struct plcom_softc *sc, char *str)
+plcomstatus(struct plcom_softc *sc, const char *str)
 {
 	struct tty *tp = sc-sc_tty;
 
@@ -304,6 +304,7 @@ plcomstatus(struct plcom_softc *sc, char
 }
 #endif
 
+/* XXX this function is not used? */
 int
 plcomprobe1(bus_space_tag_t iot, bus_space_handle_t ioh)
 {



CVS commit: src/distrib/evbarm/gzboot/gzimg

2012-04-04 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Wed Apr  4 07:32:29 UTC 2012

Modified Files:
src/distrib/evbarm/gzboot/gzimg: Makefile

Log Message:
add phony targets to build gzimg files for specified kernels, instead
of building all gzimg files in TARGETS.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/distrib/evbarm/gzboot/gzimg/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/evbarm/gzboot/gzimg/Makefile
diff -u src/distrib/evbarm/gzboot/gzimg/Makefile:1.21 src/distrib/evbarm/gzboot/gzimg/Makefile:1.22
--- src/distrib/evbarm/gzboot/gzimg/Makefile:1.21	Fri Apr  3 22:36:35 2009
+++ src/distrib/evbarm/gzboot/gzimg/Makefile	Wed Apr  4 07:32:29 2012
@@ -1,10 +1,16 @@
-#	$NetBSD: Makefile,v 1.21 2009/04/03 22:36:35 perry Exp $
+#	$NetBSD: Makefile,v 1.22 2012/04/04 07:32:29 bsh Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
 
 .include bsd.kernobj.mk
 
+#
+# `make' or `make all' builds all gzimg files defined in ${TARGETS}.
+# `make _KERNELNAME_' builds all gzimg files for specified kernels.
+#
+
+
 
 #	TARGETS is a list of:
 #		KERNEL_name	GZBOOT_name	GZIMG_name
@@ -75,8 +81,17 @@ gzimg_${I}_flash_${R}.gz: .NOTMAIN gzimg
 CLEANFILES+=	gzimg_${I}_flash_${R}.kern gzimg_${I}_flash_${R}.kern.gz \
 		gzimg_${I}_flash_${R}
 
+.if empty(GZKERNELS:M${K})
+GZKERNELS+=	$K
+.endif
+KZ${K}+=	gzimg_${I}_flash_${R}.gz
+
 .endfor			# }
 
+.for K in ${GZKERNELS}
+${K}: .PHONY ${KZ${K}}
+.endfor
+
 CLEANFILES+=	${GZIMGS}
 
 



CVS commit: src

2012-04-03 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Wed Apr  4 01:23:27 UTC 2012

Modified Files:
src/external/mit/xorg/server/drivers: Makefile
src/external/mit/xorg/server/xorg-server: Makefile.common
src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos: Makefile
Added Files:
src/distrib/sets/lists/xserver: md.evbarm

Log Message:
enable X11 build for evbarm.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/distrib/sets/lists/xserver/md.evbarm
cvs rdiff -u -r1.60 -r1.61 src/external/mit/xorg/server/drivers/Makefile
cvs rdiff -u -r1.23 -r1.24 \
src/external/mit/xorg/server/xorg-server/Makefile.common
cvs rdiff -u -r1.31 -r1.32 \
src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/xorg/server/drivers/Makefile
diff -u src/external/mit/xorg/server/drivers/Makefile:1.60 src/external/mit/xorg/server/drivers/Makefile:1.61
--- src/external/mit/xorg/server/drivers/Makefile:1.60	Tue Aug 30 04:22:56 2011
+++ src/external/mit/xorg/server/drivers/Makefile	Wed Apr  4 01:23:27 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.60 2011/08/30 04:22:56 macallan Exp $
+#	$NetBSD: Makefile,v 1.61 2012/04/04 01:23:27 bsh Exp $
 
 # xf86-input drivers
 
@@ -147,6 +147,11 @@ SUBDIR+= \
 	xf86-video-wsfb
 .endif	# ${MACHINE} == dreamcast
 
+.if ${MACHINE} == evbarm
+SUBDIR+= \
+	xf86-video-wsfb
+.endif # ${MACHINE} == evbarm
+
 .if ${MACHINE} == evbmips
 SUBDIR+= \
 	xf86-video-siliconmotion \

Index: src/external/mit/xorg/server/xorg-server/Makefile.common
diff -u src/external/mit/xorg/server/xorg-server/Makefile.common:1.23 src/external/mit/xorg/server/xorg-server/Makefile.common:1.24
--- src/external/mit/xorg/server/xorg-server/Makefile.common:1.23	Tue Aug 30 04:22:56 2011
+++ src/external/mit/xorg/server/xorg-server/Makefile.common	Wed Apr  4 01:23:27 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.common,v 1.23 2011/08/30 04:22:56 macallan Exp $
+#	$NetBSD: Makefile.common,v 1.24 2012/04/04 01:23:27 bsh Exp $
 
 # These define parts of the Xserver tree that are to be
 # conditionally compiled for different platforms.  See
@@ -13,6 +13,7 @@
 ${MACHINE} == cats	|| \
 ${MACHINE} == dreamcast	|| \
 ${MACHINE} == ews4800mips	|| \
+${MACHINE} == evbarm	|| \
 ${MACHINE} == evbmips	|| \
 ${MACHINE} == hp300	|| \
 ${MACHINE} == hpcarm	|| \

Index: src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile
diff -u src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile:1.31 src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile:1.32
--- src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile:1.31	Tue Aug 30 04:22:56 2011
+++ src/external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile	Wed Apr  4 01:23:27 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.31 2011/08/30 04:22:56 macallan Exp $
+#	$NetBSD: Makefile,v 1.32 2012/04/04 01:23:27 bsh Exp $
 
 .include ../../../Makefile.serverlib
 .include ../../../Makefile.servermod
@@ -69,6 +69,7 @@ CPPFLAGS.${_FN}=	-DWSCONS_SUPPORT -DUSES
 .endif
 
 .if ${MACHINE} == cats || \
+${MACHINE} == evbarm || \
 ${MACHINE} == hpcarm || \
 ${MACHINE} == shark || \
 ${MACHINE} == netwinder || \

Added files:

Index: src/distrib/sets/lists/xserver/md.evbarm
diff -u /dev/null src/distrib/sets/lists/xserver/md.evbarm:1.1
--- /dev/null	Wed Apr  4 01:23:27 2012
+++ src/distrib/sets/lists/xserver/md.evbarm	Wed Apr  4 01:23:26 2012
@@ -0,0 +1,122 @@
+# $NetBSD: md.evbarm,v 1.1 2012/04/04 01:23:26 bsh Exp $
+./usr/X11R7/bin/X	-unknown-	xorg
+./usr/X11R7/bin/Xorg	-unknown-	xorg
+./usr/X11R7/bin/cvt	-unknown-	xorg
+./usr/X11R7/bin/gtf	-unknown-	xorg
+./usr/X11R7/lib/X11/doc/README.DRI			-unknown-	obsolete
+./usr/X11R7/lib/X11/doc/README.modes			-unknown-	xorg
+./usr/X11R7/lib/X11/doc/README.rapidaccess		-unknown-	obsolete
+./usr/X11R7/lib/modules/drivers/kbd_drv.so		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/kbd_drv.so.1		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/mouse_drv.so		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/mouse_drv.so.1		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/void_drv.so		-unknown-	obsolete
+./usr/X11R7/lib/modules/drivers/void_drv.so.1		-unknown-	obsolete
+./usr/X11R7/lib/modules/drivers/ws_drv.so		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/ws_drv.so.1		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/wsfb_drv.so		-unknown-	xorg
+./usr/X11R7/lib/modules/drivers/wsfb_drv.so.0		-unknown-	xorg
+./usr/X11R7/lib/modules/extensions/libdbe.a		-unknown-	xorg
+./usr/X11R7/lib/modules/extensions/libdbe.so		-unknown-	xorg
+./usr/X11R7/lib/modules/extensions/libdbe.so.0		-unknown-	xorg
+./usr/X11R7/lib/modules/extensions/libdbe_g.a		-unknown-	debuglib,xorg
+./usr/X11R7/lib/modules/extensions/libdbe_pic.a		-unknown-	xorg

CVS commit: src/lib/libc/arch/arm/gen

2012-03-21 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Wed Mar 21 09:05:36 UTC 2012

Modified Files:
src/lib/libc/arch/arm/gen: _lwp.c

Log Message:
shut up lint(1)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/arm/gen/_lwp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/arm/gen/_lwp.c
diff -u src/lib/libc/arch/arm/gen/_lwp.c:1.5 src/lib/libc/arch/arm/gen/_lwp.c:1.6
--- src/lib/libc/arch/arm/gen/_lwp.c:1.5	Thu Feb 24 04:28:41 2011
+++ src/lib/libc/arch/arm/gen/_lwp.c	Wed Mar 21 09:05:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: _lwp.c,v 1.5 2011/02/24 04:28:41 joerg Exp $	*/
+/*	$NetBSD: _lwp.c,v 1.6 2012/03/21 09:05:35 bsh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: _lwp.c,v 1.5 2011/02/24 04:28:41 joerg Exp $);
+__RCSID($NetBSD: _lwp.c,v 1.6 2012/03/21 09:05:35 bsh Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -58,16 +58,22 @@ _lwp_makecontext(ucontext_t *u, void (*s
 	u-uc_stack.ss_sp = stack_base;
 	u-uc_stack.ss_size = stack_size;
 
+	/* LINTED - alignment is fixed below. */
 	sp = (void **) (stack_base + stack_size);
 
 	/*
 	 * Note: We make sure the stack is 8-byte aligned, here.
 	 */
 
+	/* LINTED - doesn't lose any bits by this conversion */
 	u-uc_mcontext.__gregs[_REG_R0] = (__greg_t) arg;
+	/* LINTED - doesn't lose any bits by this conversion */
 	u-uc_mcontext.__gregs[_REG_SP] = ((__greg_t) sp)  ~7;
+	/* LINTED - doesn't lose any bits by this conversion */
 	u-uc_mcontext.__gregs[_REG_LR] = (__greg_t) _lwp_exit;
+	/* LINTED - doesn't lose any bits by this conversion */
 	u-uc_mcontext.__gregs[_REG_PC] = (__greg_t) start;
+	/* LINTED - unsinged long and unsigned int are same size */
 	u-uc_mcontext._mc_tlsbase = (uintptr_t)private;
 	u-uc_flags |= _UC_TLSBASE;
 }



CVS commit: src

2012-03-19 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Mon Mar 19 06:08:51 UTC 2012

Modified Files:
src: UPDATING

Log Message:
add note about SYMTAB_SPACE.


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/UPDATING

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.235 src/UPDATING:1.236
--- src/UPDATING:1.235	Wed Feb 15 23:32:27 2012
+++ src/UPDATING	Mon Mar 19 06:08:51 2012
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.235 2012/02/15 23:32:27 joerg Exp $
+$NetBSD: UPDATING,v 1.236 2012/03/19 06:08:51 bsh Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -16,6 +16,13 @@ See also: BUILDING, build.sh, Makefile.
 Recent changes:
 ^^^
 
+20120319:
+	sys/conf/Makefile.kern.inc has been modified to adjust the
+	size of db_symtab automatically.  You need to update dbsym in
+	your $TOOLDIR to build kernels with options SYMTAB_SPACE.  If
+	you don't want this behavior, add AUTO_SYMTAB_SPACE=no to your
+	mk.conf.
+
 20120216:
 	Default for MKCATPAGES changed to NO. Update builds will fail
 	unless DESTDIR is cleaned manually. If you built between 20120207



CVS commit: src/doc

2012-03-19 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Mon Mar 19 06:29:38 UTC 2012

Modified Files:
src/doc: CHANGES

Log Message:
add option -p to dbsym(8)


To generate a diff of this commit:
cvs rdiff -u -r1.1684 -r1.1685 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1684 src/doc/CHANGES:1.1685
--- src/doc/CHANGES:1.1684	Sat Mar 10 16:56:33 2012
+++ src/doc/CHANGES	Mon Mar 19 06:29:37 2012
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1684 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1685 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -30,3 +30,4 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 	pkg_add(1): imported 20120221 version from pkgsrc [wiz 20120221]
 	file(1): upgraded to 5.11 [christos 20120222]
 	evbmips: Add support for Lemote Yeeloong Notebook. [nonaka 20120302]
+	dbsym(8): Add option -p [bsh 20120319]



CVS commit: src

2012-03-18 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Mon Mar 19 05:38:26 UTC 2012

Modified Files:
src/external/gpl3/binutils/usr.sbin/dbsym: dbsym.8 dbsym.c
src/sys/arch/arm/conf: Makefile.arm
src/sys/conf: Makefile.kern.inc

Log Message:
adjust the size of db_symtab space automatically.
proposed on tech-toolchain@, and got no objections.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.8 \
src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/conf/Makefile.arm
cvs rdiff -u -r1.152 -r1.153 src/sys/conf/Makefile.kern.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.8
diff -u src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.8:1.1 src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.8:1.2
--- src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.8:1.1	Tue Aug 18 20:22:20 2009
+++ src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.8	Mon Mar 19 05:38:26 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: dbsym.8,v 1.1 2009/08/18 20:22:20 skrll Exp $
+.\	$NetBSD: dbsym.8,v 1.2 2012/03/19 05:38:26 bsh Exp $
 .\
 .Dd November 9, 2001
 .Dt DBSYM 8
@@ -8,7 +8,7 @@
 .Nd copy kernel symbol table into db_symtab space
 .Sh SYNOPSIS
 .Nm
-.Op Fl v
+.Op Fl pv
 .Op Fl b Ar bfdname
 .Ar kernel
 .Sh DESCRIPTION
@@ -39,6 +39,14 @@ flag is given,
 will print out status information as
 it is copying the symbol table.
 .Pp
+If the
+.Fl p
+flag is given,
+.Nm
+will report the size of the kernel symbol table and the size of the
+db_symtab space.
+Two values are printed out in a line separated by a space.
+.Pp
 Note that debugging symbols are not useful to the
 .Xr ddb 4
 kernel debugger, so to minimize the size of the kernel, one should
Index: src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c
diff -u src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c:1.1 src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c:1.2
--- src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c:1.1	Tue Aug 18 20:22:20 2009
+++ src/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c	Mon Mar 19 05:38:26 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: dbsym.c,v 1.1 2009/08/18 20:22:20 skrll Exp $ */
+/* $NetBSD: dbsym.c,v 1.2 2012/03/19 05:38:26 bsh Exp $ */
 
 /*
  * Copyright (c) 2001 Simon Burge (for Wasabi Systems)
@@ -39,7 +39,7 @@
 __COPYRIGHT(@(#) Copyright (c) 1996 Christopher G. Demetriou.\
   Copyright 2001 Simon Burge.\
   All rights reserved.);
-__RCSID($NetBSD: dbsym.c,v 1.1 2009/08/18 20:22:20 skrll Exp $);
+__RCSID($NetBSD: dbsym.c,v 1.2 2012/03/19 05:38:26 bsh Exp $);
 #endif /* not lint */
 
 #include sys/param.h
@@ -75,6 +75,7 @@ int	find_symtab(bfd *, struct symbols *)
 int	load_symtab(bfd *, int fd, char **, u_int32_t *);
 
 int	verbose;
+int	printsize;
 
 int
 main(int argc, char **argv)
@@ -90,7 +91,7 @@ main(int argc, char **argv)
 	setprogname(argv[0]);
 
 	bfdname = NULL;
-	while ((ch = getopt(argc, argv, b:v)) != -1)
+	while ((ch = getopt(argc, argv, b:pv)) != -1)
 		switch (ch) {
 		case 'b':
 			bfdname = optarg;
@@ -98,6 +99,9 @@ main(int argc, char **argv)
 		case 'v':
 			verbose = 1;
 			break;
+		case 'p':
+			printsize = 1;
+			break;
 		case '?':
 		default:
 			usage();
@@ -150,6 +154,11 @@ main(int argc, char **argv)
 	symtab_space = bfd_get_32(abfd,
 	mappedkfile[db_symtab_symbols[X_DB_SYMTABSIZE].offset]);
 
+	if (printsize) {
+		printf(%d %d\n, symtabsize, symtab_space);
+		goto done;
+	}
+
 	if (symtabsize  symtab_space)
 		errx(1, symbol table (%u bytes) too big for buffer (%u bytes)\n
 		Increase options SYMTAB_SPACE in your kernel config,
@@ -168,6 +177,7 @@ main(int argc, char **argv)
 	bfd_put_32(abfd, symtabsize,
 	mappedkfile[db_symtab_symbols[X_DB_SYMTABSIZE].offset]);
 
+done:
 	munmap(mappedkfile, ksb.st_size);
 	close(kfd);
 

Index: src/sys/arch/arm/conf/Makefile.arm
diff -u src/sys/arch/arm/conf/Makefile.arm:1.32 src/sys/arch/arm/conf/Makefile.arm:1.33
--- src/sys/arch/arm/conf/Makefile.arm:1.32	Sun Apr 27 03:23:13 2008
+++ src/sys/arch/arm/conf/Makefile.arm	Mon Mar 19 05:38:26 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.arm,v 1.32 2008/04/27 03:23:13 tsutsui Exp $
+#	$NetBSD: Makefile.arm,v 1.33 2012/03/19 05:38:26 bsh Exp $
 
 # Makefile for NetBSD
 #
@@ -63,7 +63,8 @@ LINKFLAGS_NORMAL=	-X
 # Strip ARM mapping symbols from the kernel image, as they interfere
 # with ddb. Do it differently if 'makeoptions DEBUG=-g' was specified.
 .if !defined(DEBUG) || empty(DEBUG:M-g*)
-SYSTEM_LD_TAIL?=	@${OBJCOPY} --strip-symbol='$$a'	 \
+SYSTEM_LD_TAIL?=	@${SYSTEM_LD_TAIL_DBSYM} ; \
+			${OBJCOPY} --strip-symbol='$$a'	 \
 --strip-symbol='$$t'	 \
 --strip-symbol='$$d' $@	;\
 			${SIZE} $@; chmod 755 $@

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.152 src/sys/conf/Makefile.kern.inc:1.153
--- src/sys/conf/Makefile.kern.inc:1.152	Sun Feb 12 16:34:11 2012

CVS commit: src/sys/arch/arm/arm

2011-03-10 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Thu Mar 10 08:06:27 UTC 2011

Modified Files:
src/sys/arch/arm/arm: cpufunc.c

Log Message:
add MPCore to CPU-ID table
add branch predict bit to arm11_options


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/arm/arm/cpufunc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.102 src/sys/arch/arm/arm/cpufunc.c:1.103
--- src/sys/arch/arm/arm/cpufunc.c:1.102	Thu Mar 10 07:47:14 2011
+++ src/sys/arch/arm/arm/cpufunc.c	Thu Mar 10 08:06:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.102 2011/03/10 07:47:14 bsh Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.103 2011/03/10 08:06:27 bsh Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpufunc.c,v 1.102 2011/03/10 07:47:14 bsh Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpufunc.c,v 1.103 2011/03/10 08:06:27 bsh Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_cpuoptions.h
@@ -2648,6 +2648,8 @@
 	{ arm11.cache,	BIC, OR,  (CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE) },
 	{ arm11.icache,	BIC, OR,  CPU_CONTROL_IC_ENABLE },
 	{ arm11.dcache,	BIC, OR,  CPU_CONTROL_DC_ENABLE },
+	{ cpu.branchpredict, 	BIC, OR,  CPU_CONTROL_BPRD_ENABLE },
+	{ arm11.branchpredict, BIC, OR,  CPU_CONTROL_BPRD_ENABLE },
 	{ NULL,			IGN, IGN, 0 }
 };
 



CVS commit: src/sys/arch/arm/arm32

2011-03-10 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Thu Mar 10 08:07:08 UTC 2011

Modified Files:
src/sys/arch/arm/arm32: cpu.c

Log Message:
add MPCore to CPU-ID table
add branch predict bit to arm11_options


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/arm/arm32/cpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/cpu.c
diff -u src/sys/arch/arm/arm32/cpu.c:1.77 src/sys/arch/arm/arm32/cpu.c:1.78
--- src/sys/arch/arm/arm32/cpu.c:1.77	Sat Oct  2 05:37:58 2010
+++ src/sys/arch/arm/arm32/cpu.c	Thu Mar 10 08:07:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.77 2010/10/02 05:37:58 kiyohara Exp $	*/
+/*	$NetBSD: cpu.c,v 1.78 2011/03/10 08:07:08 bsh Exp $	*/
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 
 #include sys/param.h
 
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.77 2010/10/02 05:37:58 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.78 2011/03/10 08:07:08 bsh Exp $);
 
 #include sys/systm.h
 #include sys/malloc.h
@@ -412,6 +412,9 @@
 	{ CPU_ID_ARM1176JS,	CPU_CLASS_ARM11J,	ARM1176J-S r0,
 	  pN_steppings },
 
+	{ CPU_ID_ARM11MPCORE,	CPU_CLASS_ARM11J, 	ARM11 MPCore,
+	  generic_steppings },
+
 	{ CPU_ID_CORTEXA8R1,	CPU_CLASS_CORTEX,	Cortex-A8 r1,
 	  pN_steppings },
 	{ CPU_ID_CORTEXA8R2,	CPU_CLASS_CORTEX,	Cortex-A8 r2,



CVS commit: src/sys/arch/arm

2011-03-10 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Fri Mar 11 03:16:14 UTC 2011

Modified Files:
src/sys/arch/arm/gemini: files.gemini
src/sys/arch/arm/imx: files.imx31 files.imx51
src/sys/arch/arm/omap: files.omap2
src/sys/arch/arm/pic: files.pic pic.c
Added Files:
src/sys/arch/arm/pic: pic_splfuncs.c

Log Message:
split arch/arm/pic/pic.c so that we can implement more efficient version of 
splfoo() while using pic framework.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/gemini/files.gemini
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/files.imx31
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/files.imx51
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/omap/files.omap2
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/pic/files.pic
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/pic/pic.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/pic/pic_splfuncs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/gemini/files.gemini
diff -u src/sys/arch/arm/gemini/files.gemini:1.10 src/sys/arch/arm/gemini/files.gemini:1.11
--- src/sys/arch/arm/gemini/files.gemini:1.10	Sun Dec 14 01:57:02 2008
+++ src/sys/arch/arm/gemini/files.gemini	Fri Mar 11 03:16:13 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.gemini,v 1.10 2008/12/14 01:57:02 matt Exp $
+#	$NetBSD: files.gemini,v 1.11 2011/03/11 03:16:13 bsh Exp $
 #
 # Configuration info for GEMINI CPU support
 # Based on omap/files.omap2
@@ -38,7 +38,7 @@
 ##file	arch/arm/gemini/gemini_nobyteacc_io.S		obio
 
 # GEMINI interrupt controller
-device	geminiicu: pic
+device	geminiicu: pic, pic_splfuncs
 attach	geminiicu at obio with geminiicu
 file	arch/arm/gemini/gemini_icu.c		geminiicu needs-flag
 

Index: src/sys/arch/arm/imx/files.imx31
diff -u src/sys/arch/arm/imx/files.imx31:1.6 src/sys/arch/arm/imx/files.imx31:1.7
--- src/sys/arch/arm/imx/files.imx31:1.6	Mon Nov 15 18:19:19 2010
+++ src/sys/arch/arm/imx/files.imx31	Fri Mar 11 03:16:13 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.imx31,v 1.6 2010/11/15 18:19:19 bsh Exp $
+#	$NetBSD: files.imx31,v 1.7 2011/03/11 03:16:13 bsh Exp $
 #
 # Configuration info for the Freescale i.MX31
 #
@@ -23,7 +23,7 @@
 
 # iMX AdVanced Interrupt Controller
 include arch/arm/pic/files.pic
-device	avic: pic
+device	avic: pic, pic_splfuncs
 attach	avic at ahb
 file	arch/arm/imx/imx31_icu.c		avic		needs-flag
 file	arch/arm/arm32/irq_dispatch.S

Index: src/sys/arch/arm/imx/files.imx51
diff -u src/sys/arch/arm/imx/files.imx51:1.2 src/sys/arch/arm/imx/files.imx51:1.3
--- src/sys/arch/arm/imx/files.imx51:1.2	Tue Nov 30 13:05:27 2010
+++ src/sys/arch/arm/imx/files.imx51	Fri Mar 11 03:16:13 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.imx51,v 1.2 2010/11/30 13:05:27 bsh Exp $
+#	$NetBSD: files.imx51,v 1.3 2011/03/11 03:16:13 bsh Exp $
 #
 # Configuration info for the Freescale i.MX51
 #
@@ -18,7 +18,7 @@
 
 # iMX51 TrustZone Interrupt Controller
 include arch/arm/pic/files.pic
-device	tzic: pic
+device	tzic: pic, pic_splfuncs
 attach	tzic at axi
 file	arch/arm/imx/imx51_tzic.c		tzic	needs-flag
 file	arch/arm/arm32/irq_dispatch.S

Index: src/sys/arch/arm/omap/files.omap2
diff -u src/sys/arch/arm/omap/files.omap2:1.7 src/sys/arch/arm/omap/files.omap2:1.8
--- src/sys/arch/arm/omap/files.omap2:1.7	Sat Feb 26 18:07:18 2011
+++ src/sys/arch/arm/omap/files.omap2	Fri Mar 11 03:16:13 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.omap2,v 1.7 2011/02/26 18:07:18 ahoka Exp $
+#	$NetBSD: files.omap2,v 1.8 2011/03/11 03:16:13 bsh Exp $
 #
 # Configuration info for Texas Instruments OMAP2/OMAP3 CPU support
 # Based on xscale/files.pxa2x0
@@ -32,7 +32,7 @@
 file	arch/arm/xscale/pxa2x0_a4x_io.S		obio
 
 # OMAP2 interrupt controller
-device	omapicu: pic
+device	omapicu: pic, pic_splfuncs
 attach	omapicu at obio with omap2icu
 file	arch/arm/omap/omap2_icu.c		(omap2 | omap3)  omapicu
 file	arch/arm/omap/omap2430_intr.c		omap2  !omapicu

Index: src/sys/arch/arm/pic/files.pic
diff -u src/sys/arch/arm/pic/files.pic:1.2 src/sys/arch/arm/pic/files.pic:1.3
--- src/sys/arch/arm/pic/files.pic:1.2	Sun Apr 27 18:58:45 2008
+++ src/sys/arch/arm/pic/files.pic	Fri Mar 11 03:16:14 2011
@@ -1,7 +1,9 @@
-#	$NetBSD: files.pic,v 1.2 2008/04/27 18:58:45 matt Exp $
+#	$NetBSD: files.pic,v 1.3 2011/03/11 03:16:14 bsh Exp $
 #
 # Configuration info for the common PIC code.
 #
 define	pic
+define	pic_splfuncs
 
 file	arch/arm/pic/pic.c		pic
+file	arch/arm/pic/pic_splfuncs.c	pic  pic_splfuncs

Index: src/sys/arch/arm/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.7 src/sys/arch/arm/pic/pic.c:1.8
--- src/sys/arch/arm/pic/pic.c:1.7	Tue Feb  1 21:44:27 2011
+++ src/sys/arch/arm/pic/pic.c	Fri Mar 11 03:16:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic.c,v 1.7 2011/02/01 21:44:27 jakllsch Exp $	*/
+/*	$NetBSD: pic.c,v 1.8 2011/03/11 03:16:14 bsh Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH 

CVS commit: src/sys/arch/arm/mpcore

2011-03-10 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Fri Mar 11 03:26:37 UTC 2011

Added Files:
src/sys/arch/arm/mpcore: dic.c dic_intr.h dicreg.h

Log Message:
DIC: ARM11 MPCore's Distributed Interrupt Controller.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/mpcore/dic.c \
src/sys/arch/arm/mpcore/dic_intr.h src/sys/arch/arm/mpcore/dicreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/arch/arm/mpcore/dic.c
diff -u /dev/null src/sys/arch/arm/mpcore/dic.c:1.1
--- /dev/null	Fri Mar 11 03:26:37 2011
+++ src/sys/arch/arm/mpcore/dic.c	Fri Mar 11 03:26:37 2011
@@ -0,0 +1,357 @@
+/*	$NetBSD: dic.c,v 1.1 2011/03/11 03:26:37 bsh Exp $ */
+
+/*
+ * Copyright (c) 2010, 2011 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 CORPORATION
+ * 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: dic.c,v 1.1 2011/03/11 03:26:37 bsh Exp $);
+
+#define	_INTR_PRIVATE	/* for arm/pic/picvar.h */
+
+#include locators.h
+#include opt_dic.h
+
+#include sys/param.h
+#include sys/evcnt.h
+#include sys/device.h
+#include sys/atomic.h
+
+#include machine/intr.h
+#include machine/bus.h
+
+#include uvm/uvm_extern.h
+
+#include arm/cpu.h
+#include arm/armreg.h
+#include arm/cpufunc.h
+#include arm/pic/picvar.h
+
+#include arm/mpcore/mpcorevar.h
+#include arm/mpcore/mpcorereg.h
+#include arm/mpcore/dicreg.h
+
+#include machine/autoconf.h
+#include machine/bus.h
+
+/*
+ * 0 is the highest priority.
+ */
+#define	HW_TO_SW_IPL(ipl)	(IPL_HIGH - (ipl))
+#define	SW_TO_HW_IPL(ipl)	(IPL_HIGH - (ipl))
+
+struct dic_softc {
+	device_t sc_dev;
+	struct pic_softc sc_pic;
+	bus_space_tag_t sc_iot;
+	bus_space_handle_t sc_cii_ioh;
+	volatile uint32_t *sc_cii_vaddr;	/* CPU interface */
+	bus_space_handle_t sc_gid_ioh;
+	volatile uint32_t *sc_gid_vaddr;	/* Global distributor */
+	int sc_nsrcs;
+//	uint32_t sc_enabled_mask[4];
+};
+
+#define	PIC_TO_SOFTC(pic) \
+	((struct dic_softc *)((char *)(pic) - \
+		offsetof(struct dic_softc, sc_pic)))
+
+
+static int dic_match(device_t, cfdata_t, void *);
+static void dic_attach(device_t, device_t, void *);
+
+static void dic_unblock_irqs(struct pic_softc *, size_t, uint32_t);
+static void dic_block_irqs(struct pic_softc *, size_t, uint32_t);
+static void dic_establish_irq(struct pic_softc *, struct intrsource *);
+
+#define	DIC_READ(sc, offset)	\
+	(*((sc)-sc_gid_vaddr + (offset) / sizeof (uint32_t)))
+#define	DIC_WRITE(sc, offset, val)	\
+	(*((sc)-sc_gid_vaddr + (offset) / sizeof (uint32_t)) = (val))
+
+#define	CII_READ(sc, offset)	\
+	(*((sc)-sc_cii_vaddr + (offset) / sizeof (uint32_t)))
+#define	CII_WRITE(sc, offset, val)	\
+	(*((sc)-sc_cii_vaddr + (offset) / sizeof (uint32_t)) = (val))
+
+const struct pic_ops dic_pic_ops = {
+	.pic_unblock_irqs = dic_unblock_irqs,
+	.pic_block_irqs = dic_block_irqs,
+	.pic_establish_irq = dic_establish_irq,
+	.pic_source_name = NULL
+};
+
+
+CFATTACH_DECL_NEW(dic, sizeof(struct dic_softc),
+dic_match, dic_attach, NULL, NULL);
+
+struct dic_softc *dic_softc;
+
+static int
+dic_match(device_t parent, cfdata_t cf, void *aux)
+{
+	if (strcmp(cf-cf_name, dic) == 0)
+		return 1;
+
+	return 0;
+}
+
+
+static void
+dic_attach(device_t parent, device_t self, void *aux)
+{
+	struct dic_softc *dic = device_private(self);
+	struct pmr_attach_args * const pa = aux;
+	uint32_t typ;
+
+	aprint_normal(: Distributed Interrupt Controller\n);
+	aprint_naive(\n);
+
+	dic-sc_dev = self;
+	dic-sc_iot = pa-pa_iot;
+
+	dic_softc = dic;
+
+	if (bus_space_subregion(dic-sc_iot, pa-pa_ioh, 
+		MPCORE_PMR_CII, MPCORE_PMR_CII_SIZE,
+		dic

CVS commit: src/sys/arch/arm/include

2010-12-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Wed Dec 15 15:43:13 UTC 2010

Modified Files:
src/sys/arch/arm/include: armreg.h

Log Message:
fix XP bit and U bit definitions of CP15 control register.
These constants are not used in our source tree for now,
so this won't change any kernel bianries.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/arm/include/armreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.45 src/sys/arch/arm/include/armreg.h:1.46
--- src/sys/arch/arm/include/armreg.h:1.45	Sat Oct  2 05:37:58 2010
+++ src/sys/arch/arm/include/armreg.h	Wed Dec 15 15:43:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.45 2010/10/02 05:37:58 kiyohara Exp $	*/
+/*	$NetBSD: armreg.h,v 1.46 2010/12/15 15:43:13 bsh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -296,9 +296,9 @@
 #define CPU_CONTROL_VECRELOC	0x2000 /* V: Vector relocation */
 #define CPU_CONTROL_ROUNDROBIN	0x4000 /* RR: Predictable replacement */
 #define CPU_CONTROL_V4COMPAT	0x8000 /* L4: ARMv4 compat LDR R15 etc */
-#define CPU_CONTROL_UNAL_ENABLE	0x0004 /* U: unaligned data access */
-#define CPU_CONTROL_XP_ENABLE	0x0008 /* XP: extended page table */
 #define CPU_CONTROL_FI_ENABLE	0x0020 /* FI: Low interrupt latency */
+#define CPU_CONTROL_UNAL_ENABLE	0x0040 /* U: unaligned data access */
+#define CPU_CONTROL_XP_ENABLE	0x0080 /* XP: extended page table */
 
 #define CPU_CONTROL_IDC_ENABLE	CPU_CONTROL_DC_ENABLE
 



CVS commit: src/sys/arch/arm/arm

2010-12-09 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Fri Dec 10 02:06:23 UTC 2010

Modified Files:
src/sys/arch/arm/arm: cpufunc_asm_armv6.S

Log Message:
fix a LINTSTUB


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/arm/cpufunc_asm_armv6.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm/cpufunc_asm_armv6.S
diff -u src/sys/arch/arm/arm/cpufunc_asm_armv6.S:1.3 src/sys/arch/arm/arm/cpufunc_asm_armv6.S:1.4
--- src/sys/arch/arm/arm/cpufunc_asm_armv6.S:1.3	Sat Jun 19 19:44:57 2010
+++ src/sys/arch/arm/arm/cpufunc_asm_armv6.S	Fri Dec 10 02:06:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc_asm_armv6.S,v 1.3 2010/06/19 19:44:57 matt Exp $	*/
+/*	$NetBSD: cpufunc_asm_armv6.S,v 1.4 2010/12/10 02:06:22 bsh Exp $	*/
 
 /*
  * Copyright (c) 2002, 2005 ARM Limited
@@ -83,7 +83,7 @@
 	mcr	p15, 0, r0, c7, c10, 4	/* drain the write buffer */
 	RET
 
-/* LINTSTUB: void armv6_icache_sync_range(vaddr_t, vsize_t); */
+/* LINTSTUB: void armv6_dcache_wb_range(vaddr_t, vsize_t); */
 ENTRY(armv6_dcache_wb_range)
 	add	r1, r1, r0
 	sub	r1, r1, #1



CVS commit: src/sys/arch/evbarm/netwalker

2010-12-08 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Thu Dec  9 04:40:22 UTC 2010

Added Files:
src/sys/arch/evbarm/netwalker: netwalker_usb.c

Log Message:
support USB on NetWalker


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/netwalker/netwalker_usb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/arch/evbarm/netwalker/netwalker_usb.c
diff -u /dev/null src/sys/arch/evbarm/netwalker/netwalker_usb.c:1.1
--- /dev/null	Thu Dec  9 04:40:22 2010
+++ src/sys/arch/evbarm/netwalker/netwalker_usb.c	Thu Dec  9 04:40:22 2010
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2010  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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 CORPORATION
+ * 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: netwalker_usb.c,v 1.1 2010/12/09 04:40:22 bsh Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/conf.h
+#include sys/kernel.h
+#include sys/device.h
+#include sys/intr.h
+#include sys/bus.h
+
+#include dev/usb/usb.h
+#include dev/usb/usbdi.h
+#include dev/usb/usbdivar.h
+#include dev/usb/usb_mem.h
+
+#include dev/usb/ehcireg.h
+#include dev/usb/ehcivar.h
+
+#include arm/imx/imx51reg.h
+#include arm/imx/imx51var.h
+#include arm/imx/imxusbreg.h
+#include arm/imx/imxusbvar.h
+#include arm/imx/imx51_iomuxreg.h
+#include arm/imx/imxgpiovar.h
+#include locators.h
+
+
+struct netwalker_usbc_softc {
+	struct imxusbc_softc  sc_imxusbc;
+};
+
+
+static int	imxusbc_match(device_t, cfdata_t, void *);
+static void	imxusbc_attach(device_t, device_t, void *);
+static void	netwalker_usb_init(struct imxehci_softc *);
+
+static void	init_otg(struct imxehci_softc *);
+static void	init_h1(struct imxehci_softc *);
+
+extern const struct iomux_conf iomux_usb1_config[];
+
+/* attach structures */
+CFATTACH_DECL_NEW(imxusbc_axi, sizeof(struct netwalker_usbc_softc),
+imxusbc_match, imxusbc_attach, NULL, NULL);
+
+static int
+imxusbc_match(device_t parent, cfdata_t cf, void *aux)
+{
+	struct axi_attach_args *aa = aux;
+
+	printf(%s\n, __func__);
+
+	if (aa-aa_addr == USBOH3_BASE)
+		return 1;
+	return 0;
+}
+
+static void
+imxusbc_attach(device_t parent, device_t self, void *aux)
+{
+	struct axi_attach_args *aa = aux;
+	struct imxusbc_softc *sc = device_private(self);
+
+	sc-sc_init_md_hook = netwalker_usb_init;
+	sc-sc_setup_md_hook = NULL;
+
+	imxusbc_attach_common(parent, self, aa-aa_iot);
+
+}
+
+static void
+netwalker_usb_init(struct imxehci_softc *sc)
+{
+	switch (sc-sc_unit) {
+	case 0:	/* OTG controller */
+		init_otg(sc);
+		break;
+	case 1:	/* EHCI Host 1 */
+		init_h1(sc);
+		break;
+	default:
+		aprint_error_dev(sc-sc_hsc.sc_dev, unit %d not supprted\n,
+		sc-sc_unit);
+	}
+}
+
+static void
+init_otg(struct imxehci_softc *sc)
+{
+	struct imxusbc_softc *usbc = sc-sc_usbc;
+	uint32_t reg;
+
+	sc-sc_iftype = IMXUSBC_IF_UTMI;
+
+	imxehci_reset(sc);
+
+	reg = bus_space_read_4(usbc-sc_iot, usbc-sc_ioh, USBOH3_PHYCTRL0);
+	reg |= PHYCTRL0_OTG_OVER_CUR_DIS;
+	bus_space_write_4(usbc-sc_iot, usbc-sc_ioh, USBOH3_PHYCTRL0, reg);
+
+	reg = bus_space_read_4(usbc-sc_iot, usbc-sc_ioh, USBOH3_USBCTRL);
+	reg = ~(USBCTRL_OWIR|USBCTRL_OPM);
+	bus_space_write_4(usbc-sc_iot, usbc-sc_ioh, USBOH3_USBCTRL, reg);
+
+	reg = bus_space_read_4(usbc-sc_iot, usbc-sc_ioh, USBOH3_PHYCTRL1);
+	reg = (reg  ~PHYCTRL1_PLLDIVVALUE_MASK) | PHYCTRL1_PLLDIVVALUE_24MHZ;
+	bus_space_write_4(usbc-sc_iot, usbc-sc_ioh, USBOH3_PHYCTRL1, reg);
+}
+
+
+
+
+static void
+init_h1(struct imxehci_softc *sc)
+{
+	struct imxusbc_softc *usbc = sc-sc_usbc;
+	uint32_t reg;
+
+	/* output HIGH to USBH1_STP */
+	gpio_data_write(GPIO_NO

CVS commit: src/sys/arch/evbarm/netwalker

2010-12-08 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Thu Dec  9 05:00:15 UTC 2010

Modified Files:
src/sys/arch/evbarm/netwalker: netwalker_machdep.c

Log Message:
adapt to changes in imx51reg.h
CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use PR category/123 to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: = For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: = If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: = If the change is major:
CVS: = If the change adds files to, or removes files from $DESTDIR:
CVS: = If you are changing a library or kernel interface:
CVS: Have you successfully run ./build.sh release?


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/netwalker/netwalker_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/netwalker/netwalker_machdep.c
diff -u src/sys/arch/evbarm/netwalker/netwalker_machdep.c:1.2 src/sys/arch/evbarm/netwalker/netwalker_machdep.c:1.3
--- src/sys/arch/evbarm/netwalker/netwalker_machdep.c:1.2	Sun Nov 28 08:23:24 2010
+++ src/sys/arch/evbarm/netwalker/netwalker_machdep.c	Thu Dec  9 05:00:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: netwalker_machdep.c,v 1.2 2010/11/28 08:23:24 hannken Exp $	*/
+/*	$NetBSD: netwalker_machdep.c,v 1.3 2010/12/09 05:00:14 bsh Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005, 2010  Genetec Corporation. 
@@ -102,7 +102,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netwalker_machdep.c,v 1.2 2010/11/28 08:23:24 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: netwalker_machdep.c,v 1.3 2010/12/09 05:00:14 bsh Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -946,45 +946,25 @@
 
 	/* left buttons */
 	IOMUX_DATA(EIM_EB2, IOMUX_CONFIG_ALT1,
-		   PAD_CTL_HYS_ENABLE),
+		   PAD_CTL_HYS),
 	/* right buttons */
 	IOMUX_DATA(EIM_EB3, IOMUX_CONFIG_ALT1,
-		   PAD_CTL_HYS_ENABLE),
-		   
+		   PAD_CTL_HYS),
 
-#if 0
-	/* UART1 */
-	IOMUX_DATA(UART1_RXD, IOMUX_CONFIG_ALT0,
-		   (PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE |
-		PAD_CTL_PUE_PULL	 | PAD_CTL_DSE_HIGH   |
-		PAD_CTL_SRE_FAST)),
-	IOMUX_DATA(UART1_TXD, IOMUX_CONFIG_ALT0,
-		   (PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE |
-		PAD_CTL_PUE_PULL	 | PAD_CTL_DSE_HIGH   |
-		PAD_CTL_SRE_FAST)),
-	IOMUX_DATA(UART1_RTS, IOMUX_CONFIG_ALT0,
-		   (PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE |
-		PAD_CTL_PUE_PULL	 | PAD_CTL_DSE_HIGH)),
-	IOMUX_DATA(UART1_CTS, IOMUX_CONFIG_ALT0,
-		   (PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE |
-		PAD_CTL_PUE_PULL	 | PAD_CTL_DSE_HIGH)),
-#else
 	/* UART1 */
 #if 1
 	IOMUX_DATA(UART1_RXD, IOMUX_CONFIG_ALT0,
-		   PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST),
+		   PAD_CTL_DSE_HIGH | PAD_CTL_SRE),
 #else
 	IOMUX_DATA(UART1_RXD, IOMUX_CONFIG_ALT3,	/* gpio4[28] */
-		   PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST),
+		   PAD_CTL_DSE_HIGH | PAD_CTL_SRE),
 #endif
 	IOMUX_DATA(UART1_TXD, IOMUX_CONFIG_ALT0,
-		   PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST),
+		   PAD_CTL_DSE_HIGH | PAD_CTL_SRE),
 	IOMUX_DATA(UART1_RTS, IOMUX_CONFIG_ALT0,
 		   PAD_CTL_DSE_HIGH),
 	IOMUX_DATA(UART1_CTS, IOMUX_CONFIG_ALT0,
 		   PAD_CTL_DSE_HIGH),
-#endif
-
 };
 
 static void
@@ -1157,6 +1137,9 @@
 	}
 	printf(\n);
 
+	printf(\nCCM\n);
+	dump_sub(CCM_BASE, CCM_SIZE);
+
 #if 0
 	/* disable power down counter in watch dog,
 	   This must be done within 16 seconds of start-up. */
@@ -1181,3 +1164,27 @@
 
 }
 #endif
+
+
+#if 0
+#include arm/imx/imxgpiovar.h
+
+void gpio_test(void)
+void
+gpio_test(void)
+{
+	int left, right;
+
+	gpio_set_direction(GPIO_NO(2, 22), GPIO_DIR_IN);
+	gpio_set_direction(GPIO_NO(2, 23), GPIO_DIR_IN);
+
+	for (;;) {
+		left = gpio_data_read(GPIO_NO(2, 22));
+		right = gpio_data_read(GPIO_NO(2, 23));
+
+		printf(\r%s %s,
+		left ? off : ON ,
+		right ? off : ON );
+	}
+}
+#endif



CVS commit: src/sys/arch/arm/conf

2010-11-30 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Tue Nov 30 12:42:48 UTC 2010

Modified Files:
src/sys/arch/arm/conf: majors.arm32

Log Message:
define major device number for UARTs on i.MX SoCs


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/conf/majors.arm32

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/conf/majors.arm32
diff -u src/sys/arch/arm/conf/majors.arm32:1.31 src/sys/arch/arm/conf/majors.arm32:1.32
--- src/sys/arch/arm/conf/majors.arm32:1.31	Sat Mar  6 23:45:39 2010
+++ src/sys/arch/arm/conf/majors.arm32	Tue Nov 30 12:42:48 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.arm32,v 1.31 2010/03/06 23:45:39 plunky Exp $
+#	$NetBSD: majors.arm32,v 1.32 2010/11/30 12:42:48 bsh Exp $
 #
 # Device majors for arm32
 #
@@ -97,6 +97,7 @@
 device-major	dmoverio	char 102		dmoverio
 device-major	apm		char 103		apm
 device-major	sscom		char 104		sscom
+device-major	imxcom		char 104		imxuart
 device-major	ksyms		char 105		ksyms
 device-major	isdnbchan	char 106		isdnbchan
 device-major	epcom		char 107		epcom



CVS commit: src/sys/arch/arm/imx

2010-11-30 Thread Hiroyuki Bessho
/imx51_usb.c
diff -u /dev/null src/sys/arch/arm/imx/imx51_usb.c:1.1
--- /dev/null	Tue Nov 30 13:05:27 2010
+++ src/sys/arch/arm/imx/imx51_usb.c	Tue Nov 30 13:05:27 2010
@@ -0,0 +1,89 @@
+/*	$NetBSD: imx51_usb.c,v 1.1 2010/11/30 13:05:27 bsh Exp $	*/
+/*
+ * Copyright (c) 2010  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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 CORPORATION
+ * 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: imx51_usb.c,v 1.1 2010/11/30 13:05:27 bsh Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/conf.h
+#include sys/kernel.h
+#include sys/device.h
+#include sys/intr.h
+#include sys/bus.h
+
+#include dev/usb/usb.h
+#include dev/usb/usbdi.h
+#include dev/usb/usbdivar.h
+#include dev/usb/usb_mem.h
+
+#include dev/usb/ehcireg.h
+#include dev/usb/ehcivar.h
+
+#include arm/imx/imx51reg.h
+#include arm/imx/imx51var.h
+#include arm/imx/imxusbvar.h
+#include locators.h
+
+static int 	imxusbc_search(device_t, cfdata_t, const int *, void *);
+
+
+int
+imxusbc_attach_common(device_t parent, device_t self, bus_space_tag_t iot)
+{
+	struct imxusbc_softc *sc = device_private(self);
+
+	sc-sc_iot = iot;
+
+	/* Map entire USBOH3 registers.  Host controller drivers
+	 * re-use subregions of this. */
+	if (bus_space_map(iot, USBOH3_BASE, USBOH3_SIZE, 0, sc-sc_ioh))
+		return -1;
+
+	/* attach OTG/EHCI host controllers */
+	config_search_ia(imxusbc_search, self, imxusbc, NULL);
+
+	return 0;
+}
+
+static int
+imxusbc_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
+{
+	struct imxusbc_softc *sc = device_private(parent);
+	struct imxusbc_attach_args aa;
+
+aa.aa_iot = sc-sc_iot;
+	aa.aa_ioh = sc-sc_ioh;
+	aa.aa_dmat = imx_bus_dma_tag;
+aa.aa_unit = cf-cf_loc[IMXUSBCCF_UNIT];
+	aa.aa_irq = cf-cf_loc[IMXUSBCCF_IRQ];
+
+if (config_match(parent, cf, aa)  0)
+config_attach(parent, cf, aa, NULL);
+
+return 0;
+}
+
Index: src/sys/arch/arm/imx/imxgpio.c
diff -u /dev/null src/sys/arch/arm/imx/imxgpio.c:1.1
--- /dev/null	Tue Nov 30 13:05:27 2010
+++ src/sys/arch/arm/imx/imxgpio.c	Tue Nov 30 13:05:27 2010
@@ -0,0 +1,422 @@
+/*	$NetBSD: imxgpio.c,v 1.1 2010/11/30 13:05:27 bsh Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas
+ *
+ * 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

CVS commit: src/sys/arch/evbarm/conf

2010-11-30 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Tue Nov 30 13:07:29 UTC 2010

Modified Files:
src/sys/arch/evbarm/conf: NETWALKER files.netwalker

Log Message:
Support USB on NetWalker.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/NETWALKER
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/files.netwalker

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/NETWALKER
diff -u src/sys/arch/evbarm/conf/NETWALKER:1.2 src/sys/arch/evbarm/conf/NETWALKER:1.3
--- src/sys/arch/evbarm/conf/NETWALKER:1.2	Tue Nov 23 11:13:56 2010
+++ src/sys/arch/evbarm/conf/NETWALKER	Tue Nov 30 13:07:29 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: NETWALKER,v 1.2 2010/11/23 11:13:56 hannken Exp $
+#	$NetBSD: NETWALKER,v 1.3 2010/11/30 13:07:29 bsh Exp $
 #
 #	NETWALKER -- Sharp
 #
@@ -23,7 +23,7 @@
 
 # Architecture options
 
-optionsIMX51_IPGCLK_FREQ=5000
+optionsIMX51_IPGCLK_FREQ=5000   # XXX This value is not correct.
 
 # File systems
 
@@ -184,6 +184,74 @@
 imxclock0	at axi? addr 0x73fac000 size 0x4000 irq 40
 imxclock1	at axi? addr 0x73fb size 0x4000 irq 41
 
+# IOMUX
+imxiomux0	at axi? addr 0x73fa8000
+
+# GPIO
+imxgpio0	at axi? addr 0x73f84000
+imxgpio1	at axi? addr 0x73f88000
+imxgpio2	at axi? addr 0x73f8c000
+imxgpio3	at axi? addr 0x73f9
+
+# USB
+imxusbc0  at axi?  addr 0x73f8
+ehci0	  at imxusbc0	unit 0	irq 18 # OTG
+ehci1	  at imxusbc0	unit 1	irq 14 # Host1
+#ehci2	  at imxusbc0	unit 2	irq 16 # Host2
+#ehci3	  at imxusbc0	unit 3	irq 17 # Host3
+
+usb*		at ehci?
+uhub*		at usb?
+uhub*		at uhub? port ?
+ugen*		at uhub? port ?
+
+# USB HID device
+uhidev* at uhub? port ? configuration ? interface ?
+
+# USB Mice
+ums*	at uhidev? reportid ?
+wsmouse* at ums? mux 0
+
+# USB Keyboards
+ukbd*	at uhidev? reportid ?
+wskbd*	at ukbd? console ? mux 1
+
+# USB Mass Storage
+umass*	at uhub? port ? configuration ? interface ?
+wd*	at umass?
+
+# Serial adapters
+ubsa*	at uhub? port ?		# Belkin serial adapter
+ucom*	at ubsa? portno ?
+
+uchcom* at uhub? port ? 	# WinChipHead CH341/CH340 serial adapter
+ucom*	at uchcom? portno ?
+
+uftdi*	at uhub? port ?		# FTDI FT8U100AX serial adapter
+ucom*	at uftdi? portno ?
+
+umct*	at uhub? port ?		# MCT USB-RS232 serial adapter
+ucom*	at umct? portno ?
+
+uplcom* at uhub? port ? 	# I/O DATA USB-RSAQ2 serial adapter
+ucom*	at uplcom? portno ?
+
+uslsa*	at uhub? port ?		# Silicon Labs USB-RS232 serial adapter
+ucom*	at uslsa? portno ?
+
+uvscom* at uhub? port ? 	# SUNTAC Slipper U VS-10U serial adapter
+ucom*	at uvscom? portno ?
+
+# USB generic serial port (e.g., data over cellular)
+ugensa* at uhub? port ?
+ucom*	at ugensa?
+
+# SCSI bus support
+scsibus* at scsi?
+
+# SCSI devices
+sd*	at scsibus? target ? lun ?	# SCSI disk drives
+
 # Pseudo-Devices
 
 pseudo-device	crypto			# /dev/crypto device

Index: src/sys/arch/evbarm/conf/files.netwalker
diff -u src/sys/arch/evbarm/conf/files.netwalker:1.1 src/sys/arch/evbarm/conf/files.netwalker:1.2
--- src/sys/arch/evbarm/conf/files.netwalker:1.1	Sat Nov 13 07:31:32 2010
+++ src/sys/arch/evbarm/conf/files.netwalker	Tue Nov 30 13:07:29 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.netwalker,v 1.1 2010/11/13 07:31:32 bsh Exp $
+#	$NetBSD: files.netwalker,v 1.2 2010/11/30 13:07:29 bsh Exp $
 #
 # Sharp
 #
@@ -11,3 +11,6 @@
 # CPU support and integrated peripherals
 include arch/arm/imx/files.imx51
 
+device imxusbc_axi
+attach imxusbc at axi with imxusbc_axi
+file   arch/evbarm/netwalker/netwalker_usb.c	imxusbc_axi



CVS commit: src/sys/dev/usb

2010-11-30 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Tue Nov 30 15:26:22 UTC 2010

Modified Files:
src/sys/dev/usb: ucom.c

Log Message:
don't clear TS_BUSY in ucomclose().
This fixes kernel crash in ucomstart() with echo Hello  /dev/ttyU0.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/usb/ucom.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.85 src/sys/dev/usb/ucom.c:1.86
--- src/sys/dev/usb/ucom.c:1.85	Wed Nov  3 22:34:23 2010
+++ src/sys/dev/usb/ucom.c	Tue Nov 30 15:26:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucom.c,v 1.85 2010/11/03 22:34:23 dyoung Exp $	*/
+/*	$NetBSD: ucom.c,v 1.86 2010/11/30 15:26:22 bsh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ucom.c,v 1.85 2010/11/03 22:34:23 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: ucom.c,v 1.86 2010/11/30 15:26:22 bsh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -596,7 +596,6 @@
 
 	s = spltty();
 	sc-sc_refcnt++;
-	CLR(tp-t_state, TS_BUSY);
 
 	(*tp-t_linesw-l_close)(tp, flag);
 	ttyclose(tp);



CVS commit: src/sys/arch/arm/imx

2010-11-27 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 27 13:37:27 UTC 2010

Modified Files:
src/sys/arch/arm/imx: imx31_uart.c imx51_uart.c imxuart.c imxuartvar.h

Log Message:
use device_t correctly for imxuart.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx31_uart.c \
src/sys/arch/arm/imx/imx51_uart.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/imxuart.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imxuartvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx31_uart.c
diff -u src/sys/arch/arm/imx/imx31_uart.c:1.1 src/sys/arch/arm/imx/imx31_uart.c:1.2
--- src/sys/arch/arm/imx/imx31_uart.c:1.1	Sat Nov 13 06:12:17 2010
+++ src/sys/arch/arm/imx/imx31_uart.c	Sat Nov 27 13:37:27 2010
@@ -36,7 +36,7 @@
 
 
 int
-imxuart_match(struct device *parent, struct cfdata *cf, void *aux)
+imxuart_match(device_t parent, struct cfdata *cf, void *aux)
 {
 	struct aips_attach_args * const aipsa = aux;
 
@@ -53,7 +53,7 @@
 }
 
 void
-imxuart_attach(struct device *parent, struct device *self, void *aux)
+imxuart_attach(device_t parent, device_t self, void *aux)
 {
 	struct aips_attach_args * aa = aux;
 
Index: src/sys/arch/arm/imx/imx51_uart.c
diff -u src/sys/arch/arm/imx/imx51_uart.c:1.1 src/sys/arch/arm/imx/imx51_uart.c:1.2
--- src/sys/arch/arm/imx/imx51_uart.c:1.1	Sat Nov 13 06:12:17 2010
+++ src/sys/arch/arm/imx/imx51_uart.c	Sat Nov 27 13:37:27 2010
@@ -36,7 +36,7 @@
 
 
 int
-imxuart_match(struct device *parent, struct cfdata *cf, void *aux)
+imxuart_match(device_t parent, struct cfdata *cf, void *aux)
 {
 	struct axi_attach_args * const aa = aux;
 
@@ -51,7 +51,7 @@
 }
 
 void
-imxuart_attach(struct device *parent, struct device *self, void *aux)
+imxuart_attach(device_t parent, device_t self, void *aux)
 {
 	struct axi_attach_args * aa = aux;
 

Index: src/sys/arch/arm/imx/imxuart.c
diff -u src/sys/arch/arm/imx/imxuart.c:1.5 src/sys/arch/arm/imx/imxuart.c:1.6
--- src/sys/arch/arm/imx/imxuart.c:1.5	Sat Nov 13 06:12:17 2010
+++ src/sys/arch/arm/imx/imxuart.c	Sat Nov 27 13:37:27 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: imxuart.c,v 1.5 2010/11/13 06:12:17 bsh Exp $ */
+/* $NetBSD: imxuart.c,v 1.6 2010/11/27 13:37:27 bsh Exp $ */
 
 /*
  * Copyright (c) 2009, 2010  Genetec Corporation.  All rights reserved.
@@ -96,7 +96,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: imxuart.c,v 1.5 2010/11/13 06:12:17 bsh Exp $);
+__KERNEL_RCSID(0, $NetBSD: imxuart.c,v 1.6 2010/11/27 13:37:27 bsh Exp $);
 
 #include opt_imxuart.h
 #include opt_ddb.h
@@ -388,7 +388,7 @@
 
 
 void
-imxuart_attach_common(struct device *parent, struct device *self,
+imxuart_attach_common(device_t parent, device_t self,
 bus_space_tag_t iot, paddr_t iobase, size_t size, int intr, int flags)
 {
 	imxuart_softc_t *sc = device_private(self);

Index: src/sys/arch/arm/imx/imxuartvar.h
diff -u src/sys/arch/arm/imx/imxuartvar.h:1.3 src/sys/arch/arm/imx/imxuartvar.h:1.4
--- src/sys/arch/arm/imx/imxuartvar.h:1.3	Sat Nov 13 06:12:17 2010
+++ src/sys/arch/arm/imx/imxuartvar.h	Sat Nov 27 13:37:27 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: imxuartvar.h,v 1.3 2010/11/13 06:12:17 bsh Exp $ */
+/* $NetBSD: imxuartvar.h,v 1.4 2010/11/27 13:37:27 bsh Exp $ */
 /*
  * driver include for Freescale i.MX31 and i.MX31L UARTs
  */
@@ -36,7 +36,7 @@
 #include  sys/termios.h	/* for tcflag_t */
 
 
-void imxuart_attach_common(struct device *parent, struct device *self,
+void imxuart_attach_common(device_t parent, device_t self,
 bus_space_tag_t, paddr_t, size_t, int, int);
 
 int imxuart_kgdb_attach(bus_space_tag_t, paddr_t, u_int, tcflag_t);



CVS commit: src/sys/dev/usb

2010-11-27 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 27 13:41:50 UTC 2010

Added Files:
src/sys/dev/usb: ulpireg.h

Log Message:
ULPI register definitions


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/usb/ulpireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/dev/usb/ulpireg.h
diff -u /dev/null src/sys/dev/usb/ulpireg.h:1.1
--- /dev/null	Sat Nov 27 13:41:50 2010
+++ src/sys/dev/usb/ulpireg.h	Sat Nov 27 13:41:49 2010
@@ -0,0 +1,88 @@
+/*	$NetBSD: ulpireg.h,v 1.1 2010/11/27 13:41:49 bsh Exp $	*/
+/*
+ * Copyright (c) 2009, 2010  Genetec Corporation.  All rights reserved.
+ * Written by Hashimoto Kenichi 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 CORPORATION
+ * 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.
+ */
+#ifndef _DEV_USB_ULPI_ULPIREG_H
+#define	_DEV_USB_ULPI_ULPIREG_H
+
+/* commands */
+#define	ULPI_CMD_SPECIAL	(0x0  6)
+#define	ULPI_CMD_NOOP   	(ULPI_CMD_SPECIAL | 0x00)
+#define	ULPI_CMD_TRANSMIT	(0x1  6)
+#define	ULPI_CMD_PID(n)  	(ULPI_CMD_TRANSMIT | (n))
+#define	ULPI_CMD_REGWRITE	(0x2  6)
+#define	ULPI_CMD_EXTW   	(ULPI_CMD_REGWRITE | 0x2f)
+#define	ULPI_CMD_REGREAD	(0x3  6)
+#define	ULPI_CMD_EXTR   	(ULPI_CMD_REGREAD | 0x2f)
+
+/* registers */
+#define	ULPI_VENDOR_ID_LOW 		0x00
+#define	ULPI_VENDOR_ID_HIGH 		0x01
+#define	ULPI_PRODUCT_ID_LOW 		0x02
+#define	ULPI_PRODUCT_ID_HIGH	0x03
+#define	ULPI_FUNCTION_CONTROL	0x04
+#define	 FUNCTION_CONTROL_XCVRSELECT	__BITS(0,1)
+#define	 XCVRSELECT_HS			0x0
+#define	 XCVRSELECT_FS			0x1
+#define	 XCVRSELECT_LS			0x2
+#define	 XCVRSELECT_FSLS		0x3  /* FS Xceiver for LS packets */
+#define	 FUNCTION_CONTROL_TERMSELECT	__BIT(2)
+#define	 FUNCTION_CONTROL_OPMODE	__BITS(3,4)
+#define	 FUNCTION_CONTROL_RESET  	__BIT(5)
+#define	 FUNCTION_CONTROL_SUSPENDM  	__BIT(6)
+#define	ULPI_INTERFACE_CONTROL  	0x07
+#define	ULPI_OTG_CONTROL 		0x0a
+#define	 OTG_CONTROL_IDPULLUP		__BIT(0)	/* ID pull up */
+#define	 OTG_CONTROL_DPPULLDOWN 	__BIT(1)	/* D+ pull down */
+#define	 OTG_CONTROL_DMPULLDOWN  	__BIT(2)	/* D- pull down */
+#define	 OTG_CONTROL_DISCHRGVBUS 	__BIT(3)	/* discharge Vbus */
+#define	 OTG_CONTROL_CHRGVBUS   	__BIT(4)	/* charge Vbus */
+#define	 OTG_CONTROL_DRVVBUS	__BIT(5)	/* drive 5V on Vbus */
+#define	 OTG_CONTROL_DRVVBUSEXT  	__BIT(6)	/* drive Vbus external */
+#define	 OTG_CONTROL_USEEXTVBUSIND	__BIT(7)	/* use external Vbus over-current
+			   indecator */
+#define	ULPI_USB_INT_RISING_EDGE 	0x0d
+#define	ULPI_USB_INT_FALLING_EDGE	0x10
+#define	ULPI_USB_INT_STATUS 		0x13
+#define	ULPI_USB_INTERRUPT_LATCH 	0x14
+#define	ULPI_DEBUG			0x15
+#define	ULPI_SCRATCH 			0x16
+#define	ULPI_CARKIT_CONTROL		0x19
+#define	ULPI_CARKIT_INTERRUPT_DELAY	0x1c
+#define	ULPI_CARKIT_INTERRUPT_ENABLE	0x1d
+#define	ULPI_CARKIT_INTERRUPT_STATUS	0x20
+#define	ULPI_CARKIT_INTERRUPT_LATCH	0x21
+#define	ULPI_CARKIT_PULSE_CONTROL	0x22
+#define	ULPI_TRANSMIT_POSITIVE_WIDTH	0x25
+#define	ULPI_TRANSMIT_NEGATIVE_WIDTH	0x26
+#define	ULPI_RECEIVE_POLARITY_RECOVERY	0x27
+
+#define	ULPI_VENDOR_SPECIFIC		0x30
+
+#define	ULPI_REG_WRITE  	0
+#define	ULPI_REG_SET 		1
+#define	ULPI_REG_CLEAR 		2
+
+#endif	/* _DEV_USB_ULPI_ULPIREG_H */



CVS commit: src/sys/arch/arm/pic

2010-11-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Mon Nov 15 09:25:58 UTC 2010

Modified Files:
src/sys/arch/arm/pic: picvar.h

Log Message:
fix compile error about missing evcnt definition.
picvar.h is now included very early because of uebayashi's change to 
sys/param.h.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/pic/picvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/pic/picvar.h
diff -u src/sys/arch/arm/pic/picvar.h:1.4 src/sys/arch/arm/pic/picvar.h:1.5
--- src/sys/arch/arm/pic/picvar.h:1.4	Tue Dec 30 05:43:14 2008
+++ src/sys/arch/arm/pic/picvar.h	Mon Nov 15 09:25:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: picvar.h,v 1.4 2008/12/30 05:43:14 matt Exp $	*/
+/*	$NetBSD: picvar.h,v 1.5 2010/11/15 09:25:58 bsh Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -57,6 +57,8 @@
 
 #ifdef _INTR_PRIVATE
 
+#include sys/evcnt.h
+
 #ifndef PIC_MAXPICS
 #define PIC_MAXPICS	32
 #endif



CVS commit: src/sys/arch/arm/omap

2010-11-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Mon Nov 15 09:34:28 UTC 2010

Modified Files:
src/sys/arch/arm/omap: omap2_icu.c omap2_intr.h

Log Message:
don't include arm/cpu.h which requires SOFTINT_COUNT before sys/intr.h
is fully included.
This change makes Beagleboard kernel compile again after uebayashi's change
to sys/param.h.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/omap2_icu.c \
src/sys/arch/arm/omap/omap2_intr.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/omap/omap2_icu.c
diff -u src/sys/arch/arm/omap/omap2_icu.c:1.5 src/sys/arch/arm/omap/omap2_icu.c:1.6
--- src/sys/arch/arm/omap/omap2_icu.c:1.5	Wed Oct 22 10:45:47 2008
+++ src/sys/arch/arm/omap/omap2_icu.c	Mon Nov 15 09:34:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_icu.c,v 1.5 2008/10/22 10:45:47 matt Exp $	*/
+/*	$NetBSD: omap2_icu.c,v 1.6 2010/11/15 09:34:28 bsh Exp $	*/
 /*
  * Define the SDP2430 specific information and then include the generic OMAP
  * interrupt header.
@@ -30,10 +30,11 @@
 #define _INTR_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: omap2_icu.c,v 1.5 2008/10/22 10:45:47 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: omap2_icu.c,v 1.6 2010/11/15 09:34:28 bsh Exp $);
 
 #include sys/param.h
 #include sys/evcnt.h
+#include sys/device.h
 
 #include uvm/uvm_extern.h
 
Index: src/sys/arch/arm/omap/omap2_intr.h
diff -u src/sys/arch/arm/omap/omap2_intr.h:1.5 src/sys/arch/arm/omap/omap2_intr.h:1.6
--- src/sys/arch/arm/omap/omap2_intr.h:1.5	Sat Aug 28 04:06:40 2010
+++ src/sys/arch/arm/omap/omap2_intr.h	Mon Nov 15 09:34:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_intr.h,v 1.5 2010/08/28 04:06:40 kiyohara Exp $ */
+/*	$NetBSD: omap2_intr.h,v 1.6 2010/11/15 09:34:28 bsh Exp $ */
 
 /*
  * Define the SDP2430 specific information and then include the generic OMAP
@@ -34,7 +34,6 @@
 
 #ifndef _LOCORE
 
-#include arm/cpu.h
 #include arm/armreg.h
 #include arm/cpufunc.h
 



CVS commit: src/sys/arch/arm/imx

2010-11-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Mon Nov 15 18:18:39 UTC 2010

Modified Files:
src/sys/arch/arm/imx: imx31_gpio.c

Log Message:
GPIO register definitions are now in imxgpioreg.h to share them with
imx51


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/imx31_gpio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx31_gpio.c
diff -u src/sys/arch/arm/imx/imx31_gpio.c:1.4 src/sys/arch/arm/imx/imx31_gpio.c:1.5
--- src/sys/arch/arm/imx/imx31_gpio.c:1.4	Wed Nov 19 06:28:14 2008
+++ src/sys/arch/arm/imx/imx31_gpio.c	Mon Nov 15 18:18:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx31_gpio.c,v 1.4 2008/11/19 06:28:14 matt Exp $	*/
+/*	$NetBSD: imx31_gpio.c,v 1.5 2010/11/15 18:18:39 bsh Exp $	*/
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: imx31_gpio.c,v 1.4 2008/11/19 06:28:14 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: imx31_gpio.c,v 1.5 2010/11/15 18:18:39 bsh Exp $);
 
 #define _INTR_PRIVATE
 
@@ -51,6 +51,7 @@
 
 #include arm/imx/imx31reg.h
 #include arm/imx/imx31var.h
+#include arm/imx/imxgpioreg.h
 #include arm/pic/picvar.h
 
 #if NGPIO  0



CVS commit: src/sys/arch/arm/imx

2010-11-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Mon Nov 15 18:19:20 UTC 2010

Modified Files:
src/sys/arch/arm/imx: files.imx31 imx31_clock.c imx31reg.h

Log Message:
EPIT support as system clock for i.MX31


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/files.imx31
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx31_clock.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/imx31reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/files.imx31
diff -u src/sys/arch/arm/imx/files.imx31:1.5 src/sys/arch/arm/imx/files.imx31:1.6
--- src/sys/arch/arm/imx/files.imx31:1.5	Sat Nov 13 06:28:20 2010
+++ src/sys/arch/arm/imx/files.imx31	Mon Nov 15 18:19:19 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.imx31,v 1.5 2010/11/13 06:28:20 bsh Exp $
+#	$NetBSD: files.imx31,v 1.6 2010/11/15 18:19:19 bsh Exp $
 #
 # Configuration info for the Freescale i.MX31
 #
@@ -51,6 +51,14 @@
 
 # iMX clock
 file	arch/arm/imx/imxclock.c
+file	arch/arm/imx/imx31_clock.c
+
+# Clock Control Module
+device	imxccm
+attach	imxccm	at aips
+file	arch/arm/imx/imx31_ccm.c	imxccm		needs-flag
+
+defparam opt_imx31clk.h IMX31_IPGCLK_FREQ
 
 # iMX UART
 device	imxuart

Index: src/sys/arch/arm/imx/imx31_clock.c
diff -u src/sys/arch/arm/imx/imx31_clock.c:1.1 src/sys/arch/arm/imx/imx31_clock.c:1.2
--- src/sys/arch/arm/imx/imx31_clock.c:1.1	Sat Nov 13 06:51:37 2010
+++ src/sys/arch/arm/imx/imx31_clock.c	Mon Nov 15 18:19:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx31_clock.c,v 1.1 2010/11/13 06:51:37 bsh Exp $ */
+/*	$NetBSD: imx31_clock.c,v 1.2 2010/11/15 18:19:19 bsh Exp $ */
 /*
  * Copyright (c) 2009,2010  Genetec corp.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec corp.
@@ -45,8 +45,14 @@
 
 #include arm/imx/imx31reg.h
 #include arm/imx/imx31var.h
+#if 0 /* notyet */
 #include arm/imx/imx31_ccmvar.h
+#endif
 #include arm/imx/imxclockvar.h
+#include arm/imx/imxepitreg.h
+
+#include imxccm.h	/* if CCM driver is configured into the kernel */
+#include opt_imx31clk.h
 
 static int imxclock_match(device_t, struct cfdata *, void *);
 static void imxclock_attach(device_t, device_t, void *);
@@ -105,10 +111,18 @@
 int
 imxclock_get_timerfreq(struct imxclock_softc *sc)
 {
+#if NIMXCCM  0
 	struct imx31_clocks clk;
 	imx31_get_clocks(clk);
 
 	return clk.ipg_clk;
+#else
+#ifndef	IMX31_IPGCLK_FREQ
+#error	IMX31_IPGCLK_FREQ need to be defined.
+#endif
+	return IMX31_IPGCLK_FREQ;
+
+#endif
 }
 
 

Index: src/sys/arch/arm/imx/imx31reg.h
diff -u src/sys/arch/arm/imx/imx31reg.h:1.4 src/sys/arch/arm/imx/imx31reg.h:1.5
--- src/sys/arch/arm/imx/imx31reg.h:1.4	Sat Nov 13 06:44:11 2010
+++ src/sys/arch/arm/imx/imx31reg.h	Mon Nov 15 18:19:19 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: imx31reg.h,v 1.4 2010/11/13 06:44:11 bsh Exp $ */
+/* $NetBSD: imx31reg.h,v 1.5 2010/11/15 18:19:19 bsh Exp $ */
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -58,6 +58,18 @@
 #define	GPIO3_BASE	0x53fa4000
 /* register definitions in imxgpiore.h */
 
+#define	GPIO_NPINS		32
+#define	GPIO_NGROUPS		3
+
+#define	GPIO_NO_SCLK0		GPIO_NO(3, 2)
+
+
+/* EPIT */
+
+#define	EPIT1_BASE	0x53f94000
+#define	EPIT2_BASE	0x53f98000
+
+
 #define	INTC_BASE		0x6800
 #define	INTC_SIZE		0x0400
 #define	IMX31_INTCNTL		0x	/* Interrupt Control (RW) */



CVS commit: src/sys/arch/evbarm/conf

2010-11-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Mon Nov 15 18:21:19 UTC 2010

Modified Files:
src/sys/arch/evbarm/conf: IMX31LITE

Log Message:
add an option for system clock frequency (used by timer driver)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/IMX31LITE

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/IMX31LITE
diff -u src/sys/arch/evbarm/conf/IMX31LITE:1.9 src/sys/arch/evbarm/conf/IMX31LITE:1.10
--- src/sys/arch/evbarm/conf/IMX31LITE:1.9	Sat Dec  5 20:11:11 2009
+++ src/sys/arch/evbarm/conf/IMX31LITE	Mon Nov 15 18:21:19 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: IMX31LITE,v 1.9 2009/12/05 20:11:11 pooka Exp $
+#	$NetBSD: IMX31LITE,v 1.10 2010/11/15 18:21:19 bsh Exp $
 #
 #	IMX31LITE -- Freescale IMX31LITE Evaluation Board Kernel
 #
@@ -22,6 +22,7 @@
 options 	CPU_ARM1136	# Support the SA110 core
 
 # Architecture options
+optionsIMX31_IPGCLK_FREQ=6600	# Fixme. bogus value
 
 # File systems
 



CVS commit: src/sys/arch/arm/s3c2xx0

2010-11-15 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Tue Nov 16 02:53:02 UTC 2010

Modified Files:
src/sys/arch/arm/s3c2xx0: s3c2xx0var.h

Log Message:
make SMDK2410 kernel compile again after changes to sys/param.h


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/s3c2xx0/s3c2xx0var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/s3c2xx0/s3c2xx0var.h
diff -u src/sys/arch/arm/s3c2xx0/s3c2xx0var.h:1.4 src/sys/arch/arm/s3c2xx0/s3c2xx0var.h:1.5
--- src/sys/arch/arm/s3c2xx0/s3c2xx0var.h:1.4	Sun Dec 11 12:16:51 2005
+++ src/sys/arch/arm/s3c2xx0/s3c2xx0var.h	Tue Nov 16 02:53:02 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: s3c2xx0var.h,v 1.4 2005/12/11 12:16:51 christos Exp $ */
+/* $NetBSD: s3c2xx0var.h,v 1.5 2010/11/16 02:53:02 bsh Exp $ */
 
 /*
  * Copyright (c) 2002 Fujitsu Component Limited
@@ -36,6 +36,7 @@
 #define _ARM_S3C2XX0VAR_H_
 
 #include machine/bus.h
+#include sys/device.h
 
 struct s3c2xx0_softc {
 	struct device   	sc_dev;



CVS commit: src/doc

2010-11-13 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 08:01:23 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
i.MX51 and NetWalker


To generate a diff of this commit:
cvs rdiff -u -r1.1458 -r1.1459 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1458 src/doc/CHANGES:1.1459
--- src/doc/CHANGES:1.1458	Sat Nov 13 00:47:23 2010
+++ src/doc/CHANGES	Sat Nov 13 08:01:23 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1458 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1459 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -784,3 +784,7 @@
 		Ethernet device [jnemeth 20101112]
 	etphy(4): Add a driver for the Agere/LSI ET1011 TruePHY Gigabit
 		Ethernet PHY [jnemeth 20101112]
+	arm: Add support for i.MX51 SoC.
+		[bsh 20101113]
+	evbarm: Add initial support for Sharp NetWalker MID.
+		[bsh 20101113]



CVS commit: src/sys/arch/arm/imx

2010-11-12 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 04:49:39 UTC 2010

Added Files:
src/sys/arch/arm/imx: files.imx31
Removed Files:
src/sys/arch/arm/imx: files.imx

Log Message:
rename files.imx as files.imx31


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/sys/arch/arm/imx/files.imx
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/imx/files.imx31

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/arch/arm/imx/files.imx31
diff -u /dev/null src/sys/arch/arm/imx/files.imx31:1.1
--- /dev/null	Sat Nov 13 04:49:39 2010
+++ src/sys/arch/arm/imx/files.imx31	Sat Nov 13 04:49:38 2010
@@ -0,0 +1,64 @@
+#	$NetBSD: files.imx31,v 1.1 2010/11/13 04:49:38 bsh Exp $
+#
+# Configuration info for the Freescale i.MX31
+#
+
+define	bus_dma_generic
+
+file	arch/arm/imx/imx31_space.c
+file	arch/arm/imx/imx31_dma.c		bus_dma_generic
+
+# iMX L2 Cache Controller
+device	l2cc
+attach	l2cc at mainbus
+file	arch/arm/imx/imx31_l2cc.c		l2cc
+
+# iMX AHB
+device	ahb  { [addr=-1], [size=0], [intr=-1], [irqbase=-1]} : bus_space_generic
+attach	ahb at mainbus
+file	arch/arm/imx/imx31_ahb.c		ahb
+
+# iMX AdVanced Interrupt Controller
+include arch/arm/pic/files.pic
+device	avic: pic
+attach	avic at ahb
+file	arch/arm/imx/imx31_icu.c		avic		needs-flag
+file	arch/arm/arm32/irq_dispatch.S
+
+# iMX IP bus
+device	aips { [addr=-1], [size=0], [intr=-1]} : bus_space_generic
+attach	aips at ahb
+file	arch/arm/imx/imx31_aips.c		aips
+
+# iMX EMI (external memory interface)
+device	emi { [offset=-1], [size=0], [intr=-1] } : bus_space_generic
+attach	emi at ahb
+file	arch/arm/imx/imx31_emi.c		emi
+
+# iMX GPIO
+device	imxgpio: gpiobus
+attach	imxgpio at ahb
+file	arch/arm/imx/imx31_gpio.c		imxgpio		needs-flag
+
+# iMX M3IF - Multi Master Memory Interface
+# iMX ESDCTL/MDDRC - Enhanced SDRAM/LPDDR memory controller
+# iMX PCMCIA - PCMCIA memory controller
+# iMX NANDFC - NAND Flash memory controller
+# iMX WEIM - Wireless External Interface Module
+
+# iMX clock
+file	arch/arm/imx/imxclock.c
+
+# iMX UART
+device	imxuart
+attach	imxuart at aips
+file	arch/arm/imx/imxuart.c			imxuart
+
+attach	ehci at ahb with ehci_ahb : bus_dma_generic
+file	arch/arm/imx/echi_ahb.c			ehci_ahb
+
+attach	ohci at ahb with ohci_ahb : bus_dma_generic
+file	arch/arm/imx/ochi_ahb.c			ohci_ahb
+
+attach	wdc at ahb with wdc_ahb : bus_dma_generic
+file	arch/arm/imx/wdc_ahb.c			wdc_ahb



CVS commit: src/sys/arch/arm/imx

2010-11-12 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 04:51:01 UTC 2010

Modified Files:
src/sys/arch/arm/imx: files.imx31
Added Files:
src/sys/arch/arm/imx: imx_space.c

Log Message:
rename imx31_space.c as imx_space.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/files.imx31
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/imx/imx_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/files.imx31
diff -u src/sys/arch/arm/imx/files.imx31:1.1 src/sys/arch/arm/imx/files.imx31:1.2
--- src/sys/arch/arm/imx/files.imx31:1.1	Sat Nov 13 04:49:38 2010
+++ src/sys/arch/arm/imx/files.imx31	Sat Nov 13 04:51:01 2010
@@ -1,12 +1,12 @@
-#	$NetBSD: files.imx31,v 1.1 2010/11/13 04:49:38 bsh Exp $
+#	$NetBSD: files.imx31,v 1.2 2010/11/13 04:51:01 bsh Exp $
 #
 # Configuration info for the Freescale i.MX31
 #
 
 define	bus_dma_generic
 
-file	arch/arm/imx/imx31_space.c
-file	arch/arm/imx/imx31_dma.c		bus_dma_generic
+file	arch/arm/imx/imx_space.c
+file	arch/arm/imx/imx_dma.c		bus_dma_generic
 
 # iMX L2 Cache Controller
 device	l2cc

Added files:

Index: src/sys/arch/arm/imx/imx_space.c
diff -u /dev/null src/sys/arch/arm/imx/imx_space.c:1.1
--- /dev/null	Sat Nov 13 04:51:01 2010
+++ src/sys/arch/arm/imx/imx_space.c	Sat Nov 13 04:51:01 2010
@@ -0,0 +1,271 @@
+/* $Id: imx_space.c,v 1.1 2010/11/13 04:51:01 bsh Exp $ */
+
+/* derived from: */
+/*	$NetBSD: imx_space.c,v 1.1 2010/11/13 04:51:01 bsh Exp $ */
+
+/*
+ * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
+ * All rights reserved.
+ *
+ * Written by Jason R. Thorpe for Wasabi Systems, Inc.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ *	This product includes software developed for the NetBSD Project by
+ *	Wasabi Systems, Inc.
+ * 4. The name of Wasabi Systems, Inc. may not be used to endorse
+ *or promote products derived from this software without specific prior
+ *written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
+ * 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.
+ */
+/*
+ * Copyright (c) 1997 Mark Brinicombe.
+ * Copyright (c) 1997 Causality Limited.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Ichiro FUKUHARA.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ *	This product includes software developed by Mark Brinicombe.
+ * 4. The name of the company nor the name of the author may be used to
+ *endorse or promote products derived from this software without specific
+ *prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 

CVS commit: src/sys/arch/arm/imx

2010-11-12 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 04:52:06 UTC 2010

Removed Files:
src/sys/arch/arm/imx: imx31_space.c

Log Message:
rename imx31_space.c as imx_space.c


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/sys/arch/arm/imx/imx31_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/evbarm/conf

2010-11-12 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 04:53:58 UTC 2010

Modified Files:
src/sys/arch/evbarm/conf: files.imx31

Log Message:
rename arm/imx/files.imx as files.imx31


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/files.imx31

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/files.imx31
diff -u src/sys/arch/evbarm/conf/files.imx31:1.2 src/sys/arch/evbarm/conf/files.imx31:1.3
--- src/sys/arch/evbarm/conf/files.imx31:1.2	Sun Apr 27 18:58:46 2008
+++ src/sys/arch/evbarm/conf/files.imx31	Sat Nov 13 04:53:58 2010
@@ -1,9 +1,9 @@
 #
-#	$Id: files.imx31,v 1.2 2008/04/27 18:58:46 matt Exp $
+#	$Id: files.imx31,v 1.3 2010/11/13 04:53:58 bsh Exp $
 #
 
 # derived from:
-#	$NetBSD: files.imx31,v 1.2 2008/04/27 18:58:46 matt Exp $
+#	$NetBSD: files.imx31,v 1.3 2010/11/13 04:53:58 bsh Exp $
 #
 # Freescale iMX31 evaluation board configuration info
 #
@@ -14,7 +14,7 @@
 defparam opt_machdep.hBOOT_ARGS
 
 # CPU support and integrated peripherals
-include arch/arm/imx/files.imx
+include arch/arm/imx/files.imx31
 
 # PCMCIA controller
 device  imx31lk_pcic: pcmciabus



CVS commit: src/sys/arch/arm/imx

2010-11-12 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 04:58:46 UTC 2010

Modified Files:
src/sys/arch/arm/imx: files.imx31

Log Message:
rename imx31_space.c as imx_space.c


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/files.imx31

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/files.imx31
diff -u src/sys/arch/arm/imx/files.imx31:1.2 src/sys/arch/arm/imx/files.imx31:1.3
--- src/sys/arch/arm/imx/files.imx31:1.2	Sat Nov 13 04:51:01 2010
+++ src/sys/arch/arm/imx/files.imx31	Sat Nov 13 04:58:46 2010
@@ -1,12 +1,12 @@
-#	$NetBSD: files.imx31,v 1.2 2010/11/13 04:51:01 bsh Exp $
+#	$NetBSD: files.imx31,v 1.3 2010/11/13 04:58:46 bsh Exp $
 #
 # Configuration info for the Freescale i.MX31
 #
 
 define	bus_dma_generic
 
-file	arch/arm/imx/imx_space.c
-file	arch/arm/imx/imx_dma.c		bus_dma_generic
+file	arch/arm/imx/imx31_space.c
+file	arch/arm/imx/imx31_dma.c		bus_dma_generic
 
 # iMX L2 Cache Controller
 device	l2cc



CVS commit: src/sys/arch/arm/imx

2010-11-12 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 05:00:31 UTC 2010

Modified Files:
src/sys/arch/arm/imx: imx31_ahb.c imx31var.h imx_space.c imxuart.c

Log Message:
rename imx31_bs_tag as imx_bs_tag to share it with imx51.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx31_ahb.c \
src/sys/arch/arm/imx/imxuart.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx31var.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx_space.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx31_ahb.c
diff -u src/sys/arch/arm/imx/imx31_ahb.c:1.3 src/sys/arch/arm/imx/imx31_ahb.c:1.4
--- src/sys/arch/arm/imx/imx31_ahb.c:1.3	Fri May  2 22:00:29 2008
+++ src/sys/arch/arm/imx/imx31_ahb.c	Sat Nov 13 05:00:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx31_ahb.c,v 1.3 2008/05/02 22:00:29 martin Exp $	*/
+/*	$NetBSD: imx31_ahb.c,v 1.4 2010/11/13 05:00:31 bsh Exp $	*/
 
 /*
  * Copyright (c) 2002, 2005  Genetec Corporation.  All rights reserved.
@@ -99,7 +99,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $Id: imx31_ahb.c,v 1.3 2008/05/02 22:00:29 martin Exp $);
+__KERNEL_RCSID(0, $Id: imx31_ahb.c,v 1.4 2010/11/13 05:00:31 bsh Exp $);
 
 #include locators.h
 #include avic.h
@@ -152,13 +152,12 @@
 ahb_attach(device_t parent, device_t self, void *aux)
 {
 	struct ahb_softc *sc = (struct ahb_softc *)self;
-	extern struct bus_space imx31_bs_tag;
 	struct ahb_attach_args ahba;
 
 	ahb_sc = sc;
-	sc-sc_memt = imx31_bs_tag;
+	sc-sc_memt = imx_bs_tag;
 #if NBUS_DMA_GENERIC  0
-	sc-sc_dmat = imx31_bus_dma_tag;
+	sc-sc_dmat = imx_bus_dma_tag;
 #else
 	sc-sc_dmat = 0;
 #endif
Index: src/sys/arch/arm/imx/imxuart.c
diff -u src/sys/arch/arm/imx/imxuart.c:1.3 src/sys/arch/arm/imx/imxuart.c:1.4
--- src/sys/arch/arm/imx/imxuart.c:1.3	Mon Jun 30 00:46:41 2008
+++ src/sys/arch/arm/imx/imxuart.c	Sat Nov 13 05:00:31 2010
@@ -1,4 +1,4 @@
-/* $Id: imxuart.c,v 1.3 2008/06/30 00:46:41 perry Exp $ */
+/* $Id: imxuart.c,v 1.4 2010/11/13 05:00:31 bsh Exp $ */
 #include sys/types.h
 #include sys/systm.h
 #include sys/device.h
@@ -26,7 +26,7 @@
 
 #define __TRACE	imxuart_puts(imxuart_softc, __func__ )
 
-extern struct bus_space imx31_bs_tag;
+extern struct bus_space imx_bs_tag;
 
 imxuart_softc_t imxuart_softc = { { 0, }, };
 

Index: src/sys/arch/arm/imx/imx31var.h
diff -u src/sys/arch/arm/imx/imx31var.h:1.2 src/sys/arch/arm/imx/imx31var.h:1.3
--- src/sys/arch/arm/imx/imx31var.h:1.2	Sun Apr 27 18:58:44 2008
+++ src/sys/arch/arm/imx/imx31var.h	Sat Nov 13 05:00:31 2010
@@ -1,9 +1,9 @@
-/*	$NetBSD: imx31var.h,v 1.2 2008/04/27 18:58:44 matt Exp $	*/
+/*	$NetBSD: imx31var.h,v 1.3 2010/11/13 05:00:31 bsh Exp $	*/
 
 #ifndef _ARM_IMX_IMX31VAR_H
 #define _ARM_IMX_IMX31VAR_H
 
-extern struct bus_space imx31_bs_tag;
+extern struct bus_space imx_bs_tag;
 
 struct aips_attach_args {
 	const char	*aipsa_name;

Index: src/sys/arch/arm/imx/imx_space.c
diff -u src/sys/arch/arm/imx/imx_space.c:1.1 src/sys/arch/arm/imx/imx_space.c:1.2
--- src/sys/arch/arm/imx/imx_space.c:1.1	Sat Nov 13 04:51:01 2010
+++ src/sys/arch/arm/imx/imx_space.c	Sat Nov 13 05:00:31 2010
@@ -1,7 +1,7 @@
-/* $Id: imx_space.c,v 1.1 2010/11/13 04:51:01 bsh Exp $ */
+/* $Id: imx_space.c,v 1.2 2010/11/13 05:00:31 bsh Exp $ */
 
 /* derived from: */
-/*	$NetBSD: imx_space.c,v 1.1 2010/11/13 04:51:01 bsh Exp $ */
+/*	$NetBSD: imx_space.c,v 1.2 2010/11/13 05:00:31 bsh Exp $ */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -82,32 +82,32 @@
 #include uvm/uvm_extern.h
 #include machine/bus.h
 
-bs_protos(imx31);
+bs_protos(imx);
 bs_protos(generic);
 bs_protos(generic_armv4);
 bs_protos(bs_notimpl);
 
-struct bus_space imx31_bs_tag = {
+struct bus_space imx_bs_tag = {
 	/* cookie */
 	(void *) 0,
 
 	/* mapping/unmapping */
-	imx31_bs_map,
-	imx31_bs_unmap,
-	imx31_bs_subregion,
+	imx_bs_map,
+	imx_bs_unmap,
+	imx_bs_subregion,
 
 	/* allocation/deallocation */
-	imx31_bs_alloc,	/* not implemented */
-	imx31_bs_free,		/* not implemented */
+	imx_bs_alloc,	/* not implemented */
+	imx_bs_free,		/* not implemented */
 
 	/* get kernel virtual address */
-	imx31_bs_vaddr,
+	imx_bs_vaddr,
 
 	/* mmap */
 	bs_notimpl_bs_mmap,
 
 	/* barrier */
-	imx31_bs_barrier,
+	imx_bs_barrier,
 
 	/* read (single) */
 	generic_bs_r_1,
@@ -165,7 +165,7 @@
 };
 
 int
-imx31_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
+imx_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
 	  int flag, bus_space_handle_t *bshp)
 {
 	u_long startpa, endpa, pa;
@@ -208,7 +208,7 @@
 }
 
 void
-imx31_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size)
+imx_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size)
 {
 	vaddr_t	va;
 	vsize_t	sz;
@@ -228,7 +228,7 @@
 
 
 int
-imx31_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset,
+imx_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset,
 bus_size_t size, bus_space_handle_t *nbshp)

CVS commit: src/sys/arch/arm/imx

2010-11-12 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 06:09:34 UTC 2010

Modified Files:
src/sys/arch/arm/imx: files.imx31

Log Message:
back out previous. That was an mistake.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/files.imx31

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/files.imx31
diff -u src/sys/arch/arm/imx/files.imx31:1.3 src/sys/arch/arm/imx/files.imx31:1.4
--- src/sys/arch/arm/imx/files.imx31:1.3	Sat Nov 13 04:58:46 2010
+++ src/sys/arch/arm/imx/files.imx31	Sat Nov 13 06:09:34 2010
@@ -1,12 +1,12 @@
-#	$NetBSD: files.imx31,v 1.3 2010/11/13 04:58:46 bsh Exp $
+#	$NetBSD: files.imx31,v 1.4 2010/11/13 06:09:34 bsh Exp $
 #
 # Configuration info for the Freescale i.MX31
 #
 
 define	bus_dma_generic
 
-file	arch/arm/imx/imx31_space.c
-file	arch/arm/imx/imx31_dma.c		bus_dma_generic
+file	arch/arm/imx/imx_space.c
+file	arch/arm/imx/imx_dma.c		bus_dma_generic
 
 # iMX L2 Cache Controller
 device	l2cc



CVS commit: src/sys/arch/arm/imx

2010-11-12 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 06:28:21 UTC 2010

Modified Files:
src/sys/arch/arm/imx: files.imx31

Log Message:
UART driver for i.MX31 and 51.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/files.imx31

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/files.imx31
diff -u src/sys/arch/arm/imx/files.imx31:1.4 src/sys/arch/arm/imx/files.imx31:1.5
--- src/sys/arch/arm/imx/files.imx31:1.4	Sat Nov 13 06:09:34 2010
+++ src/sys/arch/arm/imx/files.imx31	Sat Nov 13 06:28:20 2010
@@ -1,8 +1,11 @@
-#	$NetBSD: files.imx31,v 1.4 2010/11/13 06:09:34 bsh Exp $
+#	$NetBSD: files.imx31,v 1.5 2010/11/13 06:28:20 bsh Exp $
 #
 # Configuration info for the Freescale i.MX31
 #
 
+defparam opt_imx.hMEMSIZE
+defflag opt_imx.hIMX51
+
 define	bus_dma_generic
 
 file	arch/arm/imx/imx_space.c
@@ -52,7 +55,9 @@
 # iMX UART
 device	imxuart
 attach	imxuart at aips
-file	arch/arm/imx/imxuart.c			imxuart
+file	arch/arm/imx/imxuart.c			imxuart	needs-flag
+file	arch/arm/imx/imx31_uart.c		imxuart
+defflag	opt_imxuart.hIMXUARTCONSOLE
 
 attach	ehci at ahb with ehci_ahb : bus_dma_generic
 file	arch/arm/imx/echi_ahb.c			ehci_ahb



CVS commit: src/sys/arch/evbarm/imx31

2010-11-12 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 06:29:12 UTC 2010

Modified Files:
src/sys/arch/evbarm/imx31: imx31lk_machdep.c

Log Message:
make this compile again.  Need to revisit for UART support.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/imx31/imx31lk_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/imx31/imx31lk_machdep.c
diff -u src/sys/arch/evbarm/imx31/imx31lk_machdep.c:1.9 src/sys/arch/evbarm/imx31/imx31lk_machdep.c:1.10
--- src/sys/arch/evbarm/imx31/imx31lk_machdep.c:1.9	Sat Dec 26 16:01:24 2009
+++ src/sys/arch/evbarm/imx31/imx31lk_machdep.c	Sat Nov 13 06:29:12 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: imx31lk_machdep.c,v 1.9 2009/12/26 16:01:24 uebayasi Exp $ */
+/* $NetBSD: imx31lk_machdep.c,v 1.10 2010/11/13 06:29:12 bsh Exp $ */
 
 /*
  * Startup routines for the ZOOM iMX31 LITEKIT.
@@ -110,7 +110,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: imx31lk_machdep.c,v 1.9 2009/12/26 16:01:24 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: imx31lk_machdep.c,v 1.10 2010/11/13 06:29:12 bsh Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -153,6 +153,7 @@
 #include arm/arm32/pte.h
 #include arm/arm32/machdep.h
 
+#include arm/imx/imx31reg.h
 #include arm/imx/imxuartreg.h
 #include arm/imx/imxuartvar.h
 #include evbarm/imx31/imx31lk_reg.h
@@ -340,7 +341,7 @@
 static const struct pmap_devmap imx31lk_devmap[] = {
 {
 	IMX31LITEKIT_UART1_VBASE,
-	_A(IMX_UART1_BASE),
+	_A(UART1_BASE),
 	_S(L1_S_SIZE),
 	VM_PROT_READ|VM_PROT_WRITE,
 	PTE_NOCACHE,
@@ -398,7 +399,7 @@
 	/* Calibrate the delay loop. */
 #endif
 
-	imx31lk_consinit(1);
+	consinit();
 
 #ifdef KGDB
 	kgdb_port_init();
@@ -672,7 +673,7 @@
 	cpu_setttb(kernel_l1pt.pv_pa);
 	cpu_tlb_flushID();
 	cpu_domains(DOMAIN_CLIENT  (PMAP_DOMAIN_KERNEL*2));
-	imx31lk_consinit(2);
+	//imx31lk_consinit(2);
 
 	/*
 	 * Moved from cpu_startup() as data_abort_handler() references
@@ -809,6 +810,7 @@
 #endif /* KGDB */
 
 
+#if 0
 void
 imx31lk_consinit(int phase)
 {
@@ -819,39 +821,22 @@
 		ophase = phase;
 		switch (phase) {
 		case 1:
-			imxuart_init(0, IMX_UART1_BASE);
+			imxuart_init(0, UART1_BASE);
 			break;
 		case 2:
 			bh = IMX31LITEKIT_UART1_VBASE;
-			bh |= (IMX_UART1_BASE  ~_A(IMX_UART1_BASE));
+			bh |= (UART1_BASE  ~_A(UART1_BASE));
 			imxuart_init(0, bh);
 			break;
 		}
 	}
 }
+#endif
 
 void
 consinit(void)
 {
-	imx31lk_consinit(2);
-}
-
-void consinit_test(void);
-void
-consinit_test(void)
-{
-	imxuart_softc_t *sc, softc;
-	extern int imxuart_puts(imxuart_softc_t *sc, const char *s);
-
-	printf(\n%s start\n, __func__);
-	sc = softc;
-	sc-sc_init_cnt = 0;
-	imxuart_init(sc, IMX_UART1_BASE);
-	imxuart_puts(sc, test1\r\n);
-	imxuart_init(sc,
-	IMX31LITEKIT_UART1_VBASE|(IMX_UART1_BASE  ~_A(IMX_UART1_BASE)));
-	imxuart_puts(sc, test2\r\n);
-	printf(%s done\n, __func__);
+	// imx31lk_consinit(2);
 }
 
 #ifdef KGDB



CVS commit: src/sys/arch/arm/imx

2010-11-12 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 06:44:11 UTC 2010

Modified Files:
src/sys/arch/arm/imx: imx31reg.h
Added Files:
src/sys/arch/arm/imx: imxgpioreg.h

Log Message:
extract GPIO register definitions from imx31reg.h to share them with
i.MX51


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx31reg.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/imx/imxgpioreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imx31reg.h
diff -u src/sys/arch/arm/imx/imx31reg.h:1.3 src/sys/arch/arm/imx/imx31reg.h:1.4
--- src/sys/arch/arm/imx/imx31reg.h:1.3	Mon Apr 28 20:23:14 2008
+++ src/sys/arch/arm/imx/imx31reg.h	Sat Nov 13 06:44:11 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: imx31reg.h,v 1.3 2008/04/28 20:23:14 martin Exp $ */
+/* $NetBSD: imx31reg.h,v 1.4 2010/11/13 06:44:11 bsh Exp $ */
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -56,21 +56,7 @@
 #define	GPIO1_BASE	0x53fcc000
 #define	GPIO2_BASE	0x53fd
 #define	GPIO3_BASE	0x53fa4000
-
-#define	GPIO_SIZE	0x0100	/* Size of GPIO registers */
-
-#define	GPIO_DR		0x	/* GPIO Data (RW) */
-#define	GPIO_DIR	0x0004	/* GPIO Direction (RW), 1=Output */
-#define	GPIO_PSR	0x0008	/* GPIO Pad Status (R) */
-#define	GPIO_ICR1	0x000c	/* GPIO Interrupt Configuration 1 (RW) */
-#define	GPIO_ICR2	0x0010	/* GPIO Interrupt Configuration 2 (RW) */
-#define	GPIO_IMR	0x0014	/* GPIO Interrupt Mask (RW) */
-#define	GPIO_ISR	0x0018	/* GPIO Interrupt Status (RW, W1C) */
-
-#define	GPIO_ICR_LEVEL_LOW	0
-#define	GPIO_ICR_LEVEL_HIGH	1
-#define	GPIO_ICR_EDGE_RISING	2
-#define	GPIO_ICR_EDGE_FALLING	3
+/* register definitions in imxgpiore.h */
 
 #define	INTC_BASE		0x6800
 #define	INTC_SIZE		0x0400

Added files:

Index: src/sys/arch/arm/imx/imxgpioreg.h
diff -u /dev/null src/sys/arch/arm/imx/imxgpioreg.h:1.1
--- /dev/null	Sat Nov 13 06:44:11 2010
+++ src/sys/arch/arm/imx/imxgpioreg.h	Sat Nov 13 06:44:11 2010
@@ -0,0 +1,55 @@
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas.
+ *
+ * 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.
+ */
+#ifndef _ARM_IMX_IMXGPIOREG_H
+#define	_ARM_IMX_IMXGPIOREG_H
+
+#define	GPIO_SIZE	0x0020	/* Size of GPIO registers */
+
+#define	GPIO_DR		0x	/* GPIO Data (RW) */
+#define	GPIO_DIR	0x0004	/* GPIO Direction (RW), 1=Output */
+#define	GPIO_PSR	0x0008	/* GPIO Pad Status (R) */
+#define	GPIO_ICR1	0x000c	/* GPIO Interrupt Configuration 1 (RW) */
+#define	GPIO_ICR2	0x0010	/* GPIO Interrupt Configuration 2 (RW) */
+#define	GPIO_IMR	0x0014	/* GPIO Interrupt Mask (RW) */
+#define	GPIO_ISR	0x0018	/* GPIO Interrupt Status (RW, W1C) */
+#define	GPIO_EDGE_SEL	0x001c	/* GPIO Edge Select Register  (i.MX51 only) */
+
+#define	GPIO_ICR_LEVEL_LOW	0
+#define	GPIO_ICR_LEVEL_HIGH	1
+#define	GPIO_ICR_EDGE_RISING	2
+#define	GPIO_ICR_EDGE_FALLING	3
+
+#define	GPIO_MODULE(pin)	((pin) / GPIO_NPINS)
+
+/*
+ * GPIO number
+ */
+#define	GPIO_NO(group, pin)	(((group) - 1) * GPIO_NPINS + (pin))
+
+#endif	/* _ARM_IMX_IMXGPIOREG_H */



CVS commit: src/sys/arch/arm/imx

2010-11-12 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Nov 13 06:51:38 UTC 2010

Modified Files:
src/sys/arch/arm/imx: imxclock.c
Added Files:
src/sys/arch/arm/imx: imx31_clock.c imx51_clock.c imxclockvar.h
imxepitreg.h

Log Message:
driver to use EPIT as system clock for i.MX31 and i.MX51,
by Hashimoto Kenichi.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/imx/imx31_clock.c \
src/sys/arch/arm/imx/imx51_clock.c src/sys/arch/arm/imx/imxclockvar.h \
src/sys/arch/arm/imx/imxepitreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imxclock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imxclock.c
diff -u src/sys/arch/arm/imx/imxclock.c:1.2 src/sys/arch/arm/imx/imxclock.c:1.3
--- src/sys/arch/arm/imx/imxclock.c:1.2	Sun Apr 27 18:58:44 2008
+++ src/sys/arch/arm/imx/imxclock.c	Sat Nov 13 06:51:37 2010
@@ -1,9 +1,105 @@
-#include sys/types.h
+/*	$NetBSD: imxclock.c,v 1.3 2010/11/13 06:51:37 bsh Exp $ */
+/*
+ * Copyright (c) 2009, 2010  Genetec corp.  All rights reserved.
+ * Written by Hashimoto Kenichi for Genetec corp.
+ *
+ * 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 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.
+ */
+
+/*
+ * common part for i.MX31 and i.MX51
+ */
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/kernel.h
+#include sys/evcnt.h
+#include sys/atomic.h
 #include sys/time.h
+#include sys/timetc.h
+
+#include sys/types.h
+#include sys/device.h
+
+#include machine/intr.h
+#include machine/bus.h
+
+#include arm/cpu.h
+#include arm/armreg.h
+#include arm/cpufunc.h
+
+#include arm/imx/imxclockvar.h
+#include arm/imx/imxepitreg.h
+
+static u_int imx_epit_get_timecount(struct timecounter *);
+static int imxclock_intr(void *);
+
+static struct timecounter imx_epit_timecounter = {
+	imx_epit_get_timecount,	/* get_timecount */
+	0,			/* no poll_pps */
+	0x,		/* counter_mask */
+	0,			/* frequency */
+	epit,			/* name */
+	100,			/* quality */
+	NULL,			/* prev */
+	NULL,			/* next */
+};
+
+static volatile uint32_t imxclock_base;
 
 void
 cpu_initclocks(void)
 {
+	uint32_t reg;
+	int freq;
+
+	if (!epit1_sc) {
+		panic(%s: driver has not been initialized!, __FUNCTION__);
+	}
+
+	freq = imxclock_get_timerfreq(epit1_sc);
+	imx_epit_timecounter.tc_frequency = freq;
+	tc_init(imx_epit_timecounter);
+
+	epit1_sc-sc_reload_value = freq / hz - 1;
+
+	/* stop all timers */
+	bus_space_write_4(epit1_sc-sc_iot, epit1_sc-sc_ioh, EPIT_EPITCR, 0);
+	bus_space_write_4(epit2_sc-sc_iot, epit2_sc-sc_ioh, EPIT_EPITCR, 0);
+
+	aprint_normal(clock: hz=%d stathz = %d\n, hz, stathz);
+
+	bus_space_write_4(epit1_sc-sc_iot, epit1_sc-sc_ioh, EPIT_EPITLR, 
+			  epit1_sc-sc_reload_value);
+	bus_space_write_4(epit1_sc-sc_iot, epit1_sc-sc_ioh, EPIT_EPITCMPR, 0);
+
+	reg = EPITCR_ENMOD | EPITCR_IOVW | EPITCR_RLD;
+	bus_space_write_4(epit1_sc-sc_iot, epit1_sc-sc_ioh, EPIT_EPITCR, reg);
+	reg |= EPITCR_EN | EPITCR_OCIEN | EPITCR_CLKSRC_HIGH |
+		EPITCR_WAITEN | EPITCR_DOZEN | EPITCR_STOPEN;
+	bus_space_write_4(epit1_sc-sc_iot, epit1_sc-sc_ioh, EPIT_EPITCR, reg);
+
+	epit1_sc-sc_ih = intr_establish(epit1_sc-sc_intr, IPL_CLOCK,
+	IST_LEVEL, imxclock_intr, epit1_sc);
 }
 
 #if 0
@@ -17,3 +113,31 @@
 setstatclockrate(int schz)
 {
 }
+
+static int
+imxclock_intr(void *arg)
+{
+	struct imxclock_softc *sc = arg;
+
+	bus_space_write_4(sc-sc_iot, sc-sc_ioh, EPIT_EPITSR, 1);
+	atomic_add_32(imxclock_base, sc-sc_reload_value);
+
+	hardclock((struct clockframe *)arg);
+
+	return 1;
+}
+
+u_int
+imx_epit_get_timecount(struct timecounter *tc)
+{
+	uint32_t counter;
+	uint32_t base;
+	u_int oldirqstate;
+
+	oldirqstate = disable_interrupts(I32_bit);
+	counter = 

CVS commit: src/sys/dev/ata

2010-07-06 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Tue Jul  6 17:56:15 UTC 2010

Modified Files:
src/sys/dev/ata: ld_ataraid.c

Log Message:
fix LOCKDEBUG panic at ataraid(4).
the patch was provided by Juan RP in response to PR kern 38273.
(http://mail-index.netbsd.org/tech-kern/2008/09/17/msg002734.html)


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/ata/ld_ataraid.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ata/ld_ataraid.c
diff -u src/sys/dev/ata/ld_ataraid.c:1.35 src/sys/dev/ata/ld_ataraid.c:1.36
--- src/sys/dev/ata/ld_ataraid.c:1.35	Tue May 12 14:16:53 2009
+++ src/sys/dev/ata/ld_ataraid.c	Tue Jul  6 17:56:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_ataraid.c,v 1.35 2009/05/12 14:16:53 cegger Exp $	*/
+/*	$NetBSD: ld_ataraid.c,v 1.36 2010/07/06 17:56:14 bsh Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ld_ataraid.c,v 1.35 2009/05/12 14:16:53 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ld_ataraid.c,v 1.36 2010/07/06 17:56:14 bsh Exp $);
 
 #include bio.h
 #include rnd.h
@@ -90,6 +90,12 @@
 	struct vnode *sc_vnodes[ATA_RAID_MAX_DISKS];
 
 	void	(*sc_iodone)(struct buf *);
+
+   pool_cache_t sc_cbufpool;
+
+   SIMPLEQ_HEAD(, cbuf) sc_cbufq;
+
+   void*sc_sih_cookie;
 };
 
 static int	ld_ataraid_match(device_t, cfdata_t, void *);
@@ -97,6 +103,10 @@
 
 static int	ld_ataraid_dump(struct ld_softc *, void *, int, int);
 
+static int cbufpool_ctor(void *, void *, int);
+static voidcbufpool_dtor(void *, void *);
+
+static voidld_ataraid_start_vstrategy(void *);
 static int	ld_ataraid_start_span(struct ld_softc *, struct buf *);
 
 static int	ld_ataraid_start_raid0(struct ld_softc *, struct buf *);
@@ -113,9 +123,6 @@
 CFATTACH_DECL_NEW(ld_ataraid, sizeof(struct ld_ataraid_softc),
 ld_ataraid_match, ld_ataraid_attach, NULL, NULL);
 
-static int ld_ataraid_initialized;
-static struct pool ld_ataraid_cbufpl;
-
 struct cbuf {
 	struct buf	cb_buf;		/* new I/O buf */
 	struct buf	*cb_obp;	/* ptr. to original I/O buf */
@@ -127,8 +134,8 @@
 #define	CBUF_IODONE	0x0001	/* I/O is already successfully done */
 };
 
-#define	CBUF_GET()	pool_get(ld_ataraid_cbufpl, PR_NOWAIT);
-#define	CBUF_PUT(cbp)	pool_put(ld_ataraid_cbufpl, (cbp))
+#defineCBUF_GET()  pool_cache_get(sc-sc_cbufpool, PR_NOWAIT);
+#defineCBUF_PUT(cbp)   pool_cache_put(sc-sc_cbufpool, (cbp))
 
 static int
 ld_ataraid_match(device_t parent, cfdata_t match, void *aux)
@@ -151,11 +158,10 @@
 
 	ld-sc_dv = self;
 
-	if (ld_ataraid_initialized == 0) {
-		ld_ataraid_initialized = 1;
-		pool_init(ld_ataraid_cbufpl, sizeof(struct cbuf), 0,
-		0, 0, ldcbuf, NULL, IPL_BIO);
-	}
+   sc-sc_cbufpool = pool_cache_init(sizeof(struct cbuf), 0,
+   0, 0, ldcbuf, NULL, IPL_BIO, cbufpool_ctor, cbufpool_dtor, sc);
+   sc-sc_sih_cookie = softint_establish(SOFTINT_BIO,
+   ld_ataraid_start_vstrategy, sc);
 
 	sc-sc_aai = aai;	/* this data persists */
 
@@ -246,9 +252,33 @@
 		panic(%s: bioctl registration failed\n,
 		device_xname(ld-sc_dv));
 #endif
+   SIMPLEQ_INIT(sc-sc_cbufq);
 	ldattach(ld);
 }
 
+static int
+cbufpool_ctor(void *arg, void *obj, int flags)
+{
+   struct ld_ataraid_softc *sc = arg;
+   struct ld_softc *ld = sc-sc_ld;
+   struct cbuf *cbp = obj;
+
+   /* We release/reacquire the spinlock before calling buf_init() */
+   mutex_exit(ld-sc_mutex);
+   buf_init(cbp-cb_buf);
+   mutex_enter(ld-sc_mutex);
+
+   return 0;
+}
+
+static void
+cbufpool_dtor(void *arg, void *obj)
+{
+   struct cbuf *cbp = obj;
+
+   buf_destroy(cbp-cb_buf);
+}
+
 static struct cbuf *
 ld_ataraid_make_cbuf(struct ld_ataraid_softc *sc, struct buf *bp,
 u_int comp, daddr_t bn, void *addr, long bcount)
@@ -257,8 +287,7 @@
 
 	cbp = CBUF_GET();
 	if (cbp == NULL)
-		return (NULL);
-	buf_init(cbp-cb_buf);
+   return NULL;
 	cbp-cb_buf.b_flags = bp-b_flags;
 	cbp-cb_buf.b_oflags = bp-b_oflags;
 	cbp-cb_buf.b_cflags = bp-b_cflags;
@@ -277,7 +306,24 @@
 	cbp-cb_other = NULL;
 	cbp-cb_flags = 0;
 
-	return (cbp);
+   return cbp;
+}
+
+static void
+ld_ataraid_start_vstrategy(void *arg)
+{
+   struct ld_ataraid_softc *sc = arg;
+   struct cbuf *cbp;
+
+   while ((cbp = SIMPLEQ_FIRST(sc-sc_cbufq)) != NULL) {
+   SIMPLEQ_REMOVE_HEAD(sc-sc_cbufq, cb_q);
+   if ((cbp-cb_buf.b_flags  B_READ) == 0) {
+   mutex_enter(cbp-cb_buf.b_vp-v_interlock);
+   cbp-cb_buf.b_vp-v_numoutput++;
+   mutex_exit(cbp-cb_buf.b_vp-v_interlock);
+   }
+   VOP_STRATEGY(cbp-cb_buf.b_vp, cbp-cb_buf);
+   }
 }
 
 static int
@@ -286,7 +332,6 @@
 	struct ld_ataraid_softc *sc = (void *) ld;
 	struct ataraid_array_info *aai = sc-sc_aai;
 

CVS commit: src/sys/dev/ata

2010-07-06 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Tue Jul  6 18:03:21 UTC 2010

Modified Files:
src/sys/dev/ata: ata_raid.c ata_raid_intel.c ata_raidvar.h

Log Message:
fix some probles with ataraid(4) and Intel MatrixRaid.
 * handle volumes largetr than 2TiB.
 * support multiple arrays for Intel Matrix RAID


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/ata/ata_raid.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ata/ata_raid_intel.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ata/ata_raidvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ata/ata_raid.c
diff -u src/sys/dev/ata/ata_raid.c:1.33 src/sys/dev/ata/ata_raid.c:1.34
--- src/sys/dev/ata/ata_raid.c:1.33	Tue May 12 14:07:01 2009
+++ src/sys/dev/ata/ata_raid.c	Tue Jul  6 18:03:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata_raid.c,v 1.33 2009/05/12 14:07:01 cegger Exp $	*/
+/*	$NetBSD: ata_raid.c,v 1.34 2010/07/06 18:03:21 bsh Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ata_raid.c,v 1.33 2009/05/12 14:07:01 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ata_raid.c,v 1.34 2010/07/06 18:03:21 bsh Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -270,14 +270,10 @@
 	aai = malloc(sizeof(*aai), M_DEVBUF, M_WAITOK | M_ZERO);
 	aai-aai_type = type;
 	aai-aai_arrayno = arrayno;
+	aai-aai_curdisk = 0;
 
 	ataraid_array_info_count++;
 
-	if (TAILQ_EMPTY(ataraid_array_info_list)) {
-		TAILQ_INSERT_TAIL(ataraid_array_info_list, aai, aai_list);
-		goto out;
-	}
-
 	/* Sort it into the list: type first, then array number. */
 	TAILQ_FOREACH(laai, ataraid_array_info_list, aai_list) {
 		if (aai-aai_type  laai-aai_type) {

Index: src/sys/dev/ata/ata_raid_intel.c
diff -u src/sys/dev/ata/ata_raid_intel.c:1.4 src/sys/dev/ata/ata_raid_intel.c:1.5
--- src/sys/dev/ata/ata_raid_intel.c:1.4	Mon May 11 17:14:31 2009
+++ src/sys/dev/ata/ata_raid_intel.c	Tue Jul  6 18:03:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata_raid_intel.c,v 1.4 2009/05/11 17:14:31 cegger Exp $	*/
+/*	$NetBSD: ata_raid_intel.c,v 1.5 2010/07/06 18:03:21 bsh Exp $	*/
 
 /*-
  * Copyright (c) 2000-2008 Søren Schmidt s...@freebsd.org
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ata_raid_intel.c,v 1.4 2009/05/11 17:14:31 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ata_raid_intel.c,v 1.5 2010/07/06 18:03:21 bsh Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -62,6 +62,9 @@
 #define	DPRINTF(x)	/* nothing */
 #endif
 
+static int find_volume_id(struct intel_raid_conf *);
+
+
 #ifdef ATA_RAID_DEBUG
 static const char *
 ata_raid_intel_type(int type)
@@ -139,10 +142,10 @@
 	struct ataraid_disk_info *adi;
 	struct vnode *vp;
 	uint32_t checksum, *ptr;
-	static int curdrive;
 	int bmajor, count, curvol = 0, error = 0;
 	char *tmp;
 	dev_t dev;
+	int volumeid, diskidx;
 
 	info = malloc(1536, M_DEVBUF, M_WAITOK|M_ZERO);
 
@@ -203,11 +206,19 @@
 	/* This one points to the first volume */
 	map = (struct intel_raid_mapping *)info-disk[info-total_disks];
 
+	volumeid = find_volume_id(info);
+	if (volumeid  0) {
+		aprint_error_dev(sc-sc_dev,
+ too many RAID arrays\n);
+		error = ENOMEM;
+		goto out;
+	}
+
 findvol:
 	/*
 	 * Lookup or allocate a new array info structure for this array.
 	 */
-	aai = ata_raid_get_array_info(ATA_RAID_TYPE_INTEL, curvol); 
+	aai = ata_raid_get_array_info(ATA_RAID_TYPE_INTEL, volumeid + curvol); 
 
 	/* Fill in array info */
 	aai-aai_generation = info-generation;
@@ -253,24 +264,26 @@
 		strlcpy(aai-aai_name, map-name, sizeof(aai-aai_name));
 
 	/* Fill in disk info */
-	adi = aai-aai_disks[curdrive];
+	diskidx = aai-aai_curdisk++;
+	adi = aai-aai_disks[diskidx];
 	adi-adi_status = 0;
 
-	if (info-disk[curdrive].flags  INTEL_F_ONLINE)
+	if (info-disk[diskidx].flags  INTEL_F_ONLINE)
 		adi-adi_status |= ADI_S_ONLINE;
-	if (info-disk[curdrive].flags  INTEL_F_ASSIGNED)
+	if (info-disk[diskidx].flags  INTEL_F_ASSIGNED)
 		adi-adi_status |= ADI_S_ASSIGNED;
-	if (info-disk[curdrive].flags  INTEL_F_SPARE) {
+	if (info-disk[diskidx].flags  INTEL_F_SPARE) {
 		adi-adi_status = ~ADI_S_ONLINE;
 		adi-adi_status |= ADI_S_SPARE;
 	}
-	if (info-disk[curdrive].flags  INTEL_F_DOWN)
+	if (info-disk[diskidx].flags  INTEL_F_DOWN)
 		adi-adi_status = ~ADI_S_ONLINE;
 
 	if (adi-adi_status) {
 		adi-adi_dev = sc-sc_dev;
-		adi-adi_sectors = info-disk[curdrive].sectors;
+		adi-adi_sectors = info-disk[diskidx].sectors;
 		adi-adi_compsize = adi-adi_sectors - aai-aai_reserved;
+
 		/*
 		 * Check if that is the only volume, otherwise repeat
 		 * the process to find more.
@@ -281,10 +294,57 @@
 			map-disk_idx[map-total_disks];
 			goto findvol;
 		}
-		curdrive++;
 	}
 
  out:
 	free(info, M_DEVBUF);
 	return error;
 }
+
+
+/*
+ * Assign `volume id' to RAID volumes.
+ */
+static struct {
+	/* We assume disks are on the same array if these three values
+	   are 

CVS commit: src/sys/dev/ata

2010-07-06 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Tue Jul  6 18:09:04 UTC 2010

Modified Files:
src/sys/dev/ata: ata_raid_intel.c ld_ataraid.c

Log Message:
* use correct interleave factor for RAID-0 of Intel MatrixRaid.
* report stripe size in Kibytes to bioctl(8).

Unfortunately this change will break compatibility with existing
filesystem made by NetBSD on RAID-0 Intel MatrixRAID volumes.

Please read: 
http://mail-index.netbsd.org/current-users/2010/07/02/msg013810.html


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ata/ata_raid_intel.c
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/ata/ld_ataraid.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ata/ata_raid_intel.c
diff -u src/sys/dev/ata/ata_raid_intel.c:1.5 src/sys/dev/ata/ata_raid_intel.c:1.6
--- src/sys/dev/ata/ata_raid_intel.c:1.5	Tue Jul  6 18:03:21 2010
+++ src/sys/dev/ata/ata_raid_intel.c	Tue Jul  6 18:09:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata_raid_intel.c,v 1.5 2010/07/06 18:03:21 bsh Exp $	*/
+/*	$NetBSD: ata_raid_intel.c,v 1.6 2010/07/06 18:09:04 bsh Exp $	*/
 
 /*-
  * Copyright (c) 2000-2008 Søren Schmidt s...@freebsd.org
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ata_raid_intel.c,v 1.5 2010/07/06 18:03:21 bsh Exp $);
+__KERNEL_RCSID(0, $NetBSD: ata_raid_intel.c,v 1.6 2010/07/06 18:09:04 bsh Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -252,7 +252,7 @@
 
 	aai-aai_type = ATA_RAID_TYPE_INTEL;
 	aai-aai_capacity = map-total_sectors;
-	aai-aai_interleave = map-stripe_sectors / 2;
+	aai-aai_interleave = map-stripe_sectors;
 	aai-aai_ndisks = map-total_disks;
 	aai-aai_heads = 255;
 	aai-aai_sectors = 63;

Index: src/sys/dev/ata/ld_ataraid.c
diff -u src/sys/dev/ata/ld_ataraid.c:1.36 src/sys/dev/ata/ld_ataraid.c:1.37
--- src/sys/dev/ata/ld_ataraid.c:1.36	Tue Jul  6 17:56:14 2010
+++ src/sys/dev/ata/ld_ataraid.c	Tue Jul  6 18:09:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_ataraid.c,v 1.36 2010/07/06 17:56:14 bsh Exp $	*/
+/*	$NetBSD: ld_ataraid.c,v 1.37 2010/07/06 18:09:04 bsh Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ld_ataraid.c,v 1.36 2010/07/06 17:56:14 bsh Exp $);
+__KERNEL_RCSID(0, $NetBSD: ld_ataraid.c,v 1.37 2010/07/06 18:09:04 bsh Exp $);
 
 #include bio.h
 #include rnd.h
@@ -621,6 +621,7 @@
 {
 	struct ataraid_array_info *aai = sc-sc_aai;
 	struct ld_softc *ld = sc-sc_ld;
+#define	to_kibytes(ld,s)	(ld-sc_secsize*(s)/1024)
 
 	/* Fill in data for _this_ volume */
 	bv-bv_percent = -1;
@@ -640,7 +641,7 @@
 	switch (aai-aai_level) {
 	case AAI_L_SPAN:
 	case AAI_L_RAID0:
-		bv-bv_stripe_size = aai-aai_interleave;
+		bv-bv_stripe_size = to_kibytes(ld, aai-aai_interleave);
 		bv-bv_level = 0;
 		break;
 	case AAI_L_RAID1:
@@ -648,7 +649,7 @@
 		bv-bv_level = 1;
 		break;
 	case AAI_L_RAID5:
-		bv-bv_stripe_size = aai-aai_interleave;
+		bv-bv_stripe_size = to_kibytes(ld, aai-aai_interleave);
 		bv-bv_level = 5;
 		break;
 	}



CVS commit: src/sys/arch/evbarm/g42xxeb

2010-06-26 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Jun 26 07:51:45 UTC 2010

Modified Files:
src/sys/arch/evbarm/g42xxeb: g42xxeb_mci.c

Log Message:
Don't use DMA for sdmmc on TWINTAIL for now, because it causes kernel panic.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/g42xxeb/g42xxeb_mci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/g42xxeb/g42xxeb_mci.c
diff -u src/sys/arch/evbarm/g42xxeb/g42xxeb_mci.c:1.1 src/sys/arch/evbarm/g42xxeb/g42xxeb_mci.c:1.2
--- src/sys/arch/evbarm/g42xxeb/g42xxeb_mci.c:1.1	Sat Mar 13 11:37:47 2010
+++ src/sys/arch/evbarm/g42xxeb/g42xxeb_mci.c	Sat Jun 26 07:51:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: g42xxeb_mci.c,v 1.1 2010/03/13 11:37:47 bsh Exp $ */
+/*	$NetBSD: g42xxeb_mci.c,v 1.2 2010/06/26 07:51:45 bsh Exp $ */
 
 /*-
  * Copyright (c) 2009  Genetec Corporation.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: g42xxeb_mci.c,v 1.1 2010/03/13 11:37:47 bsh Exp $);
+__KERNEL_RCSID(0, $NetBSD: g42xxeb_mci.c,v 1.2 2010/06/26 07:51:45 bsh Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -163,6 +163,9 @@
 	pxa.pxa_intr = PXA2X0_INT_MMC;
 #endif
 
+	/* disable DMA for sdmmc for now. */
+	SET(sc-sc_mci.sc_caps, PMC_CAPS_NO_DMA);
+
 	if (pxamci_attach_sub(self, pxa)) {
 		aprint_error_dev(self,
 		unable to attach MMC controller\n);



CVS commit: src/sys/arch/evbarm/lubbock

2010-03-13 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Mar 13 10:55:10 UTC 2010

Modified Files:
src/sys/arch/evbarm/lubbock: sacc_obio.c

Log Message:
pass correct atttach args to sacc_probe()


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/lubbock/sacc_obio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/lubbock/sacc_obio.c
diff -u src/sys/arch/evbarm/lubbock/sacc_obio.c:1.10 src/sys/arch/evbarm/lubbock/sacc_obio.c:1.11
--- src/sys/arch/evbarm/lubbock/sacc_obio.c:1.10	Fri May 29 14:15:44 2009
+++ src/sys/arch/evbarm/lubbock/sacc_obio.c	Sat Mar 13 10:55:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sacc_obio.c,v 1.10 2009/05/29 14:15:44 rjs Exp $ */
+/*	$NetBSD: sacc_obio.c,v 1.11 2010/03/13 10:55:09 bsh Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sacc_obio.c,v 1.10 2009/05/29 14:15:44 rjs Exp $);
+__KERNEL_RCSID(0, $NetBSD: sacc_obio.c,v 1.11 2010/03/13 10:55:09 bsh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -65,10 +65,11 @@
 #include evbarm/lubbock/lubbock_var.h
 
 
+static	int	sacc_obio_probe(device_t parent, cfdata_t match, void *aux);
 static	void	sacc_obio_attach(device_t, device_t, void *);
 static	int  sacc_obio_intr(void *arg);
 
-CFATTACH_DECL_NEW(sacc_obio, sizeof(struct sacc_softc), sacc_probe, 
+CFATTACH_DECL_NEW(sacc_obio, sizeof(struct sacc_softc), sacc_obio_probe, 
 sacc_obio_attach, NULL, NULL);
 
 #if 0
@@ -79,6 +80,22 @@
 
 uint16_t cs2_memctl_init = 0x7ff0;
 
+static int
+sacc_obio_probe(device_t parent, cfdata_t match, void *aux)
+{
+	struct obio_attach_args *oa = aux;
+	struct sa11x0_attach_args sa;
+
+	printf(%s: addr=%lx\n, __func__, oa-oba_addr);
+
+	sa.sa_sc = oa-oba_sc;
+	sa.sa_iot = oa-oba_iot;
+	sa.sa_addr = oa-oba_addr;
+	sa.sa_size = 0x2000;
+
+	return sacc_probe(parent, match, sa);
+}
+
 static void
 sacc_obio_attach(device_t parent, device_t self, void *aux)
 {



CVS commit: src/sys/arch

2010-03-13 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Mar 13 11:13:31 UTC 2010

Modified Files:
src/sys/arch/arm/sa11x0: sa_kbc.c
src/sys/arch/evbarm/lubbock: lubbock_pcic.c

Log Message:
fix changes for struct device split for Lubbock.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/sa11x0/sa_kbc.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/lubbock/lubbock_pcic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/sa11x0/sa_kbc.c
diff -u src/sys/arch/arm/sa11x0/sa_kbc.c:1.11 src/sys/arch/arm/sa11x0/sa_kbc.c:1.12
--- src/sys/arch/arm/sa11x0/sa_kbc.c:1.11	Fri May 29 14:15:44 2009
+++ src/sys/arch/arm/sa11x0/sa_kbc.c	Sat Mar 13 11:13:31 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: sa_kbc.c,v 1.11 2009/05/29 14:15:44 rjs Exp $ */
+/*  $NetBSD: sa_kbc.c,v 1.12 2010/03/13 11:13:31 bsh Exp $ */
 
 /*
  * Copyright (c) 2004  Ben Harris.
@@ -57,7 +57,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sa_kbc.c,v 1.11 2009/05/29 14:15:44 rjs Exp $);
+__KERNEL_RCSID(0, $NetBSD: sa_kbc.c,v 1.12 2010/03/13 11:13:31 bsh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -193,7 +193,8 @@
 
 	if (!(sc-polling)  sc-ih_rx == NULL) {
 		sc-ih_rx = sacc_intr_establish(
-			(sacc_chipset_tag_t *) device_parent(sc-dev), 
+			(sacc_chipset_tag_t *) 
+			  device_private(device_parent(sc-dev)), 
 			sc-intr+1, IST_EDGE_RAISE, IPL_TTY, sackbc_rxint, sc);
 		if (sc-ih_rx == NULL) {
 			aprint_normal_dev(sc-dev, can't establish interrupt\n);
@@ -206,7 +207,8 @@
 {
 	if (sc-polling  sc-ih_rx) {
 		sacc_intr_disestablish(
-			(sacc_chipset_tag_t *) device_parent(sc-dev),
+			(sacc_chipset_tag_t *)
+			  device_private(device_parent(sc-dev)),
 			sc-ih_rx);
 		sc-ih_rx = NULL;
 	}

Index: src/sys/arch/evbarm/lubbock/lubbock_pcic.c
diff -u src/sys/arch/evbarm/lubbock/lubbock_pcic.c:1.5 src/sys/arch/evbarm/lubbock/lubbock_pcic.c:1.6
--- src/sys/arch/evbarm/lubbock/lubbock_pcic.c:1.5	Fri May 29 14:15:44 2009
+++ src/sys/arch/evbarm/lubbock/lubbock_pcic.c	Sat Mar 13 11:13:31 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: lubbock_pcic.c,v 1.5 2009/05/29 14:15:44 rjs Exp $	*/
+/*  $NetBSD: lubbock_pcic.c,v 1.6 2010/03/13 11:13:31 bsh Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lubbock_pcic.c,v 1.5 2009/05/29 14:15:44 rjs Exp $);
+__KERNEL_RCSID(0, $NetBSD: lubbock_pcic.c,v 1.6 2010/03/13 11:13:31 bsh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -90,8 +90,11 @@
 static void
 sacpcic_attach(device_t parent, device_t self, void *aux)
 {
+	struct sacpcic_softc *sc = device_private(self);
+
+	sc-sc_pc.sc_dev = self;
 	sacpcic_attach_common(device_private(parent),
-	device_private(self), aux, lubbock_socket_setup);
+	sc, aux, lubbock_socket_setup);
 }
 
 



CVS commit: src/sys/arch

2010-03-13 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Mar 13 11:15:52 UTC 2010

Modified Files:
src/sys/arch/arm/xscale: pxa2x0_lcd.c
src/sys/arch/evbarm/g42xxeb: g42xxeb_lcd.c
src/sys/arch/evbarm/lubbock: lubbock_lcd.c

Log Message:
fix LCD drivers for Lubbock and Twintail.
  - pass correct attach args to pxa2x0_lcd_attach_sub()
  - make this driver compile without wsdisplay again.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/xscale/pxa2x0_lcd.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/lubbock/lubbock_lcd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/xscale/pxa2x0_lcd.c
diff -u src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.27 src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.28
--- src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.27	Thu Jan 29 12:28:15 2009
+++ src/sys/arch/arm/xscale/pxa2x0_lcd.c	Sat Mar 13 11:15:52 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0_lcd.c,v 1.27 2009/01/29 12:28:15 nonaka Exp $ */
+/* $NetBSD: pxa2x0_lcd.c,v 1.28 2010/03/13 11:15:52 bsh Exp $ */
 
 /*
  * Copyright (c) 2002  Genetec Corporation.  All rights reserved.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pxa2x0_lcd.c,v 1.27 2009/01/29 12:28:15 nonaka Exp $);
+__KERNEL_RCSID(0, $NetBSD: pxa2x0_lcd.c,v 1.28 2010/03/13 11:15:52 bsh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -82,9 +82,11 @@
 
 static void	pxa2x0_lcd_initialize(struct pxa2x0_lcd_softc *, 
 		const struct lcd_panel_geometry *);
+#if NWSDISPLAY  0
 static void	pxa2x0_lcd_setup_rasops(struct pxa2x0_lcd_softc *,
 		struct rasops_info *, struct pxa2x0_wsscreen_descr *,
 		const struct lcd_panel_geometry *);
+#endif
 
 void
 pxa2x0_lcd_geometry(struct pxa2x0_lcd_softc *sc,
@@ -249,6 +251,7 @@
 
 	pxa2x0_lcd_initialize(sc, geom);
 
+#if NWSDISPLAY  0
 	if (pxa2x0_lcd_console.is_console) {
 		struct pxa2x0_wsscreen_descr *descr = pxa2x0_lcd_console.descr;
 		struct pxa2x0_lcd_screen *scr;
@@ -278,6 +281,7 @@
 
 		aprint_normal_dev(sc-dev, console\n);
 	}
+#endif
 }
 
 int
@@ -368,7 +372,6 @@
 	restore_interrupts(save);
 }
 
-#if NWSDISPLAY  0
 /*
  * Disable screen refresh.
  */
@@ -391,7 +394,6 @@
 	~LCCR0_DIS 
 	bus_space_read_4(sc-iot, sc-ioh, LCDC_LCCR0));
 }
-#endif
 
 #define _rgb(r,g,b)	(((r)11) | ((g)5) | b)
 #define rgb(r,g,b)	_rgb((r)1,g,(b)1)
@@ -604,6 +606,7 @@
 	return error;
 }
 
+#if NWSDISPLAY  0
 /*
  * Initialize rasops for a screen, as well as struct wsscreen_descr if this
  * is the first screen creation.
@@ -645,6 +648,7 @@
 	descr-c.capabilities = rinfo-ri_caps;
 	descr-c.textops = rinfo-ri_ops;
 }
+#endif
 
 /*
  * Power management

Index: src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c
diff -u src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c:1.12 src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c:1.13
--- src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c:1.12	Thu Jan 29 12:28:15 2009
+++ src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c	Sat Mar 13 11:15:52 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: g42xxeb_lcd.c,v 1.12 2009/01/29 12:28:15 nonaka Exp $ */
+/* $NetBSD: g42xxeb_lcd.c,v 1.13 2010/03/13 11:15:52 bsh Exp $ */
 
 /*-
  * Copyright (c) 2001, 2002, 2005 Genetec corp.
@@ -127,7 +127,7 @@
 dev_type_mmap(lcdmmap);
 const struct cdevsw lcd_cdevsw = {
 	lcdopen, lcdclose, noread, nowrite,
-	lcdioctl, nostop, notty, nopoll, lcdmmap, D_TTY
+	lcdioctl, nostop, notty, nopoll, lcdmmap, nokqfilter, D_TTY
 };
 
 #endif
@@ -188,19 +188,27 @@
 };
 #endif /* G4250_LCD_TOSHIBA_LTM035 */
 
-void lcd_attach( device_t parent, device_t self, void *aux )
+void lcd_attach(device_t parent, device_t self, void *aux)
 {
 	struct pxa2x0_lcd_softc *sc = device_private(self);
+	struct pxaip_attach_args paa;
+	struct obio_attach_args *oba = aux;
 
 	sc-dev = self;
 
+	paa.pxa_name = obio;
+	paa.pxa_iot = oba-oba_iot;
+	paa.pxa_addr = oba-oba_addr;
+	paa.pxa_size = 0;		/* XXX */
+	paa.pxa_intr = oba-oba_intr;
+
 #ifdef G4250_LCD_TOSHIBA_LTM035
 # define PANEL	toshiba_LTM035
 #else
 # define PANEL	nec_NL3224BC35
 #endif
 
-	pxa2x0_lcd_attach_sub(sc, aux, PANEL);
+	pxa2x0_lcd_attach_sub(sc, paa, PANEL);
 
 
 #if NWSDISPLAY  0
@@ -218,8 +226,6 @@
 		aa.accessops = lcd_accessops;
 		aa.accesscookie = sc;
 
-		printf(\n);
-
 		(void) config_found(self, aa, wsemuldisplaydevprint);
 	}
 #else
@@ -232,8 +238,6 @@
 			sc-active = screen;
 			pxa2x0_lcd_start_dma(sc, screen);
 		}
-
-		printf(\n);
 	}
 #endif
 
@@ -246,8 +250,9 @@
 int
 lcd_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct lwp *l)
 {
+	struct pxa2x0_lcd_softc *sc = v;
 	struct obio_softc *osc = 
-	(struct obio_softc *) device_parent((struct device *)v);
+	device_private(device_parent(sc-dev));
 	uint16_t reg;
 
 	switch (cmd) {
@@ -273,8 +278,9 @@
 lcd_show_screen(void *v, void *cookie, int waitok,
 void (*cb)(void *, int, int), void *cbarg)
 {
+	

CVS commit: src/sys/arch/evbarm/g42xxeb

2010-03-13 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Mar 13 11:26:42 UTC 2010

Modified Files:
src/sys/arch/evbarm/g42xxeb: g42xxeb_kmkbd.c g42xxeb_var.h gb225.c
gb225_pcic.c gb225var.h obio.c

Log Message:
apply struct device split to the rest of the drivers for Twintail.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/g42xxeb/g42xxeb_kmkbd.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/g42xxeb/g42xxeb_var.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/g42xxeb/gb225.c \
src/sys/arch/evbarm/g42xxeb/obio.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/g42xxeb/gb225_pcic.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/g42xxeb/gb225var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/g42xxeb/g42xxeb_kmkbd.c
diff -u src/sys/arch/evbarm/g42xxeb/g42xxeb_kmkbd.c:1.10 src/sys/arch/evbarm/g42xxeb/g42xxeb_kmkbd.c:1.11
--- src/sys/arch/evbarm/g42xxeb/g42xxeb_kmkbd.c:1.10	Sat Mar 14 15:36:05 2009
+++ src/sys/arch/evbarm/g42xxeb/g42xxeb_kmkbd.c	Sat Mar 13 11:26:42 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: g42xxeb_kmkbd.c,v 1.10 2009/03/14 15:36:05 dsl Exp $ */
+/* $NetBSD: g42xxeb_kmkbd.c,v 1.11 2010/03/13 11:26:42 bsh Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003, 2005 Genetec corp.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: g42xxeb_kmkbd.c,v 1.10 2009/03/14 15:36:05 dsl Exp $ );
+__KERNEL_RCSID(0, $NetBSD: g42xxeb_kmkbd.c,v 1.11 2010/03/13 11:26:42 bsh Exp $ );
 
 #include sys/param.h
 #include sys/systm.h
@@ -65,7 +65,7 @@
 #define RELEASE_WATCH_TICKS  (hz/10)	/* 100ms */
 
 struct kmkbd_softc {
-struct  device dev;
+	device_t dev;
 
 	struct device *wskbddev;
 	void *ih;			/* interrupt handler */
@@ -86,10 +86,10 @@
 };
 
 
-int kmkbd_match(struct device *, struct cfdata *, void *);
-void kmkbd_attach(struct device *, struct device *, void *);
+int kmkbd_match(device_t, cfdata_t, void *);
+void kmkbd_attach(device_t, device_t, void *);
 
-CFATTACH_DECL(kmkbd, sizeof(struct kmkbd_softc),
+CFATTACH_DECL_NEW(kmkbd, sizeof(struct kmkbd_softc),
 kmkbd_match, kmkbd_attach, NULL, NULL);
 
 static  int	kmkbd_enable(void *, int);
@@ -189,17 +189,18 @@
 }
 
 void
-kmkbd_attach(struct device *parent, struct device *self, void *aux)
+kmkbd_attach(device_t parent, device_t self, void *aux)
 {
-	struct kmkbd_softc *sc = (void *)self;
+	struct kmkbd_softc *sc = device_private(self);
 	/*struct obio_attach_args *oa = aux;*/
 	int state0;
 	struct wskbddev_attach_args a;
-	struct obio_softc *osc = (struct obio_softc *)parent;
+	struct obio_softc *osc = device_private(parent);
 	int s;
 
 	printf(\n);
 
+	sc-dev = self;
 	sc-state = ST_INIT;
 
 	if (kmkbd_is_console()){
@@ -367,7 +368,7 @@
 {
 	int i;
 	u_int ret, data;
-	struct obio_softc *osc = (struct obio_softc *)device_parent(sc-dev);
+	struct obio_softc *osc = device_private(device_parent(sc-dev));
 	bus_space_tag_t iot = osc-sc_iot;
 	bus_space_handle_t ioh = osc-sc_obioreg_ioh;
 
@@ -438,7 +439,7 @@
 kmkbd_intr(void *arg)
 {
 	struct kmkbd_softc *sc = arg;
-	struct obio_softc *osc = (struct obio_softc *)device_parent(sc-dev);
+	struct obio_softc *osc = device_private(device_parent(sc-dev));
 
 	if ( sc-state != ST_ALL_UP ){
 		printf(Spurious interrupt from key matrix\n);
@@ -499,7 +500,7 @@
 static void
 kmkbd_new_state(struct kmkbd_softc *sc, enum kmkbd_state new_state)
 {
-	struct obio_softc *osc = (struct obio_softc *)device_parent(sc-dev);
+	struct obio_softc *osc = device_private(device_parent(sc-dev));
 
 	switch(new_state){
 	case ST_DISABLED:

Index: src/sys/arch/evbarm/g42xxeb/g42xxeb_var.h
diff -u src/sys/arch/evbarm/g42xxeb/g42xxeb_var.h:1.3 src/sys/arch/evbarm/g42xxeb/g42xxeb_var.h:1.4
--- src/sys/arch/evbarm/g42xxeb/g42xxeb_var.h:1.3	Sat May 10 15:31:04 2008
+++ src/sys/arch/evbarm/g42xxeb/g42xxeb_var.h	Sat Mar 13 11:26:42 2010
@@ -43,7 +43,7 @@
  * G42xxeb on-board IO bus
  */
 struct obio_softc {
-	struct device sc_dev;
+	device_t sc_dev;
 	bus_space_tag_t sc_iot;
 	bus_space_handle_t sc_obioreg_ioh;
 

Index: src/sys/arch/evbarm/g42xxeb/gb225.c
diff -u src/sys/arch/evbarm/g42xxeb/gb225.c:1.7 src/sys/arch/evbarm/g42xxeb/gb225.c:1.8
--- src/sys/arch/evbarm/g42xxeb/gb225.c:1.7	Wed Oct 17 19:54:12 2007
+++ src/sys/arch/evbarm/g42xxeb/gb225.c	Sat Mar 13 11:26:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gb225.c,v 1.7 2007/10/17 19:54:12 garbled Exp $ */
+/*	$NetBSD: gb225.c,v 1.8 2010/03/13 11:26:42 bsh Exp $ */
 
 /*
  * Copyright (c) 2002, 2003  Genetec corp.  All rights reserved.
@@ -60,10 +60,9 @@
 #define DEBOUNCE_TICKS	(hz/20)			/* 50ms */
 
 /* prototypes */
-static int	opio_match(struct device *, struct cfdata *, void *);
-static void	opio_attach(struct device *, struct device *, void *);
-static int 	opio_search(struct device *, struct cfdata *,
-			const int *, void *);
+static int	opio_match(device_t, cfdata_t, void *);
+static void	

CVS commit: src/sys/arch/evbarm

2010-03-13 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sat Mar 13 11:37:47 UTC 2010

Modified Files:
src/sys/arch/evbarm/conf: TWINTAIL files.g42xxeb
Added Files:
src/sys/arch/evbarm/g42xxeb: g42xxeb_mci.c

Log Message:
add SD/MMC driver for Twintail based on the driver for Zaurus.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbarm/conf/TWINTAIL
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/files.g42xxeb
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/g42xxeb/g42xxeb_mci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/TWINTAIL
diff -u src/sys/arch/evbarm/conf/TWINTAIL:1.33 src/sys/arch/evbarm/conf/TWINTAIL:1.34
--- src/sys/arch/evbarm/conf/TWINTAIL:1.33	Sun Mar  7 09:39:42 2010
+++ src/sys/arch/evbarm/conf/TWINTAIL	Sat Mar 13 11:37:47 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: TWINTAIL,v 1.33 2010/03/07 09:39:42 plunky Exp $
+#	$NetBSD: TWINTAIL,v 1.34 2010/03/13 11:37:47 bsh Exp $
 #
 #	TWINTAIL -- Genetec corp. G4255EB-X002 Evaluation Board Kernel
 #
@@ -353,6 +353,22 @@
 com*	at mhzc?
 sm*	at mhzc?
 
+# DMAC support
+pxadmac0 at pxaip? addr 0x4000 intr 25
+options 	PXA2X0_DMAC_DMOVER_CONCURRENCY=4 # Enable dmover(9) backend
+#options 	PXA2X0_DMAC_FIXED_PRIORITY	# Don't want multiple priority
+
+
+# MMC/SD contoller in PXA255
+#  (attached on obio for card detect and write protect signal)
+pxamci0 at obio?
+sdmmc* at pxamci?
+#options 	PXAMCI_DEBUG
+#options 	SDMMC_DEBUG
+#options 	SDMMC_DUMP_CSD
+
+ld* at sdmmc?# MMC/SD card
+
 # Pseudo-Devices
 
 # disk/mass storage pseudo-devices

Index: src/sys/arch/evbarm/conf/files.g42xxeb
diff -u src/sys/arch/evbarm/conf/files.g42xxeb:1.5 src/sys/arch/evbarm/conf/files.g42xxeb:1.6
--- src/sys/arch/evbarm/conf/files.g42xxeb:1.5	Mon Mar 17 09:30:02 2008
+++ src/sys/arch/evbarm/conf/files.g42xxeb	Sat Mar 13 11:37:47 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.g42xxeb,v 1.5 2008/03/17 09:30:02 kiyohara Exp $
+#	$NetBSD: files.g42xxeb,v 1.6 2010/03/13 11:37:47 bsh Exp $
 #
 # Genetec corp. G4255EB evaluation board configuration info
 #
@@ -8,6 +8,9 @@
 # CPU support and integrated peripherals
 include arch/arm/xscale/files.pxa2x0
 
+# Machine-independent SD/MMC drivers
+include dev/sdmmc/files.sdmmc
+
 # G4250EBX on-board devices (including CPLD)
 device	obio {[addr=-1], [intr=-1]}
 attach	obio at pxaip
@@ -39,3 +42,6 @@
 # Cypress SL811HS USB host controller
 attach	slhci at opio with slhci_opio
 file	arch/evbarm/g42xxeb/gb225_slhci.c	slhci_opio
+
+attach pxamci at obio with pxamci_obio
+file   arch/evbarm/g42xxeb/g42xxeb_mci.c	pxamci_obio

Added files:

Index: src/sys/arch/evbarm/g42xxeb/g42xxeb_mci.c
diff -u /dev/null src/sys/arch/evbarm/g42xxeb/g42xxeb_mci.c:1.1
--- /dev/null	Sat Mar 13 11:37:47 2010
+++ src/sys/arch/evbarm/g42xxeb/g42xxeb_mci.c	Sat Mar 13 11:37:47 2010
@@ -0,0 +1,239 @@
+/*	$NetBSD: g42xxeb_mci.c,v 1.1 2010/03/13 11:37:47 bsh Exp $ */
+
+/*-
+ * Copyright (c) 2009  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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS
+ * 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 zaurus/dev/zmci.c */
+
+/*-
+ * Copyright (c) 2006-2008 NONAKA Kimihiro non...@netbsd.org
+ * 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

CVS commit: src/sys/arch/arm/s3c2xx0

2010-02-20 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Feb 21 06:08:53 UTC 2010

Modified Files:
src/sys/arch/arm/s3c2xx0: s3c24x0reg.h s3c2800reg.h s3c2xx0reg.h

Log Message:
Modify definitions for ULCOM register of UART according to S3C2800
User's manual rev 1.3.

The values of ULCON_PARITY_SHIFT and ULCON_IR are now same to those
for S3C2410. So the definitions are moved to s3c2xx0reg.h.  (Old
definitions from User's manual rev1.1 were differ to those for
S3C2410, and that was why I put them in s3c2800reg.h and s3c24x0reg.h.
There's no description in errata about this changes.)

Also, fix the value for UMSTAT_DCTS on 2800.

The values of UMCON_AFC and UMSTAT_DCTS still differ between 2800 and
2410.

Reported by Brett Slager.  Thank you very much.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/s3c2xx0/s3c24x0reg.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/s3c2xx0/s3c2800reg.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/s3c2xx0/s3c2xx0reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/s3c2xx0/s3c24x0reg.h
diff -u src/sys/arch/arm/s3c2xx0/s3c24x0reg.h:1.8 src/sys/arch/arm/s3c2xx0/s3c24x0reg.h:1.9
--- src/sys/arch/arm/s3c2xx0/s3c24x0reg.h:1.8	Sun Dec 11 12:16:51 2005
+++ src/sys/arch/arm/s3c2xx0/s3c24x0reg.h	Sun Feb 21 06:08:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: s3c24x0reg.h,v 1.8 2005/12/11 12:16:51 christos Exp $ */
+/* $NetBSD: s3c24x0reg.h,v 1.9 2010/02/21 06:08:53 bsh Exp $ */
 
 /*
  * Copyright (c) 2003  Genetec corporation  All rights reserved.
@@ -335,8 +335,6 @@
 /* diffs to s3c2800 */
 #define	 UMCON_AFC	(14)	/* auto flow control */
 #define	 UMSTAT_DCTS	(12)	/* CTS change */
-#define	 ULCON_IR  	(16)
-#define	 ULCON_PARITY_SHIFT  3
 
 #define	S3C24X0_UART_SIZE 	0x2c
 

Index: src/sys/arch/arm/s3c2xx0/s3c2800reg.h
diff -u src/sys/arch/arm/s3c2xx0/s3c2800reg.h:1.6 src/sys/arch/arm/s3c2xx0/s3c2800reg.h:1.7
--- src/sys/arch/arm/s3c2xx0/s3c2800reg.h:1.6	Sun Dec 11 12:16:51 2005
+++ src/sys/arch/arm/s3c2xx0/s3c2800reg.h	Sun Feb 21 06:08:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: s3c2800reg.h,v 1.6 2005/12/11 12:16:51 christos Exp $ */
+/* $NetBSD: s3c2800reg.h,v 1.7 2010/02/21 06:08:53 bsh Exp $ */
 
 /*
  * Copyright (c) 2002, 2003 Fujitsu Component Limited
@@ -239,9 +239,7 @@
 
 /* UART (Small diffs to S3C2400's UART) */
 #define	 UMCON_AFC	(11)	/* auto flow control */
-#define	 UMSTAT_DCTS	(14)	/* CTS change */
-#define	 ULCON_IR  	(17)
-#define	 ULCON_PARITY_SHIFT  4
+#define	 UMSTAT_DCTS	(11)	/* CTS change */
 
 /* Interrupt controller */
 #define	INTCTL_IRQPND	0x0c	/* IRQ pending */

Index: src/sys/arch/arm/s3c2xx0/s3c2xx0reg.h
diff -u src/sys/arch/arm/s3c2xx0/s3c2xx0reg.h:1.5 src/sys/arch/arm/s3c2xx0/s3c2xx0reg.h:1.6
--- src/sys/arch/arm/s3c2xx0/s3c2xx0reg.h:1.5	Sun Dec 11 12:16:51 2005
+++ src/sys/arch/arm/s3c2xx0/s3c2xx0reg.h	Sun Feb 21 06:08:53 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: s3c2xx0reg.h,v 1.5 2005/12/11 12:16:51 christos Exp $ */
+/* $NetBSD: s3c2xx0reg.h,v 1.6 2010/02/21 06:08:53 bsh Exp $ */
 
 /*
  * Copyright (c) 2002, 2003 Fujitsu Component Limited
@@ -46,14 +46,13 @@
  * Following definitions can be foune in s3c{2800,24x0}reg.h for
  * that reason.
  *
- *  ULCON_IR (Infra-red mode)
- *  ULCON_PARITY_SHIFT   (Parity mode bit position)
  *  UMCON_AFC(Auto flow control)
  *  UMSTAT_DCTS  (CTS change)
  */
 
 #define	SSCOM_ULCON 0x00 /* UART line control */
-/*   ULCON_PARITY_SHIFT and ULCON_IR is defined in s3c{2800,24x0}reg.h */
+#define	 ULCON_IR  	(16)
+#define	 ULCON_PARITY_SHIFT  3
 #define	 ULCON_PARITY_NONE  (0ULCON_PARITY_SHIFT)
 #define	 ULCON_PARITY_ODD   (4ULCON_PARITY_SHIFT)
 #define	 ULCON_PARITY_EVEN  (5ULCON_PARITY_SHIFT)



CVS commit: src/sys/ddb

2009-09-27 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Sun Sep 27 18:24:23 UTC 2009

Modified Files:
src/sys/ddb: db_access.c files.ddb

Log Message:
kgdb still needs db_{get,put}_value in ddb/db_access.c when SOFTWARE_SSTEP is 
defined in db_machdep.h.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/ddb/db_access.c
cvs rdiff -u -r1.4 -r1.5 src/sys/ddb/files.ddb

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ddb/db_access.c
diff -u src/sys/ddb/db_access.c:1.19 src/sys/ddb/db_access.c:1.20
--- src/sys/ddb/db_access.c:1.19	Sat Mar  7 22:02:17 2009
+++ src/sys/ddb/db_access.c	Sun Sep 27 18:24:23 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_access.c,v 1.19 2009/03/07 22:02:17 ad Exp $	*/
+/*	$NetBSD: db_access.c,v 1.20 2009/09/27 18:24:23 bsh Exp $	*/
 
 /*
  * Mach Operating System
@@ -30,7 +30,9 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_access.c,v 1.19 2009/03/07 22:02:17 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_access.c,v 1.20 2009/09/27 18:24:23 bsh Exp $);
+
+#include opt_kgdb.h
 
 #include sys/param.h
 #include sys/proc.h
@@ -41,8 +43,12 @@
 /*
  * Access unaligned data items on aligned (longword)
  * boundaries.
+ *
+ * This file is shared by ddb and kgdb.
  */
 
+#if defined(DDB) || defined(KGDB)  defined(SOFTWARE_SSTEP)
+
 const int db_extend[] = {	/* table for sign-extending */
 	0,
 	0xFF80,
@@ -91,6 +97,10 @@
 	db_write_bytes(addr, size, data);
 }
 
+#endif	/* DDB || KGDB  SOFTWARE_SSTEP */
+
+#ifdef	DDB
+
 void *
 db_read_ptr(const char *name)
 {
@@ -120,3 +130,5 @@
 	db_read_bytes((db_addr_t)val, sizeof(p), (char *)p);
 	return p;
 }
+
+#endif	/* DDB */

Index: src/sys/ddb/files.ddb
diff -u src/sys/ddb/files.ddb:1.4 src/sys/ddb/files.ddb:1.5
--- src/sys/ddb/files.ddb:1.4	Tue Mar 31 15:50:45 2009
+++ src/sys/ddb/files.ddb	Sun Sep 27 18:24:23 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ddb,v 1.4 2009/03/31 15:50:45 reinoud Exp $
+#	$NetBSD: files.ddb,v 1.5 2009/09/27 18:24:23 bsh Exp $
 
 #
 # DDB options
@@ -8,7 +8,7 @@
 DDB_BREAK_CHAR DDB_KEYCODE SYMTAB_SPACE
 DDB_COMMANDONENTER 
 
-file	ddb/db_access.c			ddb
+file	ddb/db_access.c			ddb | kgdb
 file	ddb/db_aout.c			ddb
 file	ddb/db_break.c			ddb
 file	ddb/db_command.c		ddb



CVS commit: src/sys/arch/arm/imx

2009-09-17 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Thu Sep 17 16:13:32 UTC 2009

Modified Files:
src/sys/arch/arm/imx: imxuartreg.h

Log Message:
fix a typo of register bit name.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imxuartreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/imx/imxuartreg.h
diff -u src/sys/arch/arm/imx/imxuartreg.h:1.2 src/sys/arch/arm/imx/imxuartreg.h:1.3
--- src/sys/arch/arm/imx/imxuartreg.h:1.2	Sun Apr 27 18:58:44 2008
+++ src/sys/arch/arm/imx/imxuartreg.h	Thu Sep 17 16:13:32 2009
@@ -1,4 +1,4 @@
-/* $Id: imxuartreg.h,v 1.2 2008/04/27 18:58:44 matt Exp $ */
+/* $Id: imxuartreg.h,v 1.3 2009/09/17 16:13:32 bsh Exp $ */
 /*
  * register definitions for Freescale i.MX31 and i.MX31L UARTs
  *
@@ -108,7 +108,7 @@
 #define IMX_UCR2_RTSEN		BIT(4)		/* rw */
 #define IMX_UCR2_WS		BIT(5)		/* rw */
 #define IMX_UCR2_STPB		BIT(6)		/* rw */
-#define IMX_UCR2_PRDE		BIT(7)		/* rw */
+#define IMX_UCR2_PROE		BIT(7)		/* rw */
 #define IMX_UCR2_PREN		BIT(8)		/* rw */
 #define IMX_UCR2_RTEC		BITS(10,9)	/* rw */
 #define IMX_UCR2_ESCEN		BIT(11)		/* rw */