diff options
author | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-06-25 23:05:50 +0000 |
---|---|---|
committer | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-06-25 23:05:50 +0000 |
commit | e0fb3b63965109c9ae459e7316b4956cfdd61296 (patch) | |
tree | d40c620ffc7a785694b144d1eb885d42c2bf4388 /target/linux/ifxmips/files/arch/mips | |
parent | 49c631ff5305545484375b89cb667fb91860a7ef (diff) |
cleanup ifxmips and add support for both ttyS
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11578 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ifxmips/files/arch/mips')
-rw-r--r-- | target/linux/ifxmips/files/arch/mips/ifxmips/prom.c | 22 |
1 files changed, 19 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 010d488ae..95630ae36 100644 --- a/target/linux/ifxmips/files/arch/mips/ifxmips/prom.c +++ b/target/linux/ifxmips/files/arch/mips/ifxmips/prom.c @@ -26,6 +26,18 @@ static char buf[1024]; unsigned int *prom_cp1_base = NULL; unsigned int prom_cp1_size = 0; +static inline u32 +asc_r32(unsigned long r) +{ + return ifxmips_r32((u32*)(IFXMIPS_ASC_BASE_ADDR + IFXMIPS_ASC_BASE_DIFF + r)); +} + +static inline void +asc_w32(u32 v, unsigned long r) +{ + ifxmips_w32(v, (u32*)(IFXMIPS_ASC_BASE_ADDR + IFXMIPS_ASC_BASE_DIFF + r)); +} + void prom_free_prom_memory(void) { @@ -34,11 +46,15 @@ prom_free_prom_memory(void) void prom_putchar(char c) { - while((ifxmips_r32(IFXMIPS_ASC1_FSTAT) & ASCFSTAT_TXFFLMASK) >> ASCFSTAT_TXFFLOFF); + unsigned long flags; + + local_irq_save(flags); + while((asc_r32(IFXMIPS_ASC_FSTAT) & ASCFSTAT_TXFFLMASK) >> ASCFSTAT_TXFFLOFF); if(c == '\n') - ifxmips_w32('\r', IFXMIPS_ASC1_TBUF); - ifxmips_w32(c, IFXMIPS_ASC1_TBUF); + asc_w32('\r', IFXMIPS_ASC_TBUF); + asc_w32(c, IFXMIPS_ASC_TBUF); + local_irq_restore(flags); } void |