From 7c3b463e98590ddb9c01e6e88057eca00da28cad Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Fri, 27 Feb 2015 17:11:06 +0800 Subject: 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 Vaidyanathan Srinivasan Benjamin Herrenschmidt Signed-off-by: Vaidyanathan Srinivasan Signed-off-by: Joel Stanley Signed-off-by: Benjamin Herrenschmidt [stewart@linux.vnet.ibm.com: squash trailing whitespace] Signed-off-by: Stewart Smith --- external/opal-prd/pnor.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 external/opal-prd/pnor.h (limited to 'external/opal-prd/pnor.h') 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 + +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*/ -- cgit v1.2.1