9
0
Fork 0

MIPS: debug_ll_ns16550.h: drop _ns16550 suffix

This commit makes it possible to have unified debug_ll_*
assembler routines for differrent UART program model.
E.g. we can use debug_ll_putc() routine in common
code without knowledge on exact UART model: ns16550
or ar933x.

Also rename *_check_char -> *_tstc.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Antony Pavlov 2015-05-04 15:29:22 +03:00 committed by Sascha Hauer
parent 660d4ef13e
commit 9035f20098
6 changed files with 26 additions and 27 deletions

View File

@ -32,7 +32,7 @@
debug_ll_ns16550_init
debug_ll_ns16550_outc '.'
debug_ll_outc '.'
debug_ll_ns16550_outnl
mips_nmon

View File

@ -30,7 +30,7 @@
debug_ll_ns16550_init
debug_ll_ns16550_outc '.'
debug_ll_outc '.'
debug_ll_ns16550_outnl
mips_nmon

View File

@ -35,7 +35,7 @@
pbl_ar2312_rst_uart0
debug_ll_ns16550_init
debug_ll_ns16550_outc 'a'
debug_ll_outc 'a'
debug_ll_ns16550_outnl
/* check if SDRAM is already configured,
@ -60,7 +60,7 @@
pbl_probe_mem t0, t1, KSEG1
beq t0, t1, sdram_configured
nop
debug_ll_ns16550_outc '#'
debug_ll_outc '#'
debug_ll_ns16550_outnl
1:
@ -68,7 +68,7 @@
nop
sdram_configured:
debug_ll_ns16550_outc 'b'
debug_ll_outc 'b'
debug_ll_ns16550_outnl
copy_to_link_location pbl_start

View File

@ -32,7 +32,7 @@
debug_ll_ns16550_init
debug_ll_ns16550_outc '.'
debug_ll_outc '.'
debug_ll_ns16550_outnl
mips_nmon

View File

@ -90,7 +90,7 @@ static __inline__ void PUTC_LL(char ch)
/*
* output a character in a0
*/
.macro debug_ll_ns16550_outc_a0
.macro debug_ll_outc_a0
#ifdef CONFIG_DEBUG_LL
.set push
.set reorder
@ -110,10 +110,10 @@ static __inline__ void PUTC_LL(char ch)
/*
* output a character
*/
.macro debug_ll_ns16550_outc chr
.macro debug_ll_outc chr
#ifdef CONFIG_DEBUG_LL
li a0, \chr
debug_ll_ns16550_outc_a0
debug_ll_outc_a0
#endif /* CONFIG_DEBUG_LL */
.endm
@ -122,15 +122,15 @@ static __inline__ void PUTC_LL(char ch)
*/
.macro debug_ll_ns16550_outnl
#ifdef CONFIG_DEBUG_LL
debug_ll_ns16550_outc '\r'
debug_ll_ns16550_outc '\n'
debug_ll_outc '\r'
debug_ll_outc '\n'
#endif /* CONFIG_DEBUG_LL */
.endm
/*
* output a 32-bit value in hex
*/
.macro debug_ll_ns16550_outhexw
.macro debug_ll_outhexw
#ifdef CONFIG_DEBUG_LL
.set push
.set reorder
@ -151,7 +151,7 @@ static __inline__ void PUTC_LL(char ch)
203:
addi a0, a0, '0'
debug_ll_ns16550_outc_a0
debug_ll_outc_a0
bgtz t5, 202b
@ -165,7 +165,7 @@ static __inline__ void PUTC_LL(char ch)
* v0 = 0 no character in input buffer
* v0 != 0 character in input buffer
*/
.macro debug_ll_ns16550_check_char
.macro debug_ll_tstc
#ifdef CONFIG_DEBUG_LL
.set push
.set reorder
@ -183,13 +183,13 @@ static __inline__ void PUTC_LL(char ch)
/*
* get character to v0
*/
.macro debug_ll_ns16550_getc
.macro debug_ll_getc
#ifdef CONFIG_DEBUG_LL
.set push
.set reorder
204:
debug_ll_ns16550_check_char
debug_ll_tstc
/* try again */
beqz v0, 204b

View File

@ -17,8 +17,7 @@
*
*/
#include <board/debug_ll.h>
#include <asm/debug_ll_ns16550.h>
#include <mach/debug_ll.h>
#define CODE_ESC 0x1b
@ -74,7 +73,7 @@ nmon_wait_user:
nmon_outs msg_bsp
debug_ll_ns16550_check_char
debug_ll_tstc
bnez v0, 3f
@ -91,7 +90,7 @@ msg_nmon_press_any_key:
.align 4
3:
/* get received char from ns16550's buffer */
debug_ll_ns16550_getc
debug_ll_getc
#endif /* CONFIG_NMON_USER_START */
nmon_main_help:
@ -102,9 +101,9 @@ nmon_main_help:
nmon_main:
nmon_outs msg_prompt
debug_ll_ns16550_getc
debug_ll_getc
/* prepare a0 for debug_ll_ns16550_outc_a0 */
/* prepare a0 for debug_ll_outc_a0 */
move a0, v0
li v1, 'q'
@ -137,7 +136,7 @@ nmon_cmd_d:
nmon_outs msg_nl
lw a0, (v0)
debug_ll_ns16550_outhexw
debug_ll_outhexw
b nmon_main
@ -170,7 +169,7 @@ nmon_cmd_g:
b nmon_main
_nmon_outc_a0:
debug_ll_ns16550_outc_a0
debug_ll_outc_a0
jr ra
_nmon_outs:
@ -178,7 +177,7 @@ _nmon_outs:
addi a1, a1, 1
beqz a0, _nmon_jr_ra_exit
debug_ll_ns16550_outc_a0
debug_ll_outc_a0
b _nmon_outs
@ -188,7 +187,7 @@ _nmon_gethexw:
li t2, 0
_get_hex_digit:
debug_ll_ns16550_getc
debug_ll_getc
li v1, CODE_ESC
beq v0, v1, nmon_main
@ -221,7 +220,7 @@ _get_hex_digit:
sub a3, v0, a3
0: move a0, v0
debug_ll_ns16550_outc_a0
debug_ll_outc_a0
sll t2, t2, 4
or t2, t2, a3