[Pdbg] [PATCH] libpdbg/cfam: Simplify FSI port enable
Reza Arbab
arbab at linux.ibm.com
Thu Jul 9 07:08:40 AEST 2020
Do this with one write to MSENP0 instead of RMW to MENP0.
Signed-off-by: Reza Arbab <arbab at linux.ibm.com>
---
libpdbg/cfam.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/libpdbg/cfam.c b/libpdbg/cfam.c
index 0b670d869496..1a7467185928 100644
--- a/libpdbg/cfam.c
+++ b/libpdbg/cfam.c
@@ -314,15 +314,13 @@ static int cfam_hmfsi_probe(struct pdbg_target *target)
{
struct fsi *fsi = target_to_fsi(target);
struct pdbg_target *fsi_parent = target->parent;
- uint32_t value, port;
+ uint32_t value;
int rc;
/* Enable the port in the upstream control register */
- assert(!(pdbg_target_u32_property(target, "port", &port)));
- fsi_read(fsi_parent, 0x3404, &value);
- value |= 1 << (31 - port);
- if ((rc = fsi_write(fsi_parent, 0x3404, value))) {
- PR_ERROR("Unable to enable HMFSI port %d\n", port);
+ assert(!(pdbg_target_u32_property(target, "port", &value)));
+ if ((rc = fsi_write(fsi_parent, 0x3406, 0x80000000 >> value))) {
+ PR_ERROR("Unable to enable HMFSI port %d\n", value);
return rc;
}
--
2.17.1
More information about the Pdbg
mailing list