xref: /openbmc/linux/arch/arm/mach-s3c/cpu.c (revision c6ff132d)
171b9114dSArnd Bergmann // SPDX-License-Identifier: GPL-2.0
271b9114dSArnd Bergmann //
371b9114dSArnd Bergmann // Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
471b9114dSArnd Bergmann //		http://www.samsung.com
571b9114dSArnd Bergmann //
671b9114dSArnd Bergmann // Samsung CPU Support
771b9114dSArnd Bergmann 
871b9114dSArnd Bergmann #include <linux/module.h>
971b9114dSArnd Bergmann #include <linux/kernel.h>
1071b9114dSArnd Bergmann #include <linux/init.h>
1171b9114dSArnd Bergmann #include <linux/io.h>
1271b9114dSArnd Bergmann 
13c6ff132dSArnd Bergmann #include <mach/map-base.h>
14c6ff132dSArnd Bergmann #include "cpu.h"
1571b9114dSArnd Bergmann 
1671b9114dSArnd Bergmann unsigned long samsung_cpu_id;
1771b9114dSArnd Bergmann 
1871b9114dSArnd Bergmann void __init s3c64xx_init_cpu(void)
1971b9114dSArnd Bergmann {
2071b9114dSArnd Bergmann 	samsung_cpu_id = readl_relaxed(S3C_VA_SYS + 0x118);
2171b9114dSArnd Bergmann 	if (!samsung_cpu_id) {
2271b9114dSArnd Bergmann 		/*
2371b9114dSArnd Bergmann 		 * S3C6400 has the ID register in a different place,
2471b9114dSArnd Bergmann 		 * and needs a write before it can be read.
2571b9114dSArnd Bergmann 		 */
2671b9114dSArnd Bergmann 		writel_relaxed(0x0, S3C_VA_SYS + 0xA1C);
2771b9114dSArnd Bergmann 		samsung_cpu_id = readl_relaxed(S3C_VA_SYS + 0xA1C);
2871b9114dSArnd Bergmann 	}
2971b9114dSArnd Bergmann 
3071b9114dSArnd Bergmann 	pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
3171b9114dSArnd Bergmann }
32