blob: 5cf35acc1e60127df04bc9b2c178ed5f46d8671c [file] [log] [blame]
Ian Campbell6efe3692014-05-05 11:52:26 +01001/*
2 * (C) Copyright 2007-2011
3 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
4 * Tom Cubie <tangliang@allwinnertech.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9#include <common.h>
10#include <asm/io.h>
11#include <asm/arch/cpu.h>
12
13#ifdef CONFIG_DISPLAY_CPUINFO
14int print_cpuinfo(void)
15{
Hans de Goede3ab9c232014-06-09 11:36:57 +020016#ifdef CONFIG_SUN4I
17 puts("CPU: Allwinner A10 (SUN4I)\n");
Hans de Goede8c1c7822014-06-09 11:36:58 +020018#elif defined CONFIG_SUN5I
19 u32 val = readl(SUNXI_SID_BASE + 0x08);
20 switch ((val >> 12) & 0xf) {
21 case 0: puts("CPU: Allwinner A12 (SUN5I)\n"); break;
22 case 3: puts("CPU: Allwinner A13 (SUN5I)\n"); break;
23 case 7: puts("CPU: Allwinner A10s (SUN5I)\n"); break;
24 default: puts("CPU: Allwinner A1X (SUN5I)\n");
25 }
Hans de Goede3ab9c232014-06-09 11:36:57 +020026#elif defined CONFIG_SUN7I
Ian Campbell6efe3692014-05-05 11:52:26 +010027 puts("CPU: Allwinner A20 (SUN7I)\n");
Hans de Goede3ab9c232014-06-09 11:36:57 +020028#else
29#warning Please update cpu_info.c with correct CPU information
30 puts("CPU: SUNXI Family\n");
31#endif
Ian Campbell6efe3692014-05-05 11:52:26 +010032 return 0;
33}
34#endif