aboutsummaryrefslogtreecommitdiff
path: root/plat/allwinner/common/sunxi_bl31_setup.c
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2018-06-22 00:47:08 +0100
committerAndre Przywara <andre.przywara@arm.com>2018-06-28 23:51:36 +0100
commitc4143b74e9f9f8fa03cf80448867696a44c447f5 (patch)
tree6833046afdc8947a2ac710aa762f2a7e3d11d310 /plat/allwinner/common/sunxi_bl31_setup.c
parentae903c56c112f463c964d85d4cbf37702aa5c67c (diff)
downloadtrusted-firmware-a-c4143b74e9f9f8fa03cf80448867696a44c447f5.tar.gz
allwinner: Detect and output current SoC
So far we already support booting on two different SoCs, and we will shortly add a third, so add some code to determine the current SoC type. This can be later used to runtime detect certain properties. Also print the SoC name to the console, to give valuable debug information. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'plat/allwinner/common/sunxi_bl31_setup.c')
-rw-r--r--plat/allwinner/common/sunxi_bl31_setup.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/plat/allwinner/common/sunxi_bl31_setup.c b/plat/allwinner/common/sunxi_bl31_setup.c
index f5f91e3186..e910ee5491 100644
--- a/plat/allwinner/common/sunxi_bl31_setup.c
+++ b/plat/allwinner/common/sunxi_bl31_setup.c
@@ -64,6 +64,22 @@ void bl31_plat_arch_setup(void)
void bl31_platform_setup(void)
{
+ const char *soc_name;
+ uint16_t soc_id = sunxi_read_soc_id();
+
+ switch (soc_id) {
+ case 0x1689:
+ soc_name = "A64/H64/R18";
+ break;
+ case 0x1718:
+ soc_name = "H5";
+ break;
+ default:
+ soc_name = "unknown";
+ break;
+ }
+ NOTICE("BL31: Detected Allwinner %s SoC (%04x)\n", soc_name, soc_id);
+
generic_delay_timer_init();
/* Configure the interrupt controller */