mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Simon Glass <sjg@chromium.org>
Cc: linux-arm-kernel@lists.infradead.org,
	Masahiro Yamada <masahiroy@kernel.org>,
	Tom Rini <trini@konsulko.com>,
	lkml <linux-kernel@vger.kernel.org>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Terrell <terrelln@fb.com>,
	Nicolas Schier <nicolas@fjasle.eu>, Will Deacon <will@kernel.org>,
	linux-kbuild@vger.kernel.org,
	Pengutronix Kernel Team <kernel@pengutronix.de>
Subject: Re: [PATCH v7 2/2] arm64: boot: Support Flat Image Tree
Date: Fri, 1 Dec 2023 03:03:58 +0100	[thread overview]
Message-ID: <5e8f42f8-2b03-4033-b6d2-9b3139f081d5@pengutronix.de> (raw)
In-Reply-To: <CAPnjgZ1iyxk0bb56QR10N5aSphRYhLsw7Ly=z2i6rQCxP_AYPw@mail.gmail.com>

Hello Simon,

On 30.11.23 21:30, Simon Glass wrote:
> On Wed, 29 Nov 2023 at 12:54, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>> On 29.11.23 20:44, Simon Glass wrote:
>>> On Wed, 29 Nov 2023 at 12:33, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>>>>
>>>> On 29.11.23 20:27, Simon Glass wrote:
>>>>> On Wed, 29 Nov 2023 at 12:15, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>>>>>> On 29.11.23 20:02, Simon Glass wrote:
>>>>>>> On Wed, 29 Nov 2023 at 11:59, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>>>>>>>> The specification says that this is the root U-Boot compatible,
>>>>>>>> which I presume to mean the top-level compatible, which makes sense to me.
>>>>>>>>
>>>>>>>> The code here though adds all compatible strings from the device tree though,
>>>>>>>> is this intended?
>>>>>>>
>>>>>>> Yes, since it saves needing to read in each DT just to get the
>>>>>>> compatible stringlist.
>>>>>>
>>>>>> The spec reads as if only one string (root) is supposed to be in the list.
>>>>>> The script adds all compatibles though. This is not really useful as a bootloader
>>>>>> that's compatible with e.g. fsl,imx8mm would just take the first device tree
>>>>>> with that SoC, which is most likely to be wrong. It would be better to just
>>>>>> specify the top-level compatible, so the bootloader fails instead of taking
>>>>>> the first DT it finds.
>>>>>
>>>>> We do need to have a list, since we have to support different board revs, etc.
>>>>
>>>> Can you give me an example? The way I see it, a bootloader with
>>>> compatible "vendor,board" and a FIT with configuration with compatibles:
>>>>
>>>>   "vendor,board-rev-a", "vendor,board"
>>>>   "vendor,board-rev-b", "vendor,board"
>>>>
>>>> would just result in the bootloader booting the first configuration, even if
>>>> the device is actually rev-b.
>>>
>>> You need to find the best match, not just any match. This is
>>> documented in the function comment for fit_conf_find_compat().
>>
>> In my above example, both configuration are equally good.
>> Can you give me an example where it makes sense to have multiple
>> compatibles automatically extracted from the device tree compatible?
>>
>> The way I see it having more than one compatible here just has
>> downsides.
> 
> I don't have an example to hand, but this is the required mechanism of
> FIT. This feature has been in place for many years and is used by
> ChromeOS, at least.

I see the utility of a FIT configuration with

    compatible = "vendor,board-rev-a", "vendor,board-rev-b";

I fail to see a utility for a configuration with

    compatible = "vendor,board", "vendor,SoM", "vendor,SoC";

Any configuration that ends up being booted because "vendor,SoC" was matched is
most likely doomed to fail. Therefore, I would suggest that only the top level
configuration is written into the FIT configurations automatically.

Cheers,
Ahmad

-- 
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 |


  reply	other threads:[~2023-12-01  2:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 17:21 [PATCH v7 0/2] arm64: Add a build target for " Simon Glass
2023-11-29 17:21 ` [PATCH v7 1/2] arm64: Add BOOT_TARGETS variable Simon Glass
2023-11-29 17:21 ` [PATCH v7 2/2] arm64: boot: Support Flat Image Tree Simon Glass
2023-11-29 18:35   ` Ahmad Fatoum
2023-11-29 19:00     ` Simon Glass
2023-11-29 20:35       ` Ahmad Fatoum
2023-11-30 20:30     ` Simon Glass
2023-11-29 18:59   ` Ahmad Fatoum
2023-11-29 19:02     ` Tom Rini
2023-11-29 19:16       ` Ahmad Fatoum
2023-11-29 20:10         ` Tom Rini
2023-11-29 19:02     ` Simon Glass
2023-11-29 19:14       ` Ahmad Fatoum
2023-11-29 19:27         ` Simon Glass
2023-11-29 19:33           ` Ahmad Fatoum
2023-11-29 19:44             ` Simon Glass
2023-11-29 19:53               ` Ahmad Fatoum
2023-11-30 20:30                 ` Simon Glass
2023-12-01  2:03                   ` Ahmad Fatoum [this message]
2023-12-02 16:36                     ` Simon Glass
2023-12-04 17:52                       ` Doug Anderson
2023-12-05 11:15                         ` Ahmad Fatoum
2023-12-05 17:06                           ` Doug Anderson
2023-11-30  8:20   ` Nicolas Schier
2023-11-30 15:12     ` Masahiro Yamada
2023-11-30 15:38   ` Masahiro Yamada
2023-11-30 20:32     ` Simon Glass

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=5e8f42f8-2b03-4033-b6d2-9b3139f081d5@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=catalin.marinas@arm.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=sjg@chromium.org \
    --cc=terrelln@fb.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®