uncompress.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (C) 2007 Google, Inc.
  3. * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
  4. *
  5. * This software is licensed under the terms of the GNU General Public
  6. * License version 2, as published by the Free Software Foundation, and
  7. * may be copied, distributed, and modified under those terms.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. */
  15. #ifndef __ASM_ARCH_MSM_UNCOMPRESS_H
  16. #define __ASM_ARCH_MSM_UNCOMPRESS_H
  17. #include <asm/processor.h>
  18. #include <mach/msm_iomap.h>
  19. #define UART_CSR (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08))
  20. #define UART_TF (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x0c))
  21. #define UART_DM_SR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08)))
  22. #define UART_DM_CR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x10)))
  23. #define UART_DM_ISR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x14)))
  24. #define UART_DM_NCHAR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x40)))
  25. #define UART_DM_TF (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x70)))
  26. static void putc(int c)
  27. {
  28. #if defined(MSM_DEBUG_UART_PHYS)
  29. #ifdef CONFIG_MSM_HAS_DEBUG_UART_HS
  30. /*
  31. * Wait for TX_READY to be set; but skip it if we have a
  32. * TX underrun.
  33. */
  34. if (UART_DM_SR & 0x08)
  35. while (!(UART_DM_ISR & 0x80))
  36. cpu_relax();
  37. UART_DM_CR = 0x300;
  38. UART_DM_NCHAR = 0x1;
  39. UART_DM_TF = c;
  40. #else
  41. while (!(UART_CSR & 0x04))
  42. cpu_relax();
  43. UART_TF = c;
  44. #endif
  45. #endif
  46. }
  47. static inline void flush(void)
  48. {
  49. }
  50. static inline void arch_decomp_setup(void)
  51. {
  52. }
  53. static inline void arch_decomp_wdog(void)
  54. {
  55. }
  56. #endif