[Skiboot] [PATCH] hdat: add support for system and type strings

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Wed Oct 12 16:09:11 AEDT 2016


On 10/10/2016 02:11 PM, Oliver O'Halloran wrote:
> In P9 the compatible string is supplied by hostboot through the HDAT.
> This patch add support for using these strings to set the compatible
> property in the device tree rather than using the machine ID number
> scheme traditionally used in the HDAT.

.../...

> -	sys_type = be32_to_cpu(p->system_type);
> -	switch(sys_type >> 28) {
> -	case 0:
> -		sys_family = "ibm,squadrons";
> -		break;
> -	case 1:
> -		sys_family = "ibm,eclipz";
> -		break;
> -	case 2:
> -		sys_family = "ibm,apollo";
> -		break;
> -	case 3:
> -		sys_family = "ibm,firenze";
> -		break;
> -	default:
> -		sys_family = NULL;
> -		prerror("IPLPARAMS: Unknown system family\n");
> -		break;
> +	if (version >= 0x70) {

Though spec says about version, I'm not sure they have really implemented on 
that version. Better to check for Processor version here.

> +		dt_add_property_strings(dt_root, "compatible",
> +			"ibm,powernv", p->sys_family_str, p->sys_type_str);
> +	} else {
> +		u32 sys_type = be32_to_cpu(p->system_type);
> +		const char *sys_family;
> +
> +		switch(sys_type >> 28) {
> +		case 0:
> +			sys_family = "ibm,squadrons";
> +			break;
> +		case 1:
> +			sys_family = "ibm,eclipz";
> +			break;
> +		case 2:
> +			sys_family = "ibm,apollo";
> +			break;
> +		case 3:
> +		case 4: /* HACK: this is actually "ibm,p9", but there's no
> +			 * useful destinction between the two right now */
> +			sys_family = "ibm,firenze";

We will not enter else block on p9 and hence `case 4` is redundant. May be to 
start with we have to explicitly add "ibm,firenze" in if block itself, until we 
define machine type for P9.


-Vasant



More information about the Skiboot mailing list