core/opal: Fix reg format for flash@0 node in DT
diff mbox series

Message ID 20190424114148.GA13164@gmail.com
State New
Headers show
Series
  • core/opal: Fix reg format for flash@0 node in DT
Related show

Checks

Context Check Description
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (d318cdb3863fcf92288528bfed3b6e435cf6f0ef)

Commit Message

Maxim Polyakov April 24, 2019, 11:41 a.m. UTC
The “reg” property for /ibm,opal/flash@0 node in device tree has
invalid format. For this reason, the FWTS on the Linux host displays
the following warning:

  /ibm,opal/flash@0:reg: property has invalid length (8 bytes)
  (#address-cells == 0, #size-cells == 0)

This patch sets the #address-cells/#size-cells to 1 and fixes this
problem. Resolve: https://github.com/open-power/skiboot/issues/47

Signed-off-by: Maxim Polyakov <m.polyakov@yadro.com>
---
 core/opal.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

Comments

Maxim Polyakov May 14, 2019, 1:16 p.m. UTC | #1
24.04.2019 14:41, Maxim Polyakov пишет:
> The “reg” property for /ibm,opal/flash@0 node in device tree has
> invalid format. For this reason, the FWTS on the Linux host displays
> the following warning:
> 
>   /ibm,opal/flash@0:reg: property has invalid length (8 bytes)
>   (#address-cells == 0, #size-cells == 0)
> 
> This patch sets the #address-cells/#size-cells to 1 and fixes this
> problem. Resolve: https://github.com/open-power/skiboot/issues/47
> 
> Signed-off-by: Maxim Polyakov <m.polyakov@yadro.com>
> ---
>  core/opal.c | 21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/core/opal.c b/core/opal.c
> index 624e2a2..cedff11 100644
> --- a/core/opal.c
> +++ b/core/opal.c
> @@ -406,8 +406,25 @@ void add_opal_node(void)
>  		(uint64_t)(cpu_max_pir + 1) * STACK_SIZE) - SKIBOOT_BASE;
>  
>  	opal_node = dt_new_check(dt_root, "ibm,opal");
> -	dt_add_property_cells(opal_node, "#address-cells", 0);
> -	dt_add_property_cells(opal_node, "#size-cells", 0);
> +	/*
> +	 * Since the "ibm,opal" node doesn`t refer to any "bus",
> +	 * the "#address-cells" and "#size-cells" being zero is correct.
> +	 * However, in this case, the “reg” property that determines the
> +	 * size of the flash memory in the child node “flash@0” has an
> +	 * invalid format. For this reason, the FWTS on the Linux host
> +	 * displays the following warning:
> +	 *
> +	 *    /ibm,opal/flash@0:reg: property has invalid length (8
> +	 *    bytes) (#address-cells == 0, #size-cells == 0)
> +	 *
> +	 * The "#address-cells" and "#size-cells" are set to 1 to fix
> +	 * this problem temporarily.
> +	 *
> +	 * TODO: need to add some property that contains the size of
> +	 * the flash device instead of "reg"
> +	 */
> +	dt_add_property_cells(opal_node, "#address-cells", 1);
> +	dt_add_property_cells(opal_node, "#size-cells", 1);
>  
>  	if (proc_gen < proc_gen_p9)
>  		dt_add_property_strings(opal_node, "compatible", "ibm,opal-v2",
> 

Please review this patch
Thanks

Patch
diff mbox series

diff --git a/core/opal.c b/core/opal.c
index 624e2a2..cedff11 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -406,8 +406,25 @@  void add_opal_node(void)
 		(uint64_t)(cpu_max_pir + 1) * STACK_SIZE) - SKIBOOT_BASE;
 
 	opal_node = dt_new_check(dt_root, "ibm,opal");
-	dt_add_property_cells(opal_node, "#address-cells", 0);
-	dt_add_property_cells(opal_node, "#size-cells", 0);
+	/*
+	 * Since the "ibm,opal" node doesn`t refer to any "bus",
+	 * the "#address-cells" and "#size-cells" being zero is correct.
+	 * However, in this case, the “reg” property that determines the
+	 * size of the flash memory in the child node “flash@0” has an
+	 * invalid format. For this reason, the FWTS on the Linux host
+	 * displays the following warning:
+	 *
+	 *    /ibm,opal/flash@0:reg: property has invalid length (8
+	 *    bytes) (#address-cells == 0, #size-cells == 0)
+	 *
+	 * The "#address-cells" and "#size-cells" are set to 1 to fix
+	 * this problem temporarily.
+	 *
+	 * TODO: need to add some property that contains the size of
+	 * the flash device instead of "reg"
+	 */
+	dt_add_property_cells(opal_node, "#address-cells", 1);
+	dt_add_property_cells(opal_node, "#size-cells", 1);
 
 	if (proc_gen < proc_gen_p9)
 		dt_add_property_strings(opal_node, "compatible", "ibm,opal-v2",