diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2015-02-27 17:11:06 +0800 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-03-04 13:08:00 +1100 |
commit | 7c3b463e98590ddb9c01e6e88057eca00da28cad (patch) | |
tree | 592d26553275980dbed690b3a9ba936f2de64941 /external/opal-prd/pnor.h | |
parent | 9ad75c41bd92ab33c1131a1e028e85e1e1a59098 (diff) | |
download | talos-skiboot-7c3b463e98590ddb9c01e6e88057eca00da28cad.tar.gz talos-skiboot-7c3b463e98590ddb9c01e6e88057eca00da28cad.zip |
external/opal-prd: Add userspace support for PRD facility
This change adds an application in external/opal-prd, implementing the
userspace portion of a PRD stack.
This code is responsible for loading the HBRT code from reserved memory,
and provding hostboot runtime functionality through a set of
callbacks.
Because we may be running little-endian (and expect the HBRT code to be
big-endian), we need to thunk the endianness between calls through the
HBRT interface.
Includes multiple contributions from:
Joel Stanley <joel@jms.id.au>
Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Benjamin Herrenschmidt <benh@kernel.crashing.org
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[stewart@linux.vnet.ibm.com: squash trailing whitespace]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external/opal-prd/pnor.h')
-rw-r--r-- | external/opal-prd/pnor.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/external/opal-prd/pnor.h b/external/opal-prd/pnor.h new file mode 100644 index 00000000..06219dce --- /dev/null +++ b/external/opal-prd/pnor.h @@ -0,0 +1,25 @@ +#ifndef PNOR_H +#define PNOR_H + +#include <libflash/libffs.h> + +struct pnor { + char *path; + struct ffs_handle *ffsh; + uint32_t size; + uint32_t erasesize; +}; + +enum pnor_op { + PNOR_OP_READ, + PNOR_OP_WRITE, +}; + +extern int pnor_operation(struct pnor *pnor, const char *name, + uint64_t offset, void *data, size_t size, + enum pnor_op); + +extern int pnor_init(struct pnor *pnor); +extern void pnor_close(struct pnor *pnor); + +#endif /*PNOR_H*/ |