Kukjin Kim | 171c067 | 2012-02-10 11:57:53 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2010-2012 Samsung Electronics Co., Ltd. |
Kukjin Kim | 7d30e8b | 2011-02-14 16:33:10 +0900 | [diff] [blame] | 3 | * http://www.samsung.com |
Changhwan Youn | 2b12b5c | 2010-07-26 21:08:52 +0900 | [diff] [blame] | 4 | * |
Kukjin Kim | 171c067 | 2012-02-10 11:57:53 +0900 | [diff] [blame] | 5 | * EXYNOS - uncompress code |
Changhwan Youn | 2b12b5c | 2010-07-26 21:08:52 +0900 | [diff] [blame] | 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 | |
| 12 | #ifndef __ASM_ARCH_UNCOMPRESS_H |
| 13 | #define __ASM_ARCH_UNCOMPRESS_H __FILE__ |
| 14 | |
Kukjin Kim | 171c067 | 2012-02-10 11:57:53 +0900 | [diff] [blame] | 15 | #include <asm/mach-types.h> |
| 16 | |
Changhwan Youn | 2b12b5c | 2010-07-26 21:08:52 +0900 | [diff] [blame] | 17 | #include <mach/map.h> |
| 18 | #include <plat/uncompress.h> |
| 19 | |
Dima Zavin | 6aa5106 | 2012-04-04 09:27:37 -0700 | [diff] [blame] | 20 | static unsigned int __raw_readl(unsigned int ptr) |
| 21 | { |
| 22 | return *((volatile unsigned int *)ptr); |
| 23 | } |
| 24 | |
Changhwan Youn | 2b12b5c | 2010-07-26 21:08:52 +0900 | [diff] [blame] | 25 | static void arch_detect_cpu(void) |
| 26 | { |
Dima Zavin | 6aa5106 | 2012-04-04 09:27:37 -0700 | [diff] [blame] | 27 | u32 chip_id = __raw_readl(EXYNOS_PA_CHIPID); |
| 28 | |
| 29 | /* |
| 30 | * product_id is bits 31:12 |
Chander Kashyap | c6fd0fe | 2013-06-19 00:29:34 +0900 | [diff] [blame] | 31 | * bits 23:20 describe the exynosX family |
| 32 | * bits 27:24 describe the exynosX family in exynos5420 |
Dima Zavin | 6aa5106 | 2012-04-04 09:27:37 -0700 | [diff] [blame] | 33 | */ |
| 34 | chip_id >>= 20; |
Dima Zavin | 6aa5106 | 2012-04-04 09:27:37 -0700 | [diff] [blame] | 35 | |
Chander Kashyap | c6fd0fe | 2013-06-19 00:29:34 +0900 | [diff] [blame] | 36 | if ((chip_id & 0x0f) == 0x5 || (chip_id & 0xf0) == 0x50) |
Kukjin Kim | 171c067 | 2012-02-10 11:57:53 +0900 | [diff] [blame] | 37 | uart_base = (volatile u8 *)EXYNOS5_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); |
| 38 | else |
| 39 | uart_base = (volatile u8 *)EXYNOS4_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); |
Changhwan Youn | 2b12b5c | 2010-07-26 21:08:52 +0900 | [diff] [blame] | 40 | |
| 41 | /* |
| 42 | * For preventing FIFO overrun or infinite loop of UART console, |
| 43 | * fifo_max should be the minimum fifo size of all of the UART channels |
| 44 | */ |
| 45 | fifo_mask = S5PV210_UFSTAT_TXMASK; |
| 46 | fifo_max = 15 << S5PV210_UFSTAT_TXSHIFT; |
| 47 | } |
| 48 | #endif /* __ASM_ARCH_UNCOMPRESS_H */ |