diff mbox

ARM: Exynos: Fix early print issue

Message ID 1356980406-29053-1-git-send-email-thomas.abraham@linaro.org
State New
Headers show

Commit Message

thomas.abraham@linaro.org Dec. 31, 2012, 7 p.m. UTC
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
---
 arch/arm/mach-exynos/common.c                   |    1 +
 arch/arm/mach-exynos/include/mach/debug-macro.S |   19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index bf59ae1..f0eb225 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -56,6 +56,7 @@ 
 #define L2_AUX_VAL 0x7C470001
 #define L2_AUX_MASK 0xC200ffff
 
+volatile u32 exynos_uart_base = 1;
 static const char name_exynos4210[] = "EXYNOS4210";
 static const char name_exynos4212[] = "EXYNOS4212";
 static const char name_exynos4412[] = "EXYNOS4412";
diff --git a/arch/arm/mach-exynos/include/mach/debug-macro.S b/arch/arm/mach-exynos/include/mach/debug-macro.S
index 69e3e52..4da270e 100644
--- a/arch/arm/mach-exynos/include/mach/debug-macro.S
+++ b/arch/arm/mach-exynos/include/mach/debug-macro.S
@@ -21,6 +21,16 @@ 
 	 */
 
 	.macro addruart, rp, rv, tmp
+		adr	\rp, 100f
+		ldr	\rv, [\rp]
+		sub	\rv, \rv, \rp
+		ldr	\rp, [\rp, #4]
+		sub	\tmp, \rp, \rv
+		ldr	\rp, [\tmp]
+
+		teq	\rp, #1
+		bne	101f
+
 		mov	\rp, #0x10000000
 		ldr	\rp, [\rp, #0]
 		and	\rp, \rp, #0x0ff00000
@@ -38,7 +48,14 @@ 
 		b	99f
 54:		mov	\rp, #EXYNOS5440_PA_UART
 		b	99f
-99:		ldr	\rv, =S3C_VA_UART
+
+		.align
+100:		.word	.
+		.word	exynos_uart_base
+		.ltorg
+
+99:		str \rp, [\tmp]
+101:		ldr	\rv, =S3C_VA_UART
 
 #if CONFIG_DEBUG_S3C_UART != 0
 		add	\rp, \rp, #(0x10000 * CONFIG_DEBUG_S3C_UART)