[Skiboot] [PATCH v2] flash: Move flash node under ibm, opal/flash/
Cyril Bur
cyril.bur at au1.ibm.com
Mon Aug 29 14:46:17 AEST 2016
On Thu, 2016-08-04 at 12:48 -0500, Jack Miller wrote:
> This changes the boot ABI, so it's only active for P9 and later
> systems,
> even though it's unrelated to hardware changes. There is an
> associated
> Linux change to properly search for this node as well.
>
> This change properly specifies #address-cells for the flash node, so
> we
> can avoid DTC errors like
>
> ---
> device tree: Warning (reg_format): "reg" property in /ibm,opal/flash@
> 0
> has invalid length (8 bytes) (#address-cells == 0, #size-cells == 0)
> ---
>
Sorry I should have thumbsuped this sooner! It was tested with a the
corresponding patch for linux http://patchwork.ozlabs.org/patch/655523/
(not upstream yet though) which works fine.
> Base on a patch from Cyril Bur
>
> Signed-off-by: Jack Miller <jack at codezen.org>
Reviewed-by: Cyril Bur <cyril.bur at au1.ibm.com>
> ---
> core/flash.c | 31 ++++++++++++++++++++++++-------
> 1 file changed, 24 insertions(+), 7 deletions(-)
>
> diff --git a/core/flash.c b/core/flash.c
> index e9c1f7d..20d0712 100644
> --- a/core/flash.c
> +++ b/core/flash.c
> @@ -187,19 +187,36 @@ static int flash_nvram_probe(struct flash
> *flash, struct ffs_handle *ffs)
>
> static struct dt_node *flash_add_dt_node(struct flash *flash, int
> id)
> {
> - struct dt_node *flash_node;
> + struct dt_node *flash_node, *flash_dir;
>
> - flash_node = dt_new_addr(opal_node, "flash", id);
> - dt_add_property_strings(flash_node, "compatible", "ibm,opal-
> flash");
> + /* Boot ABI on P9+, flash node is in ibm,opal/flash/flash at 0
> */
> +
> + if (proc_gen >= proc_gen_p9) {
> + flash_dir = dt_new(opal_node, "flash");
> + assert(flash_dir);
> +
> + dt_add_property_cells(flash_dir, "#address-cells",
> 0);
> + dt_add_property_cells(flash_dir, "#size-cells", 2);
> +
> + flash_node = dt_new_addr(flash_dir, "flash", id);
> + assert(flash_node);
> +
> + /* <= P8, flash is ibm,opal/flash at 0, with legacy cell
> settings */
> +
> + } else {
> + flash_node = dt_new_addr(opal_node, "flash", id);
> + assert(flash_node);
> +
> + dt_add_property_cells(flash_node, "#address-cells",
> 1);
> + dt_add_property_cells(flash_node, "#size-cells", 1);
> + }
> +
> + dt_add_property_string(flash_node, "compatible", "ibm,opal-
> flash");
> dt_add_property_cells(flash_node, "ibm,opal-id", id);
> dt_add_property_cells(flash_node, "reg", 0, flash->size);
> dt_add_property_cells(flash_node, "ibm,flash-block-size",
> flash->block_size);
>
> - /* we fix to 32-bits */
> - dt_add_property_cells(flash_node, "#address-cells", 1);
> - dt_add_property_cells(flash_node, "#size-cells", 1);
> -
> return flash_node;
> }
>
More information about the Skiboot
mailing list