[U-Boot] [PATCH 1/3] dm: core: also parse chosen node

Simon Glass sjg at chromium.org
Sun Aug 6 05:16:32 UTC 2017


Hi Rob,

On 3 August 2017 at 10:46, Rob Clark <robdclark at gmail.com> wrote:
> This is the node that would contain, for example, the framebuffer setup
> by an earlier stage.
>
> Signed-off-by: Rob Clark <robdclark at gmail.com>
> ---
>  drivers/core/root.c | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)

Please can you add one to test.dts and add a sandbox test for it?

>
> diff --git a/drivers/core/root.c b/drivers/core/root.c
> index d691d6ff94..5e6b2da248 100644
> --- a/drivers/core/root.c
> +++ b/drivers/core/root.c
> @@ -266,6 +266,26 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
>         for (offset = fdt_first_subnode(blob, offset);
>              offset > 0;
>              offset = fdt_next_subnode(blob, offset)) {
> +               ofnode node = offset_to_ofnode(offset);
> +
> +               /* "chosen" node isn't a device itself but may contain some: */
> +               if (strcmp(ofnode_get_name(node), "chosen") == 0) {

!strcmp()

> +                       dm_dbg("parsing subnodes of \"chosen\"\n");
> +
> +                       for (node = ofnode_first_subnode(node);
> +                            ofnode_valid(node);
> +                            node = ofnode_next_subnode(node)) {
> +                               dm_dbg("subnode: %s\n", ofnode_get_name(node));
> +                               err = lists_bind_fdt(parent, node, NULL);
> +                               if (err && !ret) {
> +                                       ret = err;
> +                                       dm_dbg("%s: ret=%d\n", ofnode_get_name(node), ret);
> +                               }
> +                       }
> +
> +                       continue;
> +               }
> +
>                 if (pre_reloc_only &&
>                     !dm_fdt_pre_reloc(blob, offset))
>                         continue;
> @@ -273,7 +293,7 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
>                         dm_dbg("   - ignoring disabled device\n");
>                         continue;
>                 }
> -               err = lists_bind_fdt(parent, offset_to_ofnode(offset), NULL);
> +               err = lists_bind_fdt(parent, node, NULL);
>                 if (err && !ret) {
>                         ret = err;
>                         debug("%s: ret=%d\n", fdt_get_name(blob, offset, NULL),
> --
> 2.13.0
>

Regards,
Simon


More information about the U-Boot mailing list