@@ -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);
@@ -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;
}
@@ -21,7 +21,7 @@
compatible = "ibm,host-pib";
reg = <0x8>;
chip-id = <0x8>;
- index = <0x1>;
+ index = <0x8>;
include(p9-pib.dts.m4)dnl
};
};
Instead of using two different ways to id various chiplets, consistently use "index" property. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> --- libpdbg/host.c | 6 +++--- libpdbg/htm.c | 11 +++++++---- p9-host.dts.m4 | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-)