summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2017-06-22 18:22:02 +1000
committerAlistair Popple <alistair@popple.id.au>2017-06-28 16:15:08 +1000
commitdb301ad96a4ecdc559a012efe82dee420dde8860 (patch)
treea5ca7341868f6112ddbbabfb88b15e53d111d4ea
parent7573f9e445a0bd9d81bfd9428bbcfd1ac8ec5c1c (diff)
downloadpdbg-db301ad96a4ecdc559a012efe82dee420dde8860.tar.gz
pdbg-db301ad96a4ecdc559a012efe82dee420dde8860.zip
libpdbg/cfam.c: Enable hmfsi ports
Errors on the hmfsi port can cause them to be disabled. So rather than relying on the host to enable the corresponding FSI ports enable them during probing of the downstream FSI link. Signed-off-by: Alistair Popple <alistair@popple.id.au>
-rw-r--r--libpdbg/cfam.c12
-rw-r--r--p8-fsi.dts.m41
-rw-r--r--p8-i2c.dts.m41
-rw-r--r--p9-fsi.dtsi.m41
-rw-r--r--p9-kernel.dts1
5 files changed, 15 insertions, 1 deletions
diff --git a/libpdbg/cfam.c b/libpdbg/cfam.c
index 69bab80..54eb4b5 100644
--- a/libpdbg/cfam.c
+++ b/libpdbg/cfam.c
@@ -305,9 +305,19 @@ static int cfam_hmfsi_write(struct fsi *fsi, uint32_t addr, uint32_t data)
static int cfam_hmfsi_probe(struct target *target)
{
struct fsi *fsi = target_to_fsi(target);
- uint32_t value;
+ struct target *fsi_parent = target->dn->parent->target;
+ uint32_t value, port;
int rc;
+ /* Enable the port in the upstream control register */
+ port = dt_prop_get_u32(target->dn, "port");
+ fsi_read(fsi_parent, 0x3404, &value);
+ value |= 1 << (31 - port);
+ if ((rc = fsi_write(fsi_parent, 0x3404, value))) {
+ PR_ERROR("Unale to enable HMFSI port %d\n", port);
+ return rc;
+ }
+
if ((rc = fsi_read(&fsi->target, 0xc09, &value)))
return rc;
diff --git a/p8-fsi.dts.m4 b/p8-fsi.dts.m4
index e975313..8c9d24f 100644
--- a/p8-fsi.dts.m4
+++ b/p8-fsi.dts.m4
@@ -33,6 +33,7 @@
hmfsi@100000 {
compatible = "ibm,fsi-hmfsi";
reg = <0x0 0x100000 0x8000>;
+ port = <0x1>;
index = <0x1>;
pib@1000 {
diff --git a/p8-i2c.dts.m4 b/p8-i2c.dts.m4
index a11f5f0..0f10efd 100644
--- a/p8-i2c.dts.m4
+++ b/p8-i2c.dts.m4
@@ -24,6 +24,7 @@
hmfsi@100000 {
compatible = "ibm,power8-opb-hmfsi";
reg = <0x100000 0x80000>;
+ port = <0x1>;
index = <0x1>;
pib@1000 {
diff --git a/p9-fsi.dtsi.m4 b/p9-fsi.dtsi.m4
index 24eaabe..4a25ea2 100644
--- a/p9-fsi.dtsi.m4
+++ b/p9-fsi.dtsi.m4
@@ -75,6 +75,7 @@ index = <HEX(eval($1, 16))>;
hmfsi@100000 {
compatible = "ibm,fsi-hmfsi";
reg = <0x0 0x100000 0x8000>;
+ port = <0x1>;
index = <0x1>;
pib@1000 {
diff --git a/p9-kernel.dts b/p9-kernel.dts
index 7223eb5..e74e282 100644
--- a/p9-kernel.dts
+++ b/p9-kernel.dts
@@ -29,6 +29,7 @@
hmfsi@100000 {
compatible = "ibm,fsi-hmfsi";
reg = <0x0 0x100000 0x8000>;
+ port = <0x1>;
index = <0x1>;
pib@1000 {
OpenPOWER on IntegriCloud