cf3ed9a1a603f25b1014f3f7f55ca9d3bc89e8fe
[openwrt.git] / target / linux / mcs814x / files-3.14 / arch / arm / mach-mcs814x / include / mach / uncompress.h
1 /*
2  * Copyright (C) 2012, Florian Fainelli <florian@openwrt.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8
9 #ifndef __ASM_ARCH_UNCOMPRESS_H
10 #define __ASM_ARCH_UNCOMPRESS_H
11
12 #include <linux/serial_reg.h>
13 #include <asm/io.h>
14 #include <mach/mcs814x.h>
15 #include <mach/cpu.h>
16
17 #define UART_SHIFT      (2)
18
19 /* cannot be static because the code will be inlined */
20 void __iomem *uart_base;
21
22 static inline void putc(int c)
23 {
24         while (!(__raw_readb(uart_base + (UART_LSR << UART_SHIFT)) & UART_LSR_TEMT));
25         __raw_writeb(c, uart_base + (UART_TX << UART_SHIFT));
26 }
27
28 static inline void flush(void)
29 {
30 }
31
32 static inline void arch_decomp_setup(void)
33 {
34         if (soc_is_mcs8140())
35                 uart_base = (void __iomem *)(MCS814X_PHYS_BASE +MCS814X_UART);
36 }
37
38 #define arch_decomp_wdog()
39
40 #endif