diff mbox series

libpdbg/cfam: Simplify FSI port enable

Message ID 1594242521-14281-1-git-send-email-arbab@linux.ibm.com
State New
Headers show
Series libpdbg/cfam: Simplify FSI port enable | expand

Commit Message

Reza Arbab July 8, 2020, 9:08 p.m. UTC
Do this with one write to MSENP0 instead of RMW to MENP0.

Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
---
 libpdbg/cfam.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

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;
 	}