uncompress.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #include <plat/uncompress.h>
  16. static unsigned int __raw_readl(unsigned int ptr)
  17. {
  18. return *((volatile unsigned int *)ptr);
  19. }
  20. static void arch_detect_cpu(void)
  21. {
  22. u32 chip_id = __raw_readl(EXYNOS_PA_CHIPID);
  23. /*
  24. * product_id is bits 31:12
  25. * bits 23:20 describe the exynosX family
  26. *
  27. */
  28. chip_id >>= 20;
  29. chip_id &= 0xf;
  30. if (chip_id == 0x5)
  31. uart_base = (volatile u8 *)EXYNOS5_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
  32. else
  33. uart_base = (volatile u8 *)EXYNOS4_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
  34. /*
  35. * For preventing FIFO overrun or infinite loop of UART console,
  36. * fifo_max should be the minimum fifo size of all of the UART channels
  37. */
  38. fifo_mask = S5PV210_UFSTAT_TXMASK;
  39. fifo_max = 15 << S5PV210_UFSTAT_TXSHIFT;
  40. }
  41. #endif /* __ASM_ARCH_UNCOMPRESS_H */