aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-03-23 12:36:28 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-03-23 12:36:28 +1100
commitc4730fb25a6ffd24aa2f9d505510dd45bc6f318c (patch)
treeed338263c59a403fad8b6639fb40ae6bda2b792a /hw
parentf333144c9eb8d9c776c2592dc1449b6d38dd757f (diff)
downloadskiboot-c4730fb25a6ffd24aa2f9d505510dd45bc6f318c.zip
skiboot-c4730fb25a6ffd24aa2f9d505510dd45bc6f318c.tar.gz
skiboot-c4730fb25a6ffd24aa2f9d505510dd45bc6f318c.tar.bz2
Change load_resource() API to be all about preloading.
No functional changes in what happens, just have two calls, one for queueing preload the other for waiting until it has loaded. future patches will introduce platform specific queueing. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/fsp/fsp.c14
-rw-r--r--hw/phb3.c10
2 files changed, 16 insertions, 8 deletions
diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c
index 779eef9..17d73b5 100644
--- a/hw/fsp/fsp.c
+++ b/hw/fsp/fsp.c
@@ -2275,8 +2275,8 @@ static struct {
{ RESOURCE_ID_CAPP, CAPP_IDX_VENICE_DD20, 0x80a02004 },
};
-bool fsp_load_resource(enum resource_id id, uint32_t idx,
- void *buf, size_t *size)
+int fsp_start_preload_resource(enum resource_id id, uint32_t idx,
+ void *buf, size_t *size)
{
uint32_t lid_no = 0, lid;
size_t tmp_size;
@@ -2292,7 +2292,7 @@ bool fsp_load_resource(enum resource_id id, uint32_t idx,
}
}
if (lid_no == 0)
- return false;
+ return OPAL_PARAMETER;
retry:
tmp_size = *size;
@@ -2306,7 +2306,7 @@ retry:
const char *ltype = dt_prop_get_def(dt_root, "lid-type", NULL);
if (!ltype || strcmp(ltype, "opal")) {
prerror("Failed to load in OPAL mode...\n");
- return false;
+ return OPAL_PARAMETER;
}
printf("Trying to load as PHYP LID...\n");
lid_no = KERNEL_LID_PHYP;
@@ -2315,13 +2315,13 @@ retry:
if (rc) {
prerror("Failed to load LID\n");
- return false;
+ return rc;
}
if (*size < tmp_size)
- return false;
+ return OPAL_INTERNAL_ERROR;
*size = tmp_size;
- return true;
+ return OPAL_SUCCESS;
}
void fsp_used_by_console(void)
diff --git a/hw/phb3.c b/hw/phb3.c
index e7127bc..32da794 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -2178,6 +2178,7 @@ static int64_t capp_lid_download(struct phb3 *p)
uint32_t index;
struct capp_lid_hdr *lid;
uint64_t rc;
+ int loaded;
rc = xscom_read_cfam_chipid(chip->id, &index);
if (rc) {
@@ -2220,7 +2221,14 @@ static int64_t capp_lid_download(struct phb3 *p)
ret = OPAL_NO_MEM;
goto end;
}
- if (!load_resource(RESOURCE_ID_CAPP, index, lid, &size)) {
+
+ loaded = start_preload_resource(RESOURCE_ID_CAPP, index,
+ lid, &size);
+ if (loaded == OPAL_SUCCESS)
+ loaded = wait_for_resource_loaded(RESOURCE_ID_CAPP,
+ index);
+
+ if (loaded != OPAL_SUCCESS) {
prerror("CAPP: Error loading ucode lid. index=%x\n", index);
ret = OPAL_RESOURCE;
free(lid);