uncompress.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2010-2012 Samsung Electronics Co., Ltd.
  3. * http://www.samsung.com
  4. *
  5. * EXYNOS - uncompress code
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef __ASM_ARCH_UNCOMPRESS_H
  12. #define __ASM_ARCH_UNCOMPRESS_H __FILE__
  13. #include <asm/mach-types.h>
  14. #include <mach/map.h>
  15. volatile u8 *uart_base;
  16. #include <plat/uncompress.h>
  17. static unsigned int __raw_readl(unsigned int ptr)
  18. {
  19. return *((volatile unsigned int *)ptr);
  20. }
  21. static void arch_detect_cpu(void)
  22. {
  23. u32 chip_id = __raw_readl(EXYNOS_PA_CHIPID);
  24. /*
  25. * product_id is bits 31:12
  26. * bits 23:20 describe the exynosX family
  27. *
  28. */
  29. chip_id >>= 20;
  30. chip_id &= 0xf;
  31. if (chip_id == 0x5)
  32. uart_base = (volatile u8 *)EXYNOS5_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
  33. else
  34. uart_base = (volatile u8 *)EXYNOS4_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
  35. /*
  36. * For preventing FIFO overrun or infinite loop of UART console,
  37. * fifo_max should be the minimum fifo size of all of the UART channels
  38. */
  39. fifo_mask = S5PV210_UFSTAT_TXMASK;
  40. fifo_max = 15 << S5PV210_UFSTAT_TXSHIFT;
  41. }
  42. #endif /* __ASM_ARCH_UNCOMPRESS_H */