aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/include/mach
diff options
context:
space:
mode:
authorDoug Anderson <dianders@chromium.org>2012-01-06 05:43:19 -0500
committerOlof Johansson <olof@lixom.net>2012-02-06 21:24:59 -0500
commit229c7b22a24b9996e3a3eb1a2748e255e16bc323 (patch)
tree8b593b4358f96a5c87b2433c800dac769c8771d1 /arch/arm/mach-tegra/include/mach
parente53b7d87cc375fbe428551651094fb676764aae3 (diff)
ARM: tegra: Introduce define DEBUG_UART_SHIFT
This removes the need for the variable "shift" in all functions in uncompress.h. Signed-off-by: Doug Anderson <dianders@chromium.org> [swarren: Extracted from a larger patch by Doug] Signed-off-by: Stephen Warren <swarren@nvidia.com> Tested-by: Doug Anderson <dianders@chromium.org> Acked-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-tegra/include/mach')
-rw-r--r--arch/arm/mach-tegra/include/mach/uncompress.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index 39bd5e5a1afd..9797279e94de 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -2,10 +2,12 @@
2 * arch/arm/mach-tegra/include/mach/uncompress.h 2 * arch/arm/mach-tegra/include/mach/uncompress.h
3 * 3 *
4 * Copyright (C) 2010 Google, Inc. 4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (C) 2011 Google, Inc.
5 * 6 *
6 * Author: 7 * Author:
7 * Colin Cross <ccross@google.com> 8 * Colin Cross <ccross@google.com>
8 * Erik Gilling <konkers@google.com> 9 * Erik Gilling <konkers@google.com>
10 * Doug Anderson <dianders@chromium.org>
9 * 11 *
10 * This software is licensed under the terms of the GNU General Public 12 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and 13 * License version 2, as published by the Free Software Foundation, and
@@ -26,17 +28,18 @@
26 28
27#include <mach/iomap.h> 29#include <mach/iomap.h>
28 30
31#define DEBUG_UART_SHIFT 2
32
29static void putc(int c) 33static void putc(int c)
30{ 34{
31 volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE; 35 volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
32 int shift = 2;
33 36
34 if (uart == NULL) 37 if (uart == NULL)
35 return; 38 return;
36 39
37 while (!(uart[UART_LSR << shift] & UART_LSR_THRE)) 40 while (!(uart[UART_LSR << DEBUG_UART_SHIFT] & UART_LSR_THRE))
38 barrier(); 41 barrier();
39 uart[UART_TX << shift] = c; 42 uart[UART_TX << DEBUG_UART_SHIFT] = c;
40} 43}
41 44
42static inline void flush(void) 45static inline void flush(void)
@@ -48,7 +51,6 @@ static inline void arch_decomp_setup(void)
48 volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE; 51 volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE;
49 u32 chip, div; 52 u32 chip, div;
50 volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE; 53 volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
51 int shift = 2;
52 54
53 if (uart == NULL) 55 if (uart == NULL)
54 return; 56 return;
@@ -59,10 +61,10 @@ static inline void arch_decomp_setup(void)
59 else 61 else
60 div = 0x00dd; 62 div = 0x00dd;
61 63
62 uart[UART_LCR << shift] |= UART_LCR_DLAB; 64 uart[UART_LCR << DEBUG_UART_SHIFT] |= UART_LCR_DLAB;
63 uart[UART_DLL << shift] = div & 0xff; 65 uart[UART_DLL << DEBUG_UART_SHIFT] = div & 0xff;
64 uart[UART_DLM << shift] = div >> 8; 66 uart[UART_DLM << DEBUG_UART_SHIFT] = div >> 8;
65 uart[UART_LCR << shift] = 3; 67 uart[UART_LCR << DEBUG_UART_SHIFT] = 3;
66} 68}
67 69
68static inline void arch_decomp_wdog(void) 70static inline void arch_decomp_wdog(void)