summaryrefslogtreecommitdiffstats
path: root/libpdbg
diff options
context:
space:
mode:
authorDinesh Chinari <chinari@us.ibm.com>2017-02-22 14:12:11 -0600
committerDinesh Chinari <chinari@us.ibm.com>2017-02-23 16:35:38 -0600
commit4ce90bfe6ddfd4f7c8f76298a10a6f31a6e9cf7a (patch)
tree609dcbcf255972edd4efab12791b863c785f6c83 /libpdbg
parentbcdad17c283f2242700a01625e20bfe98bca2c2e (diff)
downloadpdbg-4ce90bfe6ddfd4f7c8f76298a10a6f31a6e9cf7a.tar.gz
pdbg-4ce90bfe6ddfd4f7c8f76298a10a6f31a6e9cf7a.zip
Fix CFAM address computing for OpenFSI.
Modified the computing of OpenFSI CFAM address masking for putcfam and getcfam. Signed-off-by: Dinesh Chinari <chinari@us.ibm.com>
Diffstat (limited to 'libpdbg')
-rw-r--r--libpdbg/bmcfsi.c2
-rw-r--r--libpdbg/kernel.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/libpdbg/bmcfsi.c b/libpdbg/bmcfsi.c
index 64dbd69..325815e 100644
--- a/libpdbg/bmcfsi.c
+++ b/libpdbg/bmcfsi.c
@@ -247,7 +247,7 @@ static uint64_t fsi_abs_ar(uint32_t addr, int read)
/* Reformat the address. I'm not sure I fully understand this
* yet but we basically shift the bottom byte and add 0b01
* (for the write word?) */
- addr = ((addr & 0x1fff00) | ((addr & 0xff) << 2)) << 1;
+ addr = ((addr & 0x1ffc00) | ((addr & 0x3ff) << 2)) << 1;
addr |= 0x3;
addr |= slave_id << 26;
addr |= (0x8ULL | !!(read)) << 22;
diff --git a/libpdbg/kernel.c b/libpdbg/kernel.c
index 925d6b0..559af08 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 & 0xffff00) | ((addr64 & 0xff) << 2);
+ uint32_t addr = (addr64 & 0x7ffc00) | ((addr64 & 0x3ff) << 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 & 0xffff00) | ((addr64 & 0xff) << 2);
+ uint32_t addr = (addr64 & 0x7ffc00) | ((addr64 & 0x3ff) << 2);
rc = lseek(fsi_fd, addr, SEEK_SET);
if (rc < 0) {
OpenPOWER on IntegriCloud