uncompress.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * arch/arm/mach-tegra/include/mach/uncompress.h
  3. *
  4. * Copyright (C) 2010 Google, Inc.
  5. *
  6. * Author:
  7. * Colin Cross <ccross@google.com>
  8. * Erik Gilling <konkers@google.com>
  9. *
  10. * This software is licensed under the terms of the GNU General Public
  11. * License version 2, as published by the Free Software Foundation, and
  12. * may be copied, distributed, and modified under those terms.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. */
  20. #ifndef __MACH_TEGRA_UNCOMPRESS_H
  21. #define __MACH_TEGRA_UNCOMPRESS_H
  22. #include <linux/types.h>
  23. #include <linux/serial_reg.h>
  24. #include <mach/iomap.h>
  25. static void putc(int c)
  26. {
  27. volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
  28. int shift = 2;
  29. if (uart == NULL)
  30. return;
  31. while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
  32. barrier();
  33. uart[UART_TX << shift] = c;
  34. }
  35. static inline void flush(void)
  36. {
  37. }
  38. static inline void arch_decomp_setup(void)
  39. {
  40. volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
  41. int shift = 2;
  42. if (uart == NULL)
  43. return;
  44. uart[UART_LCR << shift] |= UART_LCR_DLAB;
  45. uart[UART_DLL << shift] = 0x75;
  46. uart[UART_DLM << shift] = 0x0;
  47. uart[UART_LCR << shift] = 3;
  48. }
  49. static inline void arch_decomp_wdog(void)
  50. {
  51. }
  52. #endif