uncompress.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Serial port stubs for kernel decompress status messages
  3. *
  4. * Initially based on:
  5. * arch/arm/plat-omap/include/mach/uncompress.h
  6. *
  7. * Original copyrights follow.
  8. *
  9. * Copyright (C) 2000 RidgeRun, Inc.
  10. * Author: Greg Lonnon <glonnon@ridgerun.com>
  11. *
  12. * Rewritten by:
  13. * Author: <source@mvista.com>
  14. * 2004 (c) MontaVista Software, Inc.
  15. *
  16. * This file is licensed under the terms of the GNU General Public License
  17. * version 2. This program is licensed "as is" without any warranty of any
  18. * kind, whether express or implied.
  19. */
  20. #include <linux/types.h>
  21. #include <linux/serial_reg.h>
  22. #include <asm/mach-types.h>
  23. #include <mach/serial.h>
  24. #define IOMEM(x) ((void __force __iomem *)(x))
  25. u32 *uart;
  26. /* PORT_16C550A, in polled non-fifo mode */
  27. static void putc(char c)
  28. {
  29. while (!(uart[UART_LSR] & UART_LSR_THRE))
  30. barrier();
  31. uart[UART_TX] = c;
  32. }
  33. static inline void flush(void)
  34. {
  35. while (!(uart[UART_LSR] & UART_LSR_THRE))
  36. barrier();
  37. }
  38. static inline void set_uart_info(u32 phys)
  39. {
  40. uart = (u32 *)phys;
  41. }
  42. #define _DEBUG_LL_ENTRY(machine, phys) \
  43. { \
  44. if (machine_is_##machine()) { \
  45. set_uart_info(phys); \
  46. break; \
  47. } \
  48. }
  49. #define DEBUG_LL_DAVINCI(machine, port) \
  50. _DEBUG_LL_ENTRY(machine, DAVINCI_UART##port##_BASE)
  51. #define DEBUG_LL_DA8XX(machine, port) \
  52. _DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE)
  53. #define DEBUG_LL_TNETV107X(machine, port) \
  54. _DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE)
  55. static inline void __arch_decomp_setup(unsigned long arch_id)
  56. {
  57. /*
  58. * Initialize the port based on the machine ID from the bootloader.
  59. * Note that we're using macros here instead of switch statement
  60. * as machine_is functions are optimized out for the boards that
  61. * are not selected.
  62. */
  63. do {
  64. /* Davinci boards */
  65. DEBUG_LL_DAVINCI(davinci_evm, 0);
  66. DEBUG_LL_DAVINCI(sffsdr, 0);
  67. DEBUG_LL_DAVINCI(neuros_osd2, 0);
  68. DEBUG_LL_DAVINCI(davinci_dm355_evm, 0);
  69. DEBUG_LL_DAVINCI(dm355_leopard, 0);
  70. DEBUG_LL_DAVINCI(davinci_dm6467_evm, 0);
  71. DEBUG_LL_DAVINCI(davinci_dm365_evm, 0);
  72. /* DA8xx boards */
  73. DEBUG_LL_DA8XX(davinci_da830_evm, 2);
  74. DEBUG_LL_DA8XX(davinci_da850_evm, 2);
  75. DEBUG_LL_DA8XX(mityomapl138, 1);
  76. DEBUG_LL_DA8XX(omapl138_hawkboard, 2);
  77. /* TNETV107x boards */
  78. DEBUG_LL_TNETV107X(tnetv107x, 1);
  79. } while (0);
  80. }
  81. #define arch_decomp_setup() __arch_decomp_setup(arch_id)
  82. #define arch_decomp_wdog()