[PATCH v3] bootstd: make it possible to use tftp for netboot with standardboot

Jerome Forissier jerome.forissier at linaro.org
Wed Oct 8 11:20:12 CEST 2025


Hi Tom & all,

On 10/8/25 01:49, Tom Rini wrote:
> On Wed, Sep 24, 2025 at 09:41:41AM +0200, Benjamin Hahn wrote:
> 
>> Add the option to load the bootscript with the tftp command (static IP)
>> instead of the dhcp command (dynamic IP). For this a new function
>> tftpb_run similar to dhcp_run, is needed. The selection of which command
>> to use can be done with the ip_dyn environment variable, which can be
>> set to yes or no. The ip_dyn variable was chosen as it is already in use
>> on the imx platforms.
>> Also edit the bootstd doc.
>>
>> Signed-off-by: Benjamin Hahn <B.Hahn at phytec.de>
> 
> OK, so this fails to build on qemu_arm64_lwip (and a few other lwip
> targets) because tftpb_run was defined just for the legacy stack and not
> lwIP too. But, and this is a question for Jerome too, why isn't dhcp_run
> already in the common network file and instead written again in
> net/lwip/dhcp.c?

No particular reason. This must have been an oversight when I introduced
lwIP.

> And for both of you, can we perhaps have a common
> function or functions? The lwIP one does handle tftp it looks like.
> Thanks!

Yeah. IMO, dhcp_run() should be common, but I'm not sure the NET_LWIP one
is correct TBH. The comment "Assume DHCP was already performed" is
suspicious and I'd rather use the NET one. That is, move dhcp_run() from
cmd/net.c into net/net-common.c, discard dhcp_run() from net/lwip/dhcp.c,
and see if that works as expected.

Thanks,
-- 
Jerome


More information about the U-Boot mailing list