diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2010-11-27 11:46:01 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-12-16 13:11:00 -0500 |
commit | 1690a7f9ab83f5c823f3044275a4a771a059d5bb (patch) | |
tree | adc9521bcf964830a478890d97e250ae5e16a6b5 | |
parent | 59833fcf48ee7b7c8a01e590aa7b7212305c3077 (diff) |
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>
-rw-r--r-- | arch/mips/bcm47xx/setup.c | 16 |
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, | |||
169 | void __init plat_mem_setup(void) | 169 | void __init plat_mem_setup(void) |
170 | { | 170 | { |
171 | int err; | 171 | int err; |
172 | char buf[100]; | ||
173 | struct ssb_mipscore *mcore; | ||
172 | 174 | ||
173 | err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE, | 175 | err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE, |
174 | bcm47xx_get_invariants); | 176 | bcm47xx_get_invariants); |
175 | if (err) | 177 | if (err) |
176 | panic("Failed to initialize SSB bus (err %d)\n", err); | 178 | panic("Failed to initialize SSB bus (err %d)\n", err); |
177 | 179 | ||
180 | mcore = &ssb_bcm47xx.mipscore; | ||
181 | if (nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) { | ||
182 | if (strstr(buf, "console=ttyS1")) { | ||
183 | struct ssb_serial_port port; | ||
184 | |||
185 | printk(KERN_DEBUG "Swapping serial ports!\n"); | ||
186 | /* swap serial ports */ | ||
187 | memcpy(&port, &mcore->serial_ports[0], sizeof(port)); | ||
188 | memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1], | ||
189 | sizeof(port)); | ||
190 | memcpy(&mcore->serial_ports[1], &port, sizeof(port)); | ||
191 | } | ||
192 | } | ||
193 | |||
178 | _machine_restart = bcm47xx_machine_restart; | 194 | _machine_restart = bcm47xx_machine_restart; |
179 | _machine_halt = bcm47xx_machine_halt; | 195 | _machine_halt = bcm47xx_machine_halt; |
180 | pm_power_off = bcm47xx_machine_halt; | 196 | pm_power_off = bcm47xx_machine_halt; |