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 | { |
Ian Campbell | 8f32aaa | 2014-10-24 21:20:47 +0100 | [diff] [blame^] | 16 | #ifdef CONFIG_MACH_SUN4I |
Hans de Goede | 3ab9c23 | 2014-06-09 11:36:57 +0200 | [diff] [blame] | 17 | puts("CPU: Allwinner A10 (SUN4I)\n"); |
Ian Campbell | 8f32aaa | 2014-10-24 21:20:47 +0100 | [diff] [blame^] | 18 | #elif defined CONFIG_MACH_SUN5I |
Hans de Goede | 8c1c782 | 2014-06-09 11:36:58 +0200 | [diff] [blame] | 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 | } |
Ian Campbell | 8f32aaa | 2014-10-24 21:20:47 +0100 | [diff] [blame^] | 26 | #elif defined CONFIG_MACH_SUN6I |
Maxime Ripard | 2c51941 | 2014-10-03 20:16:29 +0800 | [diff] [blame] | 27 | puts("CPU: Allwinner A31 (SUN6I)\n"); |
Ian Campbell | 8f32aaa | 2014-10-24 21:20:47 +0100 | [diff] [blame^] | 28 | #elif defined CONFIG_MACH_SUN7I |
Ian Campbell | 6efe369 | 2014-05-05 11:52:26 +0100 | [diff] [blame] | 29 | puts("CPU: Allwinner A20 (SUN7I)\n"); |
Ian Campbell | 8f32aaa | 2014-10-24 21:20:47 +0100 | [diff] [blame^] | 30 | #elif defined CONFIG_MACH_SUN8I |
Chen-Yu Tsai | 848c263 | 2014-10-22 16:47:44 +0800 | [diff] [blame] | 31 | puts("CPU: Allwinner A23 (SUN8I)\n"); |
Hans de Goede | 3ab9c23 | 2014-06-09 11:36:57 +0200 | [diff] [blame] | 32 | #else |
| 33 | #warning Please update cpu_info.c with correct CPU information |
| 34 | puts("CPU: SUNXI Family\n"); |
| 35 | #endif |
Ian Campbell | 6efe369 | 2014-05-05 11:52:26 +0100 | [diff] [blame] | 36 | return 0; |
| 37 | } |
| 38 | #endif |