Skip to contentSkip to conversation

U-boot patches

PATCH Sjöberg Andreas 2 participants 2 messages Sep 8, 2021 Networking

lore
Share & tools
lore
#0 lore raw

Hi,
We have two patch files for u-boot:

Bootelf_async_abort_fix.patch:
Booting a .elf files sometimes triggers an asynchronous abort error disabling the icache and dcahe before boot turned out to prevent this and this patch adds disabling of these caches as a part of the bootelf command.

Tftp_next_ack_update:
When running tftp without any additional options (i.e no oack gets sent) the client does not change the expected block number of the next package from 0 to tftp_windowsize preventing acknowledgement of received data. There also was no prober mreset for this counter that instead only reset upon receiveing an oack. This patch increments the value of next_ack when receiving a data packet instead of an oack and also ensures that sending a new read request or write request resets the counter to 0, indicating that the next packet should be an oack.

/Andreas Sjöberg

net/tftp.c +2 -0
index 2cfa0b1486..479bfa72a8 100644
@@ -355,6 +355,7 @@ static void tftp_send(void)
 	switch (tftp_state) {
 	case STATE_SEND_RRQ:
 	case STATE_SEND_WRQ:
+	        tftp_next_ack = 0;
 		xp = pkt;
 		s = (ushort *)pkt;
 #ifdef CONFIG_CMD_TFTPPUT
@@ -631,6 +632,7 @@ static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
 		tftp_cur_block %= TFTP_SEQUENCE_SIZE;
 
 		if (tftp_state == STATE_SEND_RRQ)
+		  tftp_next_ack += tftp_windowsize;
 			debug("Server did not acknowledge any options!\n");
 
 		if (tftp_state == STATE_SEND_RRQ || tftp_state == STATE_OACK ||
cmd/elf.c +2 -0
index d44b95d903..77d8abf997 100644
@@ -25,6 +25,8 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]),
 				     int argc, char *const argv[])
 {
 	unsigned long ret;
+	icache_disable();
+	dcache_disable();
 
 	/*
 	 * pass address parameter as argv[0] (aka command name),
#1 lore raw
Quoted 10 lines · Sjöberg Andreas

Hi,
We have two patch files for u-boot:

Bootelf_async_abort_fix.patch:
Booting a .elf files sometimes triggers an asynchronous abort error disabling the icache and dcahe before boot turned out to prevent this and this patch adds disabling of these caches as a part of the bootelf command.

Tftp_next_ack_update:
When running tftp without any additional options (i.e no oack gets sent) the client does not change the expected block number of the next package from 0 to tftp_windowsize preventing acknowledgement of received data. There also was no prober mreset for this counter that instead only reset upon receiveing an oack. This patch increments the value of next_ack when receiving a data packet instead of an oack and also ensures that sending a new read request or write request resets the counter to 0, indicating that the next packet should be an oack.

/Andreas Sjöberg

Please see http://www.denx.de/wiki/U-Boot/Patches and re-post each of these patches with a proper commit message, thanks!

Signature · 1 line
Tom