diff options
-rw-r--r-- | board/microchip/mpfs_icicle/mpfs_icicle.c | 4 | ||||
-rw-r--r-- | drivers/net/Kconfig | 2 | ||||
-rw-r--r-- | drivers/net/designware.c | 2 | ||||
-rw-r--r-- | lib/lwip/u-boot/lwipopts.h | 1 | ||||
-rw-r--r-- | net/lwip/dhcp.c | 14 | ||||
-rw-r--r-- | net/lwip/net-lwip.c | 4 |
6 files changed, 22 insertions, 5 deletions
diff --git a/board/microchip/mpfs_icicle/mpfs_icicle.c b/board/microchip/mpfs_icicle/mpfs_icicle.c index 739a9b6cd76..c99207bc89b 100644 --- a/board/microchip/mpfs_icicle/mpfs_icicle.c +++ b/board/microchip/mpfs_icicle/mpfs_icicle.c @@ -74,7 +74,7 @@ int board_fit_config_name_match(const char *name) int board_fdt_blob_setup(void **fdtp) { - fdtp = (void *)_end; + *fdtp = (void *)_end; /* * The devicetree provided by the previous stage is very minimal due to @@ -85,7 +85,7 @@ int board_fdt_blob_setup(void **fdtp) */ if (IS_ENABLED(CONFIG_OF_BOARD) && !IS_ENABLED(CONFIG_MULTI_DTB_FIT)) { if (gd->arch.firmware_fdt_addr) - fdtp = (void *)(uintptr_t)gd->arch.firmware_fdt_addr; + *fdtp = (void *)(uintptr_t)gd->arch.firmware_fdt_addr; } return 0; diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index d1cb69f85ad..7ae28c4e0d5 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -662,7 +662,7 @@ config MII config RMII bool "Enable RMII" help - Enable support of the Reduced Media-Independent Interface (MII) + Enable support of the Reduced Media-Independent Interface (RMII) config PCNET bool "AMD PCnet series Ethernet controller driver" diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 7ecedc3d7f0..2fd92cf16bb 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -894,7 +894,7 @@ int designware_eth_probe(struct udevice *dev) if (ret) { debug("%s: No phy supply\n", dev->name); } else { - ret = regulator_set_enable(phy_supply, true); + ret = regulator_set_enable_if_allowed(phy_supply, true); if (ret) { puts("Error enabling phy supply\n"); return ret; diff --git a/lib/lwip/u-boot/lwipopts.h b/lib/lwip/u-boot/lwipopts.h index 80b93ea172d..e8a2c9d7a0a 100644 --- a/lib/lwip/u-boot/lwipopts.h +++ b/lib/lwip/u-boot/lwipopts.h @@ -44,6 +44,7 @@ #define DNS_DEBUG LWIP_DBG_ON #define IP6_DEBUG LWIP_DBG_OFF #define DHCP6_DEBUG LWIP_DBG_OFF +#define SNTP_DEBUG LWIP_DBG_ON #endif #define LWIP_TESTMODE 0 diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c index 4c9cb0ecaa0..531bf2c6705 100644 --- a/net/lwip/dhcp.c +++ b/net/lwip/dhcp.c @@ -8,6 +8,7 @@ #include <dm/device.h> #include <linux/delay.h> #include <linux/errno.h> +#include <lwip/apps/sntp.h> #include <lwip/dhcp.h> #include <lwip/dns.h> #include <lwip/timeouts.h> @@ -32,6 +33,7 @@ static int dhcp_loop(struct udevice *udev) char ipstr[] = "ipaddr\0\0"; char maskstr[] = "netmask\0\0"; char gwstr[] = "gatewayip\0\0"; + const ip_addr_t *ntpserverip; unsigned long start; struct netif *netif; struct dhcp *dhcp; @@ -48,6 +50,13 @@ static int dhcp_loop(struct udevice *udev) if (!netif) return CMD_RET_FAILURE; + /* + * Request the DHCP stack to parse and store the NTP servers for + * eventual use by the SNTP command + */ + if (CONFIG_IS_ENABLED(CMD_SNTP)) + sntp_servermode_dhcp(1); + start = get_timer(0); if (dhcp_start(netif)) @@ -102,6 +111,11 @@ static int dhcp_loop(struct udevice *udev) strncpy(boot_file_name, dhcp->boot_file_name, sizeof(boot_file_name)); #endif + if (CONFIG_IS_ENABLED(CMD_SNTP)) { + ntpserverip = sntp_getserver(1); + if (ntpserverip != IP_ADDR_ANY) + env_set("ntpserverip", ip4addr_ntoa(ntpserverip)); + } printf("DHCP client bound to address %pI4 (%lu ms)\n", &dhcp->offered_ip_addr, get_timer(start)); diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index 1a70cedfb58..8741f65fe12 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -7,6 +7,7 @@ #include <dm/device.h> #include <dm/uclass.h> #include <hexdump.h> +#include <linux/compiler_attributes.h> #include <linux/kernel.h> #include <lwip/ip4_addr.h> #include <lwip/dns.h> @@ -30,7 +31,8 @@ void (*push_packet)(void *, int len) = 0; int net_try_count; static int net_restarted; int net_restart_wrap; -static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN]; +static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN] + __aligned(PKTALIGN); uchar *net_rx_packets[PKTBUFSRX]; uchar *net_rx_packet; const u8 net_bcast_ethaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; |