2 * arch/arm/mach-tegra/include/mach/uncompress.h
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (C) 2011 Google, Inc.
8 * Colin Cross <ccross@google.com>
9 * Erik Gilling <konkers@google.com>
10 * Doug Anderson <dianders@chromium.org>
12 * This software is licensed under the terms of the GNU General Public
13 * License version 2, as published by the Free Software Foundation, and
14 * may be copied, distributed, and modified under those terms.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
23 #ifndef __MACH_TEGRA_UNCOMPRESS_H
24 #define __MACH_TEGRA_UNCOMPRESS_H
26 #include <linux/types.h>
27 #include <linux/serial_reg.h>
29 #include <mach/iomap.h>
31 #define DEBUG_UART_SHIFT 2
33 static void putc(int c)
35 volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
40 while (!(uart[UART_LSR << DEBUG_UART_SHIFT] & UART_LSR_THRE))
42 uart[UART_TX << DEBUG_UART_SHIFT] = c;
45 static inline void flush(void)
49 static inline void arch_decomp_setup(void)
51 volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE;
53 volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
58 chip = (apb_misc[0x804 / 4] >> 8) & 0xff;
64 uart[UART_LCR << DEBUG_UART_SHIFT] |= UART_LCR_DLAB;
65 uart[UART_DLL << DEBUG_UART_SHIFT] = div & 0xff;
66 uart[UART_DLM << DEBUG_UART_SHIFT] = div >> 8;
67 uart[UART_LCR << DEBUG_UART_SHIFT] = 3;
70 static inline void arch_decomp_wdog(void)