[U-Boot-Users] [PATCH] TQM5200: Enable multi serial console feature on the STK52xx base board
Martin Krause
martin.krause at tqs.de
Tue Oct 23 15:03:45 CEST 2007
If the TQM5200 is used on a STK52xx base board, now PSC3 also
could be used as serial console (in addition to PSC1). Se
/doc/README.serial_multi for more information.
Signed-off-by: Martin Krause <martin.krause at tqs.de>
---
board/tqm5200/cmd_stk52xx.c | 8 +++++++-
include/configs/TQM5200.h | 4 ++++
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/board/tqm5200/cmd_stk52xx.c b/board/tqm5200/cmd_stk52xx.c
index 27a6c41..3a931d5 100644
--- a/board/tqm5200/cmd_stk52xx.c
+++ b/board/tqm5200/cmd_stk52xx.c
@@ -68,7 +68,7 @@ static void spi_init(void)
/* PSC3 as SPI and GPIOs */
gpio->port_config &= 0xFFFFF0FF;
- gpio->port_config |= 0x00000800;
+ gpio->port_config |= 0x00000C00;
/*
* Its important to use the correct order when initializing the
* registers
@@ -545,9 +545,15 @@ void led_init(void)
struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO;
struct mpc5xxx_gpt_0_7 *gpt = (struct mpc5xxx_gpt_0_7 *)MPC5XXX_GPT;
+#if defined (CONFIG_SERIAL_MULTI)
+ printf (" LEDs 0-3 are not usable with the CONFIG_SERIAL_MULTI\n" \
+ " configuration, because the pins PSC3_0-3 are used as\n" \
+ " 'serial1' console\n");
+#else
/* configure PSC3 for SPI and GPIO */
gpio->port_config &= ~(0x00000F00);
gpio->port_config |= 0x00000800;
+#endif /* CONFIG_SERIAL_MULTI */
gpio->simple_gpioe &= ~(0x00000F00);
gpio->simple_gpioe |= 0x00000F00;
diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h
index c3f16f5..8ad164b 100644
--- a/include/configs/TQM5200.h
+++ b/include/configs/TQM5200.h
@@ -51,6 +51,10 @@
* Serial console configuration
*/
#define CONFIG_PSC_CONSOLE 1 /* console is on PSC1 */
+#ifdef CONFIG_STK52XX
+#define CONFIG_SERIAL_MULTI 1 /* support multiple consoles */
+#define CONFIG_PSC_CONSOLE2 3 /* second console is on PSC3 */
+#endif /* CONFIG_STK52XX */
#define CONFIG_BAUDRATE 115200 /* ... at 115200 bps */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
More information about the U-Boot
mailing list