diff options
author | Amitay Isaacs <amitay@ozlabs.org> | 2018-12-03 14:27:56 +1100 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2018-12-07 14:36:50 +1100 |
commit | e554483c257f95b8505979dbefde61f2f6c62c61 (patch) | |
tree | d64fca26b9b03469cc1417b88f21001acb3b5222 | |
parent | 10b3ad5aedcfba57277a588281a57e58876d46ca (diff) | |
download | pdbg-e554483c257f95b8505979dbefde61f2f6c62c61.tar.gz pdbg-e554483c257f95b8505979dbefde61f2f6c62c61.zip |
libpdbg: Use index instead of chip-id for id
Instead of using two different ways to id various chiplets, consistently
use "index" property.
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
-rw-r--r-- | libpdbg/host.c | 6 | ||||
-rw-r--r-- | libpdbg/htm.c | 11 | ||||
-rw-r--r-- | p9-host.dts.m4 | 2 |
3 files changed, 11 insertions, 8 deletions
diff --git a/libpdbg/host.c b/libpdbg/host.c index 1cc1b48..163b991 100644 --- a/libpdbg/host.c +++ b/libpdbg/host.c @@ -85,13 +85,13 @@ static int host_pib_probe(struct pdbg_target *target) struct pib *pib = target_to_pib(target); int *fd; char *access_fn; - uint32_t chip_id; + uint32_t index; fd = malloc(sizeof(fd)); if (!fd) return -1; - chip_id = pdbg_target_chip_id(target); + index = pdbg_target_index(target); /* This check should probably be done earlier */ if (access(XSCOM_BASE_PATH, F_OK) == -1) @@ -101,7 +101,7 @@ static int host_pib_probe(struct pdbg_target *target) PR_ERROR("You may need to re-run the command as root.\n"); } - if (asprintf(&access_fn, "%s/%08x/access", XSCOM_BASE_PATH, chip_id) < 0) + if (asprintf(&access_fn, "%s/%08x/access", XSCOM_BASE_PATH, index) < 0) goto out; *fd = open(access_fn, O_RDWR); diff --git a/libpdbg/htm.c b/libpdbg/htm.c index 070980b..4a326d2 100644 --- a/libpdbg/htm.c +++ b/libpdbg/htm.c @@ -548,13 +548,16 @@ static int is_startable(struct htm_status *status) static char *get_debugfs_file(struct htm *htm, const char *file) { - uint32_t chip_id; + struct pdbg_target *pib; + uint32_t index; char *filename; - chip_id = pdbg_target_chip_id(&htm->target); - if (asprintf(&filename, "%s/%08x/%s", DEBUGFS_MEMTRACE, chip_id, file) == -1) { + pib = pdbg_target_parent("pib", &htm->target); + assert(pib); + index = pdbg_target_index(pib); + if (asprintf(&filename, "%s/%08x/%s", DEBUGFS_MEMTRACE, index, file) == -1) { PR_ERROR("Couldn't asprintf() '%s/%08x/size': %m\n", - DEBUGFS_MEMTRACE, chip_id); + DEBUGFS_MEMTRACE, index); return NULL; } diff --git a/p9-host.dts.m4 b/p9-host.dts.m4 index e1ec779..c6f5090 100644 --- a/p9-host.dts.m4 +++ b/p9-host.dts.m4 @@ -21,7 +21,7 @@ compatible = "ibm,host-pib"; reg = <0x8>; chip-id = <0x8>; - index = <0x1>; + index = <0x8>; include(p9-pib.dts.m4)dnl }; }; |