uncompress.h 907 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #ifndef __ASM_ARCH_UNCOMPRESS_H
  9. #define __ASM_ARCH_UNCOMPRESS_H
  10. #include <linux/serial_reg.h>
  11. #include <asm/io.h>
  12. #include <mach/mcs814x.h>
  13. #include <mach/cpu.h>
  14. #define UART_SHIFT (2)
  15. /* cannot be static because the code will be inlined */
  16. void __iomem *uart_base;
  17. static inline void putc(int c)
  18. {
  19. while (!(__raw_readb(uart_base + (UART_LSR << UART_SHIFT)) & UART_LSR_TEMT));
  20. __raw_writeb(c, uart_base + (UART_TX << UART_SHIFT));
  21. }
  22. static inline void flush(void)
  23. {
  24. }
  25. static inline void arch_decomp_setup(void)
  26. {
  27. if (soc_is_mcs8140())
  28. uart_base = (void __iomem *)(MCS814X_PHYS_BASE +MCS814X_UART);
  29. }
  30. #define arch_decomp_wdog()
  31. #endif