comparison gsm-fw/lldbg/serio.S @ 865:f5affe83ba2d

lldbg hack (poor girl's substitute for JTAG) implemented
author Space Falcon <falcon@ivan.Harhan.ORG>
date Fri, 15 May 2015 00:02:03 +0000
parents
children
comparison
equal deleted inserted replaced
864:4fa939eada22 865:f5affe83ba2d
1 #include "../include/config.h"
2 #include "ns16550.h"
3
4 /* this module implements the elementary serial I/O operations */
5
6 .text
7 .code 32
8 .globl lldbg_serial_out
9 lldbg_serial_out:
10 ldr r2, =CONFIG_LLDBG_UART_BASE
11 1: ldrb r3, [r2, #NS16550_LSR]
12 tst r3, #NS16550_LSR_THRE
13 beq 1b
14 strb r0, [r2, #NS16550_THR]
15 bx lr
16
17 .globl lldbg_serial_in_poll
18 lldbg_serial_in_poll:
19 ldr r2, =CONFIG_LLDBG_UART_BASE
20 ldrb r3, [r2, #NS16550_LSR]
21 tst r3, #NS16550_LSR_DR
22 ldrneb r0, [r2, #NS16550_RBR]
23 mvneq r0, #0
24 bx lr
25
26 #if 0 // not needed currently
27 .globl lldbg_serial_flush
28 lldbg_serial_flush:
29 ldr r2, =CONFIG_LLDBG_UART_BASE
30 1: ldrb r3, [r2, #NS16550_LSR]
31 tst r3, #NS16550_LSR_TEMP
32 beq 1b
33 bx lr
34 #endif