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

Reza Arbab arbab at linux.ibm.com
Wed May 4 05:22:27 AEST 2022


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.

-- 
Reza Arbab


More information about the Skiboot mailing list