diff options
author | Jeremy Kerr <jeremy.kerr@au1.ibm.com> | 2014-09-12 14:26:06 +0800 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2014-10-30 16:50:39 +1100 |
commit | 4797b3eee3a0fc41ff5d68408dc73ac5e6fd248e (patch) | |
tree | 3e7660ee2ae9beaaf6205997041fac5509f64b43 /include | |
parent | b2a374da98aa710b4c55556f9a9047d4d4a8665d (diff) | |
download | skiboot-4797b3eee3a0fc41ff5d68408dc73ac5e6fd248e.zip skiboot-4797b3eee3a0fc41ff5d68408dc73ac5e6fd248e.tar.gz skiboot-4797b3eee3a0fc41ff5d68408dc73ac5e6fd248e.tar.bz2 |
platform: add a platform hook for loading external resources
Currently, in core/init.c we do a fsp-specific load procedure to grab
the kernel image.
We'd like to do two things: allow other types of resources, and have
paths for non-FSP platforms to perform loads.
This change adds a platform-specific load_resource hook, and moves the
currently loading code to fsp_load_resource. To allow other resource
types, we add an identifier to indicate the type of resouce to load.
Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com>
Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/fsp.h | 1 | ||||
-rw-r--r-- | include/platform.h | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/fsp.h b/include/fsp.h index 0464da4..e41498e 100644 --- a/include/fsp.h +++ b/include/fsp.h @@ -709,6 +709,7 @@ 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)); +extern bool fsp_load_resource(enum resource_id id, 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 b916e5e..77d025b 100644 --- a/include/platform.h +++ b/include/platform.h @@ -22,6 +22,10 @@ struct phb; struct pci_device; struct errorlog; +enum resource_id { + RESOURCE_ID_KERNEL, +}; + /* * Each platform can provide a set of hooks * that can affect the generic code @@ -119,6 +123,13 @@ struct platform { uint32_t (*occ_timeout)(void); int (*elog_commit)(struct errorlog *buf); + + /* + * Load an external resource (eg, kernel payload) into a preallocated + * buffer. Returns true on success. + */ + bool (*load_resource)(enum resource_id id, + void *buf, size_t *len); }; extern struct platform __platforms_start; |