uncompress.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * arch/arm/mach-ixp4xx/include/mach/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 "ixp4xx-regs.h"
  15. #include <asm/mach-types.h>
  16. #include <linux/serial_reg.h>
  17. #define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
  18. volatile u32* uart_base;
  19. static inline void putc(int 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. barrier();
  25. *uart_base = c;
  26. }
  27. static void flush(void)
  28. {
  29. }
  30. static __inline__ void __arch_decomp_setup(unsigned long arch_id)
  31. {
  32. /*
  33. * Some boards are using UART2 as console
  34. */
  35. if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
  36. machine_is_gateway7001() || machine_is_wg302v2() ||
  37. machine_is_devixp() || machine_is_miccpt() || machine_is_mic256())
  38. uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
  39. else
  40. uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
  41. }
  42. /*
  43. * arch_id is a variable in decompress_kernel()
  44. */
  45. #define arch_decomp_setup() __arch_decomp_setup(arch_id)
  46. #endif