[oe-commits] Frans Meulenbroeks : linux-kirkwood: fixed patch issues for openrd-base

git version control git at git.openembedded.org
Sun Jan 31 17:08:00 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: e76a15f95e8bb62e499ee61eb15a3e533b4483c2
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=e76a15f95e8bb62e499ee61eb15a3e533b4483c2

Author: Frans Meulenbroeks <fransmeulenbroeks at gmail.com>
Date:   Sun Jan 31 17:52:31 2010 +0100

linux-kirkwood: fixed patch issues for openrd-base

- eliminate a patch from the recipe that was already in git
- fixed a patch which failed on a file which was not applicable for openrd-base
  (made a dedicated patch with only those parts that are needed for openrd-base)

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks at gmail.com>

---

 conf/machine/include/kirkwood.inc                  |    2 +-
 ...M-Kirkwood-OpenRD-base-SD-UART1-selection.patch |  110 ++++++++++++++++++++
 recipes/linux/linux-kirkwood_2.6.33-rc5.bb         |    3 +-
 3 files changed, 112 insertions(+), 3 deletions(-)

diff --git a/conf/machine/include/kirkwood.inc b/conf/machine/include/kirkwood.inc
index 6de8b7d..8507857 100644
--- a/conf/machine/include/kirkwood.inc
+++ b/conf/machine/include/kirkwood.inc
@@ -11,7 +11,7 @@ USE_DEVFS = "0"
 PREFERRED_PROVIDER_virtual/bootloader = ""
 PREFERRED_PROVIDER_virtual/kernel = "linux-kirkwood"
 
-MACHINE_KERNEL_PR = "r15"
+MACHINE_KERNEL_PR = "r16"
 
 IMAGE_FSTYPES += "tar.gz ubi"
 SERIAL_CONSOLE = "ttyS0 115200"
diff --git a/recipes/linux/linux-kirkwood/0004-ARM-Kirkwood-OpenRD-base-SD-UART1-selection.patch b/recipes/linux/linux-kirkwood/0004-ARM-Kirkwood-OpenRD-base-SD-UART1-selection.patch
new file mode 100644
index 0000000..b846da9
--- /dev/null
+++ b/recipes/linux/linux-kirkwood/0004-ARM-Kirkwood-OpenRD-base-SD-UART1-selection.patch
@@ -0,0 +1,110 @@
+From 3423306f9b0aa3f9f4b41338565e18d9c3bf0bb2 Mon Sep 17 00:00:00 2001
+From: Tanmay Upadhyay <tanmay.upadhyay at einfochips.com>
+Date: Fri, 25 Dec 2009 15:02:12 +0530
+Subject: [PATCH] ARM: Kirkwood: OpenRD: SD/UART1 selection
+
+To select UART1, pass "uart=232" (for RS232) OR "uart=485" (for RS485) in the
+boot argument. To select SDIO lines pass "uart=no". SDIO lines will be selected
+by default in absence of this parameter.
+
+Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay at einfochips.com>
+---
+ arch/arm/mach-kirkwood/openrd_base-setup.c   |   61 +++++++++++++++++++++++++-
+ arch/arm/mach-kirkwood/openrd_client-setup.c |   59 ++++++++++++++++++++++++-
+ 2 files changed, 117 insertions(+), 3 deletions(-)
+
+Index: git/arch/arm/mach-kirkwood/openrd_base-setup.c
+===================================================================
+--- git.orig/arch/arm/mach-kirkwood/openrd_base-setup.c
++++ git/arch/arm/mach-kirkwood/openrd_base-setup.c
+@@ -15,6 +15,7 @@
+ #include <linux/ata_platform.h>
+ #include <linux/mv643xx_eth.h>
+ #include <linux/gpio.h>
++#include <linux/io.h>
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+ #include <mach/kirkwood.h>
+@@ -51,16 +52,53 @@ static struct mvsdio_platform_data openr
+ };
+ 
+ static unsigned int openrd_base_mpp_config[] __initdata = {
+-	MPP29_GPIO,	
++	MPP12_SD_CLK,
++	MPP13_SD_CMD,
++	MPP14_SD_D0,
++	MPP15_SD_D1,
++	MPP16_SD_D2,
++	MPP17_SD_D3,
++	MPP29_GPIO,
+ 	0
+ };
+ 
++static int uart1;
++
++static void sd_uart_selection(void)
++{
++	char *ptr = NULL;
++
++	/* Parse boot_command_line string uart=no/232/485 */
++	ptr = strstr(boot_command_line, "uart=");
++
++	/* Default is SD. Change if required, for UART */
++	if (ptr != NULL) {
++		if (!strncmp(ptr + 5, "232", 3)) {
++			/* Configure MPP for UART */
++			openrd_base_mpp_config[1] = MPP13_UART1_TXD;
++			openrd_base_mpp_config[2] = MPP14_UART1_RXD;
++
++			uart1 = 232;
++		} else if (!strncmp(ptr + 5, "485", 3)) {
++			/* Configure MPP for UART */
++			openrd_base_mpp_config[1] = MPP13_UART1_TXD;
++			openrd_base_mpp_config[2] = MPP14_UART1_RXD;
++
++			uart1 = 485;
++		}
++	}
++}
++
+ static void __init openrd_base_init(void)
+ {
+ 	/*
+ 	 * Basic setup. Needs to be called early.
+ 	 */
+ 	kirkwood_init();
++
++	/* This function modifies MPP config according to boot argument */
++	sd_uart_selection();
++
+ 	kirkwood_mpp_conf(openrd_base_mpp_config);
+ 
+ 	kirkwood_uart0_init();
+@@ -70,7 +108,26 @@ static void __init openrd_base_init(void
+ 
+ 	kirkwood_ge00_init(&openrd_base_ge00_data);
+ 	kirkwood_sata_init(&openrd_base_sata_data);
+-	kirkwood_sdio_init(&openrd_base_mvsdio_data);
++
++	if (!uart1) {
++		/* Select SD
++		 * Pin # 34: 0 => UART1, 1 => SD */
++		writel(readl(GPIO_OUT(34)) | 4, GPIO_OUT(34));
++
++		kirkwood_sdio_init(&openrd_base_mvsdio_data);
++	} else {
++		/* Select UART1
++		 * Pin # 34: 0 => UART1, 1 => SD */
++		writel(readl(GPIO_OUT(34)) & ~(4), GPIO_OUT(34));
++
++		/* Select RS232 OR RS485
++		 * Pin # 28: 0 => RS232, 1 => RS485 */
++		if (uart1 == 232)
++			writel(readl(GPIO_OUT(28)) & ~(0x10000000),
++				GPIO_OUT(28));
++		else
++			writel(readl(GPIO_OUT(28)) | 0x10000000, GPIO_OUT(28));
++	}
+ 
+ 	kirkwood_i2c_init();
+ }
diff --git a/recipes/linux/linux-kirkwood_2.6.33-rc5.bb b/recipes/linux/linux-kirkwood_2.6.33-rc5.bb
index b164082..b54add9 100644
--- a/recipes/linux/linux-kirkwood_2.6.33-rc5.bb
+++ b/recipes/linux/linux-kirkwood_2.6.33-rc5.bb
@@ -15,8 +15,7 @@ SRC_URI = "git://repo.or.cz/linux-2.6/linux-2.6-openrd.git;protocol=git \
            file://defconfig"
 
 SRC_URI_append_openrd-base += " \
-	 file://openrd-base/openrd-base-enable-pcie.patch;patch=1 \
-	 file://0004-ARM-Kirkwood-OpenRD-SD-UART1-selection.patch;patch=1 \
+	 file://0004-ARM-Kirkwood-OpenRD-base-SD-UART1-selection.patch;patch=1 \
 	"
 
 SRC_URI_append_openrd-client += " \





More information about the Openembedded-commits mailing list