summaryrefslogtreecommitdiff
path: root/common/serial.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2006-08-30 23:02:10 +0200
committerWolfgang Denk <wd@pollux.denx.de>2006-08-30 23:02:10 +0200
commit0fd30252c840ee54d2a80475d6504766d43b8add (patch)
tree1ca4d91cd9ef225477cfc5aeeb9008f08ac587c2 /common/serial.c
parent2b75062a0f97ad6ff19d9d2c030d4b29829260f1 (diff)
Make the serial driver framework work with CONFIG_SERIAL_MULTI enabled
Diffstat (limited to 'common/serial.c')
-rw-r--r--common/serial.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/common/serial.c b/common/serial.c
index 38057d21f6c..605d4e34be0 100644
--- a/common/serial.c
+++ b/common/serial.c
@@ -42,7 +42,19 @@ struct serial_device *default_serial_console (void)
return &serial_scc_device;
#elif defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) \
|| defined(CONFIG_405EP) || defined(CONFIG_MPC5xxx)
-#if defined(CONFIG_UART1_CONSOLE)
+#if defined(CONFIG_CONS_INDEX) && defined(CFG_NS16550_SERIAL)
+#if (CONFIG_CONS_INDEX==1)
+ return &eserial1_device;
+#elif (CONFIG_CONS_INDEX==2)
+ return &eserial2_device;
+#elif (CONFIG_CONS_INDEX==3)
+ return &eserial3_device;
+#elif (CONFIG_CONS_INDEX==4)
+ return &eserial4_device;
+#else
+#error "Bad CONFIG_CONS_INDEX."
+#endif
+#elif defined(CONFIG_UART1_CONSOLE)
return &serial1_device;
#else
return &serial0_device;
@@ -84,6 +96,20 @@ void serial_initialize (void)
serial_register(&serial1_device);
#endif
+#if defined(CFG_NS16550_SERIAL)
+#if defined(CFG_NS16550_COM1)
+ serial_register(&eserial1_device);
+#endif
+#if defined(CFG_NS16550_COM2)
+ serial_register(&eserial2_device);
+#endif
+#if defined(CFG_NS16550_COM3)
+ serial_register(&eserial3_device);
+#endif
+#if defined(CFG_NS16550_COM4)
+ serial_register(&eserial4_device);
+#endif
+#endif /* CFG_NS16550_SERIAL */
serial_assign (default_serial_console ()->name);
}