Board code with 2 dts
a.fatoum at pengutronix.de
Tue Mar 22 10:34:45 PDT 2022
On 22.03.22 18:23, Frank Wunderlich wrote:
> I get information that new hardware revision of bpi-r2 pro has some differences to the version i upstreamed. Is it possible to add a new dts and use same board code?
> How can i choose between the 2 dts on build (kconfig option)?
In any case, don't add a new Kconfig option. The existing one suffices.
> Afaik the name of dtb is hardcoded in lowlevel.c 
> Differences are iodomains (not defined in barebox,but linux) and gmac-config (gmacs swapped and different settings).
> Currently i have not yet the new board for testing,but then i want to send patches for linux and barebox.
>  https://git.pengutronix.de/cgit/barebox/tree/arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c#n24
Is it possible to detect which board is being used?
If so, best practice is to have barebox the same image for both
and detect board type at runtime.
Here's an example doing it in lowlevel.c:
If you need more barebox infrastructure than what's available in the bootloader
to detect board type, you could e.g. rewrite gmac-config in barebox board code
If there is no way to dynamically detect which board variant barebox is running
on, just duplicate the entry point in the same file and change just the device
tree. Then extend images/Makefile.rockchip to reference the new entry point
and barebox build will generate an image for each board. See for example:
> regards Frank
> barebox mailing list
> barebox at lists.infradead.org
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://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