summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-uniphier/soc_info.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2015-12-17 17:47:41 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2015-12-23 00:08:35 +0900
commit2071f149e5d9376d392281689cf41cd165f7e19c (patch)
tree35f9c767c94734b6113048f0b43d15f3df467ab8 /arch/arm/mach-uniphier/soc_info.c
parentb00543e5535485dde6403a009156e95c937cbd99 (diff)
downloadtalos-obmc-uboot-2071f149e5d9376d392281689cf41cd165f7e19c.tar.gz
talos-obmc-uboot-2071f149e5d9376d392281689cf41cd165f7e19c.zip
ARM: uniphier: add functions to get SoC model/revision
We sometimes have to implement different code depending on the SoC revision. This commit adds functions to get the model/revision number. Note: Model number: incremented on major changes of the SoC Revision number: incremented on minor changes of the SoC The "Model 2" exists for PH1-sLD3, ProXstream2/PH1-LD6b. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch/arm/mach-uniphier/soc_info.c')
-rw-r--r--arch/arm/mach-uniphier/soc_info.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-uniphier/soc_info.c b/arch/arm/mach-uniphier/soc_info.c
index 3e8e7f4ef3..a4010eb3f7 100644
--- a/arch/arm/mach-uniphier/soc_info.c
+++ b/arch/arm/mach-uniphier/soc_info.c
@@ -59,3 +59,15 @@ enum uniphier_soc_id uniphier_get_soc_type(void)
return ret;
}
#endif
+
+int uniphier_get_soc_model(void)
+{
+ return (readl(SG_REVISION) & SG_REVISION_MODEL_MASK) >>
+ SG_REVISION_MODEL_SHIFT;
+}
+
+int uniphier_get_soc_revision(void)
+{
+ return (readl(SG_REVISION) & SG_REVISION_REV_MASK) >>
+ SG_REVISION_REV_SHIFT;
+}
OpenPOWER on IntegriCloud