blob: 41b9add297a2362732c360a6b51ec893735f06a7 [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{
Ian Campbell8f32aaa2014-10-24 21:20:47 +010016#ifdef CONFIG_MACH_SUN4I
Hans de Goede3ab9c232014-06-09 11:36:57 +020017 puts("CPU: Allwinner A10 (SUN4I)\n");
Ian Campbell8f32aaa2014-10-24 21:20:47 +010018#elif defined CONFIG_MACH_SUN5I
Hans de Goede8c1c7822014-06-09 11:36:58 +020019 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 }
Ian Campbell8f32aaa2014-10-24 21:20:47 +010026#elif defined CONFIG_MACH_SUN6I
Maxime Ripard2c519412014-10-03 20:16:29 +080027 puts("CPU: Allwinner A31 (SUN6I)\n");
Ian Campbell8f32aaa2014-10-24 21:20:47 +010028#elif defined CONFIG_MACH_SUN7I
Ian Campbell6efe3692014-05-05 11:52:26 +010029 puts("CPU: Allwinner A20 (SUN7I)\n");
Ian Campbell8f32aaa2014-10-24 21:20:47 +010030#elif defined CONFIG_MACH_SUN8I
Chen-Yu Tsai848c2632014-10-22 16:47:44 +080031 puts("CPU: Allwinner A23 (SUN8I)\n");
Hans de Goede3ab9c232014-06-09 11:36:57 +020032#else
33#warning Please update cpu_info.c with correct CPU information
34 puts("CPU: SUNXI Family\n");
35#endif
Ian Campbell6efe3692014-05-05 11:52:26 +010036 return 0;
37}
38#endif