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 $  */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -48,6 +48,7 @@
 #define GUMSTIX_LCDC_VBASE		0xfd700000
 
 #define OVERO_L4_PERIPHERAL_VBASE	0x90000000
+#define OVERO_GPMC_VBASE		0x90100000
 
 
 #define ioreg_read(a)		(*(volatile unsigned *)(a))

Reply via email to