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

2020-10-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Oct  1 08:27:20 UTC 2020

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

Log Message:
Fix evbarmv5 build


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 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.67 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.68
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.67	Tue Sep 29 19:58:50 2020
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Thu Oct  1 08:27:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.67 2020/09/29 19:58:50 jmcneill Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.68 2020/10/01 08:27:20 skrll Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -152,10 +152,10 @@
 #include "arml2cc.h"
 #endif
 #include "prcm.h"
-#endif
 
 #include "arma9tmr.h"
 #include "armgtmr.h"
+#endif
 
 #include 
 #include 



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

2018-03-13 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Tue Mar 13 06:19:30 UTC 2018

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

Log Message:
fix compile error (unused variables)


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 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.25 src/sys/arch/evbarm/gumstix/gxio.c:1.26
--- src/sys/arch/evbarm/gumstix/gxio.c:1.25	Sun Jan 22 17:19:32 2017
+++ src/sys/arch/evbarm/gumstix/gxio.c	Tue Mar 13 06:19:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.25 2017/01/22 17:19:32 christos Exp $ */
+/*	$NetBSD: gxio.c,v 1.26 2018/03/13 06:19:30 ryo Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.25 2017/01/22 17:19:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.26 2018/03/13 06:19:30 ryo Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_gumstix.h"
@@ -241,11 +241,14 @@ static int gxio_omap_mux_config_address(
 static void gxio_omap_gpio_config(const struct omap_gpio_conf[]);
 void gxio_omap_gpio_write(int, int);
 
+#if defined(OVERO)
 static const struct omap_mux_conf overo_mux_i2c3_conf[] = {
 	{ 0x1c2, MUXMODE(0) | INPUTENABLE },		/* i2c3_scl */
 	{ 0x1c4, MUXMODE(0) | INPUTENABLE },		/* i2c3_sda */
 	{ -1 }
 };
+#endif
+#if defined(OVERO)
 static const struct omap_mux_conf overo_mux_mmchs2_conf[] = {
 	{ 0x158,	/* mmc2_clk */
 	  MUXMODE(0) | PULLUDENABLE | PULLTYPESELECT | INPUTENABLE },
@@ -261,6 +264,7 @@ static const struct omap_mux_conf overo_
 	  MUXMODE(0) | PULLUDENABLE | PULLTYPESELECT | INPUTENABLE },
 	{ -1 }
 };
+#endif
 #if defined(OVERO) 
 static const struct omap_mux_conf overo_mux_wireless_conf[] = {
 	{ 0x0b4, MUXMODE(4) },/* gpio_54:BT_nPOWERON*/



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

2017-03-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar  1 16:44:54 UTC 2017

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

Log Message:
Set xscale_cache_clean_addr appropriately and re-arrange default KVA
layout to allow direct map for all boards.

OVERO/DUOVERO/PEPPER aren't tested.

PR/52010: Regression: Gumstix Verdex is hanging in enabling cache + KASSERT 
ram_size


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 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.57 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.58
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.57	Thu Oct 20 09:53:08 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Wed Mar  1 16:44:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.57 2016/10/20 09:53:08 skrll Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.58 2017/03/01 16:44:54 skrll Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -206,13 +206,16 @@
 #endif
 
 /*
- * The range 0xc100 - 0xcfff is available for kernel VM space
- * Core-logic registers and I/O mappings occupy 0xfd00 - 0x
+ * The range 0xc100 - 0xfd00 is available for kernel VM space
+ * Core-logic registers and I/O mappings occupy
+ *
+ *0xfd00 - 0xfd80	on gumstix
+ *0xc000 - 0xc040	on overo, duovero and pepper
  */
 #ifndef KERNEL_VM_BASE
-#define	KERNEL_VM_BASE		0xc100
+#define	KERNEL_VM_BASE		0xc800
 #endif
-#define KERNEL_VM_SIZE		0x0f00
+#define KERNEL_VM_SIZE		0x3500
 
 BootConfig bootconfig;		/* Boot config storage */
 static char bootargs[MAX_BOOT_STRING];
@@ -487,6 +490,9 @@ initarm(void *arg)
 	 */
 
 #if defined(CPU_XSCALE)
+	extern vaddr_t xscale_cache_clean_addr;
+	xscale_cache_clean_addr = 0xff00U;
+
 	cpu_reset_address = NULL;
 #elif defined(OMAP2)
 	cpu_reset_address = omap_reset;



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

2017-01-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 22 17:19:32 UTC 2017

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

Log Message:
PR/51905: GXIO Expension boards arn't configured if GXIO_DEFAULT_EXPANSION
isn't defined. Fix a bunch of issues with the original code.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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.24 src/sys/arch/evbarm/gumstix/gxio.c:1.25
--- src/sys/arch/evbarm/gumstix/gxio.c:1.24	Fri Oct 28 15:00:48 2016
+++ src/sys/arch/evbarm/gumstix/gxio.c	Sun Jan 22 12:19:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.24 2016/10/28 19:00:48 christos Exp $ */
+/*	$NetBSD: gxio.c,v 1.25 2017/01/22 17:19:32 christos Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.24 2016/10/28 19:00:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.25 2017/01/22 17:19:32 christos Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_gumstix.h"
@@ -88,7 +88,7 @@ CFATTACH_DECL_NEW(gxio, sizeof(struct gx
 #endif
 
 void gxio_config(void);
-void gxio_config_expansion(char *);
+void gxio_config_expansion(const char *);
 #if defined(GUMSTIX)
 static void basix_config(void);
 static void cfstix_config(void);
@@ -662,48 +662,54 @@ gxio_config(void)
 }
 #endif
 
-void
-gxio_config_expansion(char *expansion)
+static int
+gxio_find_default_expansion(void)
 {
-	int i, d, s;
-
-	if (expansion == NULL) {
-		printf("not specified 'expansion=' in the boot args.\n");
-		s = -1;
-	} else {
-		for (i = 0; gxioconflist[i].name != NULL; i++)
-			if (strncasecmp(gxioconflist[i].name, expansion,
-	strlen(gxioconflist[i].name) + 1) == 0)
-break;
-		if (gxioconflist[i].name == NULL)
-			printf("unknown expansion specified: %s\n", expansion);
-		s = i;
-	}
 #ifdef GXIO_DEFAULT_EXPANSION
+	int i;
+
+	/* Find out the default expansion */
 	for (i = 0; gxioconflist[i].name != NULL; i++)
 		if (strncasecmp(gxioconflist[i].name, GXIO_DEFAULT_EXPANSION,
-	strlen(gxioconflist[i].name) + 1) == 0)
+		strlen(gxioconflist[i].name) + 1) == 0)
 			break;
-	d = i;
+	return gxioconflist[i].name == NULL ? -1 : i;
 #else
-	d = -1;
+	return -1;
 #endif
+}
+
+void
+gxio_config_expansion(const char *expansion)
+{
+	int i, d;
+
+	d = gxio_find_default_expansion();
+
+	/* Print information about expansions */
 	printf("supported expansions:\n");
 	for (i = 0; gxioconflist[i].name != NULL; i++)
-		printf("  %s%s\n",
-		gxioconflist[i].name,
+		printf("  %s%s\n", gxioconflist[i].name,
 		i == d ? " (DEFAULT)" : "");
 
-	if (s < 0 || gxioconflist[i].name == NULL) {
-#ifdef GXIO_DEFAULT_EXPANSION
-		expansion = __UNCONST(GXIO_DEFAULT_EXPANSION);
-#else
-		return;
-#endif
+	
+	if (expansion == NULL) {
+		printf("not specified 'expansion=' in the boot args.\n");
+		i = -1;
+	} else {
+		for (i = 0; gxioconflist[i].name != NULL; i++)
+			if (strncasecmp(gxioconflist[i].name, expansion,
+			strlen(gxioconflist[i].name) + 1) == 0)
+break;
+		if (gxioconflist[i].name == NULL) {
+			printf("unknown expansion specified: %s\n", expansion);
+			i = -1;
+		}
 	}
 
+	/* Do some magic stuff for PEPPER */
 #if defined(PEPPER)
-	if (s < 0) {
+	if (i < 0) {
 		struct pepper_board_id {
 			unsigned int device_vendor;
 #define GUMSTIX_PEPPER  0x3200	/* 1st gen */
@@ -730,10 +736,29 @@ gxio_config_expansion(char *expansion)
 	}
 #endif
 
-	printf("configure %s expansion (%s)\n",
-	(s < 0 || gxioconflist[i].name == NULL) ? "default" : "specified",
-	expansion);
-	gxioconflist[(s < 0 || gxioconflist[i].name == NULL) ? d : s].config();
+	/*
+	 * Now proceed to configure the default expansion if one was
+	 * specified (and found) or return.
+	 */
+	const char *toconfigure;
+	if (i < 0) {
+#ifdef GXIO_DEFAULT_EXPANSION
+		if (d == -1) {
+			printf("default expansion (%s) not found\n", 
+			GXIO_DEFAULT_EXPANSION);
+			return;
+		}
+		expansion = GXIO_DEFAULT_EXPANSION;
+		i = d;
+		toconfigure = "default";
+#else
+		return;
+#endif
+	} else
+		toconfigure = "specified";
+
+	printf("configure %s expansion (%s)\n", toconfigure, expansion);
+	gxioconflist[i].config();
 }
 
 



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

2017-01-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan  2 21:46:59 UTC 2017

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_start.S

Log Message:
Fix boot on Gumstix Verdex boards.

Reported by smesgr on port-arm


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/gumstix/gumstix_start.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/evbarm/gumstix/gumstix_start.S
diff -u src/sys/arch/evbarm/gumstix/gumstix_start.S:1.14 src/sys/arch/evbarm/gumstix/gumstix_start.S:1.15
--- src/sys/arch/evbarm/gumstix/gumstix_start.S:1.14	Sat Oct 15 15:27:18 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_start.S	Mon Jan  2 21:46:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_start.S,v 1.14 2016/10/15 15:27:18 kiyohara Exp $ */
+/*	$NetBSD: gumstix_start.S,v 1.15 2017/01/02 21:46:59 skrll Exp $ */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -71,7 +71,7 @@
 #include 
 #endif
 
-RCSID("$NetBSD: gumstix_start.S,v 1.14 2016/10/15 15:27:18 kiyohara Exp $")
+RCSID("$NetBSD: gumstix_start.S,v 1.15 2017/01/02 21:46:59 skrll Exp $")
 
 /*
  * CPWAIT -- Canonical method to wait for CP15 update.
@@ -212,6 +212,8 @@ _C_LABEL(gumstix_start):
 	cmp	r1, #0			/* Check MPIDR_MP (bit 31) */
 	orrlt	r1, r0, #TTBR_MPATTR
 	orrge	r1, r0, #TTBR_UPATTR
+#else
+	mov	r1, r0
 #endif
 	mcr	p15, 0, r1, c2, c0, 0	/* Set TTB */
 	mcr	p15, 0, r1, c8, c7, 0	/* Flush TLB */



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

2016-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 28 19:00:48 UTC 2016

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

Log Message:
sprinkle ifdef spices.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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.23 src/sys/arch/evbarm/gumstix/gxio.c:1.24
--- src/sys/arch/evbarm/gumstix/gxio.c:1.23	Tue Oct 18 10:39:52 2016
+++ src/sys/arch/evbarm/gumstix/gxio.c	Fri Oct 28 15:00:48 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.23 2016/10/18 14:39:52 kiyohara Exp $ */
+/*	$NetBSD: gxio.c,v 1.24 2016/10/28 19:00:48 christos Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.23 2016/10/18 14:39:52 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.24 2016/10/28 19:00:48 christos Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_gumstix.h"
@@ -261,6 +261,7 @@ static const struct omap_mux_conf overo_
 	  MUXMODE(0) | PULLUDENABLE | PULLTYPESELECT | INPUTENABLE },
 	{ -1 }
 };
+#if defined(OVERO) 
 static const struct omap_mux_conf overo_mux_wireless_conf[] = {
 	{ 0x0b4, MUXMODE(4) },/* gpio_54:BT_nPOWERON*/
 	{ 0x0bc, MUXMODE(4) | INPUTENABLE },		/* gpio_58: WIFI_IRQ */
@@ -269,6 +270,7 @@ static const struct omap_mux_conf overo_
 	{ -1 }
 };
 
+#elif defined(DUOVERO)
 static const struct omap_mux_conf duovero_mux_led_conf[] = {
 	{ 0x116, MUXMODE(3) },/* GPIO 122 */
 	{ -1 }
@@ -279,6 +281,7 @@ static const struct omap_mux_conf duover
 	{ -1 }
 };
 
+#elif defined(PEPPER)
 static const struct omap_mux_conf pepper_mux_led_conf[] = {
 	{ 0x850, MMODE(7) | PUDEN },			/* GPIO 52: Blue */
 	{ 0x854, MMODE(7) | PUDEN },			/* GPIO 53: Red */
@@ -301,6 +304,7 @@ static const struct omap_mux_conf pepper
 	{ 0x840, MMODE(7) | PUDEN },			/* GPIO 48: #Reset */
 	{ -1 }
 };
+#endif
 
 #endif
 



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

2016-10-19 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed Oct 19 14:07:22 UTC 2016

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

Log Message:
Remove white spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 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.55 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.56
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.55	Tue Oct 18 14:39:52 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Wed Oct 19 14:07:22 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.55 2016/10/18 14:39:52 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.56 2016/10/19 14:07:22 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -583,7 +583,7 @@ initarm(void *arg)
 #ifdef MULTIPROCESSOR
 	if (bus_space_map(iot, OMAP4_SCU_BASE, SCU_SIZE, 0, ) != 0)
 		panic("OMAP4_SCU_BASE map failed\n");
-arm_cpu_max =
+	arm_cpu_max =
 	1 + (bus_space_read_4(iot, ioh, SCU_CFG) & SCU_CFG_CPUMAX);
 #endif
 #endif
@@ -1067,7 +1067,7 @@ gumstix_device_register(device_t dev, vo
 			 * The iot mainbus supplies is completely wrong since
 			 * it scales addresses by 2.  The simpliest remedy is
 			 * to replace with our bus space used for the armcore
-			 * regisers (which armperiph uses). 
+			 * regisers (which armperiph uses).
 			 */
 			struct mainbus_attach_args * const mb = aux;
 			mb->mb_iot = _bs_tag;



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

2016-10-16 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Oct 16 23:07:31 UTC 2016

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

Log Message:
omap2_gpio_*() into #if - #endif.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 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.53 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.54
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.53	Sun Oct 16 13:54:28 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sun Oct 16 23:07:31 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.53 2016/10/16 13:54:28 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.54 2016/10/16 23:07:31 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -1164,11 +1164,13 @@ gumstix_device_register(device_t dev, vo
 		prop_dictionary_set_bool(dict, "dual-volt", dualvolt);
 	}
 	if (device_is_a(dev, "tifb")) {
+#if defined(OMAP2)
 		/* enable LCD */
 		omap2_gpio_ctl(59, GPIO_PIN_OUTPUT);
 		omap2_gpio_write(59, 0);	/* reset */
 		delay(100);
 		omap2_gpio_write(59, 1);
+#endif
 	}
 	if (device_is_a(dev, "tps65217pmic")) {
 #if defined(TI_AM335X)



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

2016-10-16 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Oct 16 13:54:28 UTC 2016

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

Log Message:
Remove not commited header-file and variable.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.21 -r1.22 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/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.52 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.53
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.52	Sat Oct 15 15:27:18 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sun Oct 16 13:54:28 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.52 2016/10/15 15:27:18 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.53 2016/10/16 13:54:28 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -192,7 +192,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -263,7 +262,6 @@ int comcnmode = CONMODE;
 static char console[16];
 #endif
 
-const struct tifb_panel_info *tifb_panel_info = NULL;
 /* Use TPS65217 White LED Driver */
 bool use_tps65217_wled = false;
 
@@ -1166,14 +1164,6 @@ gumstix_device_register(device_t dev, vo
 		prop_dictionary_set_bool(dict, "dual-volt", dualvolt);
 	}
 	if (device_is_a(dev, "tifb")) {
-		prop_data_t panel_info;
-
-		panel_info = prop_data_create_data_nocopy(tifb_panel_info,
-		sizeof(struct tifb_panel_info));
-		KASSERT(panel_info != NULL);
-		prop_dictionary_set(dict, "panel-info", panel_info);
-		prop_object_release(panel_info);
-
 		/* enable LCD */
 		omap2_gpio_ctl(59, GPIO_PIN_OUTPUT);
 		omap2_gpio_write(59, 0);	/* reset */

Index: src/sys/arch/evbarm/gumstix/gxio.c
diff -u src/sys/arch/evbarm/gumstix/gxio.c:1.21 src/sys/arch/evbarm/gumstix/gxio.c:1.22
--- src/sys/arch/evbarm/gumstix/gxio.c:1.21	Sat Oct 15 15:27:18 2016
+++ src/sys/arch/evbarm/gumstix/gxio.c	Sun Oct 16 13:54:28 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.21 2016/10/15 15:27:18 kiyohara Exp $ */
+/*	$NetBSD: gxio.c,v 1.22 2016/10/16 13:54:28 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.21 2016/10/15 15:27:18 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.22 2016/10/16 13:54:28 kiyohara Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_gumstix.h"
@@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.2
 #endif
 #endif
 #include 
-#include 
 #include 
 #if defined(CPU_XSCALE)
 #include 



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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 16:30:46 UTC 2016

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

Log Message:
Add map for DuoVero and Pepper.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 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.8 src/sys/arch/evbarm/gumstix/gumstixreg.h:1.9
--- src/sys/arch/evbarm/gumstix/gumstixreg.h:1.8	Thu Mar 31 14:33:17 2016
+++ src/sys/arch/evbarm/gumstix/gumstixreg.h	Sat Oct 15 16:30:46 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstixreg.h,v 1.8 2016/03/31 14:33:17 kiyohara Exp $  */
+/*	$NetBSD: gumstixreg.h,v 1.9 2016/10/15 16:30:46 kiyohara Exp $  */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -49,8 +49,16 @@
 
 #define OVERO_L4_CORE_VBASE		0xc000
 #define OVERO_L4_PERIPHERAL_VBASE	0xc010
-#define OVERO_GPMC_VBASE		0xc020
+#define OVERO_L4_WAKEUP_VBASE		0xc020
+#define OVERO_GPMC_VBASE		0xc030
 
+#define DUOVERO_L4_CM_VBASE		0xc000
+#define DUOVERO_L4_PERIPHERAL_VBASE	0xc010
+#define DUOVERO_L4_WAKEUP_VBASE		0xc040
+#define DUOVERO_GPMC_VBASE		0xc050
+
+#define PEPPER_PRCM_VBASE		0xc000
+#define PEPPER_L4_PERIPHERAL_VBASE	0xc010
 
 #define ioreg_read(a)		(*(volatile unsigned *)(a))
 #define ioreg_write(a,v)	(*(volatile unsigned *)(a)=(v))



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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:27:18 UTC 2016

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

Log Message:
Support Duovero and Pepper.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/gumstix/gumstix_start.S
cvs rdiff -u -r1.20 -r1.21 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/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.51 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.52
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.51	Thu Mar 31 14:33:17 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sat Oct 15 15:27:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.51 2016/03/31 14:33:17 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.52 2016/10/15 15:27:18 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -137,16 +137,21 @@
  * boards using RedBoot firmware.
  */
 
-#include "opt_evbarm_boardtype.h"
+#include "opt_com.h"
 #include "opt_cputypes.h"
+#include "opt_evbarm_boardtype.h"
 #include "opt_gumstix.h"
-#ifdef OVERO
+#include "opt_kgdb.h"
+#include "opt_multiprocessor.h"
+#include "opt_pmap_debug.h"
+#if defined(OVERO) || defined(DUOVERO) || defined(PEPPER)
 #include "opt_omap.h"
+
+#if defined(DUOVERO)
+#include "arml2cc.h"
+#endif
 #include "prcm.h"
 #endif
-#include "opt_kgdb.h"
-#include "opt_pmap_debug.h"
-#include "opt_com.h"
 
 #include 
 #include 
@@ -159,22 +164,35 @@
 #include 
 #include 
 #include 
+#include 
+
+#include 
 
 #include 
 
-#include 
+#include 	/* don't reorder */
+
+#include 		/* don't reorder */
 #include 
 #include 
 
 #include 
-#ifdef OVERO
-#include 
+#if NARML2CC > 0
+#include 
+#endif
+#include 
 #include 
+#include 
+#include 
+#include 
 #include 
-#include 
+#if defined(OVERO) || defined(DUOVERO) || defined(PEPPER)
+#include 		/* Must required "opt_omap.h" */
+#endif
+#include 
 #include 
 #include 
-#endif
+#include 
 #include 
 #include 
 #include 
@@ -207,8 +225,9 @@ uint32_t system_serial_low;
 /* Prototypes */
 #if defined(GUMSTIX)
 static void	read_system_serial(void);
-#elif defined(OVERO)
-static void	overo_reset(void);
+#endif
+#if defined(OMAP2)
+static void	omap_reset(void);
 static void	find_cpu_clock(void);
 #endif
 static void	process_kernel_args(int, char *[]);
@@ -226,7 +245,7 @@ bs_protos(bs_notimpl);
 #include 
 #endif
 
-#if defined(CPU_XSCALE_PXA250) || defined(CPU_XSCALE_PXA270)
+#if defined(CPU_XSCALE)
 #include "lcd.h"
 #endif
 
@@ -244,7 +263,11 @@ int comcnmode = CONMODE;
 static char console[16];
 #endif
 
-extern void gxio_config_pin(void);
+const struct tifb_panel_info *tifb_panel_info = NULL;
+/* Use TPS65217 White LED Driver */
+bool use_tps65217_wled = false;
+
+extern void gxio_config(void);
 extern void gxio_config_expansion(char *);
 
 
@@ -335,20 +358,27 @@ static const struct pmap_devmap gumstix_
 		PTE_NOCACHE,
 	},
 #elif defined(OVERO)
-	{
+	{	/* SCM, PRCM */
 		OVERO_L4_CORE_VBASE,
 		_A(OMAP3530_L4_CORE_BASE),
 		_S(L1_S_SIZE),		/* No need 16MB.  Use only first 1MB */
 		VM_PROT_READ | VM_PROT_WRITE,
 		PTE_NOCACHE
 	},
-	{
+	{	/* Console, GPIO[2-6] */
 		OVERO_L4_PERIPHERAL_VBASE,
 		_A(OMAP3530_L4_PERIPHERAL_BASE),
 		_S(OMAP3530_L4_PERIPHERAL_SIZE),
 		VM_PROT_READ | VM_PROT_WRITE,
 		PTE_NOCACHE
 	},
+	{	/* GPIO1 */
+		OVERO_L4_WAKEUP_VBASE,
+		_A(OMAP3530_L4_WAKEUP_BASE),
+		_S(OMAP3530_L4_WAKEUP_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
 	{
 		OVERO_GPMC_VBASE,
 		_A(GPMC_BASE),
@@ -356,6 +386,52 @@ static const struct pmap_devmap gumstix_
 		VM_PROT_READ | VM_PROT_WRITE,
 		PTE_NOCACHE
 	},
+#elif defined(DUOVERO)
+	{
+		DUOVERO_L4_CM_VBASE,
+		_A(OMAP4430_L4_CORE_BASE + 0x10),
+		_S(L1_S_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{	/* Console, SCU, L2CC, GPIO[2-6] */
+		DUOVERO_L4_PERIPHERAL_VBASE,
+		_A(OMAP4430_L4_PERIPHERAL_BASE),
+		_S(L1_S_SIZE * 3),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{	/* PRCM, GPIO1 */
+		DUOVERO_L4_WAKEUP_VBASE,
+		_A(OMAP4430_L4_WAKEUP_BASE),
+		_S(OMAP4430_L4_WAKEUP_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{
+		DUOVERO_GPMC_VBASE,
+		_A(GPMC_BASE),
+		_S(GPMC_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+#elif defined(PEPPER)
+	{
+		/* CM, Control Module, GPIO0, Console */
+		PEPPER_PRCM_VBASE,
+		_A(OMAP2_CM_BASE),
+		_S(L1_S_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{
+		/* GPIO[1-3] */
+		PEPPER_L4_PERIPHERAL_VBASE,
+		_A(TI_AM335X_L4_PERIPHERAL_BASE),
+		_S(L1_S_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
 #endif
 	{ 0, 0, 0, 0, 0 }
 };
@@ -400,16 +476,22 @@ initarm(void *arg)
 	 * Overo:
 	 

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

2016-03-31 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Mar 31 14:33:17 UTC 2016

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

Log Message:
Ensure enable clocks for omapmputmr.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.7 -r1.8 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/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.50 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.51
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.50	Sat Jun  7 10:30:13 2014
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Thu Mar 31 14:33:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.50 2014/06/07 10:30:13 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.51 2016/03/31 14:33:17 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -169,6 +169,7 @@
 #include 
 #ifdef OVERO
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -335,6 +336,13 @@ static const struct pmap_devmap gumstix_
 	},
 #elif defined(OVERO)
 	{
+		OVERO_L4_CORE_VBASE,
+		_A(OMAP3530_L4_CORE_BASE),
+		_S(L1_S_SIZE),		/* No need 16MB.  Use only first 1MB */
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{
 		OVERO_L4_PERIPHERAL_VBASE,
 		_A(OMAP3530_L4_PERIPHERAL_BASE),
 		_S(OMAP3530_L4_PERIPHERAL_SIZE),
@@ -920,4 +928,28 @@ gumstix_device_register(device_t dev, vo
 			" property for %s\n", device_xname(dev));
 		}
 	}
+	if (device_is_a(dev, "omapmputmr")) {
+#ifdef OVERO
+		struct obio_attach_args *obio = aux;
+		int en;
+
+		switch (obio->obio_addr) {
+		case 0x49032000:	/* GPTIMER2 */
+		case 0x49034000:	/* GPTIMER3 */
+		case 0x49036000:	/* GPTIMER4 */
+		case 0x49038000:	/* GPTIMER5 */
+		case 0x4903a000:	/* GPTIMER6 */
+		case 0x4903c000:	/* GPTIMER7 */
+		case 0x4903e000:	/* GPTIMER8 */
+		case 0x4904:	/* GPTIMER9 */
+			/* Ensure enable PRCM.CM_[FI]CLKEN_PER[3:10]. */
+			en = 1 << (((obio->obio_addr >> 13) & 0x3f) - 0x16);
+			ioreg_write(OVERO_L4_CORE_VBASE + 0x5000,
+			ioreg_read(OVERO_L4_CORE_VBASE + 0x5000) | en);
+			ioreg_write(OVERO_L4_CORE_VBASE + 0x5010,
+			ioreg_read(OVERO_L4_CORE_VBASE + 0x5010) | en);
+			break;
+		}
+#endif
+	}
 }

Index: src/sys/arch/evbarm/gumstix/gumstixreg.h
diff -u src/sys/arch/evbarm/gumstix/gumstixreg.h:1.7 src/sys/arch/evbarm/gumstix/gumstixreg.h:1.8
--- src/sys/arch/evbarm/gumstix/gumstixreg.h:1.7	Mon Dec 24 06:49:41 2012
+++ src/sys/arch/evbarm/gumstix/gumstixreg.h	Thu Mar 31 14:33:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstixreg.h,v 1.7 2012/12/24 06:49:41 kiyohara Exp $  */
+/*	$NetBSD: gumstixreg.h,v 1.8 2016/03/31 14:33:17 kiyohara Exp $  */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -47,8 +47,9 @@
 #define GUMSTIX_HWUART_VBASE		0xfd60
 #define GUMSTIX_LCDC_VBASE		0xfd70
 
-#define OVERO_L4_PERIPHERAL_VBASE	0xc000
-#define OVERO_GPMC_VBASE		0xc010
+#define OVERO_L4_CORE_VBASE		0xc000
+#define OVERO_L4_PERIPHERAL_VBASE	0xc010
+#define OVERO_GPMC_VBASE		0xc020
 
 
 #define ioreg_read(a)		(*(volatile unsigned *)(a))



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

2014-06-07 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jun  7 10:30:13 UTC 2014

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

Log Message:
Fix reset parameters for omap3_ehci.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 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.49 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.50
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.49	Fri May 23 13:56:18 2014
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sat Jun  7 10:30:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.49 2014/05/23 13:56:18 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.50 2014/06/07 10:30:13 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -892,13 +892,13 @@ gumstix_device_register(device_t dev, vo
 	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_uint16(dict, nports, 2);
 		prop_dictionary_set_bool(dict, phy-reset, true);
+		prop_dictionary_set_cstring(dict, port0-mode, none);
 		prop_dictionary_set_int16(dict, port0-gpio, -1);
+		prop_dictionary_set_cstring(dict, port1-mode, phy);
 		prop_dictionary_set_int16(dict, port1-gpio, 183);
-		prop_dictionary_set_int16(dict, port2-gpio, -1);
+		prop_dictionary_set_bool(dict, port1-gpioval, true);
 		prop_dictionary_set_uint16(dict, dpll5-m, 443);
 		prop_dictionary_set_uint16(dict, dpll5-n, 11);
 		prop_dictionary_set_uint16(dict, dpll5-m2, 4);



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

2013-02-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb  2 20:06:48 UTC 2013

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

Log Message:
static inline so that the kernel links.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/gumstix/gxpcic.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/gxpcic.c
diff -u src/sys/arch/evbarm/gumstix/gxpcic.c:1.12 src/sys/arch/evbarm/gumstix/gxpcic.c:1.13
--- src/sys/arch/evbarm/gumstix/gxpcic.c:1.12	Fri Jul  1 16:39:34 2011
+++ src/sys/arch/evbarm/gumstix/gxpcic.c	Sat Feb  2 15:06:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxpcic.c,v 1.12 2011/07/01 20:39:34 dyoung Exp $ */
+/*	$NetBSD: gxpcic.c,v 1.13 2013/02/02 20:06:48 christos Exp $ */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -106,8 +106,8 @@ static	void	gxpcic_clear_intr(struct pxa
 static	void	*gxpcic_intr_establish(struct pxapcic_socket *, int,
    int (*)(void *), void *);
 static	void	gxpcic_intr_disestablish(struct pxapcic_socket *, void *);
-__inline void gxpcic_cpld_clk(void);
-__inline u_char gxpcic_cpld_read_bits(int bits);
+static __inline void gxpcic_cpld_clk(void);
+static __inline u_char gxpcic_cpld_read_bits(int bits);
 static	int	gxpcic_count_slot(struct pxapcic_softc *);
 
 CFATTACH_DECL_NEW(gxpcic, sizeof(struct pxapcic_softc),
@@ -276,7 +276,7 @@ gxpcic_intr_disestablish(struct pxapcic_
 /*
  * X: slot count functions from Linux
  */
-__inline void
+static __inline void
 gxpcic_cpld_clk(void)
 {
 
@@ -284,7 +284,7 @@ gxpcic_cpld_clk(void)
 	pxa2x0_gpio_set_function(48, GPIO_OUT | GPIO_SET);
 }
 
-__inline u_char
+static inline u_char
 gxpcic_cpld_read_bits(int bits)
 {
 	u_int shift = 0, gpio;



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

2012-12-29 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Dec 29 14:22:55 UTC 2012

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_start.S

Log Message:
Change order for TLB operation.
We can boot Overo EarthSTORM.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/gumstix/gumstix_start.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/evbarm/gumstix/gumstix_start.S
diff -u src/sys/arch/evbarm/gumstix/gumstix_start.S:1.10 src/sys/arch/evbarm/gumstix/gumstix_start.S:1.11
--- src/sys/arch/evbarm/gumstix/gumstix_start.S:1.10	Sat Sep  1 14:52:35 2012
+++ src/sys/arch/evbarm/gumstix/gumstix_start.S	Sat Dec 29 14:22:55 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_start.S,v 1.10 2012/09/01 14:52:35 matt Exp $ */
+/*	$NetBSD: gumstix_start.S,v 1.11 2012/12/29 14:22:55 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -66,7 +66,7 @@
 #include arm/armreg.h
 #include assym.h
 
-RCSID($NetBSD: gumstix_start.S,v 1.10 2012/09/01 14:52:35 matt Exp $)
+RCSID($NetBSD: gumstix_start.S,v 1.11 2012/12/29 14:22:55 kiyohara Exp $)
 
 /*
  * CPWAIT -- Canonical method to wait for CP15 update.
@@ -179,8 +179,8 @@ _C_LABEL(gumstix_start):
 	cmp	r1, #0
 	bne	4b
 
-	mcr	p15, 0, r0, c8, c7, 0	/* Flush TLB */
 	mcr	p15, 0, r0, c2, c0, 0	/* Set TTB */
+	mcr	p15, 0, r0, c8, c7, 0	/* Flush TLB */
 
 	/*
 	 * Set the Domain Access register.  Very important!



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/gumstix

2012-09-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Sep  4 22:58:35 UTC 2012

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

Log Message:
Add support for getting the mac-address from the device properties.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/gumstix/if_smsh_gpmc.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/if_smsh_gpmc.c
diff -u src/sys/arch/evbarm/gumstix/if_smsh_gpmc.c:1.2 src/sys/arch/evbarm/gumstix/if_smsh_gpmc.c:1.3
--- src/sys/arch/evbarm/gumstix/if_smsh_gpmc.c:1.2	Tue Sep  4 00:19:48 2012
+++ src/sys/arch/evbarm/gumstix/if_smsh_gpmc.c	Tue Sep  4 22:58:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsh_gpmc.c,v 1.2 2012/09/04 00:19:48 matt Exp $	*/
+/*	$NetBSD: if_smsh_gpmc.c,v 1.3 2012/09/04 22:58:35 matt Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,9 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_smsh_gpmc.c,v 1.2 2012/09/04 00:19:48 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_smsh_gpmc.c,v 1.3 2012/09/04 22:58:35 matt Exp $);
+
+#include locators.h
 
 #include sys/param.h
 #include sys/device.h
@@ -34,8 +36,6 @@ __KERNEL_RCSID(0, $NetBSD: if_smsh_gpmc
 #include sys/bus.h
 #include sys/systm.h
 
-#include arm/omap/omap2_gpmcvar.h
-
 #include net/if.h
 #include net/if_ether.h
 #include net/if_media.h
@@ -45,7 +45,7 @@ __KERNEL_RCSID(0, $NetBSD: if_smsh_gpmc
 #include dev/ic/lan9118var.h
 #include dev/ic/lan9118reg.h
 
-#include locators.h
+#include arm/omap/omap2_gpmcvar.h
 
 
 static int smsh_gpmc_match(device_t, struct cfdata *, void *);
@@ -90,10 +90,23 @@ smsh_gpmc_attach(device_t parent, device
 {
 	struct lan9118_softc *sc = device_private(self);
 	struct gpmc_attach_args *gpmc = aux;
+	prop_dictionary_t dict = device_properties(self);
 	void *ih;
 
 	sc-sc_dev = self;
 
+	/*
+	 * Prefer the Ethernet address in device properties.
+	 */
+	prop_data_t ea = prop_dictionary_get(dict, mac-address);
+	if (ea != NULL) {
+		KASSERT(prop_object_type(ea) == PROP_TYPE_DATA);
+		KASSERT(prop_data_size(ea) == ETHER_ADDR_LEN);
+		memcpy(sc-sc_enaddr, prop_data_data_nocopy(ea),
+		ETHER_ADDR_LEN);
+		sc-sc_flags |= LAN9118_FLAGS_NO_EEPROM;
+	}
+
 	/* Map i/o space. */
 	if (bus_space_map(gpmc-gpmc_iot, gpmc-gpmc_addr, LAN9118_IOSIZE, 0,
 	sc-sc_ioh))



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

2012-09-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Sep  4 00:19:48 UTC 2012

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

Log Message:
No reason to include gumstixvar.h so don't.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/gumstix/if_smsh_gpmc.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/if_smsh_gpmc.c
diff -u src/sys/arch/evbarm/gumstix/if_smsh_gpmc.c:1.1 src/sys/arch/evbarm/gumstix/if_smsh_gpmc.c:1.2
--- src/sys/arch/evbarm/gumstix/if_smsh_gpmc.c:1.1	Sat Aug 28 04:54:46 2010
+++ src/sys/arch/evbarm/gumstix/if_smsh_gpmc.c	Tue Sep  4 00:19:48 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsh_gpmc.c,v 1.1 2010/08/28 04:54:46 kiyohara Exp $	*/
+/*	$NetBSD: if_smsh_gpmc.c,v 1.2 2012/09/04 00:19:48 matt Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_smsh_gpmc.c,v 1.1 2010/08/28 04:54:46 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_smsh_gpmc.c,v 1.2 2012/09/04 00:19:48 matt Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -36,8 +36,6 @@ __KERNEL_RCSID(0, $NetBSD: if_smsh_gpmc
 
 #include arm/omap/omap2_gpmcvar.h
 
-#include evbarm/gumstix/gumstixvar.h
-
 #include net/if.h
 #include net/if_ether.h
 #include net/if_media.h



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

2012-09-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Sep  1 14:52:35 UTC 2012

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_start.S

Log Message:
Don't shift VA in table since that generates errors


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/gumstix/gumstix_start.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/evbarm/gumstix/gumstix_start.S
diff -u src/sys/arch/evbarm/gumstix/gumstix_start.S:1.9 src/sys/arch/evbarm/gumstix/gumstix_start.S:1.10
--- src/sys/arch/evbarm/gumstix/gumstix_start.S:1.9	Mon Jan 31 06:28:03 2011
+++ src/sys/arch/evbarm/gumstix/gumstix_start.S	Sat Sep  1 14:52:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_start.S,v 1.9 2011/01/31 06:28:03 matt Exp $ */
+/*	$NetBSD: gumstix_start.S,v 1.10 2012/09/01 14:52:35 matt Exp $ */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -66,7 +66,7 @@
 #include arm/armreg.h
 #include assym.h
 
-RCSID($NetBSD: gumstix_start.S,v 1.9 2011/01/31 06:28:03 matt Exp $)
+RCSID($NetBSD: gumstix_start.S,v 1.10 2012/09/01 14:52:35 matt Exp $)
 
 /*
  * CPWAIT -- Canonical method to wait for CP15 update.
@@ -168,13 +168,14 @@ _C_LABEL(gumstix_start):
 	b	5f
 
 4:
-	str	r3, [r0, r2]
-	add	r2, r2, #4
+	str	r3, [r0, r2, lsl #2]
+	add	r2, r2, #1
 	add	r3, r3, #(L1_S_SIZE)
 	adds	r1, r1, #-1
 	bhi	4b
 5:
 	ldmia	r4!, {r1, r2, r3}	/* # of sections, PA|attr, VA */
+	lsr	r2, r2, #L1_S_SHIFT
 	cmp	r1, #0
 	bne	4b
 
@@ -211,8 +212,8 @@ _C_LABEL(gumstix_start):
 	CPWAIT(r0)
 
 	/* Jump to kernel code in TRUE VA */
-	adr	r0, Lstart
-	ldr	pc, [r0]
+	ldr	r0, Lstart
+	bx	r0
 
 Lstart:
 	.word	start
@@ -238,15 +239,15 @@ ram_size:
 
 #define MMU_INIT(va, pa, n_sec, attr)	  \
 	.word	n_sec			; \
-	.word	(va)  (L1_S_SHIFT-2)	; \
+	.word	(va)			; \
 	.word	(pa) | (attr)		;
 
 mmu_init_table:
+#if defined(GUMSTIX)
 	/* fill all table VA==PA */
 	MMU_INIT(0x, 0x,
 	1  (32 - L1_S_SHIFT), L1_S_PROTO | L1_S_AP_KRW)
 
-#if defined(GUMSTIX)
 #define SDRAM_START	0xa000
 
 	/* map SDRAM VA==PA, write-back cacheable (first 64M only)*/
@@ -258,6 +259,10 @@ mmu_init_table:
 	64, L1_S_PROTO | L1_S_C | L1_S_AP_KRW)
 
 #elif defined(OVERO)
+	/* fill all table VA==PA */
+	MMU_INIT(0x, 0x,
+	1  (32 - L1_S_SHIFT), L1_S_PROTO | L1_S_APv7_KRW)
+
 #define SDRAM_START	0x8000
 
 	/* Map VA to PA, write-back cacheable (first 64M only) */



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

2011-07-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jul  7 08:48:34 UTC 2011

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

Log Message:
fix an off by one array bounds issue, and also fix a potentially non
nul-terminated string.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 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.37 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.38
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.37	Fri Jul  1 20:39:34 2011
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Thu Jul  7 08:48:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.37 2011/07/01 20:39:34 dyoung Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.38 2011/07/07 08:48:34 mrg Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -222,6 +222,7 @@
 
 BootConfig bootconfig;		/* Boot config storage */
 static char bootargs[MAX_BOOT_STRING];
+const size_t bootargs_len = sizeof(bootargs) - 1;	/* without nul */
 char *boot_args = NULL;
 
 uint32_t system_serial_high;
@@ -1092,13 +1093,14 @@
 			consinit();
 		}
 #endif
-		if (j == MAX_BOOT_STRING) {
+		if (j == bootargs_len) {
 			*(bootargs + j) = '\0';
 			continue;
 		}
 		if (j != 0)
 			*(bootargs + j++) = ' ';
-		strncpy(bootargs + j, argv[i], MAX_BOOT_STRING - j);
+		strncpy(bootargs + j, argv[i], bootargs_len - j);
+		bootargs[bootargs_len] = '\0';
 		j += strlen(argv[i]);
 	}
 	boot_args = bootargs;



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

2011-06-21 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Jun 21 11:38:03 UTC 2011

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

Log Message:
Use CFATTACH_DECL_NEW().


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/gumstix/gxiic.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/gxiic.c
diff -u src/sys/arch/evbarm/gumstix/gxiic.c:1.6 src/sys/arch/evbarm/gumstix/gxiic.c:1.7
--- src/sys/arch/evbarm/gumstix/gxiic.c:1.6	Sun Jun 19 16:16:42 2011
+++ src/sys/arch/evbarm/gumstix/gxiic.c	Tue Jun 21 11:38:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxiic.c,v 1.6 2011/06/19 16:16:42 nonaka Exp $ */
+/*	$NetBSD: gxiic.c,v 1.7 2011/06/21 11:38:03 kiyohara Exp $ */
 /*
  * Copyright (c) 2007 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gxiic.c,v 1.6 2011/06/19 16:16:42 nonaka Exp $);
+__KERNEL_RCSID(0, $NetBSD: gxiic.c,v 1.7 2011/06/21 11:38:03 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -58,7 +58,7 @@
 void *, size_t, int);
 
 
-CFATTACH_DECL(gxiic, sizeof(struct gxiic_softc),
+CFATTACH_DECL_NEW(gxiic, sizeof(struct gxiic_softc),
 gxiicmatch, gxiicattach, NULL, NULL);
 
 
@@ -88,6 +88,7 @@
 
 	sc-sc_pxa_i2c.sc_dev = self;
 	sc-sc_pxa_i2c.sc_iot = pxa-pxa_iot;
+	sc-sc_pxa_i2c.sc_addr = pxa-pxa_addr;
 	sc-sc_pxa_i2c.sc_size = pxa-pxa_size;
 	sc-sc_pxa_i2c.sc_flags = 0;
 	if (pxa2x0_i2c_attach_sub(sc-sc_pxa_i2c)) {



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

2010-09-23 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Sep 23 06:54:46 UTC 2010

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

Log Message:
If GUMSTIX_NETBSD_ARGS_CONSOLE is defined, argument 'console=ttyS0,speed'
that u-boot passes Linux will be interpreted.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 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.32 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.33
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.32	Mon Aug 30 05:37:30 2010
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Thu Sep 23 06:54:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.32 2010/08/30 05:37:30 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.33 2010/09/23 06:54:46 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -1203,6 +1203,17 @@
 
 #if NCOM  0
 
+#ifdef GUMSTIX_NETBSD_ARGS_CONSOLE
+	/* Maybe passed Linux's bootargs 'console=ttyS?,speed...' */
+	if (strncmp(console, ttyS, 4) == 0  console[5] == ',') {
+		int i;
+
+		comcnspeed = 0;
+		for (i = 6; i  strlen(console)  isdigit(console[i]); i++)
+			comcnspeed = comcnspeed * 10 + (console[i] - '0');
+	}
+#endif
+
 #if defined(GUMSTIX)
 
 #ifdef FFUARTCONSOLE
@@ -1212,7 +1223,8 @@
 	} else
 #endif
 #if defined(GUMSTIX_NETBSD_ARGS_CONSOLE)
-	if (console[0] == '\0' || strcasecmp(console, ffuart) == 0)
+	if (console[0] == '\0' || strcasecmp(console, ffuart) == 0 ||
+	strncmp(console, ttyS0,, 6) == 0)
 #endif
 	{
 		int rv;



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

2010-09-23 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Sep 23 07:01:42 UTC 2010

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

Log Message:
Remove #ifdef NPRCM.  Always include omap2_prcm.h.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 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.33 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.34
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.33	Thu Sep 23 06:54:46 2010
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Thu Sep 23 07:01:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.33 2010/09/23 06:54:46 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.34 2010/09/23 07:01:41 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -173,9 +173,7 @@
 
 #include arm/arm32/machdep.h
 #include arm/omap/omap2_gpmcreg.h
-#if NPRCM  0
 #include arm/omap/omap2_prcm.h
-#endif
 #include arm/omap/omap2_reg.h
 #include arm/omap/omap_var.h
 #include arm/omap/omap_com.h



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

2010-08-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 07:06:29 UTC 2010

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

Log Message:
Fix build failed.  omap2_intr.h includes, if defined OMAP3530.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 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.16 src/sys/arch/evbarm/gumstix/gxio.c:1.17
--- src/sys/arch/evbarm/gumstix/gxio.c:1.16	Sat Aug 28 04:39:42 2010
+++ src/sys/arch/evbarm/gumstix/gxio.c	Sat Aug 28 07:06:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.16 2010/08/28 04:39:42 kiyohara Exp $ */
+/*	$NetBSD: gxio.c,v 1.17 2010/08/28 07:06:29 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -31,11 +31,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gxio.c,v 1.16 2010/08/28 04:39:42 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: gxio.c,v 1.17 2010/08/28 07:06:29 kiyohara Exp $);
 
 #include opt_cputypes.h
 #include opt_gumstix.h
 #include opt_gxio.h
+#if defined(OVERO)
+#include opt_omap.h
+#endif
 
 #include sys/param.h
 #include sys/device.h
@@ -48,7 +51,9 @@
 
 #include arm/omap/omap2_gpmcreg.h
 #include arm/omap/omap2_reg.h
+#if defined(OMAP3530)
 #include arm/omap/omap2_intr.h
+#endif
 #include arm/omap/omap_var.h
 #if defined(CPU_XSCALE_PXA270) || defined(CPU_XSCALE_PXA250)
 #include arm/xscale/pxa2x0cpu.h



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

2010-08-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 07:13:47 UTC 2010

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

Log Message:
Fix build fail.
  + Include opt_omap.h, if defined OVERO.
  + Fix the pair of parentheses.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.30 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.31
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.30	Sat Aug 28 04:46:24 2010
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sat Aug 28 07:13:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.30 2010/08/28 04:46:24 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.31 2010/08/28 07:13:47 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -139,8 +139,10 @@
 
 #include opt_evbarm_boardtype.h
 #include opt_cputypes.h
-#include opt_omap.h
 #include opt_gumstix.h
+#ifdef OVERO
+#include opt_omap.h
+#endif
 #include opt_ddb.h
 #include opt_kgdb.h
 #include opt_pmap_debug.h
@@ -1117,7 +1119,7 @@
 		if ((p = strstr(bootargs, expansion_name)))
 			q = p + strlen(expansion_name);
 #ifdef GUMSTIX_NETBSD_ARGS_BUSHEADER
-		else if (p = strstr(bootargs, busheader_name))
+		else if ((p = strstr(bootargs, busheader_name)))
 			q = p + strlen(busheader_name);
 #endif
 		if (p) {



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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:12:40 UTC 2010

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_start.S

Log Message:
Disable L2 Cache when boot time.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/gumstix/gumstix_start.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/evbarm/gumstix/gumstix_start.S
diff -u src/sys/arch/evbarm/gumstix/gumstix_start.S:1.7 src/sys/arch/evbarm/gumstix/gumstix_start.S:1.8
--- src/sys/arch/evbarm/gumstix/gumstix_start.S:1.7	Sat Jul 10 08:17:48 2010
+++ src/sys/arch/evbarm/gumstix/gumstix_start.S	Sat Aug 28 04:12:40 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_start.S,v 1.7 2010/07/10 08:17:48 kiyohara Exp $ */
+/*	$NetBSD: gumstix_start.S,v 1.8 2010/08/28 04:12:40 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -195,6 +195,11 @@
 	orr	r0, r0, #CPU_CONTROL_SYST_ENABLE
 #endif
 #if defined(CPU_CORTEXA8)
+	/* Disable L2 cache beforehand. */
+	mrc	p15, 0, r1, c1, c0, 1
+	bic	r1, r1, #0x2		/* clear L2EN */
+	mcr	p15, 0, r1, c1, c0, 1
+
 	orr	r0, r0, #CPU_CONTROL_AFLT_ENABLE | CPU_CONTROL_DC_ENABLE
 	orr	r0, r0, #CPU_CONTROL_BPRD_ENABLE | CPU_CONTROL_IC_ENABLE
 #endif



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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:30:25 UTC 2010

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

Log Message:
+ Struct smsh_gxio is obsolated, and struct lan9118_softc is used.
  We do not have private data at all.
+ Fix typo.  sms_gxio_attach - smsh_gxio_attach


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/gumstix/if_smsh_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/if_smsh_gxio.c
diff -u src/sys/arch/evbarm/gumstix/if_smsh_gxio.c:1.2 src/sys/arch/evbarm/gumstix/if_smsh_gxio.c:1.3
--- src/sys/arch/evbarm/gumstix/if_smsh_gxio.c:1.2	Sun Nov 29 10:08:15 2009
+++ src/sys/arch/evbarm/gumstix/if_smsh_gxio.c	Sat Aug 28 04:30:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsh_gxio.c,v 1.2 2009/11/29 10:08:15 kiyohara Exp $	*/
+/*	$NetBSD: if_smsh_gxio.c,v 1.3 2010/08/28 04:30:24 kiyohara Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_smsh_gxio.c,v 1.2 2009/11/29 10:08:15 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_smsh_gxio.c,v 1.3 2010/08/28 04:30:24 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -51,21 +51,9 @@
 static int smsh_gxio_match(device_t, struct cfdata *, void *);
 static void smsh_gxio_attach(device_t, device_t, void *);
 
-static int ether_serial_digit = 1;  
+static int ether_serial_digit = 1;
 
-struct smsh_gxio_softc {
-	struct lan9118_softc sc_smsh;
-	void *sc_ih;
-
-	/*
-	 * Board independent DMA stuffs, if uses master DMA.
-	 * We use PXA2x0's DMA.
-	 */
-	struct dmac_xfer *sc_txfer;
-	struct dmac_xfer *sc_rxfer;
-};
-
-CFATTACH_DECL_NEW(smsh_gxio, sizeof(struct smsh_gxio_softc),
+CFATTACH_DECL_NEW(smsh_gxio, sizeof(struct lan9118_softc),
 smsh_gxio_match, smsh_gxio_attach, NULL, NULL);
 
 
@@ -104,9 +92,9 @@
 static void
 smsh_gxio_attach(device_t parent, device_t self, void *aux)
 {
-	struct smsh_gxio_softc *gsc = device_private(self);
-	struct lan9118_softc *sc = gsc-sc_smsh;
+	struct lan9118_softc *sc = device_private(self);
 	struct gxio_attach_args *gxa = aux;
+	void *ih;
 
 	KASSERT(system_serial_high != 0 || system_serial_low != 0);
 
@@ -115,7 +103,7 @@
 	/* Map i/o space. */
 	if (bus_space_map(gxa-gxa_iot, gxa-gxa_addr, LAN9118_IOSIZE, 0,
 	sc-sc_ioh))
-		panic(sms_gxio_attach: can't map i/o space);
+		panic(smsh_gxio_attach: can't map i/o space);
 	sc-sc_iot = gxa-gxa_iot;
 
 	sc-sc_enaddr[0] = ((system_serial_high  8)  0xfe) | 0x02;
@@ -132,9 +120,9 @@
 	}
 
 	/* Establish the interrupt handler. */
-	gsc-sc_ih = gxio_intr_establish(gxa-gxa_sc,
+	ih = gxio_intr_establish(gxa-gxa_sc,
 	gxa-gxa_gpirq, IST_EDGE_FALLING, IPL_NET, lan9118_intr, sc);
-	if (gsc-sc_ih == NULL) {
+	if (ih == NULL) {
 		aprint_error_dev(self,
 		couldn't establish interrupt handler\n);
 		bus_space_unmap(sc-sc_iot, sc-sc_ioh, LAN9118_IOSIZE);



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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:33:00 UTC 2010

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

Log Message:
Remove a white space.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/gumstix/if_sm_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/if_sm_gxio.c
diff -u src/sys/arch/evbarm/gumstix/if_sm_gxio.c:1.8 src/sys/arch/evbarm/gumstix/if_sm_gxio.c:1.9
--- src/sys/arch/evbarm/gumstix/if_sm_gxio.c:1.8	Mon Mar 15 13:11:23 2010
+++ src/sys/arch/evbarm/gumstix/if_sm_gxio.c	Sat Aug 28 04:33:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sm_gxio.c,v 1.8 2010/03/15 13:11:23 kiyohara Exp $ */
+/*	$NetBSD: if_sm_gxio.c,v 1.9 2010/08/28 04:33:00 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_sm_gxio.c,v 1.8 2010/03/15 13:11:23 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_sm_gxio.c,v 1.9 2010/08/28 04:33:00 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -100,7 +100,7 @@
 
 struct sm_gxio_softc {
 	struct	smc91cxx_softc sc_smc;
-	void	*sc_ih;	
+	void	*sc_ih;
 };
 
 CFATTACH_DECL(sm_gxio, sizeof(struct sm_gxio_softc),



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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:39:42 UTC 2010

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

Log Message:
+ Add configuration function for NIC of Chestnut43/Tobi/Tobi-Duo.
  tested Chestnut43 only.
+ Remove parenthesis for return.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 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.15 src/sys/arch/evbarm/gumstix/gxio.c:1.16
--- src/sys/arch/evbarm/gumstix/gxio.c:1.15	Sat Jul 10 08:17:48 2010
+++ src/sys/arch/evbarm/gumstix/gxio.c	Sat Aug 28 04:39:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.15 2010/07/10 08:17:48 kiyohara Exp $ */
+/*	$NetBSD: gxio.c,v 1.16 2010/08/28 04:39:42 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.15 2010/07/10 08:17:48 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: gxio.c,v 1.16 2010/08/28 04:39:42 kiyohara Exp $);
 
 #include opt_cputypes.h
 #include opt_gumstix.h
@@ -46,7 +46,9 @@
 
 #include machine/bootconfig.h
 
+#include arm/omap/omap2_gpmcreg.h
 #include arm/omap/omap2_reg.h
+#include arm/omap/omap2_intr.h
 #include arm/omap/omap_var.h
 #if defined(CPU_XSCALE_PXA270) || defined(CPU_XSCALE_PXA250)
 #include arm/xscale/pxa2x0cpu.h
@@ -54,11 +56,11 @@
 #include arm/xscale/pxa2x0reg.h
 #include arm/xscale/pxa2x0var.h
 #include arm/xscale/pxa2x0_gpio.h
+#include evbarm/gumstix/gumstixreg.h
 #include evbarm/gumstix/gumstixvar.h
 
-#if !defined(OVERO)	/* X */
+#include ioconf.h
 #include locators.h
-#endif
 
 
 struct gxioconf {
@@ -66,17 +68,20 @@
 	void (*config)(void);
 };
 
-#if !defined(OVERO)	/* X */
+#if defined(GUMSTIX)
 static int gxiomatch(device_t, cfdata_t, void *);
 static void gxioattach(device_t, device_t, void *);
 static int gxiosearch(device_t, cfdata_t, const int *, void *);
 static int gxioprint(void *, const char *);
+
+CFATTACH_DECL_NEW(gxio, sizeof(struct gxio_softc),
+gxiomatch, gxioattach, NULL, NULL);
 #endif
 
 void gxio_config_pin(void);
 void gxio_config_expansion(char *);
 static void gxio_config_gpio(const struct gxioconf *, char *);
-#if defined(CPU_XSCALE_PXA270) || defined(CPU_XSCALE_PXA250)
+#if defined(GUMSTIX)
 static void basix_config(void);
 static void cfstix_config(void);
 static void etherstix_config(void);
@@ -89,15 +94,14 @@
 static void netmmc_config(void);
 static void wifistix_config(void);
 static void wifistix_cf_config(void);
+#elif defined(OVERO)
+static void eth0_config(void);
+static void eth1_config(void);
+static void chestnut_config(void);
+static void tobi_config(void);
+static void tobiduo_config(void);
 #endif
 
-#if !defined(OVERO)	/* X */
-CFATTACH_DECL_NEW(
-gxio, sizeof(struct gxio_softc), gxiomatch, gxioattach, NULL, NULL);
-#endif
-
-char busheader[MAX_BOOT_STRING];
-
 #if defined(CPU_XSCALE_PXA250)
 static struct pxa2x0_gpioconf pxa255dep_gpioconf[] = {
 	/* Bluetooth module configuration */
@@ -161,7 +165,7 @@
 #endif
 
 static const struct gxioconf busheader_conf[] = {
-#if defined(CPU_XSCALE_PXA270) || defined(CPU_XSCALE_PXA250)
+#if defined(GUMSTIX)
 	{ basix,		basix_config },
 	{ cfstix,		cfstix_config },
 	{ etherstix,		etherstix_config },
@@ -176,6 +180,10 @@
 	{ netpro-vx,		netwifimicrosd_config },
 	{ wifistix-cf,	wifistix_cf_config },
 	{ wifistix,		wifistix_config },
+#elif defined(OVERO)
+	{ chestnut43,		chestnut_config },
+	{ tobi,		tobi_config },
+	{ tobi-duo,		tobiduo_config },
 #endif
 	{ NULL }
 };
@@ -184,11 +192,12 @@
 struct gxpcic_slot_irqs gxpcic_slot_irqs[2] = { { 0, -1, -1 }, { 0, -1, -1 } };
 
 
-#if !defined(OVERO)	/* X */
+#if defined(GUMSTIX)
 /* ARGSUSED */
 static int
 gxiomatch(device_t parent, cfdata_t match, void *aux)
 {
+
 	struct pxaip_attach_args *pxa = aux;
 	bus_space_tag_t iot = pxa2x0_bs_tag;
 	bus_space_handle_t ioh;
@@ -199,11 +208,11 @@
 
 	if (bus_space_map(iot,
 	PXA2X0_MEMCTL_BASE, PXA2X0_MEMCTL_SIZE, 0, ioh))
-		return (0);
+		return 0;
 	bus_space_unmap(iot, ioh, PXA2X0_MEMCTL_SIZE);
 
 	/* nothing */
-	return (1);
+	return 1;
 }
 
 /* ARGSUSED */
@@ -223,7 +232,7 @@
 		return;
 
 	/*
-	 *  Attach each gumstix expansion of busheader side devices
+	 *  Attach each gumstix(busheader)/overo expansion board devices.
 	 */
 	config_search_ia(gxiosearch, self, gxio, NULL);
 }
@@ -243,7 +252,7 @@
 	if (config_match(parent, cf, gxa))
 		config_attach(parent, cf, gxa, gxioprint);
 
-	return (0);
+	return 0;
 }
 
 /* ARGSUSED */
@@ -256,7 +265,7 @@
 		printf( addr 0x%lx, gxa-gxa_addr);
 	if (gxa-gxa_gpirq  0)
 		printf( gpirq %d, gxa-gxa_gpirq);
-	return (UNCONF);
+	return UNCONF;
 }
 #endif
 
@@ -322,7 +331,7 @@
 {
 
 	if (expansion == NULL) {
-		

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

2010-08-27 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 28 04:46:24 UTC 2010

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

Log Message:
+ Add parsing keyword 'expansion=' in args from U-boot.  And keep backword
  compatibility 'busheader=', in case Gumstix.
+ Add GPMC device map to gumstix_devmap[].


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.5 -r1.6 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/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.29 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.30
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.29	Sun Aug  8 09:00:15 2010
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sat Aug 28 04:46:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.29 2010/08/08 09:00:15 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.30 2010/08/28 04:46:24 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -139,6 +139,7 @@
 
 #include opt_evbarm_boardtype.h
 #include opt_cputypes.h
+#include opt_omap.h
 #include opt_gumstix.h
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -168,6 +169,7 @@
 #include machine/frame.h
 
 #include arm/arm32/machdep.h
+#include arm/omap/omap2_gpmcreg.h
 #include arm/omap/omap2_reg.h
 #include arm/omap/omap_var.h
 #include arm/omap/omap_com.h
@@ -460,6 +462,13 @@
 		VM_PROT_READ | VM_PROT_WRITE,
 		PTE_NOCACHE
 	},
+	{
+		OVERO_GPMC_VBASE,
+		_A(GPMC_BASE),
+		_S(GPMC_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
 #endif
 	{ 0, 0, 0, 0, 0 }
 };
@@ -1035,6 +1044,10 @@
 #ifdef GUMSTIX_NETBSD_ARGS_BUSHEADER
 static const char busheader_name[] = busheader=;
 #endif
+#if defined(GUMSTIX_NETBSD_ARGS_BUSHEADER) || \
+defined(GUMSTIX_NETBSD_ARGS_EXPANSION)
+static const char expansion_name[] = expansion=;
+#endif
 #ifdef GUMSTIX_NETBSD_ARGS_CONSOLE
 static const char console_name[] = console=;
 #endif
@@ -1048,12 +1061,21 @@
 	for (i = 1, j = 0; i  argc; i++) {
 #ifdef GUMSTIX_NETBSD_ARGS_BUSHEADER
 		if (!strncmp(argv[i], busheader_name, strlen(busheader_name))) {
-			/* configure for GPIOs of busheader side */
+			/* Configure for GPIOs of busheader side */
 			gxio_config_expansion(argv[i] + strlen(busheader_name));
 			gxio_configured = 1;
 			continue;
 		}
 #endif
+#if defined(GUMSTIX_NETBSD_ARGS_BUSHEADER) || \
+defined(GUMSTIX_NETBSD_ARGS_EXPANSION)
+		if (!strncmp(argv[i], expansion_name, strlen(expansion_name))) {
+			/* Configure expansion */
+			gxio_config_expansion(argv[i] + strlen(expansion_name));
+			gxio_configured = 1;
+			continue;
+		}
+#endif
 #ifdef GUMSTIX_NETBSD_ARGS_CONSOLE
 		if (!strncmp(argv[i], console_name, strlen(console_name))) {
 			strncpy(console, argv[i] + strlen(console_name),
@@ -1081,25 +1103,36 @@
 static void
 process_kernel_args_liner(char *args)
 {
+	int i = 0;
 	char *p = NULL;
 
 	boothowto = 0;
 
 	strncpy(bootargs, args, sizeof(bootargs));
+#if defined(GUMSTIX_NETBSD_ARGS_BUSHEADER) || \
+defined(GUMSTIX_NETBSD_ARGS_EXPANSION)
+	{
+		char *q;
+
+		if ((p = strstr(bootargs, expansion_name)))
+			q = p + strlen(expansion_name);
 #ifdef GUMSTIX_NETBSD_ARGS_BUSHEADER
-	p = strstr(bootargs, busheader_name);
-	if (p) {
-		int i = 0;
-		char expansion[256], c;
+		else if (p = strstr(bootargs, busheader_name))
+			q = p + strlen(busheader_name);
+#endif
+		if (p) {
+			char expansion[256], c;
 
-		do {
-			c = *(p + strlen(busheader_name) + i);
-			if (c == ' ')
-c = '\0';
-			expansion[i++] = c;
-		} while (c != '\0'  i  sizeof(expansion));
-		gxio_config_expansion(expansion);
-		strcpy(p, p + i);
+			i = 0;
+			do {
+c = *(q + i);
+if (c == ' ')
+	c = '\0';
+expansion[i++] = c;
+			} while (c != '\0'  i  sizeof(expansion));
+			gxio_config_expansion(expansion);
+			strcpy(p, q + i);
+		}
 	}
 #endif
 	if (p == NULL)
@@ -1107,9 +1140,9 @@
 #ifdef GUMSTIX_NETBSD_ARGS_CONSOLE
 	p = strstr(bootargs, console_name);
 	if (p != NULL) {
-		int i = 0;
 		char c;
 
+		i = 0;
 		do {
 			c = *(p + strlen(console_name) + i);
 			if (c == ' ')
@@ -1117,7 +1150,7 @@
 			console[i++] = c;
 		} while (c != '\0'  i  sizeof(console));
 		consinit();
-		strcpy(p, p + i);
+		strcpy(p, p + strlen(console_name) + i);
 	}
 #endif
 	boot_args = bootargs;

Index: src/sys/arch/evbarm/gumstix/gumstixreg.h
diff -u src/sys/arch/evbarm/gumstix/gumstixreg.h:1.5 src/sys/arch/evbarm/gumstix/gumstixreg.h:1.6
--- src/sys/arch/evbarm/gumstix/gumstixreg.h:1.5	Sat Jul 10 08:17:48 2010
+++ src/sys/arch/evbarm/gumstix/gumstixreg.h	Sat Aug 28 04:46:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstixreg.h,v 1.5 2010/07/10 08:17:48 kiyohara Exp $  */
+/*	$NetBSD: gumstixreg.h,v 1.6 2010/08/28 04:46:24 kiyohara Exp $  */
 /*
  * 

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

2010-07-10 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Jul 10 08:26:34 UTC 2010

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

Log Message:
Add gumstix_device_register().  Set properties for pxa2x0_ohci here.
However this properties not used in NetBSD source tree.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 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.27 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.28
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.27	Sat Jul 10 08:17:48 2010
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sat Jul 10 08:26:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.27 2010/07/10 08:17:48 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.28 2010/07/10 08:26:34 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -268,6 +268,7 @@
 #ifdef KGDB
 static void	kgdb_port_init(void);
 #endif
+static void	gumstix_device_register(device_t, void *);
 
 bs_protos(bs_notimpl);
 
@@ -983,6 +984,9 @@
 		Debugger();
 #endif
 
+	/* We have our own device_register() */
+	evbarm_device_register = gumstix_device_register;
+
 	/* We return the new stack pointer address */
 	return(kernelstack.pv_va + USPACE_SVC_STACK_TOP);
 }
@@ -1295,3 +1299,26 @@
 #endif
 }
 #endif
+
+static void
+gumstix_device_register(device_t dev, void *aux)
+{
+
+	if (device_is_a(dev, ohci)) {
+		if (prop_dictionary_set_bool(device_properties(dev),
+		Ganged-power-mask-on-port1, 1) == false) {
+			printf(WARNING: unable to set power-mask for port1
+			 property for %s\n, dev-dv_xname);
+		}
+		if (prop_dictionary_set_bool(device_properties(dev),
+		Ganged-power-mask-on-port2, 1) == false) {
+			printf(WARNING: unable to set power-mask for port2
+			 property for %s\n, dev-dv_xname);
+		}
+		if (prop_dictionary_set_bool(device_properties(dev),
+		Ganged-power-mask-on-port3, 1) == false) {
+			printf(WARNING: unable to set power-mask for port3
+			 property for %s\n, dev-dv_xname);
+		}
+	}
+}



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

2010-03-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Mon Mar 15 13:11:23 UTC 2010

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

Log Message:
Use bus_space_write_2() instead of _1, because sm(4) is 16bit/word.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/gumstix/if_sm_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/if_sm_gxio.c
diff -u src/sys/arch/evbarm/gumstix/if_sm_gxio.c:1.7 src/sys/arch/evbarm/gumstix/if_sm_gxio.c:1.8
--- src/sys/arch/evbarm/gumstix/if_sm_gxio.c:1.7	Sun Aug  9 07:10:13 2009
+++ src/sys/arch/evbarm/gumstix/if_sm_gxio.c	Mon Mar 15 13:11:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sm_gxio.c,v 1.7 2009/08/09 07:10:13 kiyohara Exp $ */
+/*	$NetBSD: if_sm_gxio.c,v 1.8 2010/03/15 13:11:23 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_sm_gxio.c,v 1.7 2009/08/09 07:10:13 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_sm_gxio.c,v 1.8 2010/03/15 13:11:23 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -136,7 +136,7 @@
 	 * Switch to bank 0 and perform the test again.
 	 * XXX INVASIVE!
 	 */
-	bus_space_write_1(iot, ioh, BANK_SELECT_REG_W, 0);
+	bus_space_write_2(iot, ioh, BANK_SELECT_REG_W, 0);
 	tmp = bus_space_read_2(iot, ioh, BANK_SELECT_REG_W);
 	if ((tmp  BSR_DETECT_MASK) != BSR_DETECT_VALUE)
 		goto out;
@@ -145,7 +145,7 @@
 	 * Check for a recognized chip id.
 	 * XXX INVASIVE!
 	 */
-	bus_space_write_1(iot, ioh, BANK_SELECT_REG_W, 3);
+	bus_space_write_2(iot, ioh, BANK_SELECT_REG_W, 3);
 	tmp = bus_space_read_2(iot, ioh, REVISION_REG_W);
 	if (smc91cxx_idstrs[RR_ID(tmp)] == NULL)
 		goto out;



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

2010-01-23 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Jan 24 03:46:48 UTC 2010

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

Log Message:
Please calculate KERNEL_PT_KERNEL_NUM from KERNEL_VM_BASE.
Moreover, can define KERNEL_VM_BASE somewhere. (ex. in conf/YOUR_GUMSTIX)
  For instance, allow miniroot.fs over 16Mbytes.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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.23 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.24
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.23	Sat Dec 26 16:01:24 2009
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sun Jan 24 03:46:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.23 2009/12/26 16:01:24 uebayasi Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.24 2010/01/24 03:46:48 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -185,7 +185,9 @@
 
 /* Kernel text starts 2MB in from the bottom of the kernel address space. */
 #define	KERNEL_TEXT_BASE	(KERNEL_BASE + 0x0020)
+#ifndef KERNEL_VM_BASE
 #define	KERNEL_VM_BASE		(KERNEL_BASE + 0x0100)
+#endif
 
 /*
  * The range 0xc100 - 0xccff is available for kernel VM space
@@ -244,7 +246,7 @@
 
 #define KERNEL_PT_SYS		0	/* Page table for mapping proc0 zero page */
 #define KERNEL_PT_KERNEL	1	/* Page table for mapping kernel */
-#define	KERNEL_PT_KERNEL_NUM	4
+#define	KERNEL_PT_KERNEL_NUM	((KERNEL_VM_BASE - KERNEL_BASE)  22)
 #define KERNEL_PT_VMDATA	(KERNEL_PT_KERNEL+KERNEL_PT_KERNEL_NUM)
 /* Page tables for mapping kernel VM */
 #define	KERNEL_PT_VMDATA_NUM	4	/* start with 16MB of KVM */



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

2009-12-02 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed Dec  2 13:05:09 UTC 2009

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

Log Message:
Enable latest bluetooth module (Infineon PBA31308).


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 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.12 src/sys/arch/evbarm/gumstix/gxio.c:1.13
--- src/sys/arch/evbarm/gumstix/gxio.c:1.12	Sun Nov 22 12:00:56 2009
+++ src/sys/arch/evbarm/gumstix/gxio.c	Wed Dec  2 13:05:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.12 2009/11/22 12:00:56 kiyohara Exp $ */
+/*	$NetBSD: gxio.c,v 1.13 2009/12/02 13:05:09 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.12 2009/11/22 12:00:56 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: gxio.c,v 1.13 2009/12/02 13:05:09 kiyohara Exp $);
 
 #include opt_gxio.h
 
@@ -123,6 +123,7 @@
 static struct pxa2x0_gpioconf verdexdep_gpioconf[] = {
 	/* Bluetooth module configuration */
 	{   9, GPIO_ALT_FN_3_OUT },	/* CHOUT0 */
+	{  12, GPIO_OUT | GPIO_SET },
 
 	/* LCD configuration */
 	{  17, GPIO_IN },		/* backlight on */
@@ -278,7 +279,11 @@
 #endif
 
 	/* XXX: turn off for power of bluetooth module */
+#if defined(CPU_XSCALE_PXA250)
 	pxa2x0_gpio_set_function(7, GPIO_OUT | GPIO_CLR);
+#elif defined(CPU_XSCALE_PXA270)
+	pxa2x0_gpio_set_function(12, GPIO_OUT | GPIO_CLR);
+#endif
 	delay(100);
 
 #if defined(CPU_XSCALE_PXA270)  defined(CPU_XSCALE_PXA250)



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

2009-12-02 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed Dec  2 13:10:09 UTC 2009

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

Log Message:
Call pxa2x0_clkman_config() instead of ioreg_write().


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 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.20 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.21
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.20	Fri Nov 27 03:23:06 2009
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Wed Dec  2 13:10:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.20 2009/11/27 03:23:06 rmind Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.21 2009/12/02 13:10:09 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -498,6 +498,8 @@
 	/* configure GPIOs. */
 	gxio_config_pin();
 
+	pxa2x0_clkman_bootstrap(GUMSTIX_CLKMAN_VBASE);
+
 	consinit();
 #ifdef KGDB
 	kgdb_port_init();
@@ -1021,10 +1023,6 @@
 consinit(void)
 {
 	static int consinit_called = 0;
-#if defined(FFUARTCONSOLE) || defined(STUARTCONSOLE) || \
-defined(BTUARTCONSOLE) || defined(HWUARTCONSOLE)
-	uint32_t ckenreg = ioreg_read(GUMSTIX_CLKMAN_VBASE + CLKMAN_CKEN);
-#endif
 
 	if (consinit_called != 0)
 		return;
@@ -1042,9 +1040,7 @@
 	{
 		if (0 == comcnattach(pxa2x0_a4x_bs_tag, PXA2X0_FFUART_BASE,
 		comcnspeed, PXA2X0_COM_FREQ, COM_TYPE_PXA2x0, comcnmode)) {
-			ioreg_write(GUMSTIX_CLKMAN_VBASE + CLKMAN_CKEN,
-			ckenreg|CKEN_FFUART);
-
+			pxa2x0_clkman_config(CKEN_FFUART, 1);
 			return;
 		}
 	}
@@ -1059,8 +1055,7 @@
 	{
 		if (0 == comcnattach(pxa2x0_a4x_bs_tag, PXA2X0_STUART_BASE,
 		comcnspeed, PXA2X0_COM_FREQ, COM_TYPE_PXA2x0, comcnmode)) {
-			ioreg_write(GUMSTIX_CLKMAN_VBASE + CLKMAN_CKEN,
-			ckenreg|CKEN_STUART);
+			pxa2x0_clkman_config(CKEN_STUART, 1);
 			return;
 		}
 	}
@@ -1075,8 +1070,7 @@
 	{
 		if (0 == comcnattach(pxa2x0_a4x_bs_tag, PXA2X0_BTUART_BASE,
 		comcnspeed, PXA2X0_COM_FREQ, COM_TYPE_PXA2x0, comcnmode)) {
-			ioreg_write(GUMSTIX_CLKMAN_VBASE + CLKMAN_CKEN,
-			ckenreg|CKEN_BTUART);
+			pxa2x0_clkman_config(CKEN_BTUART, 1);
 			return;
 		}
 	}
@@ -1091,8 +1085,7 @@
 	{
 		if (0 == comcnattach(pxa2x0_a4x_bs_tag, PXA2X0_HWUART_BASE,
 		comcnspeed, PXA2X0_COM_FREQ, COM_TYPE_PXA2x0, comcnmode)) {
-			ioreg_write(GUMSTIX_CLKMAN_VBASE + CLKMAN_CKEN,
-			ckenreg|CKEN_HWUART);
+			pxa2x0_clkman_config(CKEN_HWUART, 1);
 			return;
 		}
 	}
@@ -,28 +1104,27 @@
 {
 #if (NCOM  0)  defined(COM_PXA2X0)
 	paddr_t paddr = 0;
-	uint32_t ckenreg = ioreg_read(GUMSTIX_CLKMAN_VBASE + CLKMAN_CKEN);
+	int cken = 0;
 
 	if (0 == strcmp(kgdb_devname, ffuart)) {
 		paddr = PXA2X0_FFUART_BASE;
-		ckenreg |= CKEN_FFUART;
+		cken = CKEN_FFUART;
 	} else if (0 == strcmp(kgdb_devname, stuart)) {
 		paddr = PXA2X0_STUART_BASE;
-		ckenreg |= CKEN_STUART;
+		cken = CKEN_STUART;
 	} else if (0 == strcmp(kgdb_devname, btuart)) {
 		paddr = PXA2X0_BTUART_BASE;
-		ckenreg |= CKEN_BTUART;
+		cken = CKEN_BTUART;
 	} else if (0 == strcmp(kgdb_devname, hwuart)) {
 		paddr = PXA2X0_HWUART_BASE;
-		ckenreg |= CKEN_HWUART;
+		cken = CKEN_HWUART;
 	}
 
 	if (paddr 
 	0 == com_kgdb_attach(pxa2x0_a4x_bs_tag, paddr,
 		kgdb_devrate, PXA2X0_COM_FREQ, COM_TYPE_PXA2x0, comkgdbmode)) {
 
-		ioreg_write(GUMSTIX_CLKMAN_VBASE + CLKMAN_CKEN, ckenreg);
-
+		pxa2x0_clkman_config(cken, 1);
 	}
 
 #endif



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

2009-11-29 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Nov 29 10:08:15 UTC 2009

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

Log Message:
Fix print message.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/gumstix/if_smsh_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/if_smsh_gxio.c
diff -u src/sys/arch/evbarm/gumstix/if_smsh_gxio.c:1.1 src/sys/arch/evbarm/gumstix/if_smsh_gxio.c:1.2
--- src/sys/arch/evbarm/gumstix/if_smsh_gxio.c:1.1	Sun Aug  9 07:10:13 2009
+++ src/sys/arch/evbarm/gumstix/if_smsh_gxio.c	Sun Nov 29 10:08:15 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsh_gxio.c,v 1.1 2009/08/09 07:10:13 kiyohara Exp $	*/
+/*	$NetBSD: if_smsh_gxio.c,v 1.2 2009/11/29 10:08:15 kiyohara Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_smsh_gxio.c,v 1.1 2009/08/09 07:10:13 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_smsh_gxio.c,v 1.2 2009/11/29 10:08:15 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -108,9 +108,6 @@
 	struct lan9118_softc *sc = gsc-sc_smsh;
 	struct gxio_attach_args *gxa = aux;
 
-	aprint_normal(\n);
-	aprint_naive(\n);
-
 	KASSERT(system_serial_high != 0 || system_serial_low != 0);
 
 	sc-sc_dev = self;



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

2009-11-22 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Nov 22 12:00:56 UTC 2009

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

Log Message:
Add GPIO configuration 'LCD backlight on'.
Remove '' in comment.  That GPIO config is power on the Marvell 88W8385.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 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.11 src/sys/arch/evbarm/gumstix/gxio.c:1.12
--- src/sys/arch/evbarm/gumstix/gxio.c:1.11	Sat Aug 15 10:18:17 2009
+++ src/sys/arch/evbarm/gumstix/gxio.c	Sun Nov 22 12:00:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.11 2009/08/15 10:18:17 kiyohara Exp $ */
+/*	$NetBSD: gxio.c,v 1.12 2009/11/22 12:00:56 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.11 2009/08/15 10:18:17 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: gxio.c,v 1.12 2009/11/22 12:00:56 kiyohara Exp $);
 
 #include opt_gxio.h
 
@@ -124,6 +124,9 @@
 	/* Bluetooth module configuration */
 	{   9, GPIO_ALT_FN_3_OUT },	/* CHOUT0 */
 
+	/* LCD configuration */
+	{  17, GPIO_IN },		/* backlight on */
+
 	/* FFUART configuration */
 	{  27, GPIO_ALT_FN_3_OUT },	/* FFRTS */
 	{  34, GPIO_ALT_FN_1_IN },	/* FFRXD */
@@ -483,7 +486,7 @@
 	cfstix_config();
 	/* However use pxamci. */
 	pxa2x0_gpio_set_function(111, GPIO_CLR | GPIO_ALT_FN_1_IN);
-	/* : Power to Marvell 88W8385??? */
+	/* Power to Marvell 88W8385 */
 	pxa2x0_gpio_set_function(80, GPIO_OUT | GPIO_SET);
 }
 
@@ -501,7 +504,7 @@
 
 	cfstix_config();
 
-	/* : Power to Marvell 88W8385??? */
+	/* Power to Marvell 88W8385 */
 	pxa2x0_gpio_set_function(80, GPIO_OUT | GPIO_SET);
 }
 
@@ -523,6 +526,6 @@
 
 	cfstix_config();
 
-	/* : Power to Marvell 88W8385??? */
+	/* Power to Marvell 88W8385 */
 	pxa2x0_gpio_set_function(80, GPIO_OUT | GPIO_SET);
 }



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

2009-11-22 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sun Nov 22 12:05:14 UTC 2009

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

Log Message:
Move definition 'void gxlcd_cnattach(void)' to gumstixvar.h.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/gumstix/gumstixvar.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/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.17 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.18
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.17	Sat Nov 21 08:41:38 2009
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sun Nov 22 12:05:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.17 2009/11/21 08:41:38 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.18 2009/11/22 12:05:14 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -1104,11 +1104,7 @@
 #endif /* NCOM */
 
 #if NLCD  0
-	{
-		extern void gxlcd_cnattach(void);
-
-		gxlcd_cnattach();
-	}
+	gxlcd_cnattach();
 #endif
 }
 

Index: src/sys/arch/evbarm/gumstix/gumstixvar.h
diff -u src/sys/arch/evbarm/gumstix/gumstixvar.h:1.4 src/sys/arch/evbarm/gumstix/gumstixvar.h:1.5
--- src/sys/arch/evbarm/gumstix/gumstixvar.h:1.4	Sun Aug  9 07:10:13 2009
+++ src/sys/arch/evbarm/gumstix/gumstixvar.h	Sun Nov 22 12:05:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstixvar.h,v 1.4 2009/08/09 07:10:13 kiyohara Exp $ */
+/*	$NetBSD: gumstixvar.h,v 1.5 2009/11/22 12:05:14 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -80,4 +80,10 @@
 extern struct gxpcic_slot_irqs gxpcic_slot_irqs[2];
 extern int gxpcic_gpio_reset;
 
+
+/*
+ * gxlcd
+ */
+void gxlcd_cnattach(void);
+
 #endif /* _EVBARM_GUMSTIXVAR_H_ */



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

2009-11-21 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Nov 21 08:33:51 UTC 2009

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

Log Message:
Fix a bug.
  sc = device_private(self);
  sc-dev = self;


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/gumstix/gxlcd.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/gxlcd.c
diff -u src/sys/arch/evbarm/gumstix/gxlcd.c:1.1 src/sys/arch/evbarm/gumstix/gxlcd.c:1.2
--- src/sys/arch/evbarm/gumstix/gxlcd.c:1.1	Sun Aug  9 07:10:13 2009
+++ src/sys/arch/evbarm/gumstix/gxlcd.c	Sat Nov 21 08:33:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxlcd.c,v 1.1 2009/08/09 07:10:13 kiyohara Exp $	*/
+/*	$NetBSD: gxlcd.c,v 1.2 2009/11/21 08:33:50 kiyohara Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003  Genetec Corporation.  All rights reserved.
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gxlcd.c,v 1.1 2009/08/09 07:10:13 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: gxlcd.c,v 1.2 2009/11/21 08:33:50 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -153,9 +153,10 @@
 static void
 gxlcd_attach(device_t parent, device_t self, void *aux)
 {
-	struct pxa2x0_lcd_softc *sc = (struct pxa2x0_lcd_softc *)self;
+	struct pxa2x0_lcd_softc *sc = device_private(self);
 	struct wsemuldisplaydev_attach_args aa;
 
+	sc-dev = self;
 	pxa2x0_lcd_attach_sub(sc, aux, CURRENT_DISPLAY);
 
 	aa.console = gxlcd_console;



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

2009-11-21 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Nov 21 08:41:38 UTC 2009

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

Log Message:
The variable ckenreg is used only when defined macro {FF,ST,BT,HW}UARTCONSOLE.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 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.16 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.17
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.16	Tue Aug 11 17:04:15 2009
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sat Nov 21 08:41:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.16 2009/08/11 17:04:15 matt Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.17 2009/11/21 08:41:38 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*
- * Copyright (c) 2002, 2003, 2004, 2005  Genetec Corporation.  
+ * Copyright (c) 2002, 2003, 2004, 2005  Genetec Corporation.
  * All rights reserved.
  *
  * Written by Hiroyuki Bessho for Genetec Corporation.
@@ -44,7 +44,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. The name of Genetec Corporation may not be used to endorse or 
+ * 3. The name of Genetec Corporation may not be used to endorse or
  *promote products derived from this software without specific prior
  *written permission.
  *
@@ -60,9 +60,9 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * Machine dependant functions for kernel setup for Genetec G4250EBX 
+ * Machine dependant functions for kernel setup for Genetec G4250EBX
  * evaluation board.
- * 
+ *
  * Based on iq80310_machhdep.c
  */
 /*
@@ -483,10 +483,10 @@
 		panic(cpu not recognized!);
 
 	/*
-	 * U-Boot doesn't use the virtual memory. 
+	 * U-Boot doesn't use the virtual memory.
 	 *
-	 * Physical Address Range Description 
-	 * ----- 
+	 * Physical Address Range Description
+	 * -----
 	 * 0x - 0x00ffflash Memory   (16MB or 4MB)
 	 * 0x4000 - 0x480fProcessor Registers
 	 * 0xa000 - 0xa3ffSDRAM Bank 0 (64MB)
@@ -644,13 +644,13 @@
 
 #ifdef VERBOSE_INIT_ARM
 	printf(IRQ stack: p0x%08lx v0x%08lx\n, irqstack.pv_pa,
-	irqstack.pv_va); 
+	irqstack.pv_va);
 	printf(ABT stack: p0x%08lx v0x%08lx\n, abtstack.pv_pa,
-	abtstack.pv_va); 
+	abtstack.pv_va);
 	printf(UND stack: p0x%08lx v0x%08lx\n, undstack.pv_pa,
-	undstack.pv_va); 
+	undstack.pv_va);
 	printf(SVC stack: p0x%08lx v0x%08lx\n, kernelstack.pv_pa,
-	kernelstack.pv_va); 
+	kernelstack.pv_va);
 #endif
 
 	/*
@@ -1024,7 +1024,10 @@
 consinit(void)
 {
 	static int consinit_called = 0;
+#if defined(FFUARTCONSOLE) || defined(STUARTCONSOLE) || \
+defined(BTUARTCONSOLE) || defined(HWUARTCONSOLE)
 	uint32_t ckenreg = ioreg_read(GUMSTIX_CLKMAN_VBASE + CLKMAN_CKEN);
+#endif
 
 	if (consinit_called != 0)
 		return;
@@ -1037,10 +1040,10 @@
 #ifdef KGDB
 	if (0 == strcmp(kgdb_devname, ffuart)){
 		/* port is reserved for kgdb */
-	} else 
+	} else
 #endif
 	{
-		if (0 == comcnattach(pxa2x0_a4x_bs_tag, PXA2X0_FFUART_BASE, 
+		if (0 == comcnattach(pxa2x0_a4x_bs_tag, PXA2X0_FFUART_BASE,
 		comcnspeed, PXA2X0_COM_FREQ, COM_TYPE_PXA2x0, comcnmode)) {
 			ioreg_write(GUMSTIX_CLKMAN_VBASE + CLKMAN_CKEN,
 			ckenreg|CKEN_FFUART);



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

2009-08-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Aug 15 10:18:17 UTC 2009

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

Log Message:
Use __UNCONST().


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 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.10 src/sys/arch/evbarm/gumstix/gxio.c:1.11
--- src/sys/arch/evbarm/gumstix/gxio.c:1.10	Sun Aug  9 07:10:13 2009
+++ src/sys/arch/evbarm/gumstix/gxio.c	Sat Aug 15 10:18:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxio.c,v 1.10 2009/08/09 07:10:13 kiyohara Exp $ */
+/*	$NetBSD: gxio.c,v 1.11 2009/08/15 10:18:17 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.10 2009/08/09 07:10:13 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: gxio.c,v 1.11 2009/08/15 10:18:17 kiyohara Exp $);
 
 #include opt_gxio.h
 
@@ -299,7 +299,7 @@
 #ifdef GXIO_DEFAULT_EXPANSION
 		printf(configure default expansion (%s)\n,
 		GXIO_DEFAULT_EXPANSION);
-		expansion = GXIO_DEFAULT_EXPANSION;
+		expansion = __UNCONST(GXIO_DEFAULT_EXPANSION);
 #else
 		return;
 #endif



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

2009-04-20 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Apr 20 12:58:33 UTC 2009

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

Log Message:
Missed this file in previous commit.  This finished updates required
to enable support of i2c quick_{read,write} operations.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/gumstix/gxiic.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/gxiic.c
diff -u src/sys/arch/evbarm/gumstix/gxiic.c:1.3 src/sys/arch/evbarm/gumstix/gxiic.c:1.4
--- src/sys/arch/evbarm/gumstix/gxiic.c:1.3	Sun May 11 08:23:17 2008
+++ src/sys/arch/evbarm/gumstix/gxiic.c	Mon Apr 20 12:58:33 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gxiic.c,v 1.3 2008/05/11 08:23:17 kiyohara Exp $ */
+/*	$NetBSD: gxiic.c,v 1.4 2009/04/20 12:58:33 pgoyette Exp $ */
 /*
  * Copyright (c) 2007 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gxiic.c,v 1.3 2008/05/11 08:23:17 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: gxiic.c,v 1.4 2009/04/20 12:58:33 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -173,5 +173,10 @@
 			addr, *(u_short *)vbuf);
 	}
 
+	/* Handle quick_read/quick_write ops - XXX Untested XXX */
+	if ((cmdlen == 0)  (buflen == 0))
+		rv = pxa2x0_i2c_quick(sc-sc_pxa_i2c, addr,
+			I2C_OP_READ_P(op)?1:0);
+
 	return rv;
 }