Commit 3c36053f authored by Ben Dooks's avatar Ben Dooks Committed by Russell King

[ARM PATCH] 2161/1: S3C2410 - uncompressor low level uart configuration

Patch from Ben Dooks

Allow the uncompressing messages to be sent to the UART
specified in the kernel configuration, instead of just
UART 0. This includes the Kconfig update to make this
option available all the time, and to rename it's
description text.

This patch also fixes s3c2440 support for the
uncompressor

Signed-off-by: Ben Dooks 
parent ba64fbf8
...@@ -104,12 +104,15 @@ config DEBUG_S3C2410_PORT ...@@ -104,12 +104,15 @@ config DEBUG_S3C2410_PORT
before it is used. before it is used.
config DEBUG_S3C2410_UART config DEBUG_S3C2410_UART
depends on DEBUG_LL && ARCH_S3C2410 depends on ARCH_S3C2410
int "S3C2410 UART to use for low-level debug" int "S3C2410 UART to use for low-level messages and debug"
default "0" default "0"
help help
Choice for UART for kernel low-level using S3C2410 UARTS, Choice for UART for kernel low-level using S3C2410 UARTS,
should be between zero and two. The port must have been should be between zero and two. The port must have been
initalised by the boot-loader before use. initalised by the boot-loader before use.
This will affect the port that the uncompressor code uses
to send debug information to.
endmenu endmenu
...@@ -13,21 +13,29 @@ ...@@ -13,21 +13,29 @@
* 22-May-2003 BJD Created * 22-May-2003 BJD Created
* 08-Sep-2003 BJD Moved to linux v2.6 * 08-Sep-2003 BJD Moved to linux v2.6
* 12-Mar-2004 BJD Updated header protection * 12-Mar-2004 BJD Updated header protection
* 12-Oct-2004 BJD Take account of debug uart configuration
*/ */
#ifndef __ASM_ARCH_UNCOMPRESS_H #ifndef __ASM_ARCH_UNCOMPRESS_H
#define __ASM_ARCH_UNCOMPRESS_H #define __ASM_ARCH_UNCOMPRESS_H
#include <config/debug/s3c2410/port.h>
/* defines for UART registers */ /* defines for UART registers */
#include "asm/arch/regs-serial.h" #include "asm/arch/regs-serial.h"
#include "asm/arch/regs-gpio.h"
#include <asm/arch/map.h> #include <asm/arch/map.h>
/* working in physical space... */
#undef S3C2410_GPIOREG
#define S3C2410_GPIOREG(x) ((S3C2410_PA_GPIO + (x)))
/* how many bytes we allow into the FIFO at a time in FIFO mode */ /* how many bytes we allow into the FIFO at a time in FIFO mode */
#define FIFO_MAX (14) #define FIFO_MAX (14)
#if 1 #if 1
#define uart_base S3C2410_PA_UART #define uart_base S3C2410_PA_UART + (0x4000 * CONFIG_DEBUG_S3C2410_UART)
#else #else
static unsigned int uart_base = S3C2410_PA_UART; static unsigned int uart_base = S3C2410_PA_UART;
#endif #endif
...@@ -74,6 +82,10 @@ arch_decomp_setup(void) ...@@ -74,6 +82,10 @@ arch_decomp_setup(void)
static void static void
putc(char ch) putc(char ch)
{ {
int cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1);
cpuid &= S3C2410_GSTATUS1_IDMASK;
if (ch == '\n') if (ch == '\n')
putc('\r'); /* expand newline to \r\n */ putc('\r'); /* expand newline to \r\n */
...@@ -82,8 +94,14 @@ putc(char ch) ...@@ -82,8 +94,14 @@ putc(char ch)
while (1) { while (1) {
level = uart_rd(S3C2410_UFSTAT); level = uart_rd(S3C2410_UFSTAT);
level &= S3C2410_UFSTAT_TXMASK;
level >>= S3C2410_UFSTAT_TXSHIFT; if (cpuid == S3C2410_GSTATUS1_2440) {
level &= S3C2440_UFSTAT_TXMASK;
level >>= S3C2440_UFSTAT_TXSHIFT;
} else {
level &= S3C2410_UFSTAT_TXMASK;
level >>= S3C2410_UFSTAT_TXSHIFT;
}
if (level < FIFO_MAX) if (level < FIFO_MAX)
break; break;
...@@ -92,7 +110,7 @@ putc(char ch) ...@@ -92,7 +110,7 @@ putc(char ch)
} else { } else {
/* not using fifos */ /* not using fifos */
while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXFE) != S3C2410_UTRSTAT_TXFE); while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE);
} }
/* write byte to transmission register */ /* write byte to transmission register */
......
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