blob: 14c5c6a00d2e0b1de610c5caf01f26c8395fe56f [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 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
24#include <common.h>
25#include <asm/io.h>
26#include <asm/arch/s3c24x0_cpu.h>
27
28typedef ulong (*getfreq)(void);
29
30static const getfreq freq_f[] = {
31 get_FCLK,
32 get_HCLK,
33 get_PCLK,
34};
35
36static const char freq_c[] = { 'F', 'H', 'P' };
37
38int print_cpuinfo(void)
39{
40 int i;
41 char buf[32];
42/* the S3C2400 seems to be lacking a CHIP ID register */
43#ifndef CONFIG_S3C2400
44 ulong cpuid;
45 struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
46
47 cpuid = readl(&gpio->gstatus1);
48 printf("CPUID: %8lX\n", cpuid);
49#endif
50 for (i = 0; i < ARRAY_SIZE(freq_f); i++)
51 printf("%cCLK: %8s MHz\n", freq_c[i], strmhz(buf, freq_f[i]()));
52
53 return 0;
54}