summaryrefslogtreecommitdiffstats
path: root/target/linux/ifxmips/files/arch
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2007-12-26 22:47:45 +0000
committerJohn Crispin <john@openwrt.org>2007-12-26 22:47:45 +0000
commitc61b903d0520cf92aed682120003649e3159d22d (patch)
tree4408017951d5f80ea5cdf85e86f31f139b2264da /target/linux/ifxmips/files/arch
parent6bdd0ef59017fd234781e68d39ee3618115c32fe (diff)
downloadmaster-31e0f0ae-c61b903d0520cf92aed682120003649e3159d22d.tar.gz
master-31e0f0ae-c61b903d0520cf92aed682120003649e3159d22d.tar.bz2
master-31e0f0ae-c61b903d0520cf92aed682120003649e3159d22d.zip
add selection of console driver for ifxmips
SVN-Revision: 9936
Diffstat (limited to 'target/linux/ifxmips/files/arch')
-rw-r--r--target/linux/ifxmips/files/arch/mips/ifxmips/prom.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/target/linux/ifxmips/files/arch/mips/ifxmips/prom.c b/target/linux/ifxmips/files/arch/mips/ifxmips/prom.c
index 514c879df3..a3b62f0114 100644
--- a/target/linux/ifxmips/files/arch/mips/ifxmips/prom.c
+++ b/target/linux/ifxmips/files/arch/mips/ifxmips/prom.c
@@ -29,6 +29,13 @@
#include <asm/bootinfo.h>
#include <asm/ifxmips/ifxmips.h>
+#ifdef CONFIG_IFXMIPS_USE_CONSOLE0
+#define ASC_OFFSET 0
+#elif CONFIG_IFXMIPS_USE_CONSOLE1
+#define ASC_OFFSET IFXMIPS_ASC1_BASE_OFFSET
+#else
+#error a tty for the console must be selected
+#endif
static char buf[1024];
void
@@ -39,11 +46,11 @@ prom_free_prom_memory (void)
void
prom_putchar (char c)
{
- while ((readl(IFXMIPS_ASC1_FSTAT) & ASCFSTAT_TXFFLMASK) >> ASCFSTAT_TXFFLOFF);
+ while ((readl(IFXMIPS_ASC0_FSTAT + ASC_OFFSET) & ASCFSTAT_TXFFLMASK) >> ASCFSTAT_TXFFLOFF);
if (c == '\n')
- writel('\r', IFXMIPS_ASC1_TBUF);
- writel(c, IFXMIPS_ASC1_TBUF);
+ writel('\r', IFXMIPS_ASC0_TBUF + ASC_OFFSET);
+ writel(c, IFXMIPS_ASC0_TBUF + ASC_OFFSET);
}
void