CVS commit: src/sys/dev

2012-12-23 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Sun Dec 23 09:31:47 UTC 2012

Modified Files:
src/sys/dev: DEVNAMES

Log Message:
Add ibmcd(4) and ptcd(4) entries.


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 src/sys/dev/DEVNAMES

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/DEVNAMES
diff -u src/sys/dev/DEVNAMES:1.280 src/sys/dev/DEVNAMES:1.281
--- src/sys/dev/DEVNAMES:1.280	Mon Oct 15 17:08:33 2012
+++ src/sys/dev/DEVNAMES	Sun Dec 23 09:31:46 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: DEVNAMES,v 1.280 2012/10/15 17:08:33 jakllsch Exp $
+#	$NetBSD: DEVNAMES,v 1.281 2012/12/23 09:31:46 mbalmer Exp $
 #
 # This file contains all used device names and defined attributes in
 # alphabetical order. New devices added to the system somewhere should first
@@ -619,6 +619,7 @@ i2c_eeprom		MI		Attribute
 i8042			shark		Attribute
 i82586			MI		Attribute
 iavc			MI
+ibmcd			MI
 ibus			pmax
 ibus			vax
 ichlpcib		i386
@@ -1116,6 +1117,8 @@ psh3lcd			hpcsh
 psh3tp			hpcsh
 psm			sparc64
 psycho			sparc64
+ptcd			amd64
+ptcd			i386
 ptsc			acorn32
 puc			MI
 pvr			dreamcast



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

2012-12-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Dec 23 13:24:22 UTC 2012

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

Log Message:
Make inner loop do up 128 bytes into one shot.
Reorganize the code that deals with non-dword starts.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/arm/cpu_in_cksum_buffer.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/cpu_in_cksum_buffer.S
diff -u src/sys/arch/arm/arm/cpu_in_cksum_buffer.S:1.7 src/sys/arch/arm/arm/cpu_in_cksum_buffer.S:1.8
--- src/sys/arch/arm/arm/cpu_in_cksum_buffer.S:1.7	Sun Dec 23 03:44:24 2012
+++ src/sys/arch/arm/arm/cpu_in_cksum_buffer.S	Sun Dec 23 13:24:22 2012
@@ -29,7 +29,7 @@
 
 #include machine/asm.h
 
-RCSID($NetBSD: cpu_in_cksum_buffer.S,v 1.7 2012/12/23 03:44:24 matt Exp $)
+RCSID($NetBSD: cpu_in_cksum_buffer.S,v 1.8 2012/12/23 13:24:22 matt Exp $)
 
 /*
  * Special note:
@@ -41,22 +41,18 @@ RCSID($NetBSD: cpu_in_cksum_buffer.S,v 
 #define	LOAD_DWORD_INTO_R6(r)	ldrd	r6, [r], #8
 #else
 #define	LOAD_DWORD_INTO_R4(r)	ldmia	r!, {r4-r5}
-#define	LOAD_DWORD_INTO_R4(r)	ldmia	r!, {r6-r7}
+#define	LOAD_DWORD_INTO_R6(r)	ldmia	r!, {r6-r7}
 #endif
 
+#define	RLOFFSET		r8	/* register for leading offset */
+#define	RTMASK			r9	/* register for trailing mask */
+
 #if defined(__ARMEL__) || !defined(_ARM_ARCH_DWORD_OK)
-#define	RLO	r4
-#define	RHI	r5
-#else
-#define	RLO	r5
-#define	RHI	r4
-#endif
-#if defined(__ARMEL__)
-#define	BYTE0	0x00ff
-#define	BYTE3	0xff00
+#define	RLO			r4
+#define	RHI			r5
 #else
-#define	BYTE0	0xff00
-#define	BYTE3	0x00ff
+#define	RLO			r5
+#define	RHI			r4
 #endif
 
 /*
@@ -71,8 +67,8 @@ ENTRY(cpu_in_cksum_buffer)
 	teq	r1, #0			/* did we get passed a zero length? */
 	beq	.Lfold			/* fold the checksum */
 	add	r2, r0, r1		/* point r2 just past end */
-	push	{r4-r5,r10-r11}		/* save registers */
-	mvn	r11, #0			/* initialize trailing mask */
+	push	{r4-r5,RLOFFSET,RTMASK}	/* save registers */
+	mvn	RTMASK, #0		/* initialize trailing mask */
 	ands	r3, r2, #3		/* limit to a word */
 	beq	1f			/* no trailing bytes? */
 	/*
@@ -85,19 +81,19 @@ ENTRY(cpu_in_cksum_buffer)
 	add	r1, r1, r3		/* align to word boundary */
 	mov	r3, r3, lsl #3		/* bytes - bits */
 #ifdef __ARMEL__
-	mov	r11, r11, lsr r3	/* replace with zero bits */
+	mov	RTMASK, RTMASK, lsr r3	/* replace with zero bits */
 #else
-	mov	r11, r11, lsl r3	/* replace with zero bits */
+	mov	RTMASK, RTMASK, lsl r3	/* replace with zero bits */
 #endif
 1:
-	ands	r10, r0, #7		/* test for dword alignment */
+	ands	RLOFFSET, r0, #7	/* test for dword alignment */
 	bne	.Ldword_misaligned	/*   no, fixup non dword aligned */
 	/*
 	 * If the (now rounded up) length is 4, then only bit 2 will be set.
 	 * So if we clear that bit and the result is 0, then the length must
 	 * have been 4.
 	 */
-	bics	RLO, r1, #4		/* more than 1 word? */
+	bics	RLO, r1, #4		/* more than 1 word (and zero RLO)? */
 	beq	.Lfinal_word_load	/*   no, just load final word */
 	LOAD_DWORD_INTO_R4(r0)		/* load first dword */
 #if defined(_ARM_ARCH_DWORD_OK)  !defined(__OPTIMIZE_SIZE__)
@@ -110,12 +106,38 @@ ENTRY(cpu_in_cksum_buffer)
 	beq	.Lfinal_words		/*   no, but we have at least 1 word */
 	push	{r6-r7}
 #if !defined(__OPTIMIZE_SIZE__)
-	bics	r3, r1, #63		/* at least 64 bytes to do? */
-	bne	.Lloop64		/*   yes, then do them */
-	tst	r1, #32			/* what about 32 bytes */
-	bne	.Lloop32		/*   yes, then do them */
-	b	.Lloop16		/* then we must have 16 bytes */
-.Lloop64:
+	tst	r1, #16
+	bne	.Lloop16
+	tst	r1, #32
+	bne	.Lloop32
+	tst	r1, #64
+	bne	.Lloop64
+.Lloop128:/* 8 qwords left */
+	LOAD_DWORD_INTO_R6(r0)		/* 16 dwords left */
+	adcs	ip, ip, r4
+	adcs	ip, ip, r5
+	LOAD_DWORD_INTO_R4(r0)		/* 15 dwords left */
+	adcs	ip, ip, r6
+	adcs	ip, ip, r7
+	LOAD_DWORD_INTO_R6(r0)		/* 14 dwords left */
+	adcs	ip, ip, r4
+	adcs	ip, ip, r5
+	LOAD_DWORD_INTO_R4(r0)		/* 13 dwords left */
+	adcs	ip, ip, r6
+	adcs	ip, ip, r7
+	LOAD_DWORD_INTO_R6(r0)		/* 12 dwords left */
+	adcs	ip, ip, r4
+	adcs	ip, ip, r5
+	LOAD_DWORD_INTO_R4(r0)		/* 11 dwords left */
+	adcs	ip, ip, r6
+	adcs	ip, ip, r7
+	LOAD_DWORD_INTO_R6(r0)		/* 10 dwords left */
+	adcs	ip, ip, r4
+	adcs	ip, ip, r5
+	LOAD_DWORD_INTO_R4(r0)		/* 9 dwords left */
+	adcs	ip, ip, r6
+	adcs	ip, ip, r7
+.Lloop64:/* 4 qwords left */
 	LOAD_DWORD_INTO_R6(r0)		/* 8 dwords left */
 	adcs	ip, ip, r4
 	adcs	ip, ip, r5
@@ -128,34 +150,36 @@ ENTRY(cpu_in_cksum_buffer)
 	LOAD_DWORD_INTO_R4(r0)		/* 5 dwords left */
 	adcs	ip, ip, r6
 	adcs	ip, ip, r7
-.Lloop32:
+.Lloop32:/* 2 qwords left */
 	LOAD_DWORD_INTO_R6(r0)		/* 4 dwords left */
 	adcs	ip, ip, r4
 	adcs	ip, ip, r5
 	LOAD_DWORD_INTO_R4(r0)		/* 3 dwords left */
 	adcs	ip, ip, r6
 	adcs	ip, ip, r7
-#endif /* !__OPTIMIZE_SIZE__ */
-.Lloop16:
+#endif
+.Lloop16:/* 1 qword left */
 	LOAD_DWORD_INTO_R6(r0)		/* 2 dwords left */
 	

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

2012-12-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Dec 23 13:26:21 UTC 2012

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

Log Message:
Conditional execution still takes one cycle per skipped instruction.
branch to unlikely cases instead of conditionally skipping them.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/arm/cpu_in_cksum_fold.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/cpu_in_cksum_fold.S
diff -u src/sys/arch/arm/arm/cpu_in_cksum_fold.S:1.3 src/sys/arch/arm/arm/cpu_in_cksum_fold.S:1.4
--- src/sys/arch/arm/arm/cpu_in_cksum_fold.S:1.3	Thu Dec 20 07:20:04 2012
+++ src/sys/arch/arm/arm/cpu_in_cksum_fold.S	Sun Dec 23 13:26:21 2012
@@ -1,4 +1,3 @@
-/*	$NetBSD: cpu_in_cksum_fold.S,v 1.3 2012/12/20 07:20:04 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -49,16 +48,15 @@
 	 * return a complement of the lower halfword, that's 0xfffe.
 	 */
 	adcs	ip, ip, #0		/* add final carry bit */
-	subeq	r0, r1, #1		/* zero?  complement the carry */
-	RETc(eq)			/*	  and return 0xfffe */
+	beq	1f			/*   0?  return 0xfffe */
+
 	/*
 	 * Now prevent the adding of 0x to 0x by making sure the upper
 	 * halfword isn't 0x.  If it is, just complement all 32-bits
 	 * which clears the upper halfword and complements the lower halfword.
 	 */
 	cmp	ip, r1, lsl #16		/* is the upper halfword 0x? */
-	mvneq	r0, ip			/*   yes, complement */
-	RETc(eq)			/*	  and return */
+	beq	2f			/*   yes, complement and return */
 	/*
 	 * Finally add the lower halfword to the upper halfword.  If we have
 	 * a result = 0x1, carry will be set.  The maximum result will
@@ -69,3 +67,9 @@
 	addcs	ip, ip, #0x1
 	eor	r0, r1, ip, lsr #16
 	RET
+
+1:	sub	r0, r1, #1		/* set return value to 0xfffe */
+	RET/* return */
+2:	mvn	r0, ip			/* complement */
+	RET/* return */
+



CVS commit: src/sys/dev/usb

2012-12-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 23 17:00:13 UTC 2012

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

Log Message:
PR/41602

Fix a memory leak when ohci_device_setintr didn't return
USBD_NORMAL_COMPLETION.

ohci_setup_isoc always returns USBD_NORMAL_COMPLETION at the moment so
there's no chance of a leak there.


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 src/sys/dev/usb/ohci.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.225 src/sys/dev/usb/ohci.c:1.226
--- src/sys/dev/usb/ohci.c:1.225	Tue Nov 20 21:16:01 2012
+++ src/sys/dev/usb/ohci.c	Sun Dec 23 17:00:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.225 2012/11/20 21:16:01 skrll Exp $	*/
+/*	$NetBSD: ohci.c,v 1.226 2012/12/23 17:00:13 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.225 2012/11/20 21:16:01 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.226 2012/12/23 17:00:13 skrll Exp $);
 
 #include opt_usb.h
 
@@ -2209,7 +2209,10 @@ ohci_open(usbd_pipe_handle pipe)
 			ival = pipe-interval;
 			if (ival == USBD_DEFAULT_INTERVAL)
 ival = ed-bInterval;
-			return (ohci_device_setintr(sc, opipe, ival));
+			err = ohci_device_setintr(sc, opipe, ival);
+			if (err)
+goto bad;
+			break;
 		case UE_ISOCHRONOUS:
 			pipe-methods = ohci_device_isoc_methods;
 			return (ohci_setup_isoc(pipe));



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

2012-12-23 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Dec 23 18:26:16 UTC 2012

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_emmc.c

Log Message:
The BCM2835 reference says the SDHC_HIGH_SPEED bit in SDHC_HOST_CTL is
implemented, so add SDHC_HIGH_SPEED_SUPP to the software-implemented
SDHC_CAPABILITIES register.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/broadcom/bcm2835_emmc.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/broadcom/bcm2835_emmc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.3 src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.4
--- src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.3	Tue Oct 30 20:20:45 2012
+++ src/sys/arch/arm/broadcom/bcm2835_emmc.c	Sun Dec 23 18:26:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_emmc.c,v 1.3 2012/10/30 20:20:45 skrll Exp $	*/
+/*	$NetBSD: bcm2835_emmc.c,v 1.4 2012/12/23 18:26:16 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm2835_emmc.c,v 1.3 2012/10/30 20:20:45 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm2835_emmc.c,v 1.4 2012/12/23 18:26:16 jakllsch Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -88,7 +88,7 @@ bcmemmc_attach(device_t parent, device_t
 // 	sc-sc.sc_flags |= SDHC_FLAG_USE_DMA;		/* not available (yet) */
 	sc-sc.sc_flags |= SDHC_FLAG_32BIT_ACCESS;
 	sc-sc.sc_flags |= SDHC_FLAG_HOSTCAPS;
-	sc-sc.sc_caps = SDHC_VOLTAGE_SUPP_3_3V;
+	sc-sc.sc_caps = SDHC_VOLTAGE_SUPP_3_3V | SDHC_HIGH_SPEED_SUPP;
 	sc-sc.sc_host = sc-sc_hosts;
 	sc-sc.sc_clkbase = 5;	/* Default to 50MHz */
 	sc-sc_iot = aaa-aaa_iot;



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

2012-12-23 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Dec 23 18:34:01 UTC 2012

Modified Files:
src/sys/arch/arm/omap: omap3_sdhc.c

Log Message:
TI_AM335X SDHCI does not need SDHC_FLAG_SINGLE_ONLY.  This was
drastically hindering transfer rate performance.

I suspect SDHC_FLAG_SINGLE_ONLY is bogus on most/all other TI-flavored
SDHCI cores as well, but I am unable to confirm.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/omap/omap3_sdhc.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/omap/omap3_sdhc.c
diff -u src/sys/arch/arm/omap/omap3_sdhc.c:1.6 src/sys/arch/arm/omap/omap3_sdhc.c:1.7
--- src/sys/arch/arm/omap/omap3_sdhc.c:1.6	Thu Dec 13 06:43:38 2012
+++ src/sys/arch/arm/omap/omap3_sdhc.c	Sun Dec 23 18:34:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdhc.c,v 1.6 2012/12/13 06:43:38 riastradh Exp $	*/
+/*	$NetBSD: omap3_sdhc.c,v 1.7 2012/12/23 18:34:01 jakllsch Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: omap3_sdhc.c,v 1.6 2012/12/13 06:43:38 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: omap3_sdhc.c,v 1.7 2012/12/23 18:34:01 jakllsch Exp $);
 
 #include opt_omap.h
 
@@ -152,6 +152,7 @@ obiosdhc_attach(device_t parent, device_
 	sc-sc.sc_flags |= SDHC_FLAG_SINGLE_ONLY;
 #ifdef TI_AM335X
 	sc-sc.sc_flags |= SDHC_FLAG_WAIT_RESET;
+	sc-sc.sc_flags = ~SDHC_FLAG_SINGLE_ONLY;
 #endif
 	sc-sc.sc_host = sc-sc_hosts;
 	sc-sc.sc_clkbase = 96000;	/* 96MHZ */



CVS commit: src

2012-12-23 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Dec 23 21:01:05 UTC 2012

Modified Files:
src/lib/libnpf: npf.3 npf.c npf.h
src/sys/net/npf: npf.h npf_ctl.c
src/usr.sbin/npf/npfctl: npf.conf.5 npf_build.c npfctl.c

Log Message:
- Add NPF version check in proplist as well, not only ioctl.  Bump the version.
- Fix a bug in table entry lookup.
- Updates/fixes to the man pages.  Misc.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libnpf/npf.3
cvs rdiff -u -r1.14 -r1.15 src/lib/libnpf/npf.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libnpf/npf.h
cvs rdiff -u -r1.23 -r1.24 src/sys/net/npf/npf.h
cvs rdiff -u -r1.19 -r1.20 src/sys/net/npf/npf_ctl.c
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/npf/npfctl/npf.conf.5 \
src/usr.sbin/npf/npfctl/npfctl.c
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/npf/npfctl/npf_build.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/libnpf/npf.3
diff -u src/lib/libnpf/npf.3:1.5 src/lib/libnpf/npf.3:1.6
--- src/lib/libnpf/npf.3:1.5	Sun Jul  1 23:21:07 2012
+++ src/lib/libnpf/npf.3	Sun Dec 23 21:01:05 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: npf.3,v 1.5 2012/07/01 23:21:07 rmind Exp $
+.\	$NetBSD: npf.3,v 1.6 2012/12/23 21:01:05 rmind Exp $
 .\
 .\ Copyright (c) 2011-2012 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd July 1, 2012
+.Dd December 23, 2012
 .Dt NPF 3
 .Os
 .Sh NAME
@@ -77,20 +77,14 @@
 .Ft nl_table_t *
 .Fn npf_table_create u_int id int type
 .Ft int
-.Fn npf_table_add_entry nl_table_t *tl in_addr_t addr in_addr_t mask
+.Fn npf_table_add_entry nl_table_t *tl int af \
+in_addr_t addr in_addr_t mask
 .Ft bool
 .Fn npf_table_exists_p nl_config_t *ncf u_int tid
 .Ft int
 .Fn npf_table_insert nl_config_t *ncf nl_table_t *tl
 .Ft void
 .Fn npf_table_destroy nl_table_t *tl
-.\ ---
-.Ft int
-.Fn npf_update_rule int fd const char *rname nl_rule_t *rl
-.Ft int
-.Fn npf_sessions_send int fd const char *fpath
-.Ft int
-.Fn npf_sessions_recv int fd const char *fpath
 .\ -
 .Sh DESCRIPTION
 The
@@ -261,13 +255,20 @@ Table is identified by
 which should be in the range between 1 and
 .Dv NPF_MAX_TABLE_ID .
 .El
-.It Fn npf_table_add_entry tl addr mask
-Add an entry of IPv4 address and mask, specified by
+.It Fn npf_table_add_entry tl af addr mask
+Add an entry of IP address and mask, specified by
 .Fa addr
 and
 .Fa mask ,
 to the table specified by
 .Fa tl .
+Family, specified by
+.Fa fa ,
+must be either
+.Dv AF_INET
+for IPv4 or
+.Dv AF_INET6
+for IPv6 address.
 .It Fn npf_table_exists_p ncf name
 Determine whether table with ID
 .Fa tid
@@ -285,19 +286,6 @@ Routine performs a check for duplicate t
 Destroy the specified table.
 .El
 .\ -
-.Ss Session interface
-.Bl -tag -width 4n
-.It Fn npf_update_rule fd rname rl
-.It Fn npf_sessions_send fd fpath
-Read the file specified by
-.Fa fpath ,
-and send sessions saved in it to the kernel.
-.It Fn npf_sessions_recv fd fpath
-Receive currently loaded session from the kernel, and save them to a file
-specified by
-.Fa fpath .
-.El
-.\ -
 .Sh SEE ALSO
 .Xr npfctl 8 ,
 .Xr npf_ncode 9

Index: src/lib/libnpf/npf.c
diff -u src/lib/libnpf/npf.c:1.14 src/lib/libnpf/npf.c:1.15
--- src/lib/libnpf/npf.c:1.14	Sun Oct 28 16:27:20 2012
+++ src/lib/libnpf/npf.c	Sun Dec 23 21:01:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf.c,v 1.14 2012/10/28 16:27:20 rmind Exp $	*/
+/*	$NetBSD: npf.c,v 1.15 2012/12/23 21:01:05 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2010-2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: npf.c,v 1.14 2012/10/28 16:27:20 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: npf.c,v 1.15 2012/12/23 21:01:05 rmind Exp $);
 
 #include sys/types.h
 #include netinet/in_systm.h
@@ -121,14 +121,15 @@ npf_config_submit(nl_config_t *ncf, int 
 	if (npf_dict == NULL) {
 		return ENOMEM;
 	}
-	if (ncf-ncf_debug) {
-		prop_dictionary_set(npf_dict, debug, ncf-ncf_debug);
-	}
+	prop_dictionary_set_uint32(npf_dict, version, NPF_VERSION);
 	prop_dictionary_set(npf_dict, rules, ncf-ncf_rules_list);
 	prop_dictionary_set(npf_dict, rprocs, ncf-ncf_rproc_list);
 	prop_dictionary_set(npf_dict, tables, ncf-ncf_table_list);
 	prop_dictionary_set(npf_dict, translation, ncf-ncf_nat_list);
 	prop_dictionary_set_bool(npf_dict, flush, ncf-ncf_flush);
+	if (ncf-ncf_debug) {
+		prop_dictionary_set(npf_dict, debug, ncf-ncf_debug);
+	}
 
 	if (plist) {
 		if (!prop_dictionary_externalize_to_file(npf_dict, plist)) {
@@ -664,24 +665,36 @@ npf_table_create(u_int id, int type)
 }
 
 int
-npf_table_add_entry(nl_table_t *tl, const int alen,
-const npf_addr_t *addr, const npf_netmask_t mask)
+npf_table_add_entry(nl_table_t *tl, int af, const npf_addr_t *addr,
+const npf_netmask_t mask)
 {
 	prop_dictionary_t tldict = tl-ntl_dict, entdict;

CVS commit: src/sys/dev/sdmmc

2012-12-23 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Dec 23 22:33:09 UTC 2012

Modified Files:
src/sys/dev/sdmmc: sdhc.c

Log Message:
SMC_CAPS_DMA without SMC_CAPS_MULTI_SEG_DMA means we as a host driver only
can support one segment per operation.  This is not the case with SDHCI SDMA,
the only SDHCI DMA mechanism we currently support in sdhc(4).  Should fix
corrupt data on DMA-enabled SDHCI controllers claiming conformance to a SDHCI
Specification other than 1.0.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/sdmmc/sdhc.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/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.38 src/sys/dev/sdmmc/sdhc.c:1.39
--- src/sys/dev/sdmmc/sdhc.c:1.38	Sat Dec 22 03:56:58 2012
+++ src/sys/dev/sdmmc/sdhc.c	Sun Dec 23 22:33:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.38 2012/12/22 03:56:58 jakllsch Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.39 2012/12/23 22:33:09 jakllsch Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sdhc.c,v 1.38 2012/12/22 03:56:58 jakllsch Exp $);
+__KERNEL_RCSID(0, $NetBSD: sdhc.c,v 1.39 2012/12/23 22:33:09 jakllsch Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_sdmmc.h
@@ -416,10 +416,7 @@ sdhc_host_found(struct sdhc_softc *sc, b
 	if (ISSET(caps, SDHC_HIGH_SPEED_SUPP))
 		saa.saa_caps |= SMC_CAPS_SD_HIGHSPEED;
 	if (ISSET(hp-flags, SHF_USE_DMA)) {
-		saa.saa_caps |= SMC_CAPS_DMA;
-		if (hp-specver == SDHC_SPEC_VERS_100) {
-			saa.saa_caps |= SMC_CAPS_MULTI_SEG_DMA;
-		}
+		saa.saa_caps |= SMC_CAPS_DMA | SMC_CAPS_MULTI_SEG_DMA;
 	}
 	if (ISSET(sc-sc_flags, SDHC_FLAG_SINGLE_ONLY))
 		saa.saa_caps |= SMC_CAPS_SINGLE_ONLY;



CVS commit: src/lib/libnpf

2012-12-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Dec 24 00:35:56 UTC 2012

Modified Files:
src/lib/libnpf: npf.3

Log Message:
Remove a superfluous quote and fix a recurring typo.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libnpf/npf.3

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

Modified files:

Index: src/lib/libnpf/npf.3
diff -u src/lib/libnpf/npf.3:1.6 src/lib/libnpf/npf.3:1.7
--- src/lib/libnpf/npf.3:1.6	Sun Dec 23 21:01:05 2012
+++ src/lib/libnpf/npf.3	Mon Dec 24 00:35:56 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: npf.3,v 1.6 2012/12/23 21:01:05 rmind Exp $
+.\	$NetBSD: npf.3,v 1.7 2012/12/24 00:35:56 wiz Exp $
 .\
 .\ Copyright (c) 2011-2012 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -77,7 +77,7 @@
 .Ft nl_table_t *
 .Fn npf_table_create u_int id int type
 .Ft int
-.Fn npf_table_add_entry nl_table_t *tl int af \
+.Fn npf_table_add_entry nl_table_t *tl int af \
 in_addr_t addr in_addr_t mask
 .Ft bool
 .Fn npf_table_exists_p nl_config_t *ncf u_int tid
@@ -230,7 +230,7 @@ is used.
 Translation address is specified by
 .Fa addr ,
 and its family by
-.Fa fa .
+.Fa af .
 Family must be either
 .Dv AF_INET
 for IPv4 or
@@ -263,7 +263,7 @@ and
 to the table specified by
 .Fa tl .
 Family, specified by
-.Fa fa ,
+.Fa af ,
 must be either
 .Dv AF_INET
 for IPv4 or



CVS commit: src/dist/pf/usr.sbin/ftp-proxy

2012-12-23 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Dec 24 01:14:41 UTC 2012

Modified Files:
src/dist/pf/usr.sbin/ftp-proxy: npf.c

Log Message:
ftp-proxy: disable NPF bits for now; it will be re-done.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/dist/pf/usr.sbin/ftp-proxy/npf.c

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

Modified files:

Index: src/dist/pf/usr.sbin/ftp-proxy/npf.c
diff -u src/dist/pf/usr.sbin/ftp-proxy/npf.c:1.1 src/dist/pf/usr.sbin/ftp-proxy/npf.c:1.2
--- src/dist/pf/usr.sbin/ftp-proxy/npf.c:1.1	Wed Feb  2 02:20:26 2011
+++ src/dist/pf/usr.sbin/ftp-proxy/npf.c	Mon Dec 24 01:14:40 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf.c,v 1.1 2011/02/02 02:20:26 rmind Exp $	*/
+/*	$NetBSD: npf.c,v 1.2 2012/12/24 01:14:40 rmind Exp $	*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -311,6 +311,7 @@ npf_server_lookup(struct sockaddr *c, st
 static int
 npf_do_commit(void)
 {
+#if 0
 	nl_rule_t *group;
 	fp_ent_t *fpe;
 	pri_t pri;
@@ -327,6 +328,10 @@ npf_do_commit(void)
 	npf_update_rule(npf_fd, NPF_FP_RULE_TAG, group);
 	npf_rule_destroy(group);
 	return 0;
+#else
+	errno = ENOTSUP;
+	return -1;
+#endif
 }
 
 static int



CVS commit: src/sbin/wsconsctl

2012-12-23 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Dec 24 01:20:12 UTC 2012

Modified Files:
src/sbin/wsconsctl: util.c

Log Message:
Added a field type for signed integers. This is required when handling
touchscreen calibration values, which is about to be implemented in
wsconsctl (see PR kern/45872).

Reviewed by uwe@ (thank you!)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sbin/wsconsctl/util.c

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

Modified files:

Index: src/sbin/wsconsctl/util.c
diff -u src/sbin/wsconsctl/util.c:1.30 src/sbin/wsconsctl/util.c:1.31
--- src/sbin/wsconsctl/util.c:1.30	Thu Dec 15 14:25:12 2011
+++ src/sbin/wsconsctl/util.c	Mon Dec 24 01:20:12 2012
@@ -1,7 +1,7 @@
-/*	$NetBSD: util.c,v 1.30 2011/12/15 14:25:12 phx Exp $ */
+/*	$NetBSD: util.c,v 1.31 2012/12/24 01:20:12 khorben Exp $ */
 
 /*-
- * Copyright (c) 1998, 2006 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 2006, 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -257,6 +257,9 @@ pr_field(struct field *f, const char *se
 	case FMT_UINT:
 		(void)printf(%u, *((unsigned int *) f-valp));
 		break;
+	case FMT_INT:
+		(void)printf(%d, *((int *) f-valp));
+		break;
 	case FMT_STRING:
 		(void)printf(\%s\, *((char **) f-valp));
 		break;
@@ -361,6 +364,14 @@ rd_field(struct field *f, char *val, int
 		else
 			*((unsigned int *) f-valp) = u;
 		break;
+	case FMT_INT:
+		if (sscanf(val, %d, i) != 1)
+			errx(EXIT_FAILURE, %s: not a number, val);
+		if (merge)
+			*((int *) f-valp) += i;
+		else
+			*((int *) f-valp) = i;
+		break;
 	case FMT_STRING:
 		if ((*((char **) f-valp) = strdup(val)) == NULL)
 			err(EXIT_FAILURE, strdup);



CVS commit: src/sbin/wsconsctl

2012-12-23 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Dec 24 01:27:23 UTC 2012

Modified Files:
src/sbin/wsconsctl: mouse.c

Log Message:
Added read-only support for touchscreen calibration (see PR kern/45872).
Tested with the uts(4) driver, as well as with mice without calibration
support.

Reviewed by uwe@ (thank you!)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/wsconsctl/mouse.c

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

Modified files:

Index: src/sbin/wsconsctl/mouse.c
diff -u src/sbin/wsconsctl/mouse.c:1.8 src/sbin/wsconsctl/mouse.c:1.9
--- src/sbin/wsconsctl/mouse.c:1.8	Mon Apr 28 20:23:09 2008
+++ src/sbin/wsconsctl/mouse.c	Mon Dec 24 01:27:23 2012
@@ -1,7 +1,7 @@
-/*	$NetBSD: mouse.c,v 1.8 2008/04/28 20:23:09 martin Exp $ */
+/*	$NetBSD: mouse.c,v 1.9 2012/12/24 01:27:23 khorben Exp $ */
 
 /*-
- * Copyright (c) 1998, 2006 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 2006, 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -45,8 +45,12 @@
 static int mstype;
 static int resolution;
 static int samplerate;
+static struct wsmouse_calibcoords calibration;
+static char *calibration_samples;
 static struct wsmouse_repeat repeat;
 
+static void mouse_get_calibration(int);
+
 static void mouse_get_repeat(int);
 static void mouse_put_repeat(int);
 
@@ -54,6 +58,16 @@ struct field mouse_field_tab[] = {
 { resolution,		resolution,	FMT_UINT,	FLG_WRONLY },
 { samplerate,		samplerate,	FMT_UINT,	FLG_WRONLY },
 { type,			mstype,	FMT_MSTYPE,	FLG_RDONLY },
+{ calibration.minx,	calibration.minx,
+		FMT_INT,	FLG_RDONLY },
+{ calibration.miny,	calibration.miny,
+		FMT_INT,	FLG_RDONLY },
+{ calibration.maxx,	calibration.maxx,
+		FMT_INT,	FLG_RDONLY },
+{ calibration.maxy,	calibration.maxy,
+		FMT_INT,	FLG_RDONLY },
+{ calibration.samples,	calibration_samples,
+		FMT_STRING,	FLG_RDONLY },
 { repeat.buttons,		repeat.wr_buttons,
 		FMT_BITFIELD, FLG_MODIFY },
 { repeat.delay.first,	repeat.wr_delay_first,
@@ -75,6 +89,13 @@ mouse_get_values(int fd)
 		if (ioctl(fd, WSMOUSEIO_GTYPE, mstype)  0)
 			err(EXIT_FAILURE, WSMOUSEIO_GTYPE);
 
+	if (field_by_value(calibration.minx)-flags  FLG_GET ||
+	field_by_value(calibration.miny)-flags  FLG_GET ||
+	field_by_value(calibration.maxx)-flags  FLG_GET ||
+	field_by_value(calibration.maxy)-flags  FLG_GET ||
+	field_by_value(calibration_samples)-flags  FLG_GET)
+		mouse_get_calibration(fd);
+
 	if (field_by_value(repeat.wr_buttons)-flags  FLG_GET ||
 	field_by_value(repeat.wr_delay_first)-flags  FLG_GET ||
 	field_by_value(repeat.wr_delay_decrement)-flags  FLG_GET ||
@@ -83,11 +104,63 @@ mouse_get_values(int fd)
 }
 
 static void
+mouse_get_calibration(int fd)
+{
+	struct wsmouse_calibcoords tmp;
+	char *samples;
+	char buf[48];
+	int i;
+
+	if (ioctl(fd, WSMOUSEIO_GCALIBCOORDS, tmp)  0) {
+		field_disable_by_value(calibration.minx);
+		field_disable_by_value(calibration.miny);
+		field_disable_by_value(calibration.maxx);
+		field_disable_by_value(calibration.maxy);
+		field_disable_by_value(calibration_samples);
+		return;
+	}
+
+	if (field_by_value(calibration.minx)-flags  FLG_GET)
+		calibration.minx = tmp.minx;
+	if (field_by_value(calibration.miny)-flags  FLG_GET)
+		calibration.miny = tmp.miny;
+	if (field_by_value(calibration.maxx)-flags  FLG_GET)
+		calibration.maxx = tmp.maxx;
+	if (field_by_value(calibration.maxy)-flags  FLG_GET)
+		calibration.maxy = tmp.maxy;
+	if (field_by_value(calibration_samples)-flags  FLG_GET) {
+		free(calibration_samples);
+		if (tmp.samplelen = 0) {
+			calibration_samples = strdup();
+			if (calibration_samples == NULL)
+err(EXIT_FAILURE, could not list calibration
+		 samples);
+		} else {
+			samples = malloc(tmp.samplelen * sizeof(buf));
+			if (samples == NULL)
+err(EXIT_FAILURE, could not list calibration
+		 samples);
+			samples[0] = '\0';
+			for (i = 0; i  tmp.samplelen; i++) {
+snprintf(buf, sizeof(buf), %s%d,%d,%d,%d,
+		(i == 0) ?  : :,
+		tmp.samples[i].rawx,
+		tmp.samples[i].rawy,
+		tmp.samples[i].x,
+		tmp.samples[i].y);
+strcat(samples, buf);
+			}
+			calibration_samples = samples;
+		}
+	}
+}
+
+static void
 mouse_get_repeat(int fd)
 {
 	struct wsmouse_repeat tmp;
 
-	if (ioctl(fd, WSMOUSEIO_GETREPEAT, tmp) == -1)
+	if (ioctl(fd, WSMOUSEIO_GETREPEAT, tmp)  0)
 		err(EXIT_FAILURE, WSMOUSEIO_GETREPEAT);
 
 	if (field_by_value(repeat.wr_buttons)-flags  FLG_GET)
@@ -132,7 +205,7 @@ mouse_put_repeat(int fd)
 	struct wsmouse_repeat tmp;
 
 	/* Fetch current values into the temporary structure. */
-	if (ioctl(fd, WSMOUSEIO_GETREPEAT, tmp) == -1)
+	if (ioctl(fd, WSMOUSEIO_GETREPEAT, tmp)  0)
 		err(EXIT_FAILURE, WSMOUSEIO_GETREPEAT);
 
 	/* Overwrite the desired values in 

CVS commit: src/sbin/wsconsctl

2012-12-23 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Dec 24 01:29:20 UTC 2012

Modified Files:
src/sbin/wsconsctl: mouse.c

Log Message:
Added complete support for touchscreen calibration (see PR kern/45872).
Tested with the uts(4) driver, as well as with mice without calibration
support.

Reviewed by uwe@ (thank you!)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sbin/wsconsctl/mouse.c

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

Modified files:

Index: src/sbin/wsconsctl/mouse.c
diff -u src/sbin/wsconsctl/mouse.c:1.9 src/sbin/wsconsctl/mouse.c:1.10
--- src/sbin/wsconsctl/mouse.c:1.9	Mon Dec 24 01:27:23 2012
+++ src/sbin/wsconsctl/mouse.c	Mon Dec 24 01:29:20 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mouse.c,v 1.9 2012/12/24 01:27:23 khorben Exp $ */
+/*	$NetBSD: mouse.c,v 1.10 2012/12/24 01:29:20 khorben Exp $ */
 
 /*-
  * Copyright (c) 1998, 2006, 2012 The NetBSD Foundation, Inc.
@@ -50,6 +50,7 @@ static char *calibration_samples;
 static struct wsmouse_repeat repeat;
 
 static void mouse_get_calibration(int);
+static void mouse_put_calibration(int);
 
 static void mouse_get_repeat(int);
 static void mouse_put_repeat(int);
@@ -59,15 +60,15 @@ struct field mouse_field_tab[] = {
 { samplerate,		samplerate,	FMT_UINT,	FLG_WRONLY },
 { type,			mstype,	FMT_MSTYPE,	FLG_RDONLY },
 { calibration.minx,	calibration.minx,
-		FMT_INT,	FLG_RDONLY },
+		FMT_INT,	FLG_MODIFY },
 { calibration.miny,	calibration.miny,
-		FMT_INT,	FLG_RDONLY },
+		FMT_INT,	FLG_MODIFY },
 { calibration.maxx,	calibration.maxx,
-		FMT_INT,	FLG_RDONLY },
+		FMT_INT,	FLG_MODIFY },
 { calibration.maxy,	calibration.maxy,
-		FMT_INT,	FLG_RDONLY },
+		FMT_INT,	FLG_MODIFY },
 { calibration.samples,	calibration_samples,
-		FMT_STRING,	FLG_RDONLY },
+		FMT_STRING,	FLG_MODIFY },
 { repeat.buttons,		repeat.wr_buttons,
 		FMT_BITFIELD, FLG_MODIFY },
 { repeat.delay.first,	repeat.wr_delay_first,
@@ -192,6 +193,13 @@ mouse_put_values(int fd)
 		pr_field(field_by_value(samplerate),  - );
 	}
 
+	if (field_by_value(calibration.minx)-flags  FLG_SET ||
+	field_by_value(calibration.miny)-flags  FLG_SET ||
+	field_by_value(calibration.maxx)-flags  FLG_SET ||
+	field_by_value(calibration.maxy)-flags  FLG_SET ||
+	field_by_value(calibration_samples)-flags  FLG_SET)
+		mouse_put_calibration(fd);
+
 	if (field_by_value(repeat.wr_buttons)-flags  FLG_SET ||
 	field_by_value(repeat.wr_delay_first)-flags  FLG_SET ||
 	field_by_value(repeat.wr_delay_decrement)-flags  FLG_SET ||
@@ -200,6 +208,70 @@ mouse_put_values(int fd)
 }
 
 static void
+mouse_put_calibration(int fd)
+{
+	struct wsmouse_calibcoords tmp;
+	int i;
+	const char *p;
+	char *q;
+
+	/* Fetch current values into the temporary structure. */
+	if (ioctl(fd, WSMOUSEIO_GCALIBCOORDS, tmp)  0)
+		err(EXIT_FAILURE, WSMOUSEIO_GCALIBCOORDS);
+
+	/* Overwrite the desired values in the temporary structure. */
+	if (field_by_value(calibration.minx)-flags  FLG_SET)
+		tmp.minx = calibration.minx;
+	if (field_by_value(calibration.miny)-flags  FLG_SET)
+		tmp.miny = calibration.miny;
+	if (field_by_value(calibration.maxx)-flags  FLG_SET)
+		tmp.maxx = calibration.maxx;
+	if (field_by_value(calibration.maxy)-flags  FLG_SET)
+		tmp.maxy = calibration.maxy;
+	if (field_by_value(calibration_samples)-flags  FLG_SET) {
+		p = calibration_samples;
+		for (i = 0; p[0] != '\0'  i  WSMOUSE_CALIBCOORDS_MAX; i++) {
+			tmp.samples[i].rawx = strtol(p, q, 0);
+			if (*q != ',')
+break;
+			p = q + 1;
+			tmp.samples[i].rawy = strtol(p, q, 0);
+			if (*q != ',')
+break;
+			p = q + 1;
+			tmp.samples[i].x = strtol(p, q, 0);
+			if (*q != ',')
+break;
+			p = q + 1;
+			tmp.samples[i].y = strtol(p, q, 0);
+			p = q + 1;
+			if (*q != '\0'  *q != ':')
+break;
+		}
+		if (p[0] != '\0')
+			errx(EXIT_FAILURE, %s: invalid calibration data,
+	calibration_samples);
+		tmp.samplelen = i;
+	}
+
+	/* Set new values for calibrating events. */
+	if (ioctl(fd, WSMOUSEIO_SCALIBCOORDS, tmp)  0)
+		err(EXIT_FAILURE, WSMOUSEIO_SCALIBCOORDS);
+
+	/* Now print what changed. */
+	if (field_by_value(calibration.minx)-flags  FLG_SET)
+		pr_field(field_by_value(calibration.minx),  - );
+	if (field_by_value(calibration.miny)-flags  FLG_SET)
+		pr_field(field_by_value(calibration.miny),  - );
+	if (field_by_value(calibration.maxx)-flags  FLG_SET)
+		pr_field(field_by_value(calibration.maxx),  - );
+	if (field_by_value(calibration.maxy)-flags  FLG_SET)
+		pr_field(field_by_value(calibration.maxy),  - );
+	if (field_by_value(calibration_samples)-flags  FLG_SET)
+		pr_field(field_by_value(calibration_samples),  - );
+}
+
+static void
 mouse_put_repeat(int fd)
 {
 	struct wsmouse_repeat tmp;



CVS commit: src/sys/dev/sdmmc

2012-12-23 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Dec 24 05:43:34 UTC 2012

Modified Files:
src/sys/dev/sdmmc: sdhcreg.h

Log Message:
Add a few more register bits from SDHCI 3.0.
Also, add comment to denote an ESDHC bit.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/sdmmc/sdhcreg.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/sdmmc/sdhcreg.h
diff -u src/sys/dev/sdmmc/sdhcreg.h:1.10 src/sys/dev/sdmmc/sdhcreg.h:1.11
--- src/sys/dev/sdmmc/sdhcreg.h:1.10	Mon Oct 15 13:38:52 2012
+++ src/sys/dev/sdmmc/sdhcreg.h	Mon Dec 24 05:43:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhcreg.h,v 1.10 2012/10/15 13:38:52 jakllsch Exp $	*/
+/*	$NetBSD: sdhcreg.h,v 1.11 2012/12/24 05:43:34 jakllsch Exp $	*/
 /*	$OpenBSD: sdhcreg.h,v 1.4 2006/07/30 17:20:40 fgsch Exp $	*/
 
 /*
@@ -74,6 +74,7 @@
 #define  SDHC_CMD_INHIBIT_CMD		(10)
 #define  SDHC_CMD_INHIBIT_MASK		0x0003
 #define SDHC_HOST_CTL			0x28
+#define  SDHC_8BIT_MODE			(15)
 #define  SDHC_HIGH_SPEED		(12)
 #define  SDHC_ESDHC_8BIT_MODE		(12)	/* eSDHC */
 #define  SDHC_4BIT_MODE			(11)
@@ -101,7 +102,7 @@
 #define SDHC_TIMEOUT_CTL		0x2e
 #define  SDHC_TIMEOUT_MAX		0x0e
 #define SDHC_SOFTWARE_RESET		0x2f
-#define  SDHC_INIT_ACTIVE		(13)
+#define  SDHC_INIT_ACTIVE		(13)	/* ESDHC */
 #define  SDHC_RESET_MASK		0x5
 #define  SDHC_RESET_DAT			(12)
 #define  SDHC_RESET_CMD			(11)
@@ -138,11 +139,18 @@
 #define  SDHC_EINTR_SIGNAL_MASK		0x01ff	/* excluding vendor signals */
 #define SDHC_CMD12_ERROR_STATUS		0x3c
 #define SDHC_CAPABILITIES		0x40
+#define  SDHC_SHARED_BUS_SLOT		(131)
+#define  SDHC_EMBEDDED_SLOT		(130)
+#define  SDHC_ASYNC_INTR		(129)
+#define  SDHC_64BIT_SYS_BUS		(128)
 #define  SDHC_VOLTAGE_SUPP_1_8V		(126)
 #define  SDHC_VOLTAGE_SUPP_3_0V		(125)
 #define  SDHC_VOLTAGE_SUPP_3_3V		(124)
 #define  SDHC_DMA_SUPPORT		(122)
 #define  SDHC_HIGH_SPEED_SUPP		(121)
+#define  SDHC_ADMA1_SUPP		(120)
+#define  SDHC_ADMA2_SUPP		(119)
+#define  SDHC_8BIT_SUPP			(118)
 #define  SDHC_MAX_BLK_LEN_512		0
 #define  SDHC_MAX_BLK_LEN_1024		1
 #define  SDHC_MAX_BLK_LEN_2048		2



CVS commit: src/sys/dev/sdmmc

2012-12-23 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Dec 24 06:09:50 UTC 2012

Modified Files:
src/sys/dev/sdmmc: sdhc.c

Log Message:
SDHC_VOLTAGE_SUPP_1_8V is only valid in the presence of SDHC_EMBEDDED_SLOT.
Fixes probing of full-size 1GB Toshiba card made in 2008 that fails to
respond with a 1.8V supply.  (JMB389 (in TS-RDF1) host claims
SDHC_VOLTAGE_SUPP_1_8V but does not claim SDHC_EMBEDDED_SLOT.)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/sdmmc/sdhc.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/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.39 src/sys/dev/sdmmc/sdhc.c:1.40
--- src/sys/dev/sdmmc/sdhc.c:1.39	Sun Dec 23 22:33:09 2012
+++ src/sys/dev/sdmmc/sdhc.c	Mon Dec 24 06:09:50 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.39 2012/12/23 22:33:09 jakllsch Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.40 2012/12/24 06:09:50 jakllsch Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sdhc.c,v 1.39 2012/12/23 22:33:09 jakllsch Exp $);
+__KERNEL_RCSID(0, $NetBSD: sdhc.c,v 1.40 2012/12/24 06:09:50 jakllsch Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_sdmmc.h
@@ -350,7 +350,8 @@ sdhc_host_found(struct sdhc_softc *sc, b
 	/*
 	 * Determine SD bus voltage levels supported by the controller.
 	 */
-	if (ISSET(caps, SDHC_VOLTAGE_SUPP_1_8V)) {
+	if (ISSET(caps, SDHC_EMBEDDED_SLOT) 
+	ISSET(caps, SDHC_VOLTAGE_SUPP_1_8V)) {
 		SET(hp-ocr, MMC_OCR_1_7V_1_8V | MMC_OCR_1_8V_1_9V);
 	}
 	if (ISSET(caps, SDHC_VOLTAGE_SUPP_3_0V)) {



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

2012-12-23 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Dec 24 06:28:55 UTC 2012

Modified Files:
src/sys/arch/arm/omap: omap2_obio.c

Log Message:
Add gpio6 to critical_devs[].  This required by some boards.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/omap/omap2_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/arm/omap/omap2_obio.c
diff -u src/sys/arch/arm/omap/omap2_obio.c:1.17 src/sys/arch/arm/omap/omap2_obio.c:1.18
--- src/sys/arch/arm/omap/omap2_obio.c:1.17	Tue Dec 11 19:18:56 2012
+++ src/sys/arch/arm/omap/omap2_obio.c	Mon Dec 24 06:28:55 2012
@@ -1,7 +1,7 @@
-/*	$Id: omap2_obio.c,v 1.17 2012/12/11 19:18:56 riastradh Exp $	*/
+/*	$Id: omap2_obio.c,v 1.18 2012/12/24 06:28:55 kiyohara Exp $	*/
 
 /* adapted from: */
-/*	$NetBSD: omap2_obio.c,v 1.17 2012/12/11 19:18:56 riastradh Exp $ */
+/*	$NetBSD: omap2_obio.c,v 1.18 2012/12/24 06:28:55 kiyohara Exp $ */
 
 
 /*
@@ -103,7 +103,7 @@
 
 #include opt_omap.h
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: omap2_obio.c,v 1.17 2012/12/11 19:18:56 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: omap2_obio.c,v 1.18 2012/12/24 06:28:55 kiyohara Exp $);
 
 #include locators.h
 #include obio.h
@@ -375,6 +375,9 @@ static const struct {
 #if defined(GPIO5_BASE)
 	{ .name = gpio5, .addr = GPIO5_BASE, .required = false },
 #endif
+#if defined(GPIO6_BASE)
+	{ .name = gpio6, .addr = GPIO6_BASE, .required = false },
+#endif
 #if 0
 	{ .name = dmac, .addr = DMAC_BASE, .required = true },
 #endif



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

2012-12-23 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Dec 24 06:41:02 UTC 2012

Modified Files:
src/sys/arch/arm/omap: omap3_ehci.c

Log Message:
Don't wait DPLL5 lock, if set to automatic mode.  It is locked by 120 MHz
being supplied.
Also enable EN_USBHOST2(120MHz) in usbhost_init().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/omap3_ehci.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/omap/omap3_ehci.c
diff -u src/sys/arch/arm/omap/omap3_ehci.c:1.5 src/sys/arch/arm/omap/omap3_ehci.c:1.6
--- src/sys/arch/arm/omap/omap3_ehci.c:1.5	Wed Dec 12 00:33:45 2012
+++ src/sys/arch/arm/omap/omap3_ehci.c	Mon Dec 24 06:41:02 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: omap3_ehci.c,v 1.5 2012/12/12 00:33:45 matt Exp $ */
+/* $NetBSD: omap3_ehci.c,v 1.6 2012/12/24 06:41:02 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2010-2012 Jared D. McNeill jmcne...@invisible.ca
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: omap3_ehci.c,v 1.5 2012/12/12 00:33:45 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: omap3_ehci.c,v 1.6 2012/12/24 06:41:02 kiyohara Exp $);
 
 #include locators.h
 
@@ -97,7 +97,7 @@ __KERNEL_RCSID(0, $NetBSD: omap3_ehci.c
 /*  USBHOST_CM registers */
 #define CM_FCLKEN_USBHOST	0x00
 #define  EN_USBHOST1		 1	/* USB HOST 48 MHz clock enable */
-#define  EN_USBHOST2		 2	/* USB HOST 1280 MHz clock enable */
+#define  EN_USBHOST2		 2	/* USB HOST 120 MHz clock enable */
 #define CM_ICLKEN_USBHOST	0x10
 #define  EN_USBHOST		 1	/* USB HOST clock enable */
 #define CM_IDLEST_USBHOST	0x20
@@ -429,8 +429,8 @@ dpll5_init(struct omap3_ehci_softc *sc)
 {
 	bus_space_tag_t iot = sc-sc.iot;
 	bus_space_handle_t ioh;
-	uint32_t m, n, m2, v;
-	int retry = 1000, err;
+	uint32_t m, n, m2;
+	int err;
 
 	if (sc-sc_dpll5.m == 0 || sc-sc_dpll5.n == 0 || sc-sc_dpll5.m2 == 0)
 		return;
@@ -462,13 +462,6 @@ dpll5_init(struct omap3_ehci_softc *sc)
 	/* Put DPLL5 into low power stop mode when the 120MHz clock is not required (restarted automatically) */
 	bus_space_write_4(iot, ioh, CM_AUTOIDLE2_PLL, AUTO_PERIPH2_DPLL);
 
-	/* Wait for DPLL5 lock */
-	while (((v = bus_space_read_4(iot, ioh, CM_IDLEST2_CKGEN))  ST_PERIPH2_CLK) == 0  --retry  0) {
-		delay(100);
-	}
-	if (retry == 0)
-		printf(%s: timeout\n, __func__);
-
 	bus_space_unmap(iot, ioh, CCR_CM_SIZE);
 }
 
@@ -490,9 +483,9 @@ usbhost_init(struct omap3_ehci_softc *sc
 
 r = bus_space_read_4(iot, ioh, CM_FCLKEN_USBHOST);
 if (enable)
-r |= EN_USBHOST1;
+r |= (EN_USBHOST1 | EN_USBHOST2);
 else
-r = ~EN_USBHOST1;
+r = ~(EN_USBHOST1 | EN_USBHOST2);
 bus_space_write_4(iot, ioh, CM_FCLKEN_USBHOST, r);
 
 r = bus_space_read_4(iot, ioh, CM_ICLKEN_USBHOST);



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

2012-12-23 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Dec 24 06:49:41 UTC 2012

Modified Files:
src/sys/arch/evbarm/gumstix: gumstixreg.h

Log Message:
Statically map of devices moves to 0xc000 from 0x9000.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/gumstix/gumstixreg.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/gumstix/gumstixreg.h
diff -u src/sys/arch/evbarm/gumstix/gumstixreg.h:1.6 src/sys/arch/evbarm/gumstix/gumstixreg.h:1.7
--- src/sys/arch/evbarm/gumstix/gumstixreg.h:1.6	Sat Aug 28 04:46:24 2010
+++ src/sys/arch/evbarm/gumstix/gumstixreg.h	Mon Dec 24 06:49:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstixreg.h,v 1.6 2010/08/28 04:46:24 kiyohara Exp $  */
+/*	$NetBSD: gumstixreg.h,v 1.7 2012/12/24 06:49:41 kiyohara Exp $  */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -47,8 +47,8 @@
 #define GUMSTIX_HWUART_VBASE		0xfd60
 #define GUMSTIX_LCDC_VBASE		0xfd70
 
-#define OVERO_L4_PERIPHERAL_VBASE	0x9000
-#define OVERO_GPMC_VBASE		0x9010
+#define OVERO_L4_PERIPHERAL_VBASE	0xc000
+#define OVERO_GPMC_VBASE		0xc010
 
 
 #define ioreg_read(a)		(*(volatile unsigned *)(a))



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

2012-12-23 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Dec 24 06:50:35 UTC 2012

Modified Files:
src/sys/arch/evbarm/gumstix: gxio.c

Log Message:
Add more comment.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/gumstix/gxio.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/gumstix/gxio.c
diff -u src/sys/arch/evbarm/gumstix/gxio.c:1.19 src/sys/arch/evbarm/gumstix/gxio.c:1.20
--- src/sys/arch/evbarm/gumstix/gxio.c:1.19	Wed Dec 12 19:47:44 2012
+++ src/sys/arch/evbarm/gumstix/gxio.c	Mon Dec 24 06:50:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.19 2012/12/12 19:47:44 matt Exp $ */
+/*	$NetBSD: gxio.c,v 1.20 2012/12/24 06:50:35 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gxio.c,v 1.19 2012/12/12 19:47:44 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: gxio.c,v 1.20 2012/12/24 06:50:35 kiyohara Exp $);
 
 #include opt_cputypes.h
 #include opt_gumstix.h
@@ -597,6 +597,10 @@ eth0_config(void)
 
 	/*
 	 * ETH0 connects via CS5.  It use GPIO 176 for IRQ.
+	 * Also GPIO 64 is NRESET.
+	 *
+	 * Basically use current settings by U-Boot.
+	 * However remap physical address to configured address.
 	 */
 
 	while (cf-cf_name != NULL) {
@@ -627,6 +631,9 @@ eth1_config(void)
 
 	/*
 	 * ETH1 connects via CS4.  It use GPIO 65 for IRQ.
+	 *
+	 * Basically use current settings by U-Boot.
+	 * However remap physical address to configured address.
 	 */
 
 	while (cf-cf_name != NULL) {



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

2012-12-23 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Dec 24 06:53:26 UTC 2012

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_machdep.c

Log Message:
Set some properties for ehci.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/evbarm/gumstix/gumstix_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/gumstix/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.45 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.46
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.45	Wed Dec 12 19:47:44 2012
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Mon Dec 24 06:53:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.45 2012/12/12 19:47:44 matt Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.46 2012/12/24 06:53:26 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -549,7 +549,7 @@ initarm(void *arg)
 	kgdb_port_init();
 #endif
 
-/*
+	/*
 	 * Examine the boot args string for options we need to know about
 	 * now.
 	 */
@@ -652,7 +652,7 @@ initarm(void *arg)
 
 #ifdef VERBOSE_INIT_ARM
 	printf(freestart = 0x%08lx, free_pages = %d (0x%08x)\n,
-	   physical_freestart, free_pages, free_pages);
+	physical_freestart, free_pages, free_pages);
 #endif
 
 	/* Define a macro to simplify memory allocation */
@@ -867,7 +867,7 @@ initarm(void *arg)
 	/* Switch tables */
 #ifdef VERBOSE_INIT_ARM
 	printf(freestart = 0x%08lx, free_pages = %d (0x%x)\n,
-	   physical_freestart, free_pages, free_pages);
+	physical_freestart, free_pages, free_pages);
 	printf(switching to new L1 page table  @%#lx..., kernel_l1pt.pv_pa);
 #endif
 
@@ -1329,19 +1329,32 @@ kgdb_port_init(void)
 static void
 gumstix_device_register(device_t dev, void *aux)
 {
+	prop_dictionary_t dict = device_properties(dev);
 
+	if (device_is_a(dev, ehci)) {
+		prop_dictionary_set_cstring(dict, port0-mode, none);
+		prop_dictionary_set_cstring(dict, port1-mode, phy);
+		prop_dictionary_set_cstring(dict, port2-mode, none);
+		prop_dictionary_set_bool(dict, phy-reset, true);
+		prop_dictionary_set_int16(dict, port0-gpio, -1);
+		prop_dictionary_set_int16(dict, port1-gpio, 183);
+		prop_dictionary_set_int16(dict, port2-gpio, -1);
+		prop_dictionary_set_uint16(dict, dpll5-m, 120);
+		prop_dictionary_set_uint16(dict, dpll5-n, 12);
+		prop_dictionary_set_uint16(dict, dpll5-m2, 1);
+	}
 	if (device_is_a(dev, ohci)) {
-		if (prop_dictionary_set_bool(device_properties(dev),
+		if (prop_dictionary_set_bool(dict,
 		Ganged-power-mask-on-port1, 1) == false) {
 			printf(WARNING: unable to set power-mask for port1
 			 property for %s\n, device_xname(dev));
 		}
-		if (prop_dictionary_set_bool(device_properties(dev),
+		if (prop_dictionary_set_bool(dict,
 		Ganged-power-mask-on-port2, 1) == false) {
 			printf(WARNING: unable to set power-mask for port2
 			 property for %s\n, device_xname(dev));
 		}
-		if (prop_dictionary_set_bool(device_properties(dev),
+		if (prop_dictionary_set_bool(dict,
 		Ganged-power-mask-on-port3, 1) == false) {
 			printf(WARNING: unable to set power-mask for port3
 			 property for %s\n, device_xname(dev));



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

2012-12-23 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Dec 24 07:05:24 UTC 2012

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

Log Message:
Enable ehci and umass.  (tested only Chestnut43)
Add some comment-outed devices.
Indent and reorder.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/evbarm/conf/OVERO

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/OVERO
diff -u src/sys/arch/evbarm/conf/OVERO:1.20 src/sys/arch/evbarm/conf/OVERO:1.21
--- src/sys/arch/evbarm/conf/OVERO:1.20	Sat Dec  8 07:05:23 2012
+++ src/sys/arch/evbarm/conf/OVERO	Mon Dec 24 07:05:24 2012
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: OVERO,v 1.20 2012/12/08 07:05:23 matt Exp $
+#	$NetBSD: OVERO,v 1.21 2012/12/24 07:05:24 kiyohara Exp $
 #
 #	OVERO -- Gumstix. Inc. Overo platforms kernel
 #
@@ -188,42 +188,42 @@ omapgpio5	at obio2 addr 0x49058000 size 
 
 gpio*		at omapgpio?
 
+# I2C Controller
+#omapiic0	at obio0 addr 0x4807 size 0x80 intr 56
+#omapiic1	at obio0 addr 0x4806 size 0x80 intr 61
+
+#iic*		at omapiic?
+
+# Integrated Power Management/Audio Codec
+#gaia*		at iic? addr 0x48..0x4b
+
 # On-board 16550 UARTs
 com0		at obio2 addr 0x4902 intr 74 mult 4	# UART3 (console)
 options CONSADDR=0x4902, CONSPEED=115200
+#com1		at obio0 addr 0x4806c000 intr 73 mult 4	# UART2 (bluetooth)
 
 # Operating System Timer
-omapmputmr0	at obio2 addr 0x49032000 intr 38	# GP Timer 2
+omapmputmr0	at obio2 addr 0x49032000 intr 38		# GP Timer 2
 # Statistics Timer
-omapmputmr1	at obio2 addr 0x49034000 intr 39	# GP Timer 3
+omapmputmr1	at obio2 addr 0x49034000 intr 39		# GP Timer 3
 # Microtime Reference Timer
-omapmputmr2	at obio2 addr 0x49036000 intr 40	# GP Timer 4
+omapmputmr2	at obio2 addr 0x49036000 intr 40		# GP Timer 4
 options OMAP_MPU_TIMER_CLOCK_FREQ=1200
 
 # Watchdog timers
-#omapwdt32k*	at obio2 addr 0x4903 size 0x0800	# WDT3
-#omapwdt32k*	at obio1 addr 0x4830c000 size 0x0800	# WDT1
-omapwdt32k*	at obio1 addr 0x48314000 size 0x0800	# WDT2
+omapwdt32k*	at obio1 addr 0x48314000 size 0x0800		# WDT2
+#omapwdt32k*	at obio2 addr 0x4903 size 0x0800		# WDT3
 
 # Power, Reset and Clock Management
-prcm*		at obio1 addr 0x48306000 size 0x2000	# PRM Module
+prcm*		at obio1 addr 0x48306000 size 0x2000		# PRM Module
 
 # SDHC controllers
 sdhc0		at obio0 addr 0x4809c000 size 0x0400 intr 83
-#sdhc1		at obio0 addr 0x480b4000 size 0x0400 intr 86	# Wifi
+#sdhc1		at obio0 addr 0x480b4000 size 0x0400 intr 86 # Wifi
 
-sdmmc*		at sdhc?			# SD/MMC bus
+sdmmc*		at sdhc?	# SD/MMC bus
 ld*		at sdmmc?
 
-# On-board USB
-#ehci*		at obio0 addr 0x48064800 size 0x0400 intr 77
-#ohci*		at obio0 addr 0x48064400 size 0x0400 intr 76
-#usb*		at ohci?
-#uhub*		at usb?
-##umass*		at uhub? port ? configuration ? interface ?
-##wd*		at umass?
-#axe*		at uhub? port ? configuration ? interface ?
-
 # Hardware clocking and power management
 
 options		HWCLOCK
@@ -233,11 +233,49 @@ options		OMAP_CK_REF_SPEED=1200
 # overo expantion boards
 
 # SMSC LAN9221
-smsh0	at gpmc? addr 0x0100 intr 272	# Tobi, Chestnut43
-smsh1	at gpmc? addr 0x0200 intr 161	# Tobi-Duo
+smsh0		at gpmc? addr 0x0100 intr 272	# Tobi, Chestnut43
+smsh1		at gpmc? addr 0x0200 intr 161	# Tobi-Duo
 
 # MII/PHY support
-ukphy*	at mii? phy ?# smsh(4) internal PHY
+ukphy*		at mii? phy ?# smsh(4) internal PHY
+
+# LCD/DVI-D
+#omapfb* 	at obio0 addr 0x4805 size 0x1	# Chestnut*, Palo*,
+			# Gallop* (LCD)
+			# Tobi, Summit (DVI-D)
+
+# make sure the console display is always wsdisplay0
+#wsdisplay0	at wsemuldisplaydev? console 1
+#wsdisplay*	at wsemuldisplaydev?
+
+# various options for wscons - we try to look as much like a standard
+# sun console as possible
+options 	WSEMUL_VT100			# sun terminal emulation
+options 	WS_DEFAULT_FG=WSCOL_BLACK
+options 	WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
+options 	WS_KERNEL_FG=WSCOL_GREEN
+options 	WS_KERNEL_BG=WSCOL_LIGHT_WHITE
+options 	WSDISPLAY_COMPAT_USL		# VT handling
+options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
+options 	WSDISPLAY_DEFAULTSCREENS=4
+options 	FONT_QVSS8x15
+#options 	FONT_GALLANT12x22		# the console font
+
+# USB Host
+ehci*		at obio0 addr 0x48064800 size 0x0400 intr 77
+			# Chestnut*, Palo*,
+			# RoboVero, Summit,
+			# Tobi, TurtleCore
+usb*		at ehci?
+
+# USB Hubs
+uhub*		at usb?
+uhub*		at uhub? port ?
+
+umass*		at uhub? port ?
+scsibus*	at scsi?
+sd*		at scsibus? target ? lun ?
+wd*		at umass?
 
 # Pseudo-Devices
 
@@ -272,14 +310,14 @@ pseudo-device	loop			# network loopback
 #pseudo-device	sl			# Serial Line IP
 #pseudo-device	strip			# Starmode Radio IP (Metricom)
 #pseudo-device	irframetty		# IrDA frame line discipline
-#pseudo-device	tap			# virtual Ethernet
+pseudo-device	tap			# virtual Ethernet
 #pseudo-device	tun			# network tunneling over tty
 #pseudo-device	gre			# generic L3 over IP tunnel