All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@mailbox.org>
To: Beiyan Yun <root@infi.wang>
Cc: u-boot@lists.denx.de, Yao Zi <ziyao@disroot.org>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Tom Rini <trini@konsulko.com>,
	Jerome Forissier <jerome.forissier@linaro.org>,
	Joe Hershberger <joe.hershberger@ni.com>,
	"Lucien.Jheng" <lucienzx159@gmail.com>,
	Ramon Fried <rfried.dev@gmail.com>,
	Romain Gantois <romain.gantois@bootlin.com>,
	Siddharth Vadapalli <s-vadapalli@ti.com>,
	Weijie Gao <weijie.gao@mediatek.com>
Subject: Re: [PATCH v4 5/5] net: phy: aquantia: use generic firmware loader
Date: Sun, 2 Nov 2025 15:25:16 +0100	[thread overview]
Message-ID: <9377791a-b36b-401d-abbb-60decd9f9e80@mailbox.org> (raw)
In-Reply-To: <490112A0-3D3B-4209-AC15-43A5A74C546D@infi.wang>

On 11/2/25 5:57 AM, Beiyan Yun wrote:

Hi,

>>>>>> Can you not use the plain FW_LOADER to load the firmware from either storage, UBI or Block ? Is FS_LOADER even needed ?
>>>>> Thanks for the suggestion, and yes you can, but that API is script-only—it expects the board to stage the blob and just copies from the address exposed via *_addr/_size. The current users of this driver expect the old pattern: the bootloader mounts a filesystem (MMC before, now possibly UBI/USB/etc.), reads the firmware, and applies it. Keeping an fs-loader node in the DT is effectively the same contract as the legacy MMC setup, just generalized.
>>>>
>>>> Can you maybe write a script which implements the old loader behavior in a compatible manner ?
>>>>
>>>>> The fs_loader driver gives us several things the script path doesn’t: a standard way to describe the storage via "/chosen/firmware-loader"
>>>>
>>>> Try this:
>>>>
>>>> "fdt addr $fdtcontroladdr ; fdt print /chosen"
>>>>
>>>> And then look at the "fdt" command and what it can do regarding reading content of DT properties into variables.
>>>>
>>>>> , runtime overrides through "storage_interface/fw_dev_part/fw_ubi_*, and no requirement for a board-specific script. So FS_LOADER isn’t redundant—it’s the part that replaces the hard-coded MMC flow with a configurable backend, while the script helper stays available for boards that want extra logic.
>>>> Maybe a more generic script can be a replacement for the older hard-coded approach ?
>>> Fair enough, I’ll remove fsloader for now.
>>> I still believe it would be valuable someday: if reading from nvmem cell is implemented, the same DT could be used for both U-Boot and Linux.
>>
>> See example above, you can read anything from the U-Boot control DT both in U-Boot shell and in U-Boot env scripts, using 'fdt' command .
>>
> 
> To make sure I understand the preferred architecture: are you suggesting that FW_LOADER is the preferred method, and that all the logic for finding, mounting, and reading from storage should be handled by board-specific scripts that parse the DT using fdt?
> 
> My main objective with FS_LOADER was to provide a "zero-script" default for most common use case. While scripting is powerful, it seems beneficial to have a C-based driver that can natively read from a filesystem described by a standard DT binding, rather than requiring every board to script the same "find-and-mount" logic.

Maybe the scripts can be made common, similar to what distro bootcommand 
did ?

The upside of doing the loading in a script is, that it allows users to 
tweak the scripts without rebuilding and updating the bootloader, which 
may be beneficial in case they need to load firmware from a device which 
was not considered when the bootloader was built.

> Am I overlooking al drawback to that C-based approach, or perhaps missing some prior discussion on this?

See above.

-- 
Best regards,
Marek Vasut

      reply	other threads:[~2025-11-02 14:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-31 15:21 [PATCH v4 0/5] net: phy: aquantia: Switch to generic firmware loader Beiyan Yun
2025-10-31 15:21 ` [PATCH v4 1/5] net: phy: aquantia: refresh format Beiyan Yun
2025-10-31 15:51   ` Marek Vasut
2025-10-31 17:21     ` Beiyan Yun
2025-10-31 18:33       ` Marek Vasut
2025-10-31 19:00         ` Tom Rini
2025-10-31 15:21 ` [PATCH v4 2/5] doc: bindings: use upstream bindings for aquantia phy Beiyan Yun
2025-10-31 15:53   ` Marek Vasut
2025-10-31 17:02     ` Beiyan Yun
2025-10-31 17:12       ` Marek Vasut
2025-10-31 15:21 ` [PATCH v4 3/5] net: phy: aquantia: replace the "mdi-reversal" node with "marvell, mdi-cfg-order" Beiyan Yun
2025-10-31 15:21 ` [PATCH v4 4/5] net: phy: aquantia: refactor firmware upload helpers Beiyan Yun
2025-10-31 15:21 ` [PATCH v4 5/5] net: phy: aquantia: use generic firmware loader Beiyan Yun
2025-10-31 15:41   ` Daniel Golle
2025-10-31 16:09     ` Beiyan Yun
2025-10-31 15:57   ` Marek Vasut
2025-10-31 16:34     ` Beiyan Yun
2025-10-31 16:51       ` Marek Vasut
2025-11-01  7:45         ` Beiyan Yun
2025-11-01 11:54           ` Marek Vasut
2025-11-02  4:57             ` Beiyan Yun
2025-11-02 14:25               ` Marek Vasut [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:
  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=9377791a-b36b-401d-abbb-60decd9f9e80@mailbox.org \
    --to=marek.vasut@mailbox.org \
    --cc=jerome.forissier@linaro.org \
    --cc=joe.hershberger@ni.com \
    --cc=lucienzx159@gmail.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=rfried.dev@gmail.com \
    --cc=romain.gantois@bootlin.com \
    --cc=root@infi.wang \
    --cc=s-vadapalli@ti.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=weijie.gao@mediatek.com \
    --cc=ziyao@disroot.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.