uncompress.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. * bits 27:24 describe the exynosX family in exynos5420
  28. */
  29. chip_id >>= 20;
  30. if ((chip_id & 0x0f) == 0x5 || (chip_id & 0xf0) == 0x50)
  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 */