aboutsummaryrefslogtreecommitdiff
path: root/hdata
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2021-08-04 12:50:56 +0530
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2021-08-06 12:21:54 +0530
commite813a0c09dc08aea7144425e1d4ee6c9134e9f47 (patch)
treeade061281b32f874a42e5ad4c8ea502a14800764 /hdata
parenta2d4d7f9e14a387371815828e4d46a9943453969 (diff)
downloadskiboot-e813a0c09dc08aea7144425e1d4ee6c9134e9f47.zip
skiboot-e813a0c09dc08aea7144425e1d4ee6c9134e9f47.tar.gz
skiboot-e813a0c09dc08aea7144425e1d4ee6c9134e9f47.tar.bz2
phys/P10: Use topology index to get phys mapping
This fixes multipchip rainier boot issue. for Rainer: chip0: ibm,primary-topology-index = < 0x0>; chip1: ibm,primary-topology-index = < 0x4>; chip2: ibm,primary-topology-index = < 0x8>; chip3: ibm,primary-topology-index = < 0xc>; for Denali: node0: chip0: ibm,primary-topology-index = < 0x0>; chip1: ibm,primary-topology-index = < 0x1>; chip2: ibm,primary-topology-index = < 0x2>; chip3: ibm,primary-topology-index = < 0x3>; node1: chip0: ibm,primary-topology-index = < 0x4>; chip1: ibm,primary-topology-index = < 0x5>; chip2: ibm,primary-topology-index = < 0x6>; chip3: ibm,primary-topology-index = < 0x7>; Note that bmc_create_node() gets called very early in the boot process. Hence we have to traverse through HDAT ntuple to get right topology index. May be we can optimize pcid_to_topology_idx() function as its pretty much duplicate of pcid_to_chip_id(). But for now lets keep it as separate function. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Ryan Grimm <grimm@linux.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Diffstat (limited to 'hdata')
-rw-r--r--hdata/fsp.c4
-rw-r--r--hdata/hdata.h1
-rw-r--r--hdata/spira.c28
3 files changed, 32 insertions, 1 deletions
diff --git a/hdata/fsp.c b/hdata/fsp.c
index 42f1121..30cda53 100644
--- a/hdata/fsp.c
+++ b/hdata/fsp.c
@@ -361,6 +361,7 @@ static void bmc_create_node(const struct HDIF_common_hdr *sp)
struct dt_node *lpcm, *lpc, *n;
u64 lpcm_base, lpcm_end;
uint32_t chip_id;
+ uint32_t topology_idx;
int size;
bmc_node = dt_new(dt_root, "bmc");
@@ -399,8 +400,9 @@ static void bmc_create_node(const struct HDIF_common_hdr *sp)
* phys map offset
*/
chip_id = pcid_to_chip_id(be32_to_cpu(iopath->lpc.chip_id));
+ topology_idx = pcid_to_topology_idx(be32_to_cpu(iopath->lpc.chip_id));
- phys_map_get(chip_id, LPC_BUS, 0, &lpcm_base, NULL);
+ __phys_map_get(topology_idx, chip_id, LPC_BUS, 0, &lpcm_base, NULL);
lpcm = dt_new_addr(dt_root, "lpcm-opb", lpcm_base);
assert(lpcm);
diff --git a/hdata/hdata.h b/hdata/hdata.h
index bae4eaa..6aad829 100644
--- a/hdata/hdata.h
+++ b/hdata/hdata.h
@@ -24,6 +24,7 @@ extern void vpd_data_parse(struct dt_node *node,
extern struct dt_node *find_xscom_for_chip(uint32_t chip_id);
extern uint32_t pcid_to_chip_id(uint32_t proc_chip_id);
+extern uint32_t pcid_to_topology_idx(uint32_t proc_chip_id);
extern uint32_t get_xscom_id(const struct sppcrd_chip_info *cinfo);
extern struct dt_node *add_core_common(struct dt_node *cpus,
diff --git a/hdata/spira.c b/hdata/spira.c
index 7d56f3f..baa2375 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -1418,6 +1418,34 @@ uint32_t pcid_to_chip_id(uint32_t proc_chip_id)
return (uint32_t)-1;
}
+uint32_t pcid_to_topology_idx(uint32_t proc_chip_id)
+{
+ unsigned int i;
+ const void *hdif;
+
+ /* First, try the proc_chip ntuples for chip data */
+ for_each_ntuple_idx(&spira.ntuples.proc_chip, hdif, i,
+ SPPCRD_HDIF_SIG) {
+ const struct sppcrd_chip_info *cinfo;
+
+ cinfo = HDIF_get_idata(hdif, SPPCRD_IDATA_CHIP_INFO, NULL);
+ if (!CHECK_SPPTR(cinfo)) {
+ prerror("XSCOM: Bad ChipID data %d\n", i);
+ continue;
+ }
+ if (proc_chip_id == be32_to_cpu(cinfo->proc_chip_id)) {
+ if (proc_gen <= proc_gen_p9)
+ return get_xscom_id(cinfo);
+ else
+ return ((u32)cinfo->topology_id_table[cinfo->primary_topology_loc]);
+ }
+ }
+
+ /* Not found, what to do ? Assert ? For now return a number
+ * guaranteed to not exist
+ */
+ return (uint32_t)-1;
+}
/* Create '/ibm,opal/led' node */
static void dt_init_led_node(void)
{