uncompress.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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 <asm/memory.h>
  22. #include <asm/mach-types.h>
  23. #include <plat/serial.h>
  24. static volatile u8 *uart_base;
  25. static int uart_shift;
  26. /*
  27. * Store the DEBUG_LL uart number into memory.
  28. * See also debug-macro.S, and serial.c for related code.
  29. */
  30. static void set_omap_uart_info(unsigned char port)
  31. {
  32. *(volatile u32 *)OMAP_UART_INFO = port;
  33. }
  34. static void putc(int c)
  35. {
  36. if (!uart_base)
  37. return;
  38. while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
  39. barrier();
  40. uart_base[UART_TX << uart_shift] = c;
  41. }
  42. static inline void flush(void)
  43. {
  44. }
  45. /*
  46. * Macros to configure UART1 and debug UART
  47. */
  48. #define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
  49. if (machine_is_##mach()) { \
  50. uart_base = (volatile u8 *)(dbg_uart); \
  51. uart_shift = (dbg_shft); \
  52. port = (dbg_id); \
  53. set_omap_uart_info(port); \
  54. break; \
  55. }
  56. #define DEBUG_LL_OMAP7XX(p, mach) \
  57. _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \
  58. OMAP1UART##p)
  59. #define DEBUG_LL_OMAP1(p, mach) \
  60. _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, \
  61. OMAP1UART##p)
  62. #define DEBUG_LL_OMAP2(p, mach) \
  63. _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \
  64. OMAP2UART##p)
  65. #define DEBUG_LL_OMAP3(p, mach) \
  66. _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \
  67. OMAP3UART##p)
  68. #define DEBUG_LL_OMAP4(p, mach) \
  69. _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \
  70. OMAP4UART##p)
  71. /* Zoom2/3 shift is different for UART1 and external port */
  72. #define DEBUG_LL_ZOOM(mach) \
  73. _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
  74. static inline void __arch_decomp_setup(unsigned long arch_id)
  75. {
  76. int port = 0;
  77. /*
  78. * Initialize the port based on the machine ID from the bootloader.
  79. * Note that we're using macros here instead of switch statement
  80. * as machine_is functions are optimized out for the boards that
  81. * are not selected.
  82. */
  83. do {
  84. /* omap7xx/8xx based boards using UART1 with shift 0 */
  85. DEBUG_LL_OMAP7XX(1, herald);
  86. DEBUG_LL_OMAP7XX(1, omap_perseus2);
  87. /* omap15xx/16xx based boards using UART1 */
  88. DEBUG_LL_OMAP1(1, ams_delta);
  89. DEBUG_LL_OMAP1(1, nokia770);
  90. DEBUG_LL_OMAP1(1, omap_h2);
  91. DEBUG_LL_OMAP1(1, omap_h3);
  92. DEBUG_LL_OMAP1(1, omap_innovator);
  93. DEBUG_LL_OMAP1(1, omap_osk);
  94. DEBUG_LL_OMAP1(1, omap_palmte);
  95. DEBUG_LL_OMAP1(1, omap_palmz71);
  96. /* omap15xx/16xx based boards using UART2 */
  97. DEBUG_LL_OMAP1(2, omap_palmtt);
  98. /* omap15xx/16xx based boards using UART3 */
  99. DEBUG_LL_OMAP1(3, sx1);
  100. /* omap2 based boards using UART1 */
  101. DEBUG_LL_OMAP2(1, omap2evm);
  102. DEBUG_LL_OMAP2(1, omap_2430sdp);
  103. DEBUG_LL_OMAP2(1, omap_apollon);
  104. DEBUG_LL_OMAP2(1, omap_h4);
  105. /* omap2 based boards using UART3 */
  106. DEBUG_LL_OMAP2(3, nokia_n800);
  107. DEBUG_LL_OMAP2(3, nokia_n810);
  108. DEBUG_LL_OMAP2(3, nokia_n810_wimax);
  109. /* omap3 based boards using UART1 */
  110. DEBUG_LL_OMAP2(1, omap3evm);
  111. DEBUG_LL_OMAP3(1, omap_3430sdp);
  112. DEBUG_LL_OMAP3(1, omap_3630sdp);
  113. /* omap3 based boards using UART3 */
  114. DEBUG_LL_OMAP3(3, cm_t35);
  115. DEBUG_LL_OMAP3(3, igep0020);
  116. DEBUG_LL_OMAP3(3, nokia_rx51);
  117. DEBUG_LL_OMAP3(3, omap3517evm);
  118. DEBUG_LL_OMAP3(3, omap3_beagle);
  119. DEBUG_LL_OMAP3(3, omap3_pandora);
  120. DEBUG_LL_OMAP3(3, omap_ldp);
  121. DEBUG_LL_OMAP3(3, overo);
  122. DEBUG_LL_OMAP3(3, touchbook);
  123. /* omap4 based boards using UART3 */
  124. DEBUG_LL_OMAP4(3, omap_4430sdp);
  125. /* zoom2/3 external uart */
  126. DEBUG_LL_ZOOM(omap_zoom2);
  127. DEBUG_LL_ZOOM(omap_zoom3);
  128. } while (0);
  129. }
  130. #define arch_decomp_setup() __arch_decomp_setup(arch_id)
  131. /*
  132. * nothing to do
  133. */
  134. #define arch_decomp_wdog()