uncompress.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. * bits 27:24 describe the exynosX family in exynos5420
  27. */
  28. chip_id >>= 20;
  29. if ((chip_id & 0x0f) == 0x5 || (chip_id & 0xf0) == 0x50)
  30. uart_base = (volatile u8 *)EXYNOS5_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
  31. else
  32. uart_base = (volatile u8 *)EXYNOS4_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
  33. /*
  34. * For preventing FIFO overrun or infinite loop of UART console,
  35. * fifo_max should be the minimum fifo size of all of the UART channels
  36. */
  37. fifo_mask = S5PV210_UFSTAT_TXMASK;
  38. fifo_max = 15 << S5PV210_UFSTAT_TXSHIFT;
  39. }
  40. #endif /* __ASM_ARCH_UNCOMPRESS_H */