uncompress.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * linux/include/asm-arm/arch-omap/uncompress.h
  3. *
  4. * Serial port stubs for kernel decompress status messages
  5. *
  6. * Initially based on:
  7. * linux-2.4.15-rmk1-dsplinux1.6/include/asm-arm/arch-omap1510/uncompress.h
  8. * Copyright (C) 2000 RidgeRun, Inc.
  9. * Author: Greg Lonnon <glonnon@ridgerun.com>
  10. *
  11. * Rewritten by:
  12. * Author: <source@mvista.com>
  13. * 2004 (c) MontaVista Software, Inc.
  14. *
  15. * This file is licensed under the terms of the GNU General Public License
  16. * version 2. This program is licensed "as is" without any warranty of any
  17. * kind, whether express or implied.
  18. */
  19. #include <linux/config.h>
  20. #include <linux/types.h>
  21. #include <linux/serial_reg.h>
  22. #include <asm/arch/hardware.h>
  23. unsigned int system_rev;
  24. #define UART_OMAP_MDR1 0x08 /* mode definition register */
  25. #define OMAP_ID_730 0x355F
  26. #define ID_MASK 0x7fff
  27. #define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0)
  28. #define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK
  29. static void
  30. putstr(const char *s)
  31. {
  32. volatile u8 * uart = 0;
  33. int shift;
  34. #ifdef CONFIG_OMAP_LL_DEBUG_UART3
  35. uart = (volatile u8 *)(OMAP_UART3_BASE);
  36. #elif CONFIG_OMAP_LL_DEBUG_UART2
  37. uart = (volatile u8 *)(OMAP_UART2_BASE);
  38. #else
  39. uart = (volatile u8 *)(OMAP_UART1_BASE);
  40. #endif
  41. /* Determine which serial port to use */
  42. do {
  43. /* MMU is not on, so cpu_is_omapXXXX() won't work here */
  44. unsigned int omap_id = omap_get_id();
  45. if (omap_id == OMAP_ID_730)
  46. shift = 0;
  47. else
  48. shift = 2;
  49. if (check_port(uart, shift))
  50. break;
  51. /* Silent boot if no serial ports are enabled. */
  52. return;
  53. } while (0);
  54. /*
  55. * Now, xmit each character
  56. */
  57. while (*s) {
  58. while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
  59. barrier();
  60. uart[UART_TX << shift] = *s;
  61. if (*s++ == '\n') {
  62. while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
  63. barrier();
  64. uart[UART_TX << shift] = '\r';
  65. }
  66. }
  67. }
  68. /*
  69. * nothing to do
  70. */
  71. #define arch_decomp_setup()
  72. #define arch_decomp_wdog()