Stephen Boyd | a3d3ef9 | 2011-11-08 10:33:04 -0800 | [diff] [blame] | 1 | /* |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 2 | * Copyright (C) 2007 Google, Inc. |
Stephen Boyd | a3d3ef9 | 2011-11-08 10:33:04 -0800 | [diff] [blame] | 3 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 4 | * |
| 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 Boyd | a3d3ef9 | 2011-11-08 10:33:04 -0800 | [diff] [blame] | 17 | #define __ASM_ARCH_MSM_UNCOMPRESS_H |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 18 | |
Stephen Boyd | a3d3ef9 | 2011-11-08 10:33:04 -0800 | [diff] [blame] | 19 | #include <asm/processor.h> |
| 20 | #include <mach/msm_iomap.h> |
| 21 | |
| 22 | #define UART_CSR (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08)) |
| 23 | #define UART_TF (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x0c)) |
| 24 | |
| 25 | #define UART_DM_SR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08))) |
| 26 | #define UART_DM_CR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x10))) |
| 27 | #define UART_DM_ISR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x14))) |
| 28 | #define UART_DM_NCHAR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x40))) |
| 29 | #define UART_DM_TF (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x70))) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 30 | |
| 31 | static void putc(int c) |
| 32 | { |
Pavel Machek | 6339f66 | 2009-11-02 11:48:29 +0100 | [diff] [blame] | 33 | #if defined(MSM_DEBUG_UART_PHYS) |
Stephen Boyd | a3d3ef9 | 2011-11-08 10:33:04 -0800 | [diff] [blame] | 34 | #ifdef CONFIG_MSM_HAS_DEBUG_UART_HS |
| 35 | /* |
| 36 | * Wait for TX_READY to be set; but skip it if we have a |
| 37 | * TX underrun. |
| 38 | */ |
| 39 | if (UART_DM_SR & 0x08) |
| 40 | while (!(UART_DM_ISR & 0x80)) |
| 41 | cpu_relax(); |
| 42 | |
| 43 | UART_DM_CR = 0x300; |
| 44 | UART_DM_NCHAR = 0x1; |
| 45 | UART_DM_TF = c; |
| 46 | #else |
| 47 | while (!(UART_CSR & 0x04)) |
| 48 | cpu_relax(); |
| 49 | UART_TF = c; |
| 50 | #endif |
Pavel Machek | 6339f66 | 2009-11-02 11:48:29 +0100 | [diff] [blame] | 51 | #endif |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | static inline void flush(void) |
| 55 | { |
| 56 | } |
| 57 | |
| 58 | static inline void arch_decomp_setup(void) |
| 59 | { |
| 60 | } |
| 61 | |
| 62 | static inline void arch_decomp_wdog(void) |
| 63 | { |
| 64 | } |
| 65 | |
| 66 | #endif |