[PATCH v2 2/2] raspi: fixup additional vc created nodes

Roland Hieber rhi at pengutronix.de
Mon Feb 19 11:14:00 PST 2024


Hi,

On Mon, Sep 25, 2023 at 01:10:05PM +0200, Denis Osterland-Heim wrote:
> From: Denis OSTERLAND-HEIM <denis.osterland at diehl.com>
> 
> The video core creates some additional nodes.
> This code takes over this values.
> The /hat node is only there if an raspi hat with EEPROM is detected.
> 
> Signed-off-by: Denis OSTERLAND-HEIM <denis.osterland at diehl.com>
> Acked-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
>  arch/arm/boards/raspberry-pi/rpi-common.c | 39 +++++++++++++++++------
>  1 file changed, 30 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c
> b/arch/arm/boards/raspberry-pi/rpi-common.c
> index ceafd55a56..713fad78c9 100644
> --- a/arch/arm/boards/raspberry-pi/rpi-common.c
> +++ b/arch/arm/boards/raspberry-pi/rpi-common.c
> @@ -264,19 +264,37 @@ static enum reset_src_type
> rpi_decode_pm_rsts(struct device_node *chosen,
>  
>  static int rpi_vc_fdt_fixup(struct device_node *root, void *data)
>  {
> -       const struct device_node *vc_chosen = data;
> -       struct device_node *chosen;
> +       const struct device_node *vc_node = data;
> +       struct device_node *node;
> +       struct property *pp;
>  
> -       chosen = of_create_node(root, "/chosen");
> -       if (!chosen)
> +       node = of_create_node(root, vc_node->full_name);
> +       if (!node)
>                 return -ENOMEM;
>  
> -       of_copy_property(vc_chosen, "overlay_prefix", chosen);
> -       of_copy_property(vc_chosen, "os_prefix", chosen);
> +       for_each_property_of_node(vc_node, pp)
> +               of_copy_property(vc_node, pp->name, node);
>  
>         return 0;
>  }
>  
> +static struct device_node *register_vc_fixup(struct device_node *root,
> +                                            const char *path)
> +{
> +       struct device_node *ret, *tmp;
> +
> +       ret = of_find_node_by_path_from(root, path);
> +       if (ret) {
> +               tmp = of_dup(ret);
> +               tmp->full_name = xstrdup(ret->full_name);
> +               of_register_fixup(rpi_vc_fdt_fixup, tmp);
> +       } else {
> +               pr_info("no '%s' node found in vc fdtn", path);
> +       }
> +
> +       return ret;
> +}
> +
>  static u32 rpi_boot_mode, rpi_boot_part;
>  /* Extract useful information from the VideoCore FDT we got.
>   * Some parameters are defined here:
> @@ -300,14 +318,17 @@ static void rpi_vc_fdt_parse(struct device_node
> *root)
>                 free(str);
>         }
>  
> -       chosen = of_find_node_by_path_from(root, "/chosen");
> +       register_vc_fixup(root, "/system");
> +       register_vc_fixup(root, "/axi");
> +       register_vc_fixup(root, "/reserved-memory");
> +       register_vc_fixup(root, "/hat");
> +       register_vc_fixup(root, "/chosen/bootloader");
> +       chosen = register_vc_fixup(root, "/chosen");

This throws a lot of new warnings and errors on our RPi 3B:

    barebox 2024.01.0 #1 2024-02-01T00:00:00+00:00
    Buildsystem version: DistroKit-2019.12.0-552-g775624b9f5d6

    Board: Raspberry Pi 3 Model B
    deep-probe: supported due to raspberrypi,3-model-b
    netconsole: registered as netconsole-1
    bcm2835-sdhost 3f202000.mmc at 7e202000.of: registered as mci0
    bcm2835_mci 3f300000.mmc at 7e300000.of: registered as mci1
    mci0: detected SD card version 2.0
    mci0: registered disk0
    state: New state registered 'state'
    state: Using bucket 0 at 0x00000000
    malloc space: 0x1d87f620 -> 0x3b0fec3f (size 472.5 MiB)
    WARNING: no property 'serial-number' found in vc fdt's '' node
    no '/system' node found in vc fdt
    no '/axi' node found in vc fdt
    no '/hat' node found in vc fdt
    no '/chosen/bootloader' node found in vc fdt
    WARNING: no property 'bootargs' found in vc fdt's '/chosen' node
    WARNING: no property 'overlay_prefix' found in vc fdt's '/chosen' node
    WARNING: no property 'os_prefix' found in vc fdt's '/chosen' node
    WARNING: 'pm_rsts' value not found in vc fdt
    ERROR: Won't delete root device node
    environment load /boot/barebox.env: No such file or directory
    Maybe you have to create the partition.

Do you have any idea what is going on here? 

I also don't see /vc.dtb, which should have been created. I have
'vc.kernel: kernel7.img' in the 'global' output, but nothing else
starting with vc.*.

 - Roland

>         if (!chosen) {
>                 pr_err("no '/chosen' node found in vc fdtn");
>                 goto out;
>         }
>  
> -       of_register_fixup(rpi_vc_fdt_fixup, of_dup(chosen));
> -
>         bootloader = of_find_node_by_name(chosen, "bootloader");
>  
>         str = of_read_vc_string(chosen, "bootargs");
> -- 
> 2.39.2
> 
> 

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber at pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list