Skip to content

Commit

Permalink
hdata: Fix reserved node label search
Browse files Browse the repository at this point in the history
Soon hostboot/HDAT will provide consistent reserved node name. It will
just provide node name without starting string "ibm,". Commit 50d508c
made sure that all device tree nodes starts with "ibm,".

But we use hostboot/HDAT provided name for `ibm,prd-label` property. So we
have to fix couple of our `ibm,prd-label` property based search/comparision
to accommodate this change.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
Vasant Hegde authored and oohal committed Nov 5, 2019
1 parent 1c28288 commit c3bfa32
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
13 changes: 9 additions & 4 deletions external/opal-prd/opal-prd.c
Expand Up @@ -122,7 +122,8 @@ static struct opal_prd_ctx *ctx;

static const char *opal_prd_devnode = "/dev/opal-prd";
static const char *opal_prd_socket = "/run/opal-prd-control";
static const char *hbrt_code_region_name = "ibm,hbrt-code-image";
static const char *hbrt_code_region_name = "hbrt-code-image";
static const char *hbrt_code_region_name_ibm = "ibm,hbrt-code-image";
static const int opal_prd_version = 1;
static uint64_t opal_prd_ipoll = 0xf000000000000000;

Expand Down Expand Up @@ -2193,9 +2194,13 @@ static int run_prd_daemon(struct opal_prd_ctx *ctx)
} else {
rc = map_hbrt_physmem(ctx, hbrt_code_region_name);
if (rc) {
pr_log(LOG_ERR, "IMAGE: Can't access hbrt "
"physical memory");
goto out_close;
/* Fallback to old style ibm,prd-label */
rc = map_hbrt_physmem(ctx, hbrt_code_region_name_ibm);
if (rc) {
pr_log(LOG_ERR, "IMAGE: Can't access hbrt "
"physical memory");
goto out_close;
}
}
dump_hbrt_map(ctx);
}
Expand Down
10 changes: 7 additions & 3 deletions hdata/tpmrel.c
Expand Up @@ -153,10 +153,14 @@ static void tpmrel_cvc_init(struct HDIF_common_hdr *hdif_hdr)
if (!node)
return;

cvc_reserved_mem = get_hb_reserved_memory("ibm,secure-crypt-algo-code");
cvc_reserved_mem = get_hb_reserved_memory("secure-crypt-algo-code");
if (!cvc_reserved_mem) {
prlog(PR_ERR, "CVC reserved memory not found\n");
return;
/* Fallback to old style ibm,prd-label */
cvc_reserved_mem = get_hb_reserved_memory("ibm,secure-crypt-algo-code");
if (!cvc_reserved_mem) {
prlog(PR_ERR, "CVC reserved memory not found\n");
return;
}
}

parent = dt_new(node, "ibm,cvc");
Expand Down

0 comments on commit c3bfa32

Please sign in to comment.