[ARM] Orion: use linux/serial_reg.h for Orion uncompress.h
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
This commit is contained in:
committed by
Lennert Buytenhek
parent
7ec753ccc1
commit
0e3bc0503f
@@ -8,23 +8,38 @@
|
|||||||
* warranty of any kind, whether express or implied.
|
* warranty of any kind, whether express or implied.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/serial_reg.h>
|
||||||
#include <asm/arch/orion5x.h>
|
#include <asm/arch/orion5x.h>
|
||||||
|
|
||||||
#define MV_UART_THR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x0))
|
#define SERIAL_BASE ((unsigned char *)UART0_PHYS_BASE)
|
||||||
#define MV_UART_LSR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x14))
|
|
||||||
|
|
||||||
#define LSR_THRE 0x20
|
|
||||||
|
|
||||||
static void putc(const char c)
|
static void putc(const char c)
|
||||||
{
|
{
|
||||||
int j = 0x1000;
|
unsigned char *base = SERIAL_BASE;
|
||||||
while (--j && !(*MV_UART_LSR & LSR_THRE))
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 0x1000; i++) {
|
||||||
|
if (base[UART_LSR << 2] & UART_LSR_THRE)
|
||||||
|
break;
|
||||||
barrier();
|
barrier();
|
||||||
*MV_UART_THR = c;
|
}
|
||||||
|
|
||||||
|
base[UART_TX << 2] = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void flush(void)
|
static void flush(void)
|
||||||
{
|
{
|
||||||
|
unsigned char *base = SERIAL_BASE;
|
||||||
|
unsigned char mask;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
mask = UART_LSR_TEMT | UART_LSR_THRE;
|
||||||
|
|
||||||
|
for (i = 0; i < 0x1000; i++) {
|
||||||
|
if ((base[UART_LSR << 2] & mask) == mask)
|
||||||
|
break;
|
||||||
|
barrier();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user