David Müller (ELSOFT AG) | 98a7611 | 2010-12-03 05:12:50 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2010 |
| 3 | * David Mueller <d.mueller@elsoft.ch> |
| 4 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
David Müller (ELSOFT AG) | 98a7611 | 2010-12-03 05:12:50 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <asm/io.h> |
| 10 | #include <asm/arch/s3c24x0_cpu.h> |
| 11 | |
| 12 | typedef ulong (*getfreq)(void); |
| 13 | |
| 14 | static const getfreq freq_f[] = { |
| 15 | get_FCLK, |
| 16 | get_HCLK, |
| 17 | get_PCLK, |
| 18 | }; |
| 19 | |
| 20 | static const char freq_c[] = { 'F', 'H', 'P' }; |
| 21 | |
| 22 | int 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 | } |