diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2018-01-18 12:30:43 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-02-14 20:44:30 -0600 |
commit | 44d352ed6bd06a9d9aa5dffc2caa682d5d124e66 (patch) | |
tree | 0649db462e1c59b58313d135d5c402efacdce694 /core/flash.c | |
parent | bfdf85c84a925a7c0ad0bd8f1dc0fc5c059d9781 (diff) | |
download | skiboot-44d352ed6bd06a9d9aa5dffc2caa682d5d124e66.zip skiboot-44d352ed6bd06a9d9aa5dffc2caa682d5d124e66.tar.gz skiboot-44d352ed6bd06a9d9aa5dffc2caa682d5d124e66.tar.bz2 |
DT: Add "version" property under ibm, firmware-versions node
First line of VERSION section in PNOR contains firmware version.
Use that to add "version" property under firmware versions dt node.
Sample output:
--------------
root@xxx2:/proc/device-tree/ibm,firmware-versions# lsprop
version "witherspoon-ibm-OP9_v1.19_1.94"
....
...
Suggested-by: Stewart Smith <stewart@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 'core/flash.c')
-rw-r--r-- | core/flash.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/flash.c b/core/flash.c index eacf55b..d526ef3 100644 --- a/core/flash.c +++ b/core/flash.c @@ -156,6 +156,7 @@ out: static void __flash_dt_add_fw_version(struct dt_node *fw_version, char* data) { + static bool first = true; char *prop; int version_len, i; int len = strlen(data); @@ -164,6 +165,25 @@ static void __flash_dt_add_fw_version(struct dt_node *fw_version, char* data) "petitboot", "occ", "capp-ucode", "sbe", "machine-xml"}; + if (first) { + first = false; + + /* Increment past "key-" */ + if (memcmp(data, "open-power", strlen("open-power")) == 0) + prop = data + strlen("open-power"); + else + prop = strchr(data, '-'); + if (!prop) { + prlog(PR_DEBUG, + "FLASH: Invalid fw version format (%s)\n", data); + return; + } + prop++; + + dt_add_property_string(fw_version, "version", prop); + return; + } + /* * PNOR version strings are not easily consumable. Split them into * property, value. |