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: Fri, 31 Oct 2025 17:51:24 +0100	[thread overview]
Message-ID: <a8f176dc-59c3-4af4-88ed-03d064f2e7c2@mailbox.org> (raw)
In-Reply-To: <FEAA3555-3109-41E7-A58F-5B601B6C2FB5@infi.wang>

On 10/31/25 5:34 PM, Beiyan Yun wrote:
> 
> 
>> On 31 Oct 2025, at 11:57 PM, Marek Vasut <marek.vasut@mailbox.org> wrote:
>>
>> On 10/31/25 4:21 PM, Beiyan Yun wrote:
>>> Aquantia PHYs are being used w/o SPI flash in some routers recently.
>>> Current firmware loader only attempts to load from FS on top of MMC,
>>> limiting the use on many devices.
>>> Removed the old firmware loader, migrate to generic firmware loader to
>>> allow a wider range and runtime override of firmware source. (e.g., USB).
>>> Tested on Buffalo WXR18000BE10P with UBIFS.
>>> Signed-off-by: Beiyan Yun <root@infi.wang>
>>> ---
>>> Changes in v4:
>>> - Split firmware upload helpers change
>>> - Reorder `aquantia_read_fw`
>>> - Make `aquantia_read_fw` weak to allow overide
>>> - Rename exit label in `aquantia_read_fw`
>>> - Kconfig polish
>>> Changes in v3:
>>> - Select FW_LOADER with PHY_AQUANTIA_UPLOAD_FW
>>> Changes in v2:
>>> - Add support for script based loader
>>>   drivers/net/phy/Kconfig    |  28 +++++----
>>>   drivers/net/phy/aquantia.c | 122 ++++++++++++++++++++++---------------
>>>   2 files changed, 91 insertions(+), 59 deletions(-)
>>> diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
>>> index 018be98705a..4a74a0d4e8c 100644
>>> --- a/drivers/net/phy/Kconfig
>>> +++ b/drivers/net/phy/Kconfig
>>> @@ -1,4 +1,3 @@
>>> -
>>>   config BITBANGMII
>>>   	bool "Bit-banged ethernet MII management channel support"
>>>   @@ -91,23 +90,30 @@ menuconfig PHY_AQUANTIA
>>>   config PHY_AQUANTIA_UPLOAD_FW
>>>   	bool "Aquantia firmware loading support"
>>>   	depends on PHY_AQUANTIA
>>> +	select FS_LOADER
>>> +	select FW_LOADER
>> 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 ?

  reply	other threads:[~2025-10-31 16:51 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 [this message]
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

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=a8f176dc-59c3-4af4-88ed-03d064f2e7c2@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.