Merge branch '2024-11-22-assorted-fixes'

- Assorted additional lwIP fixes
- Assorted test fixes
- Assorted other localized fixes
diff --git a/board/armltd/total_compute/MAINTAINERS b/board/armltd/total_compute/MAINTAINERS
index 3dc1cd1..92486f4 100644
--- a/board/armltd/total_compute/MAINTAINERS
+++ b/board/armltd/total_compute/MAINTAINERS
@@ -1,5 +1,5 @@
 TOTAL_COMPUTE BOARD
-M:	Usama Arif <usama.arif@arm.com>
+M:	Ben Horgan <ben.horgan@arm.com>
 S:	Maintained
 F:	board/armltd/total_compute/
 F:	include/configs/total_compute.h
diff --git a/cmd/Kconfig b/cmd/Kconfig
index b2d0348..1d7ddb4 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -2016,7 +2016,9 @@
 config CMD_CDP
 	bool "cdp"
 	help
-	  Perform CDP network configuration
+	  The cdp command is used to announce the U-Boot device in the network
+	  and to retrieve configuration data including the VLAN id using the
+	  proprietary Cisco Discovery Protocol (CDP).
 
 config CMD_SNTP
 	bool "sntp"
diff --git a/cmd/net-lwip.c b/cmd/net-lwip.c
index 6f5fc74..0fd446e 100644
--- a/cmd/net-lwip.c
+++ b/cmd/net-lwip.c
@@ -27,6 +27,9 @@
 #endif
 
 #if defined(CONFIG_CMD_WGET)
-U_BOOT_CMD(wget, 3, 1, do_wget, "boot image via network using HTTP protocol",
-	   "[loadAddress] URL");
+U_BOOT_CMD(wget, 3, 1, do_wget,
+	   "boot image via network using HTTP/HTTPS protocol",
+	   "[loadAddress] url\n"
+	   "wget [loadAddress] [host:]path"
+);
 #endif
diff --git a/dts/upstream/src/arm64/ti/k3-j7200-som-p0.dtsi b/dts/upstream/src/arm64/ti/k3-j7200-som-p0.dtsi
index 21fe194..014cf18 100644
--- a/dts/upstream/src/arm64/ti/k3-j7200-som-p0.dtsi
+++ b/dts/upstream/src/arm64/ti/k3-j7200-som-p0.dtsi
@@ -124,6 +124,7 @@
 	};
 
 	mcu_fss0_ospi0_pins_default: mcu-fss0-ospi0-default-pins {
+		bootph-all;
 		pinctrl-single,pins = <
 			J721E_WKUP_IOPAD(0x0000, PIN_OUTPUT, 0) /* MCU_OSPI0_CLK */
 			J721E_WKUP_IOPAD(0x002c, PIN_OUTPUT, 0) /* MCU_OSPI0_CSn0 */
diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c
index 23b5622..9b882cf 100644
--- a/net/lwip/dhcp.c
+++ b/net/lwip/dhcp.c
@@ -27,9 +27,9 @@
 
 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";
+	char maskstr[] = "netmask\0\0";
+	char gwstr[] = "gatewayip\0\0";
 	unsigned long start;
 	struct netif *netif;
 	struct dhcp *dhcp;
@@ -111,9 +111,21 @@
 
 int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
+	int ret;
+
 	eth_set_current();
 
-	return dhcp_loop(eth_get_dev());
+	ret = dhcp_loop(eth_get_dev());
+	if (ret)
+		return ret;
+
+	if (argc > 1) {
+		struct cmd_tbl cmdtp = {};
+
+		return do_tftpb(&cmdtp, 0, argc, argv);
+	}
+
+	return CMD_RET_SUCCESS;
 }
 
 int dhcp_run(ulong addr, const char *fname, bool autoload)
diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c
index 4702177..b863047 100644
--- a/net/lwip/net-lwip.c
+++ b/net/lwip/net-lwip.c
@@ -91,9 +91,9 @@
 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";
+	char maskstr[] = "netmask\0\0";
+	char gwstr[] = "gatewayip\0\0";
 	int idx = dev_seq(dev);
 	char *env;
 
diff --git a/net/lwip/wget.c b/net/lwip/wget.c
index e85d57b..062aa7c 100644
--- a/net/lwip/wget.c
+++ b/net/lwip/wget.c
@@ -42,7 +42,6 @@
 			  size_t *olen)
 {
 	struct udevice *dev;
-	u64 rng = 0;
 	int ret;
 
 	*olen = 0;
@@ -52,12 +51,11 @@
 		log_err("Failed to get an rng: %d\n", ret);
 		return ret;
 	}
-	ret = dm_rng_read(dev, &rng, sizeof(rng));
+	ret = dm_rng_read(dev, output, len);
 	if (ret)
 		return ret;
 
-	memcpy(output, &rng, len);
-	*olen = sizeof(rng);
+	*olen = len;
 
 	return 0;
 }
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
index 9397328..da713d8 100644
--- a/test/boot/bootflow.c
+++ b/test/boot/bootflow.c
@@ -1197,7 +1197,7 @@
 
 	return 0;
 }
-BOOTSTD_TEST(bootflow_cros, UTF_CONSOLE);
+BOOTSTD_TEST(bootflow_cros, UTF_CONSOLE | UTF_DM | UTF_SCAN_FDT);
 
 /* Test Android bootmeth  */
 static int bootflow_android(struct unit_test_state *uts)
@@ -1220,7 +1220,7 @@
 
 	return 0;
 }
-BOOTSTD_TEST(bootflow_android, UTF_CONSOLE);
+BOOTSTD_TEST(bootflow_android, UTF_CONSOLE | UTF_DM | UTF_SCAN_FDT);
 
 /* Test EFI bootmeth */
 static int bootflow_efi(struct unit_test_state *uts)
diff --git a/test/lib/str.c b/test/lib/str.c
index 3cc9dfe..e620453 100644
--- a/test/lib/str.c
+++ b/test/lib/str.c
@@ -18,6 +18,8 @@
 static const char str5[] = "0x9876543210the last time I was deloused";
 static const char str6[] = "0778octal is seldom used";
 static const char str7[] = "707it is a piece of computing history";
+static const char str8[] = "0x887e2561352d80fa";
+static const char str9[] = "614FF7EAA63009DA";
 
 static int str_upper(struct unit_test_state *uts)
 {
@@ -186,6 +188,22 @@
 }
 LIB_TEST(str_hextoul, 0);
 
+static int str_hextoull(struct unit_test_state *uts)
+{
+	char *endp;
+
+	/* Just a simple test, since we know this uses simple_strtoull() */
+	ut_asserteq_64(0x887e2561352d80faULL, hextoull(str8, &endp));
+	ut_asserteq_64(0x12, endp - str8);
+	ut_asserteq_64(0x614ff7eaa63009daULL, hextoull(str9, &endp));
+	ut_asserteq_64(0x10, endp - str9);
+	ut_asserteq_64(0x887e2561352d80faULL, hextoull(str8, NULL));
+	ut_asserteq_64(0x614ff7eaa63009daULL, hextoull(str9, NULL));
+
+	return 0;
+}
+LIB_TEST(str_hextoull, 0);
+
 static int str_dectoul(struct unit_test_state *uts)
 {
 	char *endp;
diff --git a/test/lib/time.c b/test/lib/time.c
index b99e738..2095bef 100644
--- a/test/lib/time.c
+++ b/test/lib/time.c
@@ -22,7 +22,11 @@
 			next = get_timer(0);
 		} while (start == next);
 
-		ut_asserteq(start + 1, next);
+		if (start + 1 != next) {
+			printf("%s: iter=%d, start=%lu, next=%lu, expected a difference of 1\n",
+			       __func__, iter, start, next);
+			return -EINVAL;
+		}
 		start++;
 	}
 
@@ -31,7 +35,11 @@
 	 * an extra millisecond may have passed.
 	 */
 	diff = get_timer(base);
-	ut_assert(diff == iter || diff == iter + 1);
+	if (diff != iter && diff != iter + 1) {
+		printf("%s: expected get_timer(base) to match elapsed time: diff=%lu, expected=%d\n",
+		       __func__, diff, iter);
+			return -EINVAL;
+	}
 
 	return 0;
 }
@@ -49,8 +57,11 @@
 		next = timer_get_us();
 		if (next != prev) {
 			delta = next - prev;
-			ut_assert(delta >= 0);
-			if (delta) {
+			if (delta < 0) {
+				printf("%s: timer_get_us() went backwards from %lu to %lu\n",
+				       __func__, prev, next);
+				return -EINVAL;
+			} else if (delta != 0) {
 				if (delta < min)
 					min = delta;
 				prev = next;
@@ -59,7 +70,11 @@
 		}
 	}
 
-	ut_asserteq(1, min);
+	if (min != 1) {
+		printf("%s: Minimum microsecond delta should be 1 but is %lu\n",
+		       __func__, min);
+		return -EINVAL;
+	}
 
 	return 0;
 }
@@ -80,7 +95,8 @@
 	error = delta_us - 1000000;
 	printf("%s: Microsecond time for 1 second: %lu, error = %ld\n",
 	       __func__, delta_us, error);
-	ut_assert(abs(error) <= 1000);
+	if (abs(error) > 1000)
+		return -EINVAL;
 
 	return 0;
 }
@@ -99,7 +115,8 @@
 	error = delta - 1000;
 	printf("%s: Delay time for 1000 udelay(1000): %lu ms, error = %ld\n",
 	       __func__, delta, error);
-	ut_assert(abs(error) <= 100);
+	if (abs(error) > 100)
+		return -EINVAL;
 
 	return 0;
 }