[Skiboot] [PATCH] flash: Make PNOR partition encoding size 64 bit safe.

Aneesh Kumar K V aneesh.kumar at linux.ibm.com
Wed May 4 13:46:40 AEST 2022


On 5/4/22 12:52 AM, Reza Arbab wrote:
> On Tue, Apr 19, 2022 at 10:24:57PM +0530, Aneesh Kumar K.V wrote:
>> --- a/core/flash.c
>> +++ b/core/flash.c
>> @@ -364,23 +364,22 @@ static struct dt_node *flash_add_dt_node(struct 
>> flash *flash, int id)
>>     flash_node = dt_new_addr(opal_node, "flash", id);
>>     dt_add_property_strings(flash_node, "compatible", "ibm,opal-flash");
>>     dt_add_property_cells(flash_node, "ibm,opal-id", id);
>> +    /*
>> +     * linux kernel reads this as u64 and not address-cells and 
>> size-cells encoded
>> +     * value.
>> +     */
>>     dt_add_property_u64(flash_node, "reg", flash->size);
>>     dt_add_property_cells(flash_node, "ibm,flash-block-size",
>>             flash->block_size);
>>     if (flash->no_erase)
>>         dt_add_property(flash_node, "no-erase", NULL, 0);
>>
>> -    /* we fix to 32-bits */
>> -    dt_add_property_cells(flash_node, "#address-cells", 1);
>> -    dt_add_property_cells(flash_node, "#size-cells", 1);
>> -
> 
> Shouldn't we revise these properties instead of removing them? I'm 
> thinking that regardless of what Linux assumes, the device tree is 
> expected to provide values for them.
> 

considering linux is not using #address-cells it becomes the standard 
now. ie, we want reg to be a 64 bit encoding, rather than one based on 
#address-cells and #size-cells. Any new user should follow that. Hence 
the removal of those property cells.

-aneesh


More information about the Skiboot mailing list