aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx/patches-2.6.36/013-MIPS-BCM47xx-Swap-serial-console-if-ttyS1-was-specif.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@openwrt.org>2010-12-05 19:19:50 +0000
committerHauke Mehrtens <hauke@openwrt.org>2010-12-05 19:19:50 +0000
commita3239da5861210e11b191eac3138df571aa22737 (patch)
tree7e40103c70b144be9d1f55eb543c3396b92ae737 /target/linux/brcm47xx/patches-2.6.36/013-MIPS-BCM47xx-Swap-serial-console-if-ttyS1-was-specif.patch
parent91e32e19b526559a67c2508c5d26a3040946eb52 (diff)
downloadupstream-a3239da5861210e11b191eac3138df571aa22737.tar.gz
upstream-a3239da5861210e11b191eac3138df571aa22737.tar.bz2
upstream-a3239da5861210e11b191eac3138df571aa22737.zip
brcm47xx: backport patch from kernel 2.6.37
Backport patches from r24162 brcm47xx: reorder patches like they were commitet upstream git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24266 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-2.6.36/013-MIPS-BCM47xx-Swap-serial-console-if-ttyS1-was-specif.patch')
-rw-r--r--target/linux/brcm47xx/patches-2.6.36/013-MIPS-BCM47xx-Swap-serial-console-if-ttyS1-was-specif.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-2.6.36/013-MIPS-BCM47xx-Swap-serial-console-if-ttyS1-was-specif.patch b/target/linux/brcm47xx/patches-2.6.36/013-MIPS-BCM47xx-Swap-serial-console-if-ttyS1-was-specif.patch
new file mode 100644
index 0000000000..e6a0d526b3
--- /dev/null
+++ b/target/linux/brcm47xx/patches-2.6.36/013-MIPS-BCM47xx-Swap-serial-console-if-ttyS1-was-specif.patch
@@ -0,0 +1,45 @@
+From 25abc0cde3f4865910b380d68ffda0916b5870e7 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sat, 27 Nov 2010 12:25:21 +0100
+Subject: [PATCH 4/6] MIPS: BCM47xx: Swap serial console if ttyS1 was specified.
+
+Some devices like the Netgear WGT634U are using ttyS1 for default
+console output. We should switch to that console if it was given in
+the kernel_args parameters.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ arch/mips/bcm47xx/setup.c | 16 ++++++++++++++++
+ 1 files changed, 16 insertions(+), 0 deletions(-)
+
+--- a/arch/mips/bcm47xx/setup.c
++++ b/arch/mips/bcm47xx/setup.c
+@@ -169,12 +169,28 @@ static int bcm47xx_get_invariants(struct
+ void __init plat_mem_setup(void)
+ {
+ int err;
++ char buf[100];
++ struct ssb_mipscore *mcore;
+
+ err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE,
+ bcm47xx_get_invariants);
+ if (err)
+ panic("Failed to initialize SSB bus (err %d)\n", err);
+
++ mcore = &ssb_bcm47xx.mipscore;
++ if (nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) {
++ if (strstr(buf, "console=ttyS1")) {
++ struct ssb_serial_port port;
++
++ printk(KERN_DEBUG "Swapping serial ports!\n");
++ /* swap serial ports */
++ memcpy(&port, &mcore->serial_ports[0], sizeof(port));
++ memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1],
++ sizeof(port));
++ memcpy(&mcore->serial_ports[1], &port, sizeof(port));
++ }
++ }
++
+ _machine_restart = bcm47xx_machine_restart;
+ _machine_halt = bcm47xx_machine_halt;
+ pm_power_off = bcm47xx_machine_halt;