diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2017-06-15 16:00:22 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-06-16 14:38:46 +1000 |
commit | 92d7ccf00bdd6c994341feb013390c28993652bf (patch) | |
tree | f376330cdff46aca799a7b50c4747634623cf474 /hw/phys-map.c | |
parent | d939c1bbd13cb1f922be80769578eae99a30cad6 (diff) | |
download | skiboot-92d7ccf00bdd6c994341feb013390c28993652bf.zip skiboot-92d7ccf00bdd6c994341feb013390c28993652bf.tar.gz skiboot-92d7ccf00bdd6c994341feb013390c28993652bf.tar.bz2 |
hw/phys_map: Use GCIDs as a chip index
Currently we pass in a proc_chip structure to phys_map_get(). All we we
really need from this structure is the Global Chip ID (GCID). This
patch reworks the function so that we only need to pass the GCID which
allows us to use it before the proc_chip structures have been
initialised (i.e in the HDAT parser).
Cc: Michael Neuling <mikey@neuling.org>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Acked-By: Michael Neuling <mikey@neuling.org>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/phys-map.c')
-rw-r--r-- | hw/phys-map.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/phys-map.c b/hw/phys-map.c index cab23f6..e99983f 100644 --- a/hw/phys-map.c +++ b/hw/phys-map.c @@ -135,10 +135,11 @@ static inline bool phys_map_entry_null(const struct phys_map_entry *e) return false; } + /* This crashes skiboot on error as any bad calls here are almost * certainly a developer error */ -void phys_map_get(struct proc_chip *chip, enum phys_map_type type, +void phys_map_get(uint64_t gcid, enum phys_map_type type, int index, uint64_t *addr, uint64_t *size) { const struct phys_map_entry *e; uint64_t a; @@ -163,16 +164,16 @@ void phys_map_get(struct proc_chip *chip, enum phys_map_type type, break; } a = e->addr; - a += (uint64_t)chip->id << phys_map->chip_select_shift; + a += gcid << phys_map->chip_select_shift; if (addr) *addr = a; if (size) *size = e->size; - prlog(PR_TRACE, "Assigning BAR [%x] type:%02i index:%x " + prlog(PR_TRACE, "Assigning BAR [%"PRIx64"] type:%02i index:%x " "0x%016"PRIx64" for 0x%016"PRIx64"\n", - chip->id, type, index, a, e->size); + gcid, type, index, a, e->size); return; |