[Pdbg] [PATCH] libpdbg/kernel: Fix FSI address masking
Reza Arbab
arbab at linux.ibm.com
Thu Jul 9 07:08:41 AEST 2020
With this backend, the FSI master port we're using is implicit, e.g.
/sys/class/fsi-master/fsi0/slave at 01:00/raw is port 1, and target addresses
should be relative to that. Mask the port from the address accordingly.
Signed-off-by: Reza Arbab <arbab at linux.ibm.com>
---
libpdbg/kernel.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libpdbg/kernel.c b/libpdbg/kernel.c
index b2b977bc6c96..18d54a35d4a9 100644
--- a/libpdbg/kernel.c
+++ b/libpdbg/kernel.c
@@ -63,7 +63,7 @@ const char *kernel_get_fsi_path(void)
static int kernel_fsi_getcfam(struct fsi *fsi, uint32_t addr64, uint32_t *value)
{
int rc;
- uint32_t tmp, addr = (addr64 & 0x7ffc00) | ((addr64 & 0x3ff) << 2);
+ uint32_t tmp, addr = (addr64 & 0x7fc00) | ((addr64 & 0x3ff) << 2);
rc = lseek(fsi->fd, addr, SEEK_SET);
if (rc < 0) {
@@ -90,7 +90,7 @@ static int kernel_fsi_getcfam(struct fsi *fsi, uint32_t addr64, uint32_t *value)
static int kernel_fsi_putcfam(struct fsi *fsi, uint32_t addr64, uint32_t data)
{
int rc;
- uint32_t tmp, addr = (addr64 & 0x7ffc00) | ((addr64 & 0x3ff) << 2);
+ uint32_t tmp, addr = (addr64 & 0x7fc00) | ((addr64 & 0x3ff) << 2);
rc = lseek(fsi->fd, addr, SEEK_SET);
if (rc < 0) {
--
2.17.1
More information about the Pdbg
mailing list