projects
/
coreboot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added rx support
[coreboot.git]
/
src
/
lib
/
uart8250.c
diff --git
a/src/lib/uart8250.c
b/src/lib/uart8250.c
index 67b0a95cfb30f81a669a3733b3cce8fee5637f18..e3a1255dc6f6f2277db4f76fc119e9db87280369 100644
(file)
--- a/
src/lib/uart8250.c
+++ b/
src/lib/uart8250.c
@@
-20,7
+20,7
@@
#define UART_MSR 0x06
#define UART_SCR 0x07
#define UART_MSR 0x06
#define UART_SCR 0x07
-static in
line in
t uart8250_can_tx_byte(unsigned base_port)
+static int uart8250_can_tx_byte(unsigned base_port)
{
return inb(base_port + UART_LSR) & 0x20;
}
{
return inb(base_port + UART_LSR) & 0x20;
}
@@
-45,6
+45,18
@@
void uart8250_tx_byte(unsigned base_port, unsigned char data)
uart8250_wait_until_sent(base_port);
}
uart8250_wait_until_sent(base_port);
}
+int uart8250_can_rx_byte(unsigned base_port)
+{
+ return inb(base_port + UART_LSR) & 0x01;
+}
+
+unsigned char uart8250_rx_byte(unsigned base_port)
+{
+ while(!uart8250_can_rx_byte(base_port))
+ ;
+ return inb(base_port + UART_RBR);
+}
+
void uart8250_init(unsigned base_port, unsigned divisor, unsigned lcs)
{
lcs &= 0x7f;
void uart8250_init(unsigned base_port, unsigned divisor, unsigned lcs)
{
lcs &= 0x7f;