Ian Campbell | 6efe369 | 2014-05-05 11:52:26 +0100 | [diff] [blame] | 1 | /* |
| 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 |
| 14 | int print_cpuinfo(void) |
| 15 | { |
Hans de Goede | 3ab9c23 | 2014-06-09 11:36:57 +0200 | [diff] [blame] | 16 | #ifdef CONFIG_SUN4I |
| 17 | puts("CPU: Allwinner A10 (SUN4I)\n"); |
Hans de Goede | 8c1c782 | 2014-06-09 11:36:58 +0200 | [diff] [blame] | 18 | #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 Goede | 3ab9c23 | 2014-06-09 11:36:57 +0200 | [diff] [blame] | 26 | #elif defined CONFIG_SUN7I |
Ian Campbell | 6efe369 | 2014-05-05 11:52:26 +0100 | [diff] [blame] | 27 | puts("CPU: Allwinner A20 (SUN7I)\n"); |
Hans de Goede | 3ab9c23 | 2014-06-09 11:36:57 +0200 | [diff] [blame] | 28 | #else |
| 29 | #warning Please update cpu_info.c with correct CPU information |
| 30 | puts("CPU: SUNXI Family\n"); |
| 31 | #endif |
Ian Campbell | 6efe369 | 2014-05-05 11:52:26 +0100 | [diff] [blame] | 32 | return 0; |
| 33 | } |
| 34 | #endif |