diff mbox

[V3,1/2] doc/opal-api: Documentation for opal-nvram-read-write

Message ID 1470913204-15404-1-git-send-email-ppaidipe@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

ppaidipe Aug. 11, 2016, 11 a.m. UTC
From: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>

This patch adds documentation for OPAL_READ_NVRAM and OPAL_WRITE_NVRAM

Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
---
Changes in V3:
    - moved the change log to below signed off by tag.

Changes in V2:
    - Changes as per Mukesh's comment on V1
    - Combined opal_read_nvram and opal_write_nvram into one file
    - Removed the api names
    - Replaced Arguments with Parameters

 doc/opal-api/opal-nvram-read-write-7-8.rst | 76 ++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 doc/opal-api/opal-nvram-read-write-7-8.rst

Comments

Stewart Smith Aug. 30, 2016, 4:28 a.m. UTC | #1
ppaidipe@linux.vnet.ibm.com writes:
> From: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
>
> This patch adds documentation for OPAL_READ_NVRAM and OPAL_WRITE_NVRAM
>
> Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>

Thanks, merged to master as of 365e06721121b4a6b2602164c910354cb464b4a7.

We likely need to move a bunch of documentation from LoPAPR too, as
we're completely devoid of any information on how NVRAM is supposed to
work, apart from being able to read and write it.
diff mbox

Patch

diff --git a/doc/opal-api/opal-nvram-read-write-7-8.rst b/doc/opal-api/opal-nvram-read-write-7-8.rst
new file mode 100644
index 0000000..fe06886
--- /dev/null
+++ b/doc/opal-api/opal-nvram-read-write-7-8.rst
@@ -0,0 +1,76 @@ 
+OPAL_READ_NVRAM
+===============
+::
+
+   #define OPAL_READ_NVRAM                         7
+
+``OPAL_READ_NVRAM`` call requests OPAL to read the data from system NVRAM
+memory into a memory buffer. The data at ``offset`` from nvram_image
+will be copied to memory ``buffer`` of size ``size``.
+
+Parameters
+----------
+::
+
+   uint64_t buffer
+   uint64_t size
+   uint64_t offset
+
+``buffer``
+   the data from nvram will be copied to ``buffer``
+
+``size``
+   the data of size ``size`` will be copied
+
+``offset``
+   the data will be copied from address equal to base ``nvram_image`` plus ``offset``
+
+Return Values
+-------------
+
+``OPAL_SUCCESS``
+  data from nvram to memory ``buffer`` copied successfully
+
+``OPAL_PARAMETER``
+  a parameter ``offset`` or ``size`` was incorrect
+
+``OPAL_HARDWARE``
+  either nvram is not initialized or permanent error related to nvram hardware.
+
+OPAL_WRITE_NVRAM
+================
+::
+
+   #define OPAL_WRITE_NVRAM                        8
+
+``OPAL_WRITE_NVRAM`` call requests OPAL to write the data to actual system NVRAM memory
+ from memory ``buffer`` at ``offset``, of size ``size``
+
+Parameters
+----------
+::
+
+   uint64_t buffer
+   uint64_t size
+   uint64_t offset
+
+``buffer``
+   data from ``buffer`` will be copied to nvram
+
+``size``
+   the data of size ``size`` will be copied
+
+``offset``
+   the data will be copied to address which is equal to base ``nvram_image`` plus ``offset``
+
+Return Values
+-------------
+
+``OPAL_SUCCESS``
+  data from memory ``buffer`` to actual nvram_image copied successfully
+
+``OPAL_PARAMETER``
+  a parameter ``offset`` or ``size`` was incorrect
+
+``OPAL_HARDWARE``
+  either nvram is not initialized or permanent error related to nvram hardware.