summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2015-04-06 14:01:34 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-05-07 17:42:34 +1000
commitb25e34639cc6410c9e0cdb08808415f548bc00bb (patch)
tree1e76410a54eaf45bfec6de1218a67792fc16fe59
parent579892d785a903303eb3ebf7c7dd343752cd8286 (diff)
downloadtalos-skiboot-b25e34639cc6410c9e0cdb08808415f548bc00bb.tar.gz
talos-skiboot-b25e34639cc6410c9e0cdb08808415f548bc00bb.zip
hdata: Detect LED mode and populate device tree
FSP based machine supports two different LED modes: - Light Path : Both identify and fault LEDs are supported - Guiding Light: Only identify LEDs are supported And this information is passed to OPAL via HDAT. Lets parse this and populate the device tree. Later LED driver uses this information to populate indivisual LED node. Device Tree property: /ibm,opal/led/led-mode : lightpath/guidinglight Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--doc/device-tree/ibm,opal/led.txt3
-rw-r--r--hdata/spira.c12
-rw-r--r--hdata/spira.h1
3 files changed, 16 insertions, 0 deletions
diff --git a/doc/device-tree/ibm,opal/led.txt b/doc/device-tree/ibm,opal/led.txt
index faff1e85..2ce6946f 100644
--- a/doc/device-tree/ibm,opal/led.txt
+++ b/doc/device-tree/ibm,opal/led.txt
@@ -8,6 +8,7 @@ led {
compatible = "ibm,opal-v3-led";
phandle = <0x1000006b>;
linux,phandle = <0x1000006b>;
+ led-mode = "lightpath";
U78C9.001.RST0027-P1-C1 {
led-types = "identify", "fault";
@@ -21,6 +22,8 @@ led {
'compatible' property describes LEDs compatibility.
+'led-mode' property describes service indicator mode (lightpath/guidinglight).
+
Each node under 'led' node describes location code of FRU/Enclosure.
The properties under each node:
diff --git a/hdata/spira.c b/hdata/spira.c
index 464fd8d7..d29e1dc1 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -737,6 +737,7 @@ static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
static void add_iplparams_ipl_params(const void *iplp, struct dt_node *node)
{
const struct iplparams_iplparams *p;
+ struct dt_node *led_node;
p = HDIF_get_idata(iplp, IPLPARAMS_IPLPARAMS, NULL);
if (!CHECK_SPPTR(p)) {
@@ -764,6 +765,17 @@ static void add_iplparams_ipl_params(const void *iplp, struct dt_node *node)
dt_add_property_cells(node, "os-ipl-mode", p->os_ipl_mode);
dt_add_property_strings(node, "cec-major-type",
p->cec_ipl_maj_type ? "hot" : "cold");
+
+ /* Add LED type info under '/ibm,opal/led' node */
+ led_node = dt_find_by_path(opal_node, DT_PROPERTY_LED_NODE);
+ assert(led_node);
+
+ if (p->other_attrib & IPLPARAMS_OATRR_LIGHT_PATH)
+ dt_add_property_strings(led_node, DT_PROPERTY_LED_MODE,
+ LED_MODE_LIGHT_PATH);
+ else
+ dt_add_property_strings(led_node, DT_PROPERTY_LED_MODE,
+ LED_MODE_GUIDING_LIGHT);
}
static void add_iplparams_serials(const void *iplp, struct dt_node *node)
diff --git a/hdata/spira.h b/hdata/spira.h
index a1ed79d6..e98edbd4 100644
--- a/hdata/spira.h
+++ b/hdata/spira.h
@@ -265,6 +265,7 @@ struct iplparams_iplparams {
__be32 other_attrib;
#define IPLPARAMS_OATTR_RST_PCI_BUSNO 0x08000000
#define IPLPARAMS_OATTR_CLEAR_NVRAM 0x04000000
+#define IPLPARAMS_OATRR_LIGHT_PATH 0x00000004
__be16 huge_page_count;
uint8_t huge_page_size;
#define IPLPARAMS_HUGE_PG_SIZE_16G 0
OpenPOWER on IntegriCloud