Skip to content

Commit 662672d

Browse files
committed
Pull request net-20250930 net-common: - DesignWare: avoid regulator enable failure - Fix RMII help text net-lwip: - Ensure alignment of packet buffers - Use NTP server(s) obtained from DHCP
2 parents a239b0b + b2217c9 commit 662672d

5 files changed

Lines changed: 20 additions & 3 deletions

File tree

drivers/net/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ config MII
662662
config RMII
663663
bool "Enable RMII"
664664
help
665-
Enable support of the Reduced Media-Independent Interface (MII)
665+
Enable support of the Reduced Media-Independent Interface (RMII)
666666

667667
config PCNET
668668
bool "AMD PCnet series Ethernet controller driver"

drivers/net/designware.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ int designware_eth_probe(struct udevice *dev)
894894
if (ret) {
895895
debug("%s: No phy supply\n", dev->name);
896896
} else {
897-
ret = regulator_set_enable(phy_supply, true);
897+
ret = regulator_set_enable_if_allowed(phy_supply, true);
898898
if (ret) {
899899
puts("Error enabling phy supply\n");
900900
return ret;

lib/lwip/u-boot/lwipopts.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#define DNS_DEBUG LWIP_DBG_ON
4545
#define IP6_DEBUG LWIP_DBG_OFF
4646
#define DHCP6_DEBUG LWIP_DBG_OFF
47+
#define SNTP_DEBUG LWIP_DBG_ON
4748
#endif
4849

4950
#define LWIP_TESTMODE 0

net/lwip/dhcp.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <dm/device.h>
99
#include <linux/delay.h>
1010
#include <linux/errno.h>
11+
#include <lwip/apps/sntp.h>
1112
#include <lwip/dhcp.h>
1213
#include <lwip/dns.h>
1314
#include <lwip/timeouts.h>
@@ -32,6 +33,7 @@ static int dhcp_loop(struct udevice *udev)
3233
char ipstr[] = "ipaddr\0\0";
3334
char maskstr[] = "netmask\0\0";
3435
char gwstr[] = "gatewayip\0\0";
36+
const ip_addr_t *ntpserverip;
3537
unsigned long start;
3638
struct netif *netif;
3739
struct dhcp *dhcp;
@@ -48,6 +50,13 @@ static int dhcp_loop(struct udevice *udev)
4850
if (!netif)
4951
return CMD_RET_FAILURE;
5052

53+
/*
54+
* Request the DHCP stack to parse and store the NTP servers for
55+
* eventual use by the SNTP command
56+
*/
57+
if (CONFIG_IS_ENABLED(CMD_SNTP))
58+
sntp_servermode_dhcp(1);
59+
5160
start = get_timer(0);
5261

5362
if (dhcp_start(netif))
@@ -102,6 +111,11 @@ static int dhcp_loop(struct udevice *udev)
102111
strncpy(boot_file_name, dhcp->boot_file_name,
103112
sizeof(boot_file_name));
104113
#endif
114+
if (CONFIG_IS_ENABLED(CMD_SNTP)) {
115+
ntpserverip = sntp_getserver(1);
116+
if (ntpserverip != IP_ADDR_ANY)
117+
env_set("ntpserverip", ip4addr_ntoa(ntpserverip));
118+
}
105119

106120
printf("DHCP client bound to address %pI4 (%lu ms)\n",
107121
&dhcp->offered_ip_addr, get_timer(start));

net/lwip/net-lwip.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <dm/device.h>
88
#include <dm/uclass.h>
99
#include <hexdump.h>
10+
#include <linux/compiler_attributes.h>
1011
#include <linux/kernel.h>
1112
#include <lwip/ip4_addr.h>
1213
#include <lwip/dns.h>
@@ -30,7 +31,8 @@ void (*push_packet)(void *, int len) = 0;
3031
int net_try_count;
3132
static int net_restarted;
3233
int net_restart_wrap;
33-
static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN];
34+
static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN]
35+
__aligned(PKTALIGN);
3436
uchar *net_rx_packets[PKTBUFSRX];
3537
uchar *net_rx_packet;
3638
const u8 net_bcast_ethaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };

0 commit comments

Comments
 (0)