uncompress.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * arch/arm/mach-mxs/include/mach/uncompress.h
  3. *
  4. * Copyright (C) 1999 ARM Limited
  5. * Copyright (C) Shane Nay (shane@minirl.com)
  6. * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. */
  18. #ifndef __MACH_MXS_UNCOMPRESS_H__
  19. #define __MACH_MXS_UNCOMPRESS_H__
  20. #include <asm/mach-types.h>
  21. static unsigned long mxs_duart_base;
  22. #define MXS_DUART(x) (*(volatile unsigned long *)(mxs_duart_base + (x)))
  23. #define MXS_DUART_DR 0x00
  24. #define MXS_DUART_FR 0x18
  25. #define MXS_DUART_FR_TXFE (1 << 7)
  26. #define MXS_DUART_CR 0x30
  27. #define MXS_DUART_CR_UARTEN (1 << 0)
  28. /*
  29. * The following code assumes the serial port has already been
  30. * initialized by the bootloader. If it's not, the output is
  31. * simply discarded.
  32. */
  33. static void putc(int ch)
  34. {
  35. if (!mxs_duart_base)
  36. return;
  37. if (!(MXS_DUART(MXS_DUART_CR) & MXS_DUART_CR_UARTEN))
  38. return;
  39. while (!(MXS_DUART(MXS_DUART_FR) & MXS_DUART_FR_TXFE))
  40. barrier();
  41. MXS_DUART(MXS_DUART_DR) = ch;
  42. }
  43. static inline void flush(void)
  44. {
  45. }
  46. #define MX23_DUART_BASE_ADDR 0x80070000
  47. #define MX28_DUART_BASE_ADDR 0x80074000
  48. static inline void __arch_decomp_setup(unsigned long arch_id)
  49. {
  50. switch (arch_id) {
  51. case MACH_TYPE_MX23EVK:
  52. mxs_duart_base = MX23_DUART_BASE_ADDR;
  53. break;
  54. case MACH_TYPE_MX28EVK:
  55. case MACH_TYPE_TX28:
  56. mxs_duart_base = MX28_DUART_BASE_ADDR;
  57. break;
  58. default:
  59. break;
  60. }
  61. }
  62. #define arch_decomp_setup() __arch_decomp_setup(arch_id)
  63. #define arch_decomp_wdog()
  64. #endif /* __MACH_MXS_UNCOMPRESS_H__ */