[Skiboot] [PATCH] DT: Add ibm,firmware-versions node

Vaidyanathan Srinivasan svaidy at linux.vnet.ibm.com
Fri Jul 7 19:17:22 AEST 2017


* Vasant Hegde <hegdevasant at linux.vnet.ibm.com> [2017-07-07 14:33:42]:

> In P8, hostboot provides mini device tree. It contains /ibm,firmware-versions
> node which has various firmware component version details.
> 
> In P9, OPAL is building device tree. This patch adds support to parse VERSION
> section of PNOR and create "/ibm,firmware-versions" device tree node.
> 
> Sample output:
> 	/sys/firmware/devicetree/base/ibm,firmware-versions # lsprop .
> 	occ              "6a00709"
> 	skiboot          "v5.7-rc1-p344fb62"
> 	buildroot        "2017.02.2-7-g23118ce"
> 	capp-ucode       "9c73e9f"
> 	petitboot        "v1.4.3-p98b6d83"
> 	sbe              "02021c6"
> 	open-power       "witherspoon-v1.17-128-gf1b53c7-dirty"
> 	....
> 	....
> 
> Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
> Signed-off-by: Mukesh Ojha <mukesh02 at linux.vnet.ibm.com>
> ---
>  core/flash.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 102 insertions(+)
> 
> diff --git a/core/flash.c b/core/flash.c
> index 8a908e5..219e6e0 100644
> --- a/core/flash.c
> +++ b/core/flash.c
> @@ -148,6 +148,107 @@ out:
>  	return rc;
>  }
>  
> +static void flash_dt_add_fw_version(struct dt_node *fw_version, char* data)
> +{
> +	char *prop;
> +	int version_len, i;
> +	int len = strlen(data);
> +	const char * version_str[] = {"open-power", "buildroot", "skiboot",
> +				      "hostboot-binaries", "hostboot", "linux",
> +				      "petitboot", "occ", "capp-ucode", "sbe"};
> +	/*
> +	 * PNOR version strings are not easily consumable. Split them into
> +	 * property, value.
> +	 *
> +	 * Example input from PNOR :
> +	 *   "open-power-firestone-v1.8"
> +	 *   "linux-4.4.6-openpower1-8420e0f"
> +	 *

How about we make a dtb and push it into VERSION partition and just
pull it out?

We should not parse strings and make a key-value pair.  The format
in VERSION partition itself could ideally change to something that is
a key-value pair or something that is consumable and does not require
string parsing.

--Vaidy



More information about the Skiboot mailing list