From 172dc18dfb13f59fc79259fcdde2906a517c2a7a Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 3 Dec 2020 12:11:48 +0100 Subject: [PATCH] bios/boot: remove SFL_CMD_LOAD_NO_CRC support (non longer useful since CRC checking is now fast). --- litex/soc/software/bios/boot.c | 27 ++++++++++++--------------- litex/soc/software/bios/sfl.h | 1 - 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/litex/soc/software/bios/boot.c b/litex/soc/software/bios/boot.c index 51e482169..6480e4773 100644 --- a/litex/soc/software/bios/boot.c +++ b/litex/soc/software/bios/boot.c @@ -189,20 +189,18 @@ int serialboot(void) frame.payload[i] = uart_read(); /* Check Frame CRC (if CMD has a CRC) */ - if (frame.cmd != SFL_CMD_LOAD_NO_CRC) { - actualcrc = ((int)frame.crc[0] << 8)|(int)frame.crc[1]; - goodcrc = crc16(&frame.cmd, frame.payload_length+1); - if(actualcrc != goodcrc) { - /* Clear out the RX buffer */ - while (uart_read_nonblock()) uart_read(); - failed++; - if(failed == MAX_FAILED) { - printf("Too many consecutive errors, aborting"); - return 1; - } - uart_write(SFL_ACK_CRCERROR); - continue; + actualcrc = ((int)frame.crc[0] << 8)|(int)frame.crc[1]; + goodcrc = crc16(&frame.cmd, frame.payload_length+1); + if(actualcrc != goodcrc) { + /* Clear out the RX buffer */ + while (uart_read_nonblock()) uart_read(); + failed++; + if(failed == MAX_FAILED) { + printf("Too many consecutive errors, aborting"); + return 1; } + uart_write(SFL_ACK_CRCERROR); + continue; } /* Execute Frame CMD */ @@ -211,8 +209,7 @@ int serialboot(void) failed = 0; uart_write(SFL_ACK_SUCCESS); return 1; - case SFL_CMD_LOAD: - case SFL_CMD_LOAD_NO_CRC: { + case SFL_CMD_LOAD: { char *writepointer; failed = 0; diff --git a/litex/soc/software/bios/sfl.h b/litex/soc/software/bios/sfl.h index b09aee485..6079b07a8 100644 --- a/litex/soc/software/bios/sfl.h +++ b/litex/soc/software/bios/sfl.h @@ -19,7 +19,6 @@ struct sfl_frame { #define SFL_CMD_ABORT 0x00 #define SFL_CMD_LOAD 0x01 #define SFL_CMD_JUMP 0x02 -#define SFL_CMD_LOAD_NO_CRC 0x03 #define SFL_CMD_FLASH 0x04 #define SFL_CMD_REBOOT 0x05