uncompress.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (C) 2010 Broadcom
  3. * Copyright (C) 2003 ARM Limited
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #include <linux/io.h>
  16. #include <linux/amba/serial.h>
  17. #include <mach/bcm2835_soc.h>
  18. #define UART0_BASE BCM2835_DEBUG_PHYS
  19. #define BCM2835_UART_DR IOMEM(UART0_BASE + UART01x_DR)
  20. #define BCM2835_UART_FR IOMEM(UART0_BASE + UART01x_FR)
  21. #define BCM2835_UART_CR IOMEM(UART0_BASE + UART011_CR)
  22. static inline void putc(int c)
  23. {
  24. while (__raw_readl(BCM2835_UART_FR) & UART01x_FR_TXFF)
  25. barrier();
  26. __raw_writel(c, BCM2835_UART_DR);
  27. }
  28. static inline void flush(void)
  29. {
  30. int fr;
  31. do {
  32. fr = __raw_readl(BCM2835_UART_FR);
  33. barrier();
  34. } while ((fr & (UART011_FR_TXFE | UART01x_FR_BUSY)) != UART011_FR_TXFE);
  35. }
  36. #define arch_decomp_setup()