Aw: Re: Board code with 2 dts

Frank Wunderlich frank-w at public-files.de
Wed Mar 23 00:47:12 PDT 2022


Hi

thanks for your fast and detailed answer.
afaik vendor have not changed the saradc-detection (because v00 was not public), so v00 has same value as v1.0 and i cannot detect difference there. Maybe there is another way to detect (maybe based on gmac or any hardware-change), but for now i used last option you've mentioned (second entry function).

Have it implemented like kontron-samx6i (both dts currently same), it compiles, can you take a quick look if i did it right?

https://github.com/frank-w/barebox-r2pro/commit/deaf7a8eed7575e35c17807aa0a432363122b033

this is not intended to be upstreamed, but for me to fix upstream with v1 config (when i get the board) and still using v00 board.

regards Frank


> Gesendet: Dienstag, 22. März 2022 um 18:34 Uhr
> Von: "Ahmad Fatoum" <a.fatoum at pengutronix.de>
> An: frank-w at public-files.de, barebox at lists.infradead.org
> Betreff: Re: Board code with 2 dts
>
> Hello Frank,
> 
> On 22.03.22 18:23, Frank Wunderlich wrote:
> > Hi,
> > 
> > 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 [1]
> > 
> > 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.
> > 
> > [1] 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:
> arch/arm/boards/stm32mp15xx-dkx/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
> after detection.
> 
> 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:
> 
> arch/arm/boards/kontron-samx6i/lowlevel.c
> 
> 
> Cheers,
> Ahmad




More information about the barebox mailing list