diff mbox

[v2,1/2] hdata: Use GCID in LPC setup

Message ID 20170519024032.26218-1-oohall@gmail.com
State Superseded
Headers show

Commit Message

Oliver O'Halloran May 19, 2017, 2:40 a.m. UTC
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>
---
 hdata/fsp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hdata/fsp.c b/hdata/fsp.c
index 2c8254f930b2..5487f33191ea 100644
--- a/hdata/fsp.c
+++ b/hdata/fsp.c
@@ -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);
@@ -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);