Commit c951c42f authored by Mark A. Greer's avatar Mark A. Greer Committed by Kevin Hilman

DaVinci: Support different console UART base addresses

The davinci pre-kernel boot code assumes that all platforms use
the same UART base address for the console.  That assumption
is not longer valid with some newer SoCs so determine the console
UART base address from the machine number passed in from u-boot.
Signed-off-by: default avatarMark A. Greer <mgreer@mvista.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 13840b0b
......@@ -48,6 +48,10 @@ else
endif
endif
ifeq ($(CONFIG_MACH_DAVINCI_EVM),y)
OBJS += head-davinci.o
endif
#
# We now have a PIC decompressor implementation. Decompressors running
# from RAM should not define ZTEXTADDR. Decompressors running directly
......
/*
* DaVinci (and relatives) specific tweaks.
* This is merged into head.S by the linker.
*/
#include <linux/linkage.h>
#include <asm/mach-types.h>
.section ".start", "ax"
__davinci_start:
/* Save machine number for later conditional code */
adr r0, davinci_machine_no
str r7, [r0]
.text
.globl davinci_machine_no
davinci_machine_no:
.word 0x00000000
......@@ -13,11 +13,27 @@
#include <linux/serial_reg.h>
#include <mach/serial.h>
#include <asm/mach-types.h>
extern u32 davinci_machine_no;
static u8 first_time = 1;
static u32 *uart;
static u32 *get_uart_base(void)
{
/* Add logic here for new platforms */
return (u32 *)DAVINCI_UART0_BASE;
}
/* PORT_16C550A, in polled non-fifo mode */
static void putc(char c)
{
volatile u32 *uart = (volatile void *) DAVINCI_UART0_BASE;
if (first_time) {
uart = get_uart_base();
first_time = 0;
}
while (!(uart[UART_LSR] & UART_LSR_THRE))
barrier();
......@@ -26,7 +42,11 @@ static void putc(char c)
static inline void flush(void)
{
volatile u32 *uart = (volatile void *) DAVINCI_UART0_BASE;
if (first_time) {
uart = get_uart_base();
first_time = 0;
}
while (!(uart[UART_LSR] & UART_LSR_THRE))
barrier();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment