uncompress.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * arch/arm/plat-omap/include/mach/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/arch/arm/plat-omap/include/mach1510/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/types.h>
  20. #include <linux/serial_reg.h>
  21. #include <mach/serial.h>
  22. unsigned int system_rev;
  23. #define UART_OMAP_MDR1 0x08 /* mode definition register */
  24. #define OMAP_ID_730 0x355F
  25. #define ID_MASK 0x7fff
  26. #define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0)
  27. #define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK
  28. static void putc(int c)
  29. {
  30. volatile u8 * uart = 0;
  31. int shift = 2;
  32. #ifdef CONFIG_MACH_OMAP_PALMTE
  33. return;
  34. #endif
  35. #ifdef CONFIG_ARCH_OMAP
  36. #ifdef CONFIG_OMAP_LL_DEBUG_UART3
  37. uart = (volatile u8 *)(OMAP_UART3_BASE);
  38. #elif defined(CONFIG_OMAP_LL_DEBUG_UART2)
  39. uart = (volatile u8 *)(OMAP_UART2_BASE);
  40. #else
  41. uart = (volatile u8 *)(OMAP_UART1_BASE);
  42. #endif
  43. #ifdef CONFIG_ARCH_OMAP1
  44. /* Determine which serial port to use */
  45. do {
  46. /* MMU is not on, so cpu_is_omapXXXX() won't work here */
  47. unsigned int omap_id = omap_get_id();
  48. if (omap_id == OMAP_ID_730)
  49. shift = 0;
  50. if (check_port(uart, shift))
  51. break;
  52. /* Silent boot if no serial ports are enabled. */
  53. return;
  54. } while (0);
  55. #endif /* CONFIG_ARCH_OMAP1 */
  56. #endif
  57. /*
  58. * Now, xmit each character
  59. */
  60. while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
  61. barrier();
  62. uart[UART_TX << shift] = c;
  63. }
  64. static inline void flush(void)
  65. {
  66. }
  67. /*
  68. * nothing to do
  69. */
  70. #define arch_decomp_setup()
  71. #define arch_decomp_wdog()