]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/mach-uniphier/soc_info.c
thunderx: Calculate TCR dynamically
[u-boot] / arch / arm / mach-uniphier / soc_info.c
index 3e8e7f4ef33bdf838cb0dd6d45fdf14e40341efc..3cfc183723b041e9ec9fb55267ca7468492833b8 100644 (file)
@@ -6,8 +6,9 @@
 
 #include <linux/io.h>
 #include <linux/types.h>
-#include <mach/sg-regs.h>
-#include <mach/soc_info.h>
+
+#include "sg-regs.h"
+#include "soc-info.h"
 
 #if UNIPHIER_MULTI_SOC
 enum uniphier_soc_id uniphier_get_soc_type(void)
@@ -50,6 +51,16 @@ enum uniphier_soc_id uniphier_get_soc_type(void)
        case 0x2F:
                ret = SOC_UNIPHIER_PH1_LD6B;
                break;
+#endif
+#ifdef CONFIG_ARCH_UNIPHIER_PH1_LD11
+       case 0x31:
+               ret = SOC_UNIPHIER_PH1_LD11;
+               break;
+#endif
+#ifdef CONFIG_ARCH_UNIPHIER_PH1_LD20
+       case 0x32:
+               ret = SOC_UNIPHIER_PH1_LD20;
+               break;
 #endif
        default:
                ret = SOC_UNIPHIER_UNKNOWN;
@@ -59,3 +70,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;
+}