summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-02-04 08:05:24 -0600
committerTom Rini <[email protected]>2026-02-04 08:05:24 -0600
commiteb1562cc3e4c5130c76db1c1ea57156322362a7c (patch)
treeba5d95a9e4401433f460db33c3df0c265e2e45db
parent3c72973b7a7fbc3f57b20bf2e2e630ba9d31a686 (diff)
parentf0a1eb8a3d13112f69c69b4c4752147cebe66900 (diff)
Merge tag 'net-20260204' of https://source.denx.de/u-boot/custodians/u-boot-net
Pull request net-20260204. net: - phy: aquantia: add support for Marvell CUX3410 10Gb PHY - drivers: phy: fix code documentation typo udevice_ops net-lwip: - Command fixes and improvements (dhcp, dns, nfs) - dhcp, tftp: do not write past end of buffer - Add TFTPSERVERIP Kconfig option misc: - Update Jerome's email address
-rw-r--r--.mailmap2
-rw-r--r--MAINTAINERS6
-rw-r--r--cmd/lwip/ping.c2
-rw-r--r--drivers/net/phy/aquantia.c14
-rw-r--r--include/env_default.h3
-rw-r--r--include/generic-phy.h2
-rw-r--r--lib/lwip/lwip/src/apps/tftp/tftp.c2
-rw-r--r--net/lwip/Kconfig12
-rw-r--r--net/lwip/dhcp.c13
-rw-r--r--net/lwip/dns.c24
-rw-r--r--net/lwip/net-lwip.c6
-rw-r--r--net/lwip/nfs.c13
-rw-r--r--net/lwip/tftp.c2
13 files changed, 65 insertions, 36 deletions
diff --git a/.mailmap b/.mailmap
index 89a61a09800..31d4970fff7 100644
--- a/.mailmap
+++ b/.mailmap
@@ -69,7 +69,7 @@ Jagan Teki <[email protected]>
Jakob Unterwurzacher <[email protected]> <[email protected]>
Jyotheeswar Reddy Mutthareddyvari <[email protected]> <[email protected]>
Jyotheeswar Reddy Mutthareddyvari <[email protected]> <[email protected]>
diff --git a/MAINTAINERS b/MAINTAINERS
index 9b81788f6ce..87d2e267dd9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1464,7 +1464,7 @@ N: mmc
NETWORK
M: Joe Hershberger <[email protected]>
M: Ramon Fried <[email protected]>
-M: Jerome Forissier <[email protected]>
+M: Jerome Forissier <[email protected]>
S: Maintained
T: git https://source.denx.de/u-boot/custodians/u-boot-net.git
F: drivers/net/
@@ -1472,7 +1472,7 @@ F: include/net.h
F: net/
NETWORK (LWIP)
-M: Jerome Forissier <[email protected]>
+M: Jerome Forissier <[email protected]>
S: Maintained
T: git https://source.denx.de/u-boot/custodians/u-boot-net.git
F: cmd/lwip/
@@ -1930,7 +1930,7 @@ F: drivers/usb/host/xhci*
F: include/usb/xhci.h
UTHREAD
-M: Jerome Forissier <[email protected]>
+M: Jerome Forissier <[email protected]>
S: Maintained
F: cmd/spawn.c
F: include/uthread.h
diff --git a/cmd/lwip/ping.c b/cmd/lwip/ping.c
index 6d090fc530d..fc4cf7bde5f 100644
--- a/cmd/lwip/ping.c
+++ b/cmd/lwip/ping.c
@@ -35,7 +35,7 @@ static u8_t ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p,
struct ping_ctx *ctx = arg;
struct icmp_echo_hdr *iecho = ctx->iecho;
- if (addr->addr != ctx->target.addr)
+ if (!ip_addr_eq(addr, &ctx->target))
return 0;
if ((p->tot_len >= (IP_HLEN + sizeof(struct icmp_echo_hdr))) &&
diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index e0deef58f52..10b87dfb8ab 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -714,3 +714,17 @@ U_BOOT_PHY_DRIVER(aqr412) = {
.shutdown = &gen10g_shutdown,
.data = AQUANTIA_GEN3,
};
+
+U_BOOT_PHY_DRIVER(cux3410) = {
+ .name = "Marvell CUX3410",
+ .uid = 0x31c31dd3,
+ .mask = 0xfffffff0,
+ .features = PHY_10G_FEATURES,
+ .mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS |
+ MDIO_MMD_PHYXS | MDIO_MMD_AN |
+ MDIO_MMD_VEND1),
+ .config = &aquantia_config,
+ .startup = &aquantia_startup,
+ .shutdown = &gen10g_shutdown,
+ .data = AQUANTIA_GEN3,
+};
diff --git a/include/env_default.h b/include/env_default.h
index 7f8dc1c35a7..014873e304d 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -58,6 +58,9 @@ const char default_environment[] = {
#ifdef CONFIG_USE_SERVERIP
"serverip=" CONFIG_SERVERIP "\0"
#endif
+#ifdef CONFIG_USE_TFTPSERVERIP
+ "tftpserverip=" CONFIG_TFTPSERVERIP "\0"
+#endif
#ifdef CONFIG_SYS_DISABLE_AUTOLOAD
"autoload=0\0"
#endif
diff --git a/include/generic-phy.h b/include/generic-phy.h
index ba3321f4849..567dd3974ad 100644
--- a/include/generic-phy.h
+++ b/include/generic-phy.h
@@ -52,7 +52,7 @@ struct phy {
};
/*
- * struct udevice_ops - set of function pointers for phy operations
+ * struct phy_ops - set of function pointers for phy operations
* @init: operation to be performed for initializing phy (optional)
* @exit: operation to be performed while exiting (optional)
* @reset: reset the phy (optional).
diff --git a/lib/lwip/lwip/src/apps/tftp/tftp.c b/lib/lwip/lwip/src/apps/tftp/tftp.c
index ecb6c55ae11..25da952e925 100644
--- a/lib/lwip/lwip/src/apps/tftp/tftp.c
+++ b/lib/lwip/lwip/src/apps/tftp/tftp.c
@@ -191,7 +191,7 @@ send_request(const ip_addr_t *addr, u16_t port, u16_t opcode, const char* fname,
MEMCPY(payload+2, fname, fname_length);
MEMCPY(payload+2+fname_length, mode, mode_length);
if (tftp_state.blksize)
- sprintf(payload+2+fname_length+mode_length, "blksize%c%d%c", 0, tftp_state.blksize, 0);
+ sprintf(payload+2+fname_length+mode_length, "blksize%c%d", 0, tftp_state.blksize);
tftp_state.wait_oack = true;
ret = udp_sendto(tftp_state.upcb, p, addr, port);
diff --git a/net/lwip/Kconfig b/net/lwip/Kconfig
index 5789766fe62..0cfd3eb2684 100644
--- a/net/lwip/Kconfig
+++ b/net/lwip/Kconfig
@@ -72,4 +72,16 @@ config LWIP_TCP_WND
but QEMU with "-net user" needs no more than a few KB or the
transfer will stall and eventually time out.
+config USE_TFTPSERVERIP
+ bool "Set a default 'tftpserverip' value in the environment"
+ depends on CMD_TFTPBOOT
+ help
+ Defines a default value for the IP address of a TFTP server to
+ contact when using the "tftpboot" command. (Environment variable
+ "tftpserverip")
+
+config TFTPSERVERIP
+ string "Value of the default 'tftpserverip' value in the environment"
+ depends on USE_TFTPSERVERIP
+
endif # NET_LWIP
diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c
index b798014ebcb..acdf601d7eb 100644
--- a/net/lwip/dhcp.c
+++ b/net/lwip/dhcp.c
@@ -30,9 +30,9 @@ static void call_lwip_dhcp_fine_tmr(void *ctx)
static int dhcp_loop(struct udevice *udev)
{
- char ipstr[] = "ipaddr\0\0";
- char maskstr[] = "netmask\0\0";
- char gwstr[] = "gatewayip\0\0";
+ char ipstr[] = "ipaddr\0\0\0";
+ char maskstr[] = "netmask\0\0\0";
+ char gwstr[] = "gatewayip\0\0\0";
const ip_addr_t *ntpserverip;
unsigned long start;
struct netif *netif;
@@ -93,14 +93,17 @@ static int dhcp_loop(struct udevice *udev)
sprintf(maskstr, "netmask%d", idx);
sprintf(gwstr, "gatewayip%d", idx);
} else {
- net_ip.s_addr = dhcp->offered_ip_addr.addr;
+ net_ip.s_addr = ip_addr_get_ip4_u32(&dhcp->offered_ip_addr);
}
env_set(ipstr, ip4addr_ntoa(&dhcp->offered_ip_addr));
env_set(maskstr, ip4addr_ntoa(&dhcp->offered_sn_mask));
env_set("serverip", ip4addr_ntoa(&dhcp->server_ip_addr));
- if (dhcp->offered_gw_addr.addr != 0)
+ if (!ip4_addr_isany(&dhcp->offered_gw_addr))
env_set(gwstr, ip4addr_ntoa(&dhcp->offered_gw_addr));
+ if (!ip4_addr_isany(&dhcp->offered_si_addr) &&
+ !ip4_addr_eq(&dhcp->offered_si_addr, &dhcp->server_ip_addr))
+ env_set("tftpserverip", ip4addr_ntoa(&dhcp->offered_si_addr));
#ifdef CONFIG_PROT_DNS_LWIP
env_set("dnsip", ip4addr_ntoa(dns_getserver(0)));
diff --git a/net/lwip/dns.c b/net/lwip/dns.c
index 9964003195f..8b7b3b7f970 100644
--- a/net/lwip/dns.c
+++ b/net/lwip/dns.c
@@ -14,7 +14,6 @@
struct dns_cb_arg {
ip_addr_t host_ipaddr;
- const char *var;
bool done;
};
@@ -26,32 +25,24 @@ static void do_dns_tmr(void *arg)
static void dns_cb(const char *name, const ip_addr_t *ipaddr, void *arg)
{
struct dns_cb_arg *dns_cb_arg = arg;
- char *ipstr = ip4addr_ntoa(ipaddr);
dns_cb_arg->done = true;
- if (!ipaddr) {
+ if (!ipaddr)
printf("DNS: host not found\n");
- dns_cb_arg->host_ipaddr.addr = 0;
- return;
- }
-
- dns_cb_arg->host_ipaddr.addr = ipaddr->addr;
- if (dns_cb_arg->var)
- env_set(dns_cb_arg->var, ipstr);
+ ip_addr_set(&dns_cb_arg->host_ipaddr, ipaddr);
}
static int dns_loop(struct udevice *udev, const char *name, const char *var)
{
struct dns_cb_arg dns_cb_arg = { };
struct netif *netif;
+ const char *ipstr;
ip_addr_t ipaddr;
ulong start;
int ret;
- dns_cb_arg.var = var;
-
netif = net_lwip_new_netif(udev);
if (!netif)
return CMD_RET_FAILURE;
@@ -84,9 +75,12 @@ static int dns_loop(struct udevice *udev, const char *name, const char *var)
net_lwip_remove_netif(netif);
- if (dns_cb_arg.done && dns_cb_arg.host_ipaddr.addr != 0) {
- if (!var)
- printf("%s\n", ipaddr_ntoa(&ipaddr));
+ if (dns_cb_arg.done && !ip_addr_isany(&dns_cb_arg.host_ipaddr)) {
+ ipstr = ipaddr_ntoa(&dns_cb_arg.host_ipaddr);
+ if (var)
+ env_set(var, ipstr);
+ else
+ printf("%s\n", ipstr);
return CMD_RET_SUCCESS;
}
diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c
index c325e923d20..0c83c004cab 100644
--- a/net/lwip/net-lwip.c
+++ b/net/lwip/net-lwip.c
@@ -103,9 +103,9 @@ struct netif *net_lwip_get_netif(void)
static int get_udev_ipv4_info(struct udevice *dev, ip4_addr_t *ip,
ip4_addr_t *mask, ip4_addr_t *gw)
{
- char ipstr[] = "ipaddr\0\0";
- char maskstr[] = "netmask\0\0";
- char gwstr[] = "gatewayip\0\0";
+ char ipstr[] = "ipaddr\0\0\0";
+ char maskstr[] = "netmask\0\0\0";
+ char gwstr[] = "gatewayip\0\0\0";
int idx = dev_seq(dev);
char *env;
diff --git a/net/lwip/nfs.c b/net/lwip/nfs.c
index 27579af8f1f..c3b819a091e 100644
--- a/net/lwip/nfs.c
+++ b/net/lwip/nfs.c
@@ -3,6 +3,7 @@
#include <console.h>
#include <display_options.h>
+#include <dm/device.h>
#include <env.h>
#include <image.h>
#include <linux/kconfig.h>
@@ -58,7 +59,7 @@ static void nfs_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p,
int plen;
struct rpc_t rpc_pkt;
- if (addr->addr != ctx->nfs_server.addr)
+ if (!ip_addr_eq(addr, &ctx->nfs_server))
goto exitfree;
if (p->tot_len > sizeof(struct rpc_t))
@@ -116,10 +117,10 @@ static int nfs_loop(struct udevice *udev, ulong addr, char *fname,
nfs_filename = nfs_basename(fname);
nfs_path = nfs_dirname(fname);
- printf("Using %s device\n", eth_get_name());
+ printf("Using %s device\n", udev->name);
printf("File transfer via NFS from server %s; our IP address is %s\n",
- ip4addr_ntoa(&srvip), env_get("ipaddr"));
+ ipaddr_ntoa(&srvip), env_get("ipaddr"));
printf("\nFilename '%s/%s'.", nfs_path, nfs_filename);
@@ -143,7 +144,7 @@ static int nfs_loop(struct udevice *udev, ulong addr, char *fname,
net_set_state(NETLOOP_CONTINUE);
- sess_ctx.nfs_server.addr = srvip.addr;
+ ip_addr_set(&sess_ctx.nfs_server, &srvip);
nfs_send();
@@ -247,9 +248,11 @@ int do_nfs(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
}
if (!server_ip)
+ server_ip = env_get("nfsserverip");
+ if (!server_ip)
server_ip = env_get("serverip");
if (!server_ip) {
- log_err("*** ERROR: 'serverip' not set\n");
+ log_err("error: nfsserverip/serverip not set\n");
ret = CMD_RET_FAILURE;
goto out;
}
diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c
index 6c7ffba661e..86516e66273 100644
--- a/net/lwip/tftp.c
+++ b/net/lwip/tftp.c
@@ -180,7 +180,7 @@ static int tftp_loop(struct udevice *udev, ulong addr, char *fname,
printf("Using %s device\n", udev->name);
printf("TFTP from server %s; our IP address is %s\n",
- ip4addr_ntoa(&srvip), env_get("ipaddr"));
+ ipaddr_ntoa(&srvip), env_get("ipaddr"));
printf("Filename '%s'.\n", fname);
printf("Load address: 0x%lx\n", ctx.daddr);
printf("Loading: ");