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

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Tue Aug 29 13:46:16 AEST 2017


On 08/29/2017 06:36 AM, Samuel Mendoza-Jonas wrote:
> On Mon, 2017-08-28 at 12:19 +0530, Vasant Hegde wrote:
>> 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"
>> 	....
>> 	....
>
> LGTM, aside from two small comments below;
>
> Reviewed-by: Samuel Mendoza-Jonas <sam at mendozajonas.com>
>
>>
>> Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
>> Signed-off-by: Mukesh Ojha <mukesh02 at linux.vnet.ibm.com>
>> ---
>> Changes in v2:
>>   - Used load_resource functions to load VERSION section from PNOR - Thanks Stewart.
>>
>> -Vasant
>>
>>  core/flash.c              | 108 ++++++++++++++++++++++++++++++++++++++++++++++
>>  include/platform.h        |   1 +
>>  include/skiboot.h         |   3 ++
>>  platforms/astbmc/common.c |   6 +++
>>  4 files changed, 118 insertions(+)
>>
>> diff --git a/core/flash.c b/core/flash.c
>> index 53e6eba..7b34000 100644
>> --- a/core/flash.c
>> +++ b/core/flash.c
>> @@ -19,6 +19,7 @@
>>  #include <lock.h>
>>  #include <opal.h>
>>  #include <opal-msg.h>
>> +#include <platform.h>
>>  #include <device.h>
>>  #include <libflash/libflash.h>
>>  #include <libflash/libffs.h>
>> @@ -47,6 +48,10 @@ static struct lock flash_lock;
>>  static struct flash *nvram_flash;
>>  static u32 nvram_offset, nvram_size;
>>
>> +/* ibm,firmware-versions support */
>> +static char *version_buf;
>> +static size_t version_buf_size = 0x1000;
>> +
>>  bool flash_reserve(void)
>>  {
>>  	bool rc = false;
>> @@ -148,6 +153,108 @@ 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"};
>
> IIRC I've seen 'machine-xml' around as well - do we know if that's
> applicable on P9?

You are right. We do have machine-xml. I missed to add that. Fixed in v3.

.../...

>> diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c
>> index ed725ce..456908f 100644
>> --- a/platforms/astbmc/common.c
>> +++ b/platforms/astbmc/common.c
>> @@ -134,6 +134,9 @@ void astbmc_init(void)
>>  	astbmc_fru_init();
>>  	ipmi_sensor_init();
>>
>> +	/* Prelaod PNOR VERSION section */
>> +	flash_fw_version_preload();
>> +
>
> s/Prelaod/Preload

Fixed in v3.


-Vasant



More information about the Skiboot mailing list