[PATCH] powernv: Search for new flash DT node location

Michael Ellerman mpe at ellerman.id.au
Wed Aug 3 17:16:34 AEST 2016


Quoting Jack Miller (2016-08-02 06:50:35)
> Skiboot will place the flash device tree node at ibm,opal/flash/flash at 0
> on P9 and later systems, so Linux needs to search for it there as well
> as ibm,opal/flash at 0 for backwards compatibility.
> 
> Signed-off-by: Jack Miller <jack at codezen.org>
> ---
>  arch/powerpc/platforms/powernv/opal.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
> index ae29eaf..2847cb0 100644
> --- a/arch/powerpc/platforms/powernv/opal.c
> +++ b/arch/powerpc/platforms/powernv/opal.c
> @@ -755,9 +755,14 @@ static int __init opal_init(void)
>  
>         /* Initialize platform devices: IPMI backend, PRD & flash interface */
>         opal_pdev_init(opal_node, "ibm,opal-ipmi");
> -       opal_pdev_init(opal_node, "ibm,opal-flash");
> +       opal_pdev_init(opal_node, "ibm,opal-flash"); // old <= P8 flash location
>         opal_pdev_init(opal_node, "ibm,opal-prd");
>  
> +       /* New >= P9 flash location */
> +       np = of_get_child_by_name(opal_node, "flash");
> +       if (np)
> +               opal_pdev_init(np, "ibm,opal-flash");

We could instead just search for all nodes that are compatible with
"ibm,opal-flash". We do that for i2c, see opal_i2c_create_devs().

Is there a particular reason not to do that?

cheers


More information about the Linuxppc-dev mailing list