summaryrefslogtreecommitdiff
path: root/target/linux/ifxmips/files/arch/mips
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2008-06-25 23:05:50 +0000
committerJohn Crispin <john@openwrt.org>2008-06-25 23:05:50 +0000
commit2cc35a5235309eac4dc1feb1fff342e5db1a1e94 (patch)
tree7a27207850a4ea3af5c408c938e0cfefb8a24762 /target/linux/ifxmips/files/arch/mips
parenta3236bc99d391015710c19c6c312ffb0e95e9d0a (diff)
downloadmtk-20170518-2cc35a5235309eac4dc1feb1fff342e5db1a1e94.zip
mtk-20170518-2cc35a5235309eac4dc1feb1fff342e5db1a1e94.tar.gz
mtk-20170518-2cc35a5235309eac4dc1feb1fff342e5db1a1e94.tar.bz2
cleanup ifxmips and add support for both ttyS
SVN-Revision: 11578
Diffstat (limited to 'target/linux/ifxmips/files/arch/mips')
-rw-r--r--target/linux/ifxmips/files/arch/mips/ifxmips/prom.c22
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 010d488..95630ae 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