aboutsummaryrefslogtreecommitdiff
path: root/hw/npu2.c
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2017-06-08 16:10:24 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-20 14:18:22 +1000
commit5b4a8c1d91380f58257f6dcd5665704b787f479d (patch)
tree272c7c3773f5fbb0ebc105086cbeea89acf5d7c3 /hw/npu2.c
parentf6c4a51a8244467c978d51e8128eca0347c9135d (diff)
downloadskiboot-5b4a8c1d91380f58257f6dcd5665704b787f479d.zip
skiboot-5b4a8c1d91380f58257f6dcd5665704b787f479d.tar.gz
skiboot-5b4a8c1d91380f58257f6dcd5665704b787f479d.tar.bz2
hw/npu2-hw-procedures.c: Add nvram option to override zcal calculations
In some rare cases the zcal state machine may fail and flag an error. According to hardware designers it is sometimes ok to ignore this failure and use nominal values for the calculations. In this case we add a nvram variable (nv_zcal_override) which will cause skiboot to ignore the failure and use the nominal value specified in nvram. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/npu2.c')
-rw-r--r--hw/npu2.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/npu2.c b/hw/npu2.c
index 8786cc1..090ac9e 100644
--- a/hw/npu2.c
+++ b/hw/npu2.c
@@ -35,6 +35,7 @@
#include <bitutils.h>
#include <chip.h>
#include <phys-map.h>
+#include <nvram.h>
/*
* NPU2 BAR layout definition. We have 3 stacks and each of them
@@ -1615,6 +1616,14 @@ static void npu2_create_phb(struct dt_node *dn)
void probe_npu2(void)
{
struct dt_node *np;
+ const char *zcal;
+
+ /* Check for a zcal override */
+ zcal = nvram_query("nv_zcal_override");
+ if (zcal) {
+ nv_zcal_nominal = atoi(zcal);
+ prlog(PR_WARNING, "NPU2: Using ZCAL impedance override = %d\n", nv_zcal_nominal);
+ }
/* Scan NPU XSCOM nodes */
dt_for_each_compatible(dt_root, np, "ibm,power9-npu")