uncompress.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * linux/include/asm-arm/arch-iop3xx/uncompress.h
  3. */
  4. #include <linux/config.h>
  5. #include <asm/types.h>
  6. #include <asm/mach-types.h>
  7. #include <linux/serial_reg.h>
  8. #include <asm/hardware.h>
  9. #ifdef CONFIG_ARCH_IOP321
  10. #define UTYPE unsigned char *
  11. #elif defined(CONFIG_ARCH_IOP331)
  12. #define UTYPE u32 *
  13. #else
  14. #error "Missing IOP3xx arch type def"
  15. #endif
  16. static volatile UTYPE uart_base;
  17. #define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
  18. static __inline__ void putc(char c)
  19. {
  20. while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE);
  21. *uart_base = c;
  22. }
  23. /*
  24. * This does not append a newline
  25. */
  26. static void putstr(const char *s)
  27. {
  28. while (*s) {
  29. putc(*s);
  30. if (*s == '\n')
  31. putc('\r');
  32. s++;
  33. }
  34. }
  35. static __inline__ void __arch_decomp_setup(unsigned long arch_id)
  36. {
  37. if(machine_is_iq80321())
  38. uart_base = (volatile UTYPE)IQ80321_UART;
  39. else if(machine_is_iq31244())
  40. uart_base = (volatile UTYPE)IQ31244_UART;
  41. else if(machine_is_iq80331() || machine_is_iq80332())
  42. uart_base = (volatile UTYPE)IOP331_UART0_PHYS;
  43. else
  44. uart_base = (volatile UTYPE)0xfe800000;
  45. }
  46. /*
  47. * nothing to do
  48. */
  49. #define arch_decomp_setup() __arch_decomp_setup(arch_id)
  50. #define arch_decomp_wdog()