[Skiboot] [PATCH 048/110] doc: Extend OPAL_LEDS_[GET|SET]_INDICATOR

Stewart Smith stewart at linux.ibm.com
Fri May 31 16:12:49 AEST 2019


There are some useful comments from the FSP code that help explain how
these calls work.

Signed-off-by: Stewart Smith <stewart at linux.ibm.com>
---
 doc/opal-api/opal-led-get-set-114-115.rst | 74 ++++++++++++++++++++++-
 1 file changed, 73 insertions(+), 1 deletion(-)

diff --git a/doc/opal-api/opal-led-get-set-114-115.rst b/doc/opal-api/opal-led-get-set-114-115.rst
index c0d874ea636d..0de7c4c0020c 100644
--- a/doc/opal-api/opal-led-get-set-114-115.rst
+++ b/doc/opal-api/opal-led-get-set-114-115.rst
@@ -50,12 +50,84 @@ Note:
 
 There are two OPAL calls relating to LED operations.
 
+.. _OPAL_LEDS_GET_INDICATOR:
+
 OPAL_LEDS_GET_INDICATOR
 -----------------------
+
+.. code-block:: c
+
+   #define OPAL_LEDS_GET_INDICATOR			114
+
+   int64_t opal_leds_get_indicator(char *loc_code, u64 *led_mask,
+		                   u64 *led_value, u64 *max_led_type);
+
 Returns LED state for the given location code.
 
+``loc_code``
+  Location code of the LEDs.
+``led_mask``
+  LED types whose status is available (return by OPAL)
+``led_value``
+  Status of the available LED types (return by OPAL)
+``max_led_type``
+  Maximum number of supported LED types (Host/OPAL)
+
+The host will pass the location code of the LED types (loc_code) and
+maximum number of LED types it understands (max_led_type). OPAL will
+update the 'led_mask' with set bits pointing to LED types whose status
+is available and updates the 'led_value' with actual status. OPAL checks
+the 'max_led_type' to understand whether the host is newer or older
+compared to itself. In the case where the OPAL is newer compared
+to host (OPAL's max_led_type > host's max_led_type), it will update
+led_mask and led_value according to max_led_type requested by the host.
+When the host is newer compared to the OPAL (host's max_led_type >
+OPAL's max_led_type), OPAL updates 'max_led_type' to the maximum
+number of LED type it understands and updates 'led_mask', 'led_value'
+based on that maximum value of LED types.
+
+Currently this is only implemented on FSP basde machines, see
+hw/fsp/fsp-leds.c for more deatails.
+
+.. _OPAL_LEDS_SET_INDICATOR:
+
 OPAL_LEDS_SET_INDICATOR
 -----------------------
+
+.. code-block:: c
+
+   #define OPAL_LEDS_SET_INDICATOR			115
+
+   int64_t opal_leds_set_indicator(uint64_t async_token,
+				   char *loc_code, const u64 led_mask,
+				   const u64 led_value, u64 *max_led_type);
+
 Sets LED state for the given location code.
 
-See hw/fsp/fsp-leds.c for more deatails.
+``loc_code``
+  Location code of the LEDs to be set.
+``led_mask``
+  LED types whose status will be updated
+``led_value``
+  Requested status of various LED types.
+``max_led_type``
+  Maximum number of supported LED types. If OPAL supports fewer LED types
+  than requested, it will set ``max_led_type`` to the maximum it does support.
+
+The host will pass the location code of the LED types, mask, value
+and maximum number of LED types it understands. OPAL will update
+LED status for all the LED types mentioned in the mask with their
+value mentioned. OPAL checks the 'max_led_type' to understand
+whether the host is newer or older compared to itself. In case where
+the OPAL is newer compared to the host (OPAL's max_led_type >
+ host's max_led_type), it updates LED status based on max_led_type
+requested from the host. When the host is newer compared to the OPAL
+(host's max_led_type > OPAL's max_led_type), OPAL updates
+'max_led_type' to the maximum number of LED type it understands and
+then it updates LED status based on that updated  maximum value of LED
+types. Host needs to check the returned updated value of max_led_type
+to figure out which part of it's request got served and which ones got
+ignored.
+
+Currently this is only implemented on FSP basde machines, see
+hw/fsp/fsp-leds.c for more deatails.
-- 
2.21.0



More information about the Skiboot mailing list