blob: c14011fe832d2fa8f014c0c5a7805204e5949387 [file] [log] [blame]
Stephen Boyda3d3ef92011-11-08 10:33:04 -08001/*
Russell Kinga09e64f2008-08-05 16:14:15 +01002 * Copyright (C) 2007 Google, Inc.
Stephen Boyda3d3ef92011-11-08 10:33:04 -08003 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
Russell Kinga09e64f2008-08-05 16:14:15 +01004 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#ifndef __ASM_ARCH_MSM_UNCOMPRESS_H
Stephen Boyda3d3ef92011-11-08 10:33:04 -080017#define __ASM_ARCH_MSM_UNCOMPRESS_H
Russell Kinga09e64f2008-08-05 16:14:15 +010018
Paul Gortmakerb443caf2012-04-01 16:38:38 -040019#include <asm/barrier.h>
Stephen Boyda3d3ef92011-11-08 10:33:04 -080020#include <asm/processor.h>
21#include <mach/msm_iomap.h>
22
23#define UART_CSR (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08))
24#define UART_TF (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x0c))
25
26#define UART_DM_SR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08)))
27#define UART_DM_CR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x10)))
28#define UART_DM_ISR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x14)))
29#define UART_DM_NCHAR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x40)))
30#define UART_DM_TF (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x70)))
Russell Kinga09e64f2008-08-05 16:14:15 +010031
32static void putc(int c)
33{
Pavel Machek6339f6692009-11-02 11:48:29 +010034#if defined(MSM_DEBUG_UART_PHYS)
Stephen Boyda3d3ef92011-11-08 10:33:04 -080035#ifdef CONFIG_MSM_HAS_DEBUG_UART_HS
36 /*
37 * Wait for TX_READY to be set; but skip it if we have a
38 * TX underrun.
39 */
40 if (UART_DM_SR & 0x08)
41 while (!(UART_DM_ISR & 0x80))
42 cpu_relax();
43
44 UART_DM_CR = 0x300;
45 UART_DM_NCHAR = 0x1;
46 UART_DM_TF = c;
47#else
48 while (!(UART_CSR & 0x04))
49 cpu_relax();
50 UART_TF = c;
51#endif
Pavel Machek6339f6692009-11-02 11:48:29 +010052#endif
Russell Kinga09e64f2008-08-05 16:14:15 +010053}
54
55static inline void flush(void)
56{
57}
58
59static inline void arch_decomp_setup(void)
60{
61}
62
63static inline void arch_decomp_wdog(void)
64{
65}
66
67#endif