Skip to content

Commit 6aa5106

Browse files
Dima Zavinkgene
authored andcommitted
ARM: EXYNOS: use chip_id reg in uncompress to select uart base phys
Signed-off-by: Dima Zavin <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
1 parent fd9abe1 commit 6aa5106

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

arch/arm/mach-exynos/include/mach/uncompress.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,24 @@ volatile u8 *uart_base;
2020

2121
#include <plat/uncompress.h>
2222

23+
static unsigned int __raw_readl(unsigned int ptr)
24+
{
25+
return *((volatile unsigned int *)ptr);
26+
}
27+
2328
static void arch_detect_cpu(void)
2429
{
25-
if (machine_is_smdk5250())
30+
u32 chip_id = __raw_readl(EXYNOS_PA_CHIPID);
31+
32+
/*
33+
* product_id is bits 31:12
34+
* bits 23:20 describe the exynosX family
35+
*
36+
*/
37+
chip_id >>= 20;
38+
chip_id &= 0xf;
39+
40+
if (chip_id == 0x5)
2641
uart_base = (volatile u8 *)EXYNOS5_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
2742
else
2843
uart_base = (volatile u8 *)EXYNOS4_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);

0 commit comments

Comments
 (0)