]> Git Repo - J-u-boot.git/blob - arch/arm/mach-u8500/cpuinfo.c
6d4c6196c3dfb18f3953fcae32c5cc244c01258e
[J-u-boot.git] / arch / arm / mach-u8500 / cpuinfo.c
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (C) 2019 Stephan Gerhold <[email protected]>
4  */
5
6 #include <init.h>
7 #include <asm/io.h>
8
9 #define U8500_BOOTROM_BASE      0x90000000
10 #define U8500_ASIC_ID_LOC_V2    (U8500_BOOTROM_BASE + 0x1DBF4)
11
12 int print_cpuinfo(void)
13 {
14         /* Convert ASIC ID to display string, e.g. 0x8520A0 => DB8520 V1.0 */
15         u32 asicid = readl(U8500_ASIC_ID_LOC_V2);
16         u32 cpu = (asicid >> 8) & 0xffff;
17         u32 rev = asicid & 0xff;
18
19         /* 0xA0 => 0x10 (V1.0) */
20         if (rev >= 0xa0)
21                 rev -= 0x90;
22
23         printf("CPU: ST-Ericsson DB%x V%d.%d\n", cpu, rev >> 4, rev & 0xf);
24         return 0;
25 }
This page took 0.015588 seconds and 2 git commands to generate.