Check Petitboot version from user-space

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Thu May 24 21:02:05 AEST 2018


On 05/24/2018 02:19 PM, Javier Martinez Canillas wrote:
> Hi Samuel,
> 
> On 05/24/2018 03:27 AM, Samuel Mendoza-Jonas wrote:
>> On Wed, 2018-05-23 at 13:05 +0200, Javier Martinez Canillas wrote:
>>> Hi all,
>>>
>>> I would like to know if a given feature is supported by the installed firmware,
>>> so I want to check what's the Petitboot version in the OPAL skiroot initrd. But
>>> it's not clear to me what's the best approach to do that.
>>>
>>> Skiboot documents a /sys/firmware/devicetree/base/ibm,firmware-versions OF node
>>> that should contain this information [0]. But says that it is only required for
>>> Power9 and that it may or may not be present on Power8 machines.
>>>
>>> Most of the doc also talks about a single version OF property that encodes all
>>> the information in a single string where each part is separated by a '-' char.
>>>
>>> It also refers to two different specifications for the ibm,firmware-versions OF
>>> node, a "New style" that only contains the mentioned single version property and
>>> a "Old style" that instead of using '-' as separator, have different properties.
>>
>> Hi Javier,
>>
>> It's been a while since I have looked at this document but I'm not sure I read
>> it the same way. "Old" vs "New" style mostly has to do with the format of the
>> version strings but I think both should be a set of properties under
>> "ibm,firmware-versions". The new/P9 style just enforces rules about versioning
>> rules.
>>
> 
> Yes, both are under the "ibm,firmware-versions" OF node but my understanding is
> that they have different OF properties. The "New" style has a single "version"
> property (which is the only one marked as Required for POWER9 in the table at
> the top) while the "Old" style has more properties. In the examples you have:

So number of OF property may differ.

"version" -- So in P9 we mandate to have version property it tells overall 
system firmware version ... like "IBM-Witherspoon-Blah-blah" and rest of the 
property tells individual
firmware component version detail.

> 
> New style (required for POWER9 and above):
> 
> ibm,firmware-versions {
>               version = "open-power-habanero-v1.14-45-g78d89280c3f9-dirty";

This is mandatory in P9, optional in P8.

>               skiboot = "5.4.0";
>               occ = "d7efe30";
>               linux = "4.4.32-openpower1";
> };
> 
> Old-style:
> 
> ibm,firmware-versions {
>          occ = "d7efe30-opdirty";
>          skiboot = "5.4.0-opdirty";
>          buildroot = "211bd05";
>          capp-ucode = "1bb7503-opdirty";
>          petitboot = "v1.3.1-opdirty-d695626";
>          open-power = "habanero-f7b8f65-dirty";
>          phandle = <0x1000012e>;
>          hostboot-binaries = "56532f5-opdirty";
>          habanero-xml = "6a78496-opdirty-526ff79";
>          hostboot = "09cfacb-opdirty";
>          linux = "4.4.32-openpower1-opdirty-85cf528";
> };
> 
> My understanding is that in "New" the "version" property contains the info
> that's in the "open-power" and "petitboot" properties from the "Old" style.

Yeah. Some old system used open-power property to tell overall system property.
Recent skiboot converts `open-power` value got from PNOR and puts it as 
`version` property.


> Hard to tell thought since the values in both examples don't match and the
> documenation is quite confusing (for me at least).

May be documentation needs some update.

> 
>> This is the point where I'll CC Stewart in :)
>>
> 
> Thanks, hopefully he can shed some light.
> 
>> But regardless behind the scenes the big split is that on P8 Hostboot put this
>> in the device tree and now on P9 Skiboot does it. The commit in Skiboot that
>> adds this is 9727fe3, "DT: Add ibm,firmware-versions node", which exists as of:
>> 	# git describe --tag 9727fe384
>> 	v5.8-12-g9727fe38
>>
> 
> But for P8 is optional, right? You can't rely on this info to be present there.

P8 BMC boxes we will this information. But on P8 and P9 FSP systems we will not 
have this
version. I'm not sure whether we can get such information from FSP someway. I 
will check
on this.

> 
>> Additionally on FSP-based machines (Tuleta, ZZ..) this doesn't exist and finding
>> the relevant firmware versions is more painful - you'd likely have to match it
>> up against the FSP image version.
>>
> 
> I see, so this is only present on BMC-based machines? How can I check if a

Yes. Only BMC based system

> machine is using FSP or BMC as the hardware manager?

You can check in device tree. If `fsps` node exists then its FSP system.
if `bmc` node exists then its BMC system.

-Vasant



More information about the Petitboot mailing list