From fae6c54d238279bf79c66ca65330425dff2c952f Mon Sep 17 00:00:00 2001 From: Benjamin Hahn Date: Tue, 21 Oct 2025 16:34:17 +0200 Subject: bootstd: make it possible to use tftp for netboot with standardboot 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. Reviewed-by: Simon Glass Signed-off-by: Benjamin Hahn --- boot/bootmeth_script.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'boot/bootmeth_script.c') diff --git a/boot/bootmeth_script.c b/boot/bootmeth_script.c index 020cb8a7aec..cd50977cc40 100644 --- a/boot/bootmeth_script.c +++ b/boot/bootmeth_script.c @@ -129,7 +129,11 @@ static int script_read_bootflow_net(struct bootflow *bflow) if (!fname) return log_msg_ret("dhc", -EINVAL); - ret = dhcp_run(addr, fname, true); + if (IS_ENABLED(CONFIG_CMD_TFTPBOOT) && env_get_yesno("ip_dyn") == 0) + ret = tftpb_run(addr, fname); + else + ret = dhcp_run(addr, fname, true); + if (ret) return log_msg_ret("dhc", ret); -- cgit v1.2.3