summaryrefslogtreecommitdiff
path: root/arch/arc/lib/cpu.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-10-05 10:16:31 -0400
committerTom Rini <trini@konsulko.com>2018-10-05 10:16:31 -0400
commit46031b3aa08814f797a379356750aa5fb94cd3f7 (patch)
tree79bc71a15a74863f4f3362d3b09c92efad35a1bf /arch/arc/lib/cpu.c
parentad8c9f614620ec77d3c0f8963d61535038c39f09 (diff)
parent5396e8b1dd0ad9741b04f506ef88b5fb49d4c82a (diff)
Merge tag 'arc-updates-for-2018.11-rc2' of git://git.denx.de/u-boot-arc
Here we do a couple of impovements for all ARC boards as well as introduce yet another developemnt board. 1. Now for ARC boards we print CPU and board info which is useful for users and helps with analysis of logs "post-mortem". 2. Synopsys IoT development kit support is added This one might bw a bit too late as we're past RC1 but: 1) This doesn't affect any other arches etc as we change purely ARC code. 2) I've got a chance to talk about U-Boot on IoT platforms during ELCE (my proposal was on a wait list and only this week I've got an update and invitation to talk) so it would be good to have this board as a primer in upstream code-base by the time of ELCE 2018. 3) For complete support of IoT devkit I'm yet to significantly rework regmap subsystem in U-Boot but that's a different topic and hopefully it will be done sometime soon... though not this release cycle for sure.
Diffstat (limited to 'arch/arc/lib/cpu.c')
-rw-r--r--arch/arc/lib/cpu.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/arch/arc/lib/cpu.c b/arch/arc/lib/cpu.c
index cb95e06e93..50cd7cdb61 100644
--- a/arch/arc/lib/cpu.c
+++ b/arch/arc/lib/cpu.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+
/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+ * Copyright (C) 2013-2014, 2018 Synopsys, Inc. All rights reserved.
*/
#include <common.h>
@@ -33,3 +33,36 @@ int dram_init(void)
{
return 0;
}
+
+#ifdef CONFIG_DISPLAY_CPUINFO
+const char *decode_identity(void)
+{
+ int arcver = read_aux_reg(ARC_AUX_IDENTITY) & 0xff;
+
+ switch (arcver) {
+ /* ARCompact cores */
+ case 0x32: return "ARC 700 v4.4-4.5";
+ case 0x33: return "ARC 700 v4.6-v4.9";
+ case 0x34: return "ARC 700 v4.10";
+ case 0x35: return "ARC 700 v4.11";
+
+ /* ARCv2 cores */
+ case 0x41: return "ARC EM v1.1a";
+ case 0x42: return "ARC EM v3.0";
+ case 0x43: return "ARC EM v4.0";
+ case 0x50: return "ARC HS v1.0";
+ case 0x51: return "ARC EM v2.0";
+ case 0x52: return "ARC EM v2.1";
+ case 0x53: return "ARC HS v3.0";
+ case 0x54: return "ARC HS v4.0";
+
+ default: return "Unknown ARC core";
+ }
+}
+
+int print_cpuinfo(void)
+{
+ printf("CPU: %s\n", decode_identity());
+ return 0;
+}
+#endif /* CONFIG_DISPLAY_CPUINFO */