uncompress.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * arch/arm/mach-netx/include/mach/uncompress.h
  3. *
  4. * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2
  8. * as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. /*
  20. * The following code assumes the serial port has already been
  21. * initialized by the bootloader. We search for the first enabled
  22. * port in the most probable order. If you didn't setup a port in
  23. * your bootloader then nothing will appear (which might be desired).
  24. *
  25. * This does not append a newline
  26. */
  27. #define REG(x) (*(volatile unsigned long *)(x))
  28. #define UART1_BASE 0x100a00
  29. #define UART2_BASE 0x100a80
  30. #define UART_DR 0x0
  31. #define UART_CR 0x14
  32. #define CR_UART_EN (1<<0)
  33. #define UART_FR 0x18
  34. #define FR_BUSY (1<<3)
  35. #define FR_TXFF (1<<5)
  36. static inline void putc(char c)
  37. {
  38. unsigned long base;
  39. if (REG(UART1_BASE + UART_CR) & CR_UART_EN)
  40. base = UART1_BASE;
  41. else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)
  42. base = UART2_BASE;
  43. else
  44. return;
  45. while (REG(base + UART_FR) & FR_TXFF);
  46. REG(base + UART_DR) = c;
  47. }
  48. static inline void flush(void)
  49. {
  50. unsigned long base;
  51. if (REG(UART1_BASE + UART_CR) & CR_UART_EN)
  52. base = UART1_BASE;
  53. else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)
  54. base = UART2_BASE;
  55. else
  56. return;
  57. while (REG(base + UART_FR) & FR_BUSY);
  58. }
  59. /*
  60. * nothing to do
  61. */
  62. #define arch_decomp_setup()