[1/3] ibm, firmware-versions: add 'open-power' for backwards compat

Message ID 20180406051646.2938-2-stewart@linux.ibm.com
State New
Headers show
Series
  • Fix various FWTS device tree warnings
Related show

Commit Message

Stewart Smith April 6, 2018, 5:16 a.m.
From: Stewart Smith <stewart@linux.vnet.ibm.com>

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 core/flash.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Vasant Hegde April 7, 2018, 11:11 a.m. | #1
On 04/06/2018 10:46 AM, Stewart Smith wrote:
> From: Stewart Smith <stewart@linux.vnet.ibm.com>
> 
> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
> ---
>   core/flash.c | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/core/flash.c b/core/flash.c
> index d526ef33a220..2652b8c36c9d 100644
> --- a/core/flash.c
> +++ b/core/flash.c
> @@ -1,4 +1,4 @@
> -/* Copyright 2013-2014 IBM Corp.
> +/* Copyright 2013-2018 IBM Corp.
>    *
>    * Licensed under the Apache License, Version 2.0 (the "License");
>    * you may not use this file except in compliance with the License.
> @@ -181,6 +181,12 @@ static void __flash_dt_add_fw_version(struct dt_node *fw_version, char* data)
>   		prop++;
>   
>   		dt_add_property_string(fw_version, "version", prop);
> +		/*
> +		 * For backwards compatibility, we still add 'open-power'
> +		 * FWTS up to and including 18.03 expects it, and maintaining
> +		 * compatibility is harmless
> +		 */
> +		dt_add_property_string(fw_version, "open-power", prop);

Stewart,

First property in VERSION partition may not be 'open-power' Like in witherspoon 
I see
"IBM-witherspoon-ibm-OP9-v1.21.2-2.6" as first entry. So we endup representing 
this as 'open-power' property. Are we ok with that?

Also are you sure we will never have 'open-power' property later in the VERSION 
partition ? Else we endup in duplicate property issue.

-Vasant
Stewart Smith April 10, 2018, 4:32 a.m. | #2
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
> On 04/06/2018 10:46 AM, Stewart Smith wrote:
>> From: Stewart Smith <stewart@linux.vnet.ibm.com>
>> 
>> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
>> ---
>>   core/flash.c | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>> 
>> diff --git a/core/flash.c b/core/flash.c
>> index d526ef33a220..2652b8c36c9d 100644
>> --- a/core/flash.c
>> +++ b/core/flash.c
>> @@ -1,4 +1,4 @@
>> -/* Copyright 2013-2014 IBM Corp.
>> +/* Copyright 2013-2018 IBM Corp.
>>    *
>>    * Licensed under the Apache License, Version 2.0 (the "License");
>>    * you may not use this file except in compliance with the License.
>> @@ -181,6 +181,12 @@ static void __flash_dt_add_fw_version(struct dt_node *fw_version, char* data)
>>   		prop++;
>>   
>>   		dt_add_property_string(fw_version, "version", prop);
>> +		/*
>> +		 * For backwards compatibility, we still add 'open-power'
>> +		 * FWTS up to and including 18.03 expects it, and maintaining
>> +		 * compatibility is harmless
>> +		 */
>> +		dt_add_property_string(fw_version, "open-power", prop);
>
> Stewart,
>
> First property in VERSION partition may not be 'open-power' Like in witherspoon 
> I see
> "IBM-witherspoon-ibm-OP9-v1.21.2-2.6" as first entry. So we endup representing 
> this as 'open-power' property. Are we ok with that?
>
> Also are you sure we will never have 'open-power' property later in the VERSION 
> partition ? Else we endup in duplicate property issue.

Yeah... umm... I was more interested in having a bit of backwards
compatibility here...

Although perhaps the better way is to just fix FWTS to look for what we
have in the spec for the firmware-versions dt node.

Patch

diff --git a/core/flash.c b/core/flash.c
index d526ef33a220..2652b8c36c9d 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -1,4 +1,4 @@ 
-/* Copyright 2013-2014 IBM Corp.
+/* Copyright 2013-2018 IBM Corp.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -181,6 +181,12 @@  static void __flash_dt_add_fw_version(struct dt_node *fw_version, char* data)
 		prop++;
 
 		dt_add_property_string(fw_version, "version", prop);
+		/*
+		 * For backwards compatibility, we still add 'open-power'
+		 * FWTS up to and including 18.03 expects it, and maintaining
+		 * compatibility is harmless
+		 */
+		dt_add_property_string(fw_version, "open-power", prop);
 		return;
 	}