Stephan Gerhold | 689088f | 2020-01-04 18:45:17 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | /* |
| 3 | * Copyright (C) 2019 Stephan Gerhold <stephan@gerhold.net> |
| 4 | */ |
| 5 | |
| 6 | #include <common.h> |
Simon Glass | 691d719 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 7 | #include <init.h> |
Stephan Gerhold | 689088f | 2020-01-04 18:45:17 +0100 | [diff] [blame] | 8 | #include <asm/io.h> |
| 9 | |
| 10 | #define U8500_BOOTROM_BASE 0x90000000 |
| 11 | #define U8500_ASIC_ID_LOC_V2 (U8500_BOOTROM_BASE + 0x1DBF4) |
| 12 | |
| 13 | int print_cpuinfo(void) |
| 14 | { |
| 15 | /* Convert ASIC ID to display string, e.g. 0x8520A0 => DB8520 V1.0 */ |
| 16 | u32 asicid = readl(U8500_ASIC_ID_LOC_V2); |
| 17 | u32 cpu = (asicid >> 8) & 0xffff; |
| 18 | u32 rev = asicid & 0xff; |
| 19 | |
| 20 | /* 0xA0 => 0x10 (V1.0) */ |
| 21 | if (rev >= 0xa0) |
| 22 | rev -= 0x90; |
| 23 | |
| 24 | printf("CPU: ST-Ericsson DB%x V%d.%d\n", cpu, rev >> 4, rev & 0xf); |
| 25 | return 0; |
| 26 | } |