summaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm47xx/setup.c
diff options
context:
space:
mode:
authorHauke Mehrtens2010-11-27 17:46:01 +0100
committerRalf Baechle2010-12-16 19:11:00 +0100
commit1690a7f9ab83f5c823f3044275a4a771a059d5bb (patch)
treeadc9521bcf964830a478890d97e250ae5e16a6b5 /arch/mips/bcm47xx/setup.c
parentMIPS: BCM47xx: Use sscanf for parsing mac address (diff)
downloadkernel-qcow2-linux-1690a7f9ab83f5c823f3044275a4a771a059d5bb.tar.gz
kernel-qcow2-linux-1690a7f9ab83f5c823f3044275a4a771a059d5bb.tar.xz
kernel-qcow2-linux-1690a7f9ab83f5c823f3044275a4a771a059d5bb.zip
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> To: linux-mips@linux-mips.org Cc: Hauke Mehrtens <hauke@hauke-m.de> Patchwork: https://patchwork.linux-mips.org/patch/1848/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/bcm47xx/setup.c')
-rw-r--r--arch/mips/bcm47xx/setup.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
index 87a305536604..c95f90bf734c 100644
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -169,12 +169,28 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus,
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;