[PATCH 08/21] sandbox: Enable wget command

Simon Glass sjg at chromium.org
Sat Aug 10 22:51:52 CEST 2024


Enable this so that the tests run.

Fix a few warnings in the code so that CI passes.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 cmd/Kconfig | 1 +
 net/wget.c  | 7 +++----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 8af136d2bd4..43f78a5aeb1 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -2010,6 +2010,7 @@ config SYS_DISABLE_AUTOLOAD
 config CMD_WGET
 	bool "wget"
 	select PROT_TCP
+	default y if SANDBOX
 	help
 	  wget is a simple command to download kernel, or other files,
 	  from a http server over TCP.
diff --git a/net/wget.c b/net/wget.c
index 5eabb413116..57fd122fd50 100644
--- a/net/wget.c
+++ b/net/wget.c
@@ -243,7 +243,7 @@ static void wget_connected(uchar *pkt, unsigned int tcp_seq_num,
 		pkt_in_q = (void *)image_load_addr + PKT_QUEUE_OFFSET +
 			(pkt_q_idx * PKT_QUEUE_PACKET_SIZE);
 
-		ptr1 = map_sysmem((phys_addr_t)pkt_in_q, len);
+		ptr1 = map_sysmem((ulong)pkt_in_q, len);
 		memcpy(ptr1, pkt, len);
 		unmap_sysmem(ptr1);
 
@@ -312,9 +312,8 @@ static void wget_connected(uchar *pkt, unsigned int tcp_seq_num,
 			for (i = 0; i < pkt_q_idx; i++) {
 				int err;
 
-				ptr1 = map_sysmem(
-					(phys_addr_t)(pkt_q[i].pkt),
-					pkt_q[i].len);
+				ptr1 = map_sysmem((ulong)pkt_q[i].pkt,
+						  pkt_q[i].len);
 				err = store_block(ptr1,
 					  pkt_q[i].tcp_seq_num -
 					  initial_data_seq_num,
-- 
2.34.1



More information about the U-Boot mailing list