diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2015-03-08 16:28:44 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-03-20 04:17:34 +1100 |
commit | 2a824b4c3935b3ba9d99c8bc00f4dd747f60dbea (patch) | |
tree | 4f8a2a38ee4d89f4c45e7556fb467d49e3b23e3c /include/opal.h | |
parent | b8581a7e7bf4429df5dc9bbfe0719182a3cc6520 (diff) | |
download | skiboot-2a824b4c3935b3ba9d99c8bc00f4dd747f60dbea.zip skiboot-2a824b4c3935b3ba9d99c8bc00f4dd747f60dbea.tar.gz skiboot-2a824b4c3935b3ba9d99c8bc00f4dd747f60dbea.tar.bz2 |
FSP/LEDS: Add OPAL interfaces for accessing or modifying the LED states
This patch adds and registers the following two new OPAL interfaces
for the LED subsystem. With the help of these new OPAL calls, the
host will be able to set or query the state of various LEDs on the
system at any given location code (as passed in the device tree).
As of now, it supports two kinds of LEDs on the same location code
one is "Identify LED" and the other being the "Fault LED".
(1) OPAL_LEDS_GET_INDICATOR fsp_opal_leds_get_ind
(2) OPAL_LEDS_SET_INDICATOR fsp_opal_leds_set_ind
The signtaure of these OPAL interfaces are like the following
(1) fsp_opal_leds_get_ind(loc_code, led_mask, led_value, led_max_type)
The host will pass the location code of the LED (loc_code) and
maximum number of LED types it understands (led_max_type). Sapphire
updates the led_mask with set bits pointing to LED types whose status
is availbale and updates the led_value with actual status. Sapphire
checks the led_max_type to understand whether host is newer or older
compared to itself. In the case where the Sapphire is newer compared
to host (Sapphire's led_max_type > host's led_max_type), it will update
led_mask and led_value according to led_max_type requested by the host.
When the host is newer compared to the Sapphire (host's led_max_type >
Sapphire's led_max_type), Sapphire updates led_max_type to the maximum
number of LED type it understands and updates led_mask, led_value based
on that maximum value.
(2) fsp_opal_leds_set_ind(loc_code, led_mask, led_value, led_max_type)
The host will pass the location code of the LED types, mask,
value and maximum number of LED types it understands. Sapphire will
update LED status for all the LED types mentioned in the mask with
their value mentioned. Sapphire checks the 'led_max_type' to understand
whether the host is newer or older compared to itself. In case where
the Sapphire is newer compared to the host (Sapphire's led_max_type >
host's led_max_type), it updates LED status based on led_max_type
requested from the host. When the host is newer compared to the Sapphire
(host's led_max_type > Sapphire's led_max_type), Sapphire updates
'led_max_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 led_max_type
to figure out which part of it's request got served and which ones got
ignored.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include/opal.h')
-rw-r--r-- | include/opal.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/opal.h b/include/opal.h index 3b31838..622e1d5 100644 --- a/include/opal.h +++ b/include/opal.h @@ -165,7 +165,9 @@ #define OPAL_FLASH_WRITE 111 #define OPAL_FLASH_ERASE 112 #define OPAL_PRD_MSG 113 -#define OPAL_LAST 113 +#define OPAL_LEDS_GET_INDICATOR 114 +#define OPAL_LEDS_SET_INDICATOR 115 +#define OPAL_LAST 115 /* Device tree flags */ @@ -378,14 +380,14 @@ enum OpalPciMaskAction { }; enum OpalSlotLedType { - OPAL_SLOT_LED_ID_TYPE = 0, - OPAL_SLOT_LED_FAULT_TYPE = 1 + OPAL_SLOT_LED_TYPE_ID = 0, /* IDENTIFY LED */ + OPAL_SLOT_LED_TYPE_FAULT = 1, /* FAULT LED */ + OPAL_SLOT_LED_TYPE_MAX = 2 }; -enum OpalLedAction { - OPAL_TURN_OFF_LED = 0, - OPAL_TURN_ON_LED = 1, - OPAL_QUERY_LED_STATE_AFTER_BUSY = 2 +enum OpalSlotLedState { + OPAL_SLOT_LED_STATE_OFF = 0, /* LED is OFF */ + OPAL_SLOT_LED_STATE_ON = 1 /* LED is ON */ }; enum OpalEpowStatus { |