[Skiboot] [PATCH v2 05/12] hdat: Grab system model name from HDAT when available

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Wed Jan 4 21:41:02 AEDT 2017


On 12/20/2016 11:34 AM, Stewart Smith wrote:
> Vasant Hegde <hegdevasant at linux.vnet.ibm.com> writes:
>> --- a/hdata/vpd.c
>> +++ b/hdata/vpd.c
>> @@ -598,6 +598,36 @@ struct dt_node *dt_add_vpd_node(const struct HDIF_common_hdr *hdr,
>>   	return node;
>>   }
>>
>> +static void dt_add_model_name(char *model)
>> +{
>> +	const struct machine_info *mi;
>> +	const struct iplparams_sysparams *p;
>> +	const struct HDIF_common_hdr *iplp;
>> +
>> +	iplp = get_hdif(&spira.ntuples.ipl_parms, "IPLPMS");
>> +	if (!iplp)
>> +		goto def_model;
>> +
>> +	p = HDIF_get_idata(iplp, IPLPARAMS_SYSPARAMS, NULL);
>> +	if (!CHECK_SPPTR(p))
>> +		goto def_model;
>> +
>> +	if (proc_gen >= proc_gen_p9) {
>> +		dt_add_property_string(dt_root,
>> +				       "model-name", p->sys_type_str);
>> +		return;
>> +	}
>
> Is there just an empty string otherwise? Why not fall through if there's
> an empty string instead? or check version?

I think this field is always populated on P9 system. Hence I added P9 check 
instead of HDAT version check.  May be I can check for HDAT  version instead and 
fall through it this string is empty.


-Vasant



More information about the Skiboot mailing list