uncompress.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * include/asm-arm/arch-ixp4xx/uncompress.h
  3. *
  4. * Copyright (C) 2002 Intel Corporation.
  5. * Copyright (C) 2003-2004 MontaVista Software, Inc.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. */
  12. #ifndef _ARCH_UNCOMPRESS_H_
  13. #define _ARCH_UNCOMPRESS_H_
  14. #include <asm/hardware.h>
  15. #include <asm/mach-types.h>
  16. #include <linux/serial_reg.h>
  17. #define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
  18. static volatile u32* uart_base;
  19. static __inline__ void putc(char c)
  20. {
  21. /* Check THRE and TEMT bits before we transmit the character.
  22. */
  23. while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE);
  24. *uart_base = c;
  25. }
  26. /*
  27. * This does not append a newline
  28. */
  29. static void putstr(const char *s)
  30. {
  31. while (*s)
  32. {
  33. putc(*s);
  34. if (*s == '\n')
  35. putc('\r');
  36. s++;
  37. }
  38. }
  39. static __inline__ void __arch_decomp_setup(unsigned long arch_id)
  40. {
  41. /*
  42. * Coyote and gtwx5715 only have UART2 connected
  43. */
  44. if (machine_is_adi_coyote() || machine_is_gtwx5715())
  45. uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
  46. else
  47. uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
  48. }
  49. /*
  50. * arch_id is a variable in decompress_kernel()
  51. */
  52. #define arch_decomp_setup() __arch_decomp_setup(arch_id)
  53. #define arch_decomp_wdog()
  54. #endif