diff options
author | Alistair Popple <alistair@popple.id.au> | 2017-06-22 18:22:02 +1000 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2017-06-28 16:15:08 +1000 |
commit | db301ad96a4ecdc559a012efe82dee420dde8860 (patch) | |
tree | a5ca7341868f6112ddbbabfb88b15e53d111d4ea /libpdbg | |
parent | 7573f9e445a0bd9d81bfd9428bbcfd1ac8ec5c1c (diff) | |
download | pdbg-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>
Diffstat (limited to 'libpdbg')
-rw-r--r-- | libpdbg/cfam.c | 12 |
1 files changed, 11 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; |