uncompress.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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/serial.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 putc(int c)
  30. {
  31. volatile u8 * uart = 0;
  32. int shift = 2;
  33. #ifdef CONFIG_MACH_OMAP_PALMTE
  34. return;
  35. #endif
  36. #ifdef CONFIG_ARCH_OMAP
  37. #ifdef CONFIG_OMAP_LL_DEBUG_UART3
  38. uart = (volatile u8 *)(OMAP_UART3_BASE);
  39. #elif defined(CONFIG_OMAP_LL_DEBUG_UART2)
  40. uart = (volatile u8 *)(OMAP_UART2_BASE);
  41. #else
  42. uart = (volatile u8 *)(OMAP_UART1_BASE);
  43. #endif
  44. #ifdef CONFIG_ARCH_OMAP1
  45. /* Determine which serial port to use */
  46. do {
  47. /* MMU is not on, so cpu_is_omapXXXX() won't work here */
  48. unsigned int omap_id = omap_get_id();
  49. if (omap_id == OMAP_ID_730)
  50. shift = 0;
  51. if (check_port(uart, shift))
  52. break;
  53. /* Silent boot if no serial ports are enabled. */
  54. return;
  55. } while (0);
  56. #endif /* CONFIG_ARCH_OMAP1 */
  57. #endif
  58. /*
  59. * Now, xmit each character
  60. */
  61. while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
  62. barrier();
  63. uart[UART_TX << shift] = c;
  64. }
  65. static inline void flush(void)
  66. {
  67. }
  68. /*
  69. * nothing to do
  70. */
  71. #define arch_decomp_setup()
  72. #define arch_decomp_wdog()