1 From 25abc0cde3f4865910b380d68ffda0916b5870e7 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sat, 27 Nov 2010 12:25:21 +0100
4 Subject: [PATCH 4/6] MIPS: BCM47xx: Swap serial console if ttyS1 was specified.
6 Some devices like the Netgear WGT634U are using ttyS1 for default
7 console output. We should switch to that console if it was given in
8 the kernel_args parameters.
10 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 arch/mips/bcm47xx/setup.c | 16 ++++++++++++++++
13 1 files changed, 16 insertions(+), 0 deletions(-)
15 --- a/arch/mips/bcm47xx/setup.c
16 +++ b/arch/mips/bcm47xx/setup.c
17 @@ -169,12 +169,28 @@ static int bcm47xx_get_invariants(struct
18 void __init plat_mem_setup(void)
22 + struct ssb_mipscore *mcore;
24 err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE,
25 bcm47xx_get_invariants);
27 panic("Failed to initialize SSB bus (err %d)\n", err);
29 + mcore = &ssb_bcm47xx.mipscore;
30 + if (nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) {
31 + if (strstr(buf, "console=ttyS1")) {
32 + struct ssb_serial_port port;
34 + printk(KERN_DEBUG "Swapping serial ports!\n");
35 + /* swap serial ports */
36 + memcpy(&port, &mcore->serial_ports[0], sizeof(port));
37 + memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1],
39 + memcpy(&mcore->serial_ports[1], &port, sizeof(port));
43 _machine_restart = bcm47xx_machine_restart;
44 _machine_halt = bcm47xx_machine_halt;
45 pm_power_off = bcm47xx_machine_halt;