diff options
author | Doug Anderson <dianders@chromium.org> | 2012-01-06 10:43:19 +0000 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-02-06 18:24:59 -0800 |
commit | 229c7b22a24b9996e3a3eb1a2748e255e16bc323 (patch) | |
tree | 8b593b4358f96a5c87b2433c800dac769c8771d1 /arch/arm/mach-tegra | |
parent | e53b7d87cc375fbe428551651094fb676764aae3 (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')
-rw-r--r-- | arch/arm/mach-tegra/include/mach/uncompress.h | 18 |
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 @@ * arch/arm/mach-tegra/include/mach/uncompress.h * * Copyright (C) 2010 Google, Inc. + * Copyright (C) 2011 Google, Inc. * * Author: * Colin Cross <ccross@google.com> * Erik Gilling <konkers@google.com> + * Doug Anderson <dianders@chromium.org> * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -26,17 +28,18 @@ #include <mach/iomap.h> +#define DEBUG_UART_SHIFT 2 + static void putc(int c) { volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE; - int shift = 2; if (uart == NULL) return; - while (!(uart[UART_LSR << shift] & UART_LSR_THRE)) + while (!(uart[UART_LSR << DEBUG_UART_SHIFT] & UART_LSR_THRE)) barrier(); - uart[UART_TX << shift] = c; + uart[UART_TX << DEBUG_UART_SHIFT] = c; } static inline void flush(void) @@ -48,7 +51,6 @@ static inline void arch_decomp_setup(void) volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE; u32 chip, div; volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE; - int shift = 2; if (uart == NULL) return; @@ -59,10 +61,10 @@ static inline void arch_decomp_setup(void) else div = 0x00dd; - uart[UART_LCR << shift] |= UART_LCR_DLAB; - uart[UART_DLL << shift] = div & 0xff; - uart[UART_DLM << shift] = div >> 8; - uart[UART_LCR << shift] = 3; + uart[UART_LCR << DEBUG_UART_SHIFT] |= UART_LCR_DLAB; + uart[UART_DLL << DEBUG_UART_SHIFT] = div & 0xff; + uart[UART_DLM << DEBUG_UART_SHIFT] = div >> 8; + uart[UART_LCR << DEBUG_UART_SHIFT] = 3; } static inline void arch_decomp_wdog(void) |