Linux 5.7.7
[linux/fpc-iii.git] / arch / arm / plat-samsung / cpu.c
blobe1ba88ba31d89e2c43a61f72df2f3c58cfb86fd8
1 // SPDX-License-Identifier: GPL-2.0
2 //
3 // Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
4 // http://www.samsung.com
5 //
6 // Samsung CPU Support
8 #include <linux/module.h>
9 #include <linux/kernel.h>
10 #include <linux/init.h>
11 #include <linux/io.h>
13 #include <plat/map-base.h>
14 #include <plat/cpu.h>
16 unsigned long samsung_cpu_id;
17 static unsigned int samsung_cpu_rev;
19 unsigned int samsung_rev(void)
21 return samsung_cpu_rev;
23 EXPORT_SYMBOL(samsung_rev);
25 void __init s3c64xx_init_cpu(void)
27 samsung_cpu_id = readl_relaxed(S3C_VA_SYS + 0x118);
28 if (!samsung_cpu_id) {
30 * S3C6400 has the ID register in a different place,
31 * and needs a write before it can be read.
33 writel_relaxed(0x0, S3C_VA_SYS + 0xA1C);
34 samsung_cpu_id = readl_relaxed(S3C_VA_SYS + 0xA1C);
37 samsung_cpu_rev = 0;
39 pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
42 void __init s5p_init_cpu(const void __iomem *cpuid_addr)
44 samsung_cpu_id = readl_relaxed(cpuid_addr);
45 samsung_cpu_rev = samsung_cpu_id & 0xFF;
47 pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);