uncompress.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * linux/include/asm-arm/arch-brutus/uncompress.h
  3. *
  4. * (C) 1999 Nicolas Pitre <nico@cam.org>
  5. *
  6. * Reorganised to be machine independent.
  7. */
  8. #include "hardware.h"
  9. /*
  10. * The following code assumes the serial port has already been
  11. * initialized by the bootloader. We search for the first enabled
  12. * port in the most probable order. If you didn't setup a port in
  13. * your bootloader then nothing will appear (which might be desired).
  14. */
  15. #define UART(x) (*(volatile unsigned long *)(serial_port + (x)))
  16. static void putstr( const char *s )
  17. {
  18. unsigned long serial_port;
  19. do {
  20. serial_port = _Ser3UTCR0;
  21. if (UART(UTCR3) & UTCR3_TXE) break;
  22. serial_port = _Ser1UTCR0;
  23. if (UART(UTCR3) & UTCR3_TXE) break;
  24. serial_port = _Ser2UTCR0;
  25. if (UART(UTCR3) & UTCR3_TXE) break;
  26. return;
  27. } while (0);
  28. for (; *s; s++) {
  29. /* wait for space in the UART's transmitter */
  30. while (!(UART(UTSR1) & UTSR1_TNF));
  31. /* send the character out. */
  32. UART(UTDR) = *s;
  33. /* if a LF, also do CR... */
  34. if (*s == 10) {
  35. while (!(UART(UTSR1) & UTSR1_TNF));
  36. UART(UTDR) = 13;
  37. }
  38. }
  39. }
  40. /*
  41. * Nothing to do for these
  42. */
  43. #define arch_decomp_setup()
  44. #define arch_decomp_wdog()