diff options
author | Alistair Popple <alistair@popple.id.au> | 2017-02-22 07:53:12 +1100 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2017-02-22 07:53:12 +1100 |
commit | 7a2bc0adbf0f618cded2324b0d737bc562067ba5 (patch) | |
tree | 327b7fa3a2c9bf47adbba24d458394cc378f7da6 /libpdbg | |
parent | 29f173dad5ee386afac33d05991a74d3e9647c2d (diff) | |
download | pdbg-7a2bc0adbf0f618cded2324b0d737bc562067ba5.tar.gz pdbg-7a2bc0adbf0f618cded2324b0d737bc562067ba5.zip |
libpdbg/kernel.c: Fix FSI address masking
The FSI byte address conversion code was copied directly from
bmcfsi.c. However the bmcfsi backend needs to set the slave-id
directly where as the OpenFSI kernel driver takes it from the given
address. So instead of masking off the upper two bits we need to pass
them directly through to the kernel driver.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Diffstat (limited to 'libpdbg')
-rw-r--r-- | libpdbg/kernel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libpdbg/kernel.c b/libpdbg/kernel.c index 735c3c1..925d6b0 100644 --- a/libpdbg/kernel.c +++ b/libpdbg/kernel.c @@ -79,7 +79,7 @@ static int kernel_getscom(struct target *target, uint64_t addr, uint64_t *value) static int kernel_fsi_getcfam(struct target *target, uint64_t addr64, uint64_t *value) { int rc; - uint32_t addr = (addr64 & 0x1fff00) | ((addr64 & 0xff) << 2); + uint32_t addr = (addr64 & 0xffff00) | ((addr64 & 0xff) << 2); rc = lseek(fsi_fd, addr, SEEK_SET); if (rc < 0) { @@ -103,7 +103,7 @@ static int kernel_fsi_getcfam(struct target *target, uint64_t addr64, uint64_t * static int kernel_fsi_putcfam(struct target *target, uint64_t addr64, uint64_t data) { int rc; - uint32_t addr = (addr64 & 0x1fff00) | ((addr64 & 0xff) << 2); + uint32_t addr = (addr64 & 0xffff00) | ((addr64 & 0xff) << 2); rc = lseek(fsi_fd, addr, SEEK_SET); if (rc < 0) { |