mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Matthias Fend <>
To: Sascha Hauer <>
Subject: Re: One barebox image for multiple boards
Date: Thu, 19 May 2022 11:25:34 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>


I was pleasantly surprised to get so many comments on this topic.
Thank you everyone for your input!

Since I want to avoid duplicating the i2c bus driver in a PBL capable 
version, I decided to have a common barebox device tree for all boards.
This means that the detection takes place in the board init code and 
then prepends the compatible with the matching board-specific entry.

If at some point the hardware no longer allows this approach, I still 
can switch to the i2c-early solution.


Am 16.05.2022 um 10:07 schrieb Sascha Hauer:
> On Fri, May 13, 2022 at 02:10:32PM +0200, Matthias Fend wrote:
>> Hi Sascha,
>> Am 13.05.2022 um 13:00 schrieb Sascha Hauer:
>>> Hi Matthias,
>>> On Fri, May 13, 2022 at 10:55:02AM +0200, Matthias Fend wrote:
>>>> Hi,
>>>> I'm looking for a solution to support multiple boards with just one barebox
>>>> image. The few core components that are relevant for barebox are the same on
>>>> all boards, so that the same barebox image runs on all boards. It is
>>>> possible to dynamically detect the board type inside barebox, but as this
>>>> requires some infrastructure it is not possible during lowlevel init. So
>>>> basically Barebox should boot with a minimal core device tree, detect the
>>>> board type and then use the corresponding device tree of the detected board.
>>>> Something similar to arch/arm/boards/stm32mp15xx-dkx/lowlevel.c but not at
>>>> low level.
>>> Do you even need the full device tree in barebox? The minimal core
>>> device tree might be enough for barebox and only the kernel is then
>>> booted with the full device tree.
>> If there is no trick to changing the used device tree at boardlevel init,
>> then this might be a possibility.
> Replacing the live tree after it has been partly probed already is
> dangerous and barebox is not really prepared for that.
>> The core device tree might not be as minimal then and in exceptional cases
>> minor fixups in the board code will be needed, but I think it could work.
>> In such a case, how should one ensure that the appropriate blspec entry is
>> booted? Maybe by simply replacing/updating the compatible string in the live
>> device tree after the board was detected?
> As it happens Oleksij has just introduced of_prepend_machine_compatible()
> exactly for this usecase. You can find it in current next branch.
> Sascha

barebox mailing list

      reply	other threads:[~2022-05-19  9:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13  8:55 Matthias Fend
2022-05-13 10:30 ` Sam Ravnborg
2022-05-13 12:08   ` Matthias Fend
2022-05-13 12:20     ` Ahmad Fatoum
2022-05-13 18:02       ` Trent Piepho
2022-05-13 12:23     ` Sascha Hauer
2022-05-13 11:00 ` Sascha Hauer
2022-05-13 12:10   ` Matthias Fend
2022-05-16  8:07     ` Sascha Hauer
2022-05-19  9:25       ` Matthias Fend [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: One barebox image for multiple boards' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox