aboutsummaryrefslogtreecommitdiff
path: root/hdata/cpu-common.c
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2017-06-15 15:12:40 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-19 14:49:29 +1000
commit805373b35234f6c0acec86c9c354e37a56cb105e (patch)
tree1f0aeed164a9f39891ec6f91e77dc7df4b3c546a /hdata/cpu-common.c
parent1826b103c4d8976bdc9ddd9c44c5d57f7e1ee967 (diff)
downloadskiboot-805373b35234f6c0acec86c9c354e37a56cb105e.zip
skiboot-805373b35234f6c0acec86c9c354e37a56cb105e.tar.gz
skiboot-805373b35234f6c0acec86c9c354e37a56cb105e.tar.bz2
Ensure P9 DD1 workarounds apply only to Nimbus
The workarounds for P9 DD1 are only needed for Nimbus. P9 Cumulus will be DD1 but don't need these same workarounds. This patch ensures the P9 DD1 workarounds only apply to Nimbus. It also renames some things to make clear what's what. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata/cpu-common.c')
-rw-r--r--hdata/cpu-common.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/hdata/cpu-common.c b/hdata/cpu-common.c
index 9a05227..a1a9312 100644
--- a/hdata/cpu-common.c
+++ b/hdata/cpu-common.c
@@ -21,6 +21,18 @@
#include "hdata.h"
+static bool is_power9n(uint32_t version)
+{
+ /*
+ * Bit 13 tells us:
+ * 0 = Scale out (aka Nimbus)
+ * 1 = Scale up (aka Cumulus)
+ */
+ if ((version >> 13) & 1)
+ return false;
+ return true;
+}
+
struct dt_node * add_core_common(struct dt_node *cpus,
const struct sppcia_cpu_cache *cache,
const struct sppaca_cpu_timebase *tb,
@@ -42,7 +54,7 @@ struct dt_node * add_core_common(struct dt_node *cpus,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00,
};
- const uint8_t pa_features_p9_dd1[] = {
+ const uint8_t pa_features_p9n_dd1[] = {
64, 0,
0xf6, 0x3f, 0xc7, 0xc0, 0x80, 0xd0, 0x80, 0x00, /* 0 .. 7 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8 .. 15 */
@@ -53,7 +65,7 @@ struct dt_node * add_core_common(struct dt_node *cpus,
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 48 .. 55 */
0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, /* 56 .. 63 */
};
- const uint8_t pa_features_p9_dd2[] = {
+ const uint8_t pa_features_p9[] = {
64, 0,
0xf6, 0x3f, 0xc7, 0xc0, 0x80, 0xd0, 0x80, 0x00, /* 0 .. 7 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8 .. 15 */
@@ -99,12 +111,12 @@ struct dt_node * add_core_common(struct dt_node *cpus,
break;
case PVR_TYPE_P9:
name = "PowerPC,POWER9";
- if (PVR_VERS_MAJ(version) == 1) {
- pa_features = pa_features_p9_dd1;
- pa_features_size = sizeof(pa_features_p9_dd1);
+ if ((PVR_VERS_MAJ(version) == 1) && is_power9n(version)) {
+ pa_features = pa_features_p9n_dd1;
+ pa_features_size = sizeof(pa_features_p9n_dd1);
} else {
- pa_features = pa_features_p9_dd2;
- pa_features_size = sizeof(pa_features_p9_dd2);
+ pa_features = pa_features_p9;
+ pa_features_size = sizeof(pa_features_p9);
}
break;
default: