uncompress.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * arch/arm/mach-lpc32xx/include/mach/uncompress.h
  3. *
  4. * Author: Kevin Wells <kevin.wells@nxp.com>
  5. *
  6. * Copyright (C) 2010 NXP Semiconductors
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. */
  18. #ifndef __ASM_ARM_ARCH_UNCOMPRESS_H
  19. #define __ASM_ARM_ARCH_UNCOMPRESS_H
  20. #include <linux/io.h>
  21. #include <mach/hardware.h>
  22. #include <mach/platform.h>
  23. /*
  24. * Uncompress output is hardcoded to standard UART 5
  25. */
  26. #define UART_FIFO_CTL_TX_RESET (1 << 2)
  27. #define UART_STATUS_TX_MT (1 << 6)
  28. #define _UARTREG(x) (void __iomem *)(LPC32XX_UART5_BASE + (x))
  29. #define LPC32XX_UART_DLLFIFO_O 0x00
  30. #define LPC32XX_UART_IIRFCR_O 0x08
  31. #define LPC32XX_UART_LSR_O 0x14
  32. static inline void putc(int ch)
  33. {
  34. /* Wait for transmit FIFO to empty */
  35. while ((__raw_readl(_UARTREG(LPC32XX_UART_LSR_O)) &
  36. UART_STATUS_TX_MT) == 0)
  37. ;
  38. __raw_writel((u32) ch, _UARTREG(LPC32XX_UART_DLLFIFO_O));
  39. }
  40. static inline void flush(void)
  41. {
  42. __raw_writel(__raw_readl(_UARTREG(LPC32XX_UART_IIRFCR_O)) |
  43. UART_FIFO_CTL_TX_RESET, _UARTREG(LPC32XX_UART_IIRFCR_O));
  44. }
  45. /* NULL functions; we don't presently need them */
  46. #define arch_decomp_setup()
  47. #define arch_decomp_wdog()
  48. #endif