]> git.ipfire.org Git - thirdparty/u-boot.git/blame - arch/arm/cpu/arm920t/s3c24x0/cpu_info.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[thirdparty/u-boot.git] / arch / arm / cpu / arm920t / s3c24x0 / cpu_info.c
CommitLineData
9fd68266
DMEA
1/*
2 * (C) Copyright 2010
3 * David Mueller <d.mueller@elsoft.ch>
4 *
1a459660 5 * SPDX-License-Identifier: GPL-2.0+
9fd68266
DMEA
6 */
7
8#include <common.h>
9#include <asm/io.h>
10#include <asm/arch/s3c24x0_cpu.h>
11
12typedef ulong (*getfreq)(void);
13
14static const getfreq freq_f[] = {
15 get_FCLK,
16 get_HCLK,
17 get_PCLK,
18};
19
20static const char freq_c[] = { 'F', 'H', 'P' };
21
22int print_cpuinfo(void)
23{
24 int i;
25 char buf[32];
26/* the S3C2400 seems to be lacking a CHIP ID register */
27#ifndef CONFIG_S3C2400
28 ulong cpuid;
29 struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
30
31 cpuid = readl(&gpio->gstatus1);
32 printf("CPUID: %8lX\n", cpuid);
33#endif
34 for (i = 0; i < ARRAY_SIZE(freq_f); i++)
35 printf("%cCLK: %8s MHz\n", freq_c[i], strmhz(buf, freq_f[i]()));
36
37 return 0;
38}