summaryrefslogtreecommitdiffstats
path: root/include
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 /include
parentf333144c9eb8d9c776c2592dc1449b6d38dd757f (diff)
downloadblackbird-skiboot-c4730fb25a6ffd24aa2f9d505510dd45bc6f318c.tar.gz
blackbird-skiboot-c4730fb25a6ffd24aa2f9d505510dd45bc6f318c.zip
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 'include')
-rw-r--r--include/fsp.h4
-rw-r--r--include/platform.h29
-rw-r--r--include/skiboot.h4
3 files changed, 27 insertions, 10 deletions
diff --git a/include/fsp.h b/include/fsp.h
index 66fadb16..e05d7a4b 100644
--- a/include/fsp.h
+++ b/include/fsp.h
@@ -722,8 +722,8 @@ extern int fsp_fetch_data(uint8_t flags, uint16_t id, uint32_t sub_id,
extern int fsp_fetch_data_queue(uint8_t flags, uint16_t id, uint32_t sub_id,
uint32_t offset, void *buffer, size_t *length,
void (*comp)(struct fsp_msg *msg)) __warn_unused_result;
-extern bool fsp_load_resource(enum resource_id id, uint32_t subid,
- void *buf, size_t *size);
+extern int fsp_start_preload_resource(enum resource_id id, uint32_t idx,
+ void *buf, size_t *size);
/* FSP console stuff */
extern void fsp_console_preinit(void);
diff --git a/include/platform.h b/include/platform.h
index bdf8bdf4..2900b4ed 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -129,11 +129,24 @@ struct platform {
int (*elog_commit)(struct errorlog *buf);
/*
- * Load an external resource (eg, kernel payload) into a preallocated
- * buffer. Returns true on success.
+ * Initiate loading an external resource (e.g. kernel payload, OCC)
+ * into a preallocated buffer.
+ * This is designed to asynchronously load external resources.
+ * Returns OPAL_SUCCESS or error.
*/
- bool (*load_resource)(enum resource_id id, uint32_t idx,
- void *buf, size_t *len);
+ int (*start_preload_resource)(enum resource_id id,
+ uint32_t idx,
+ void *buf, size_t *len);
+
+ /*
+ * Returns true when resource is loaded.
+ * Only has to return true once, for the
+ * preivous start_preload_resource call for this resource.
+ * If not implemented, will return true and start_preload_resource
+ * *must* have synchronously done the load.
+ * Retruns OPAL_SUCCESS, OPAL_BUSY or an error code
+ */
+ int (*resource_loaded)(enum resource_id id, uint32_t idx);
/*
* Executed just prior to handing control over to the payload.
@@ -151,7 +164,11 @@ static const struct platform __used __section(".platforms") name ##_platform
extern void probe_platform(void);
-extern bool load_resource(enum resource_id id, uint32_t subid,
- void *buf, size_t *len);
+extern int start_preload_resource(enum resource_id id, uint32_t subid,
+ void *buf, size_t *len);
+
+extern int resource_loaded(enum resource_id id, uint32_t idx);
+
+extern int wait_for_resource_loaded(enum resource_id id, uint32_t idx);
#endif /* __PLATFORM_H */
diff --git a/include/skiboot.h b/include/skiboot.h
index 0fe50e96..6cb9b2d0 100644
--- a/include/skiboot.h
+++ b/include/skiboot.h
@@ -199,8 +199,8 @@ extern void occ_fsp_init(void);
/* flash support */
struct flash_chip;
extern int flash_register(struct flash_chip *chip, bool is_system_flash);
-extern bool flash_load_resource(enum resource_id id, uint32_t subid,
- void *buf, size_t *len);
+extern int flash_start_preload_resource(enum resource_id id, uint32_t subid,
+ void *buf, size_t *len);
extern bool flash_reserve(void);
extern void flash_release(void);
OpenPOWER on IntegriCloud