uncompress.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * arch/arm/mach-at91/include/mach/uncompress.h
  3. *
  4. * Copyright (C) 2003 SAN People
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #ifndef __ASM_ARCH_UNCOMPRESS_H
  21. #define __ASM_ARCH_UNCOMPRESS_H
  22. #include <linux/io.h>
  23. #include <linux/atmel_serial.h>
  24. #if defined(CONFIG_AT91_EARLY_DBGU0)
  25. #define UART_OFFSET AT91_BASE_DBGU0
  26. #elif defined(CONFIG_AT91_EARLY_DBGU1)
  27. #define UART_OFFSET AT91_BASE_DBGU1
  28. #elif defined(CONFIG_AT91_EARLY_USART0)
  29. #define UART_OFFSET AT91_USART0
  30. #elif defined(CONFIG_AT91_EARLY_USART1)
  31. #define UART_OFFSET AT91_USART1
  32. #elif defined(CONFIG_AT91_EARLY_USART2)
  33. #define UART_OFFSET AT91_USART2
  34. #elif defined(CONFIG_AT91_EARLY_USART3)
  35. #define UART_OFFSET AT91_USART3
  36. #elif defined(CONFIG_AT91_EARLY_USART4)
  37. #define UART_OFFSET AT91_USART4
  38. #elif defined(CONFIG_AT91_EARLY_USART5)
  39. #define UART_OFFSET AT91_USART5
  40. #endif
  41. /*
  42. * The following code assumes the serial port has already been
  43. * initialized by the bootloader. If you didn't setup a port in
  44. * your bootloader then nothing will appear (which might be desired).
  45. *
  46. * This does not append a newline
  47. */
  48. static void putc(int c)
  49. {
  50. #ifdef UART_OFFSET
  51. void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */
  52. while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXRDY))
  53. barrier();
  54. __raw_writel(c, sys + ATMEL_US_THR);
  55. #endif
  56. }
  57. static inline void flush(void)
  58. {
  59. #ifdef UART_OFFSET
  60. void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */
  61. /* wait for transmission to complete */
  62. while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXEMPTY))
  63. barrier();
  64. #endif
  65. }
  66. #define arch_decomp_setup()
  67. #define arch_decomp_wdog()
  68. #endif