blob: 364963a0a34486ec92975888442650da491a7d9b [file] [log] [blame]
Kukjin Kime6d1cb92011-08-20 12:18:07 +09001/* linux/arch/arm/plat-samsung/cpu.c
2 *
3 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Samsung CPU Support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/io.h>
17
Kukjin Kime6d1cb92011-08-20 12:18:07 +090018
19#include <mach/map.h>
20#include <plat/cpu.h>
21
22unsigned long samsung_cpu_id;
23static unsigned int samsung_cpu_rev;
24
25unsigned int samsung_rev(void)
26{
27 return samsung_cpu_rev;
28}
29EXPORT_SYMBOL(samsung_rev);
30
Kukjin Kime6d1cb92011-08-20 12:18:07 +090031void __init s3c64xx_init_cpu(void)
32{
33 samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0x118);
34 if (!samsung_cpu_id) {
35 /*
36 * S3C6400 has the ID register in a different place,
37 * and needs a write before it can be read.
38 */
39 __raw_writel(0x0, S3C_VA_SYS + 0xA1C);
40 samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0xA1C);
41 }
42
43 samsung_cpu_rev = 0;
44}
45
46void __init s5p_init_cpu(void __iomem *cpuid_addr)
47{
48 samsung_cpu_id = __raw_readl(cpuid_addr);
49 samsung_cpu_rev = samsung_cpu_id & 0xFF;
50}