CVS commit: [matt-nb5-mips64] src/sys/dev/i2c

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:48:52 UTC 2014

Modified Files:
src/sys/dev/i2c [matt-nb5-mips64]: files.i2c
Added Files:
src/sys/dev/i2c [matt-nb5-mips64]: gttwsi_core.c gttwsireg.h
gttwsivar.h

Log Message:
Merge mvi2c from HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.10.1 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/dev/i2c/gttwsi_core.c \
src/sys/dev/i2c/gttwsireg.h src/sys/dev/i2c/gttwsivar.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/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.23 src/sys/dev/i2c/files.i2c:1.23.10.1
--- src/sys/dev/i2c/files.i2c:1.23	Thu Oct 30 12:52:46 2008
+++ src/sys/dev/i2c/files.i2c	Mon Mar 24 18:48:52 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.23 2008/10/30 12:52:46 nakayama Exp $
+#	$NetBSD: files.i2c,v 1.23.10.1 2014/03/24 18:48:52 matt Exp $
 
 defflag	opt_i2cbus.hI2C_SCAN
 define	i2cbus { }
@@ -14,6 +14,12 @@ define	i2c_bitbang
 file	dev/i2c/i2c_bitbang.c			i2c_bitbang
 
 #
+# I2C master devices
+#
+define	mvi2c
+file	dev/i2c/gttwsi_core.c			mvi2c
+
+#
 # I2C client devices
 #
 

Added files:

Index: src/sys/dev/i2c/gttwsi_core.c
diff -u /dev/null src/sys/dev/i2c/gttwsi_core.c:1.1.2.2
--- /dev/null	Mon Mar 24 18:48:52 2014
+++ src/sys/dev/i2c/gttwsi_core.c	Mon Mar 24 18:48:52 2014
@@ -0,0 +1,353 @@
+/*	$NetBSD: gttwsi_core.c,v 1.1.2.2 2014/03/24 18:48:52 matt Exp $	*/
+/*
+ * Copyright (c) 2008 Eiji Kawauchi.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 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
+ *  Eiji Kawauchi.
+ * 4. The name of the author may not 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 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) 2005 Brocade Communcations, inc.
+ * All rights reserved.
+ *
+ * Written by Matt Thomas for Brocade Communcations, 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. The name of Brocade Communications, Inc. may not be used to endorse
+ *or promote products derived from this software without specific prior
+ *written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BROCADE COMMUNICATIONS, 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 EITHER BROCADE COMMUNICATIONS, 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.
+ */
+//#define TWSI_DEBUG
+
+/*
+ * Marvell Two-Wire Serial Interface (aka I2C) 

CVS commit: [matt-nb5-mips64] src/sys/dev/i2c

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:48:52 UTC 2014

Modified Files:
src/sys/dev/i2c [matt-nb5-mips64]: files.i2c
Added Files:
src/sys/dev/i2c [matt-nb5-mips64]: gttwsi_core.c gttwsireg.h
gttwsivar.h

Log Message:
Merge mvi2c from HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.10.1 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/dev/i2c/gttwsi_core.c \
src/sys/dev/i2c/gttwsireg.h src/sys/dev/i2c/gttwsivar.h

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



CVS commit: [matt-nb5-mips64] src/sys/dev/i2c

2013-11-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov  5 18:40:22 UTC 2013

Modified Files:
src/sys/dev/i2c [matt-nb5-mips64]: spdmem.c

Log Message:
Deal with larger DIMMs


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.8.1 src/sys/dev/i2c/spdmem.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/i2c/spdmem.c
diff -u src/sys/dev/i2c/spdmem.c:1.11 src/sys/dev/i2c/spdmem.c:1.11.8.1
--- src/sys/dev/i2c/spdmem.c:1.11	Sun Sep 28 12:59:54 2008
+++ src/sys/dev/i2c/spdmem.c	Tue Nov  5 18:40:22 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmem.c,v 1.11 2008/09/28 12:59:54 pgoyette Exp $ */
+/* $NetBSD: spdmem.c,v 1.11.8.1 2013/11/05 18:40:22 matt Exp $ */
 
 /*
  * Copyright (c) 2007 Nicolas Joly
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: spdmem.c,v 1.11 2008/09/28 12:59:54 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: spdmem.c,v 1.11.8.1 2013/11/05 18:40:22 matt Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -227,7 +227,7 @@ spdmem_attach(device_t parent, device_t 
 	const char *rambus_rev = Reserved;
 	int num_banks = 0;
 	int per_chip = 0;
-	int dimm_size, cycle_time, d_clk, p_clk, bits;
+	unsigned int dimm_size, cycle_time, d_clk, p_clk, bits;
 	int i;
 	unsigned int spd_len, spd_size;
 	unsigned int tAA, tRCD, tRP, tRAS;
@@ -420,9 +420,12 @@ spdmem_attach(device_t parent, device_t 
 	}
 	if (IS_RAMBUS_TYPE ||
 	(num_banks = 8  per_chip = 8  dimm_size  0 
-	 dimm_size = 12)) {
+	 dimm_size = 18)) {
 		dimm_size = (1  dimm_size) * num_banks * per_chip;
-		aprint_normal(, %dMB, dimm_size);
+		if (dimm_size = 1024)
+			aprint_normal(, %uGB, dimm_size / 1024);
+		else
+			aprint_normal(, %uMB, dimm_size);
 		if (node != NULL)
 			sysctl_createv(NULL, 0, NULL, NULL,
 			CTLFLAG_IMMEDIATE,
@@ -545,7 +548,7 @@ spdmem_attach(device_t parent, device_t 
 p_clk += 50;
 			p_clk -= p_clk % 100;
 		}
-		aprint_normal(, %dMHz (%s-%d)\n,
+		aprint_normal(, %uMHz (%s-%u)\n,
 			  d_clk, ddr_type_string, p_clk);
 		if (node != NULL)
 			sysctl_createv(NULL, 0, NULL, NULL,



CVS commit: [matt-nb5-mips64] src/sys/dev/i2c

2013-11-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov  5 18:40:22 UTC 2013

Modified Files:
src/sys/dev/i2c [matt-nb5-mips64]: spdmem.c

Log Message:
Deal with larger DIMMs


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.8.1 src/sys/dev/i2c/spdmem.c

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