aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Michlmayr <tbm@cyrius.com>2010-02-22 21:13:36 +0000
committerMartin Michlmayr <tbm@cyrius.com>2010-02-22 21:13:36 +0000
commit3c0344d2785c7227a3065fe3c023a32ba1db8fdf (patch)
tree65221e49448942c3534b47c26350080669c79309
parent2f5c47eb6372b7b0a7a0924367902868a6d4f1b7 (diff)
downloadkernel_replicant_linux-3c0344d2785c7227a3065fe3c023a32ba1db8fdf.tar.gz
kernel_replicant_linux-3c0344d2785c7227a3065fe3c023a32ba1db8fdf.tar.bz2
kernel_replicant_linux-3c0344d2785c7227a3065fe3c023a32ba1db8fdf.zip
OpenRD-Base: allow SD/UART1 selection (Closes: #571019)
svn path=/dists/sid/linux-2.6/; revision=15257
-rw-r--r--debian/changelog1
-rw-r--r--debian/patches/features/arm/openrd-base-uart.patch95
-rw-r--r--debian/patches/series/91
3 files changed, 97 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 3857d78f0654..1765f23a4854 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -41,6 +41,7 @@ linux-2.6 (2.6.32-9) UNRELEASED; urgency=low
Patard).
* [armel/kirkwood] Disable MTD_NAND_VERIFY_WRITE to avoid errors
with ubifs on OpenRD (Thanks Gert Doering) (Closes: #570407)
+ * OpenRD-Base: allow SD/UART1 selection (Closes: #571019)
-- Ben Hutchings <ben@decadent.org.uk> Fri, 12 Feb 2010 02:59:33 +0000
diff --git a/debian/patches/features/arm/openrd-base-uart.patch b/debian/patches/features/arm/openrd-base-uart.patch
new file mode 100644
index 000000000000..bc0034087436
--- /dev/null
+++ b/debian/patches/features/arm/openrd-base-uart.patch
@@ -0,0 +1,95 @@
+From: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
+Date: Wed, 3 Feb 2010 11:56:21 +0530
+Subject: [PATCH] ARM: Kirkwood: OpenRD: SD/UART1 selection
+
+To select UART1, pass "uart=232" in the boot argument. Else SDIO lines will be
+selected.
+
+Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
+---
+ arch/arm/mach-kirkwood/openrd_base-setup.c | 49 +++++++++++++++++++++++++++-
+ 1 files changed, 48 insertions(+), 1 deletions(-)
+
+--- a/arch/arm/mach-kirkwood/openrd_base-setup.c 2009-12-03 03:51:21.000000000 +0000
++++ b/arch/arm/mach-kirkwood/openrd_base-setup.c 2010-02-22 21:07:11.000000000 +0000
+@@ -14,6 +14,8 @@
+ #include <linux/mtd/partitions.h>
+ #include <linux/ata_platform.h>
+ #include <linux/mv643xx_eth.h>
++#include <linux/io.h>
++#include <linux/gpio.h>
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+ #include <mach/kirkwood.h>
+@@ -50,16 +52,48 @@
+ };
+
+ static unsigned int openrd_base_mpp_config[] __initdata = {
++ MPP12_SD_CLK,
++ MPP13_SD_CMD,
++ MPP14_SD_D0,
++ MPP15_SD_D1,
++ MPP16_SD_D2,
++ MPP17_SD_D3,
++ MPP29_GPIO,
+ MPP29_GPIO,
+ 0
+ };
+
++static int uart1;
++
++static void sd_uart_selection(void)
++{
++ char *ptr = NULL;
++
++ /* Parse boot_command_line string uart=no/232 */
++ 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;
++ }
++ }
++}
++
+ 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();
+@@ -69,7 +103,20 @@
+
+ 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));
++
++ kirkwood_uart1_init();
++ }
+
+ kirkwood_i2c_init();
+ }
+
diff --git a/debian/patches/series/9 b/debian/patches/series/9
index e347b76373f6..470853ed071d 100644
--- a/debian/patches/series/9
+++ b/debian/patches/series/9
@@ -19,3 +19,4 @@
+ bugfix/all/sfc-SFE4002-SFN4112F-Widen-temperature-voltage-tolerances.patch
+ features/all/ath9k-add-support-for-802.11n-bonded-out-AR2427.patch
+ bugfix/all/drm-i915-give-up-on-8xx-lid-status.patch
++ features/arm/openrd-base-uart.patch