blob: fede51a1605c28303168f287c5bb274f4282b38f [file] [log] [blame]
David Müller (ELSOFT AG)98a76112010-12-03 05:12:50 +00001/*
2 * (C) Copyright 2010
3 * David Mueller <d.mueller@elsoft.ch>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
David Müller (ELSOFT AG)98a76112010-12-03 05:12:50 +00006 */
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}