u-boot/arch/arm/mach-u8500/cpuinfo.c
Stephan Gerhold 689088f9da arm: Add support for ST-Ericsson U8500 SoC
The NovaThor U8500 SoC was released by ST-Ericsson in 2011.
It was used for some development boards like the CALAO Systems
Snowball SBC, but mass production was primarily for Android
smartphones like the Samsung Galaxy S III mini.

Previous support for U8500 was removed in
commit 68282f55b8 ("arm: Remove unused ST-Ericsson u8500 arch")
since none of the boards were converted to generic boards
before the deadline.

The new code does not have much in common with the previous code.
I have completely rewritten everything, embracing the Driver Model
and device trees wherever possible.

The U8500 support is a bit more minimal for now - my primary
use case is to use U-Boot as alternative bootloader for some of the
U8500 Samsung smartphones. At the moment U-Boot is chain-loaded from
the original Samsung bootloader. A side effect of this is that we
can (temporarily) get away without implementing some functionality
- e.g. all clocks are already enabled by the original bootloader.

More functionality will be added in future patches.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: John Rigby <john.rigby@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2020-01-22 17:47:57 -05:00

25 lines
598 B
C

// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2019 Stephan Gerhold <stephan@gerhold.net>
*/
#include <common.h>
#include <asm/io.h>
#define U8500_BOOTROM_BASE 0x90000000
#define U8500_ASIC_ID_LOC_V2 (U8500_BOOTROM_BASE + 0x1DBF4)
int print_cpuinfo(void)
{
/* Convert ASIC ID to display string, e.g. 0x8520A0 => DB8520 V1.0 */
u32 asicid = readl(U8500_ASIC_ID_LOC_V2);
u32 cpu = (asicid >> 8) & 0xffff;
u32 rev = asicid & 0xff;
/* 0xA0 => 0x10 (V1.0) */
if (rev >= 0xa0)
rev -= 0x90;
printf("CPU: ST-Ericsson DB%x V%d.%d\n", cpu, rev >> 4, rev & 0xf);
return 0;
}