1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

add selection of console driver for ifxmips

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9936 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
blogic
2007-12-26 22:47:45 +00:00
parent adde95556f
commit 632d9c15dd
3 changed files with 29 additions and 20 deletions

View File

@@ -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