summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-uniphier/cpu_info.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2015-02-27 02:26:42 +0900
committerMasahiro Yamada <yamada.m@jp.panasonic.com>2015-03-01 00:01:56 +0900
commit4c425570214cac091d9bdcf840b936062fb8da12 (patch)
treea8a83c219c46dec073438df0c77031418c662b25 /arch/arm/mach-uniphier/cpu_info.c
parent1606b34aa50804227806971dbb6b82ea0bf81f55 (diff)
downloadtalos-obmc-uboot-4c425570214cac091d9bdcf840b936062fb8da12.tar.gz
talos-obmc-uboot-4c425570214cac091d9bdcf840b936062fb8da12.zip
ARM: UniPhier: move SoC sources to mach-uniphier
Move arch/arm/cpu/armv7/uniphier/* -> arch/arm/mach-uniphier/* Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Diffstat (limited to 'arch/arm/mach-uniphier/cpu_info.c')
-rw-r--r--arch/arm/mach-uniphier/cpu_info.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/arch/arm/mach-uniphier/cpu_info.c b/arch/arm/mach-uniphier/cpu_info.c
new file mode 100644
index 0000000000..86d079ad56
--- /dev/null
+++ b/arch/arm/mach-uniphier/cpu_info.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2013-2014 Panasonic Corporation
+ * Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/sg-regs.h>
+
+int print_cpuinfo(void)
+{
+ u32 revision, type, model, rev, required_model = 1, required_rev = 1;
+
+ revision = readl(SG_REVISION);
+ type = (revision & SG_REVISION_TYPE_MASK) >> SG_REVISION_TYPE_SHIFT;
+ model = (revision & SG_REVISION_MODEL_MASK) >> SG_REVISION_MODEL_SHIFT;
+ rev = (revision & SG_REVISION_REV_MASK) >> SG_REVISION_REV_SHIFT;
+
+ puts("CPU: ");
+
+ switch (type) {
+ case 0x25:
+ puts("PH1-sLD3 (MN2WS0220)");
+ required_model = 2;
+ break;
+ case 0x26:
+ puts("PH1-LD4 (MN2WS0250)");
+ required_rev = 2;
+ break;
+ case 0x28:
+ puts("PH1-Pro4 (MN2WS0230)");
+ break;
+ case 0x29:
+ puts("PH1-sLD8 (MN2WS0270)");
+ break;
+ default:
+ printf("Unknown Processor ID (0x%x)\n", revision);
+ return -1;
+ }
+
+ if (model > 1)
+ printf(" model %d", model);
+
+ printf(" (rev. %d)\n", rev);
+
+ if (model < required_model) {
+ printf("Sorry, this model is not supported.\n");
+ printf("Required model is %d.", required_model);
+ return -1;
+ } else if (rev < required_rev) {
+ printf("Sorry, this revision is not supported.\n");
+ printf("Required revision is %d.", required_rev);
+ return -1;
+ }
+
+ return 0;
+}
OpenPOWER on IntegriCloud