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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Trent,

Thanks for your comments, much appreciated!

On 6/29/21 11:58 PM, Trent Piepho wrote:
> On Tue, Jun 29, 2021 at 5:32 AM Michael Riesch
> <michael.riesch@xxxxxxxxxxxxxx> 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.

Right, this approach seems to be more flexible.

>> +               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:
> 
> env/init/board-overlay:
> global of.overlay.filepattern="${global.of.overlay.filepattern}
> ${global.board.variant}-overlay.dtbo"
> 
> 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.

Thanks for the hint, I think I'll go along this direction.

Regards, Michael

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux