Skip to content

Commit

Permalink
hdata: Use GCID in LPC setup
Browse files Browse the repository at this point in the history
The HDAT has a notion of "chip ID" which is an arbitrary numbering of
chips. This numbering isn't useful outside of the HDAT so we refer to
chips uing their Global Chip ID (GCID). Currently we're using the HDAT
chip ID in a few places and this patch fixes them.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
oohal authored and stewartsmith committed Jun 16, 2017
1 parent 8b5a7c0 commit d939c1b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hdata/fsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ static void bmc_create_node(const struct HDIF_common_hdr *sp)
const struct spss_sp_impl *sp_impl;
struct dt_node *lpcm, *lpc, *n;
u64 lpcm_base, lpcm_end;
int chip_id, size;
uint32_t chip_id;
int size;

bmc_node = dt_new(dt_root, "bmc");
assert(bmc_node);
Expand Down Expand Up @@ -318,7 +319,11 @@ static void bmc_create_node(const struct HDIF_common_hdr *sp)
return;

#define GB (1024ul * 1024ul * 1024ul)
chip_id = be32_to_cpu(iopath->lpc.chip_id);
/*
* convert the hdat chip ID the HW chip id so we get the right
* phys map offset
*/
chip_id = pcid_to_chip_id(be32_to_cpu(iopath->lpc.chip_id));

phys_map_get(get_chip(chip_id), LPC_BUS, 0, &lpcm_base, NULL);
lpcm = dt_new_addr(dt_root, "lpcm-opb", lpcm_base);
Expand Down

0 comments on commit d939c1b

Please sign in to comment.