Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187477
b: refs/heads/master
c: c95efee
h: refs/heads/master
i:
  187475: bdae0d0
v: v3
  • Loading branch information
Eric Miao committed Mar 1, 2010
1 parent 50c019d commit e23f308
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2029e5643a3c4fdd4ad20169fb950cc16e023d0c
refs/heads/master: c95efee13303d9ff9e67f2600174f492039311ce
35 changes: 28 additions & 7 deletions trunk/arch/arm/mach-pxa/include/mach/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,41 @@
*/

#include <linux/serial_reg.h>
#include <mach/regs-uart.h>
#include <asm/mach-types.h>

#define __REG(x) ((volatile unsigned long *)x)
#define FFUART_BASE (0x40100000)
#define BTUART_BASE (0x40200000)
#define STUART_BASE (0x40700000)

static volatile unsigned long *UART = FFUART;
static unsigned long uart_base = FFUART_BASE;
static unsigned int uart_shift = 2;
static unsigned int uart_is_pxa = 1;

static inline unsigned char uart_read(int offset)
{
return *(volatile unsigned char *)(uart_base + (offset << uart_shift));
}

static inline void uart_write(unsigned char val, int offset)
{
*(volatile unsigned char *)(uart_base + (offset << uart_shift)) = val;
}

static inline int uart_is_enabled(void)
{
/* assume enabled by default for non-PXA uarts */
return uart_is_pxa ? uart_read(UART_IER) & UART_IER_UUE : 1;
}

static inline void putc(char c)
{
if (!(UART[UART_IER] & IER_UUE))
if (!uart_is_enabled())
return;
while (!(UART[UART_LSR] & LSR_TDRQ))

while (!(uart_read(UART_LSR) & UART_LSR_THRE))
barrier();
UART[UART_TX] = c;

uart_write(c, UART_TX);
}

/*
Expand All @@ -38,7 +59,7 @@ static inline void arch_decomp_setup(void)
if (machine_is_littleton() || machine_is_intelmote2()
|| machine_is_csb726() || machine_is_stargate2()
|| machine_is_cm_x300() || machine_is_balloon3())
UART = STUART;
uart_base = STUART_BASE;
}

/*
Expand Down

0 comments on commit e23f308

Please sign in to comment.