1.. _opal-sysparams:
2
3=========================
4Get/Set System Parameters
5=========================
6
7The usual way for setting system parameters is via IPMI for things controlled
8by the service processor, or through NVRAM for things controlled by host
9firmware. However, some platforms may have other options not easily (or
10possible to be) exposed over IPMI. These OPAL calls will read (and write)
11these parameters.
12
13The list of parameters is set at boot time, and is represented in the device
14tree (see :ref:`device-tree/ibm,opal/sysparams` for details).
15
16Currently only implemented on FSP based systems.
17
18.. _OPAL_GET_PARAM:
19
20OPAL_GET_PARAM
21==============
22
23.. code-block:: c
24
25   #define OPAL_GET_PARAM				89
26
27   int64_t fsp_opal_get_param(uint64_t async_token, uint32_t param_id,
28                              uint64_t buffer, uint64_t length);
29
30Get the current setting of `param_id`. This is an asynchronous call as OPAL may
31need to communicate with a service processor. The `param_id` and `length` are
32described in the device tree for each parameter (see
33:ref:`device-tree/ibm,opal/sysparams` for details).
34
35Returns
36-------
37:ref:`OPAL_HARDWARE`
38     Hardware issue prevents retreiving parameter. e.g. FSP is offline or
39     absent.
40:ref:`OPAL_PARAMETER`
41     Invalid `param_id`
42:ref:`OPAL_PERMISSION`
43     Not allowed to read parameter.
44:ref:`OPAL_NO_MEM`
45     Not enough free memory in OPAL to process request.
46:ref:`OPAL_INTERNAL_ERROR`
47     Other internal OPAL error
48:ref:`OPAL_ASYNC_COMPLETION`
49     Request is submitted.
50
51.. _OPAL_SET_PARAM:
52
53OPAL_SET_PARAM
54==============
55
56.. code-block:: c
57
58   #define OPAL_SET_PARAM				90
59
60   int64_t fsp_opal_set_param(uint64_t async_token, uint32_t param_id,
61                              uint64_t buffer, uint64_t length);
62
63
64Write a new setting for `param_id`. This is an asynchronous call as OPAL may
65need to communicate with a service processor. The `param_id` and `length` are
66described in the device tree for each parameter (see
67:ref:`device-tree/ibm,opal/sysparams` for details).
68
69
70Returns
71-------
72:ref:`OPAL_HARDWARE`
73     Hardware issue prevents retreiving parameter. e.g. FSP is offline or
74     absent.
75:ref:`OPAL_PARAMETER`
76     Invalid `param_id`
77:ref:`OPAL_PERMISSION`
78     Not allowed to write parameter.
79:ref:`OPAL_NO_MEM`
80     Not enough free memory in OPAL to process request.
81:ref:`OPAL_INTERNAL_ERROR`
82     Other internal OPAL error
83:ref:`OPAL_ASYNC_COMPLETION`
84     Request is submitted.
85