[RFC PATCH 2/2] arm: rockchip-rk3568-evb: apply dt overlay for evb7

Trent Piepho trent.piepho at igorinstitute.com
Tue Jun 29 14:58:26 PDT 2021

On Tue, Jun 29, 2021 at 5:32 AM Michael Riesch
<michael.riesch at wolfvision.net> wrote:
> @@ -63,6 +64,9 @@ static int rk3568_evb_detect_version(void)
>                 evb_hw_id = 6;
>         } else {
>                 evb_hw_id = 7;
> +               setenv("global.of.overlay.dir", "boot");

Hardcoding the location of boot files in the rootfs into board code
doesn't seem right to me.

Seems like either creating a nv/global.of.overlay.dir file in the
default env for the board or creating an init script that sets that
variable would be the way to set this.

> +               setenv("global.of.overlay.filepattern",
> +                      "rk3568-evb7-overlay.dtb*");

What if one had a board magicvar, something like:

globalvar_add_simple("board.variant", "rk3568-evb7");  // Or just evb7
if rk3568 is already somewhere else
BAREBOX_MAGICVAR(global.board.variant, "The board variant");

Then an init script could easily construct the overlay:

global of.overlay.filepattern="${global.of.overlay.filepattern}

Since every overlay file is added to the same variable, some care
needs to be taken to ensure different initscripts work together.  Thus
the append in the above script.

More information about the barebox mailing list