[Skiboot] [PATCH v5 09/10] Add POWER9 Cumulus processor PVR type

Vaidyanathan Srinivasan svaidy at linux.ibm.com
Wed Apr 22 15:04:18 AEST 2020


From: Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com>

Add PVR checks and feature mapping for POWER9 Cumulus chip.

Signed-off-by: Vaidyanathan Srinivasan <svaidy at linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 core/cpufeatures.c  | 19 +++++++++++++++++++
 include/processor.h | 14 ++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/core/cpufeatures.c b/core/cpufeatures.c
index c6754abb..7bc72e24 100644
--- a/core/cpufeatures.c
+++ b/core/cpufeatures.c
@@ -943,6 +943,25 @@ void dt_add_cpufeatures(struct dt_node *root)
 			default:
 				assert(0);
 			}
+		} else if (is_power9c(version) &&
+                            (PVR_VERS_MAJ(version) == 1)) {
+                          /* P9C DD1.x */
+			switch (PVR_VERS_MIN(version)) {
+                        case 1:
+				/* Cumulus DD1.1 => Nimbus DD2.1 */
+				cpu_feature_cpu = CPU_P9_DD2_0_1;
+				break;
+			case 2:
+				/* Cumulus DD1.2 */
+				cpu_feature_cpu = CPU_P9_DD2_2;
+				break;
+			case 3:
+				/* Cumulus DD1.3 */
+				cpu_feature_cpu = CPU_P9_DD2_3;
+				break;
+			default:
+				assert(0);
+			}
 		} else {
 			assert(0);
 		}
diff --git a/include/processor.h b/include/processor.h
index 57c2ee13..8977dfec 100644
--- a/include/processor.h
+++ b/include/processor.h
@@ -228,6 +228,20 @@ static inline bool is_power9n(uint32_t version)
 	return true;
 }
 
+static inline bool is_power9c(uint32_t version) {
+
+	if (PVR_TYPE(version) != PVR_TYPE_P9)
+		return false;
+	/*
+	 * Bit 13 tells us:
+	 *   0 = Scale out (aka Nimbus)
+	 *   1 = Scale up  (aka Cumulus)
+	 */
+	if (!((version >> 13) & 1))
+		return false;
+	return true;
+}
+
 #ifndef __TEST__
 
 /*
-- 
2.26.1



More information about the Skiboot mailing list