From: Mateusz Holenko Date: Tue, 25 Jun 2019 09:59:22 +0000 (+0200) Subject: bios: add fw (flash write) command X-Git-Tag: 24jan2021_ls180~1143^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2ee194b2595ecf32b9241f957b2ee016d237bdbd;p=litex.git bios: add fw (flash write) command --- diff --git a/litex/soc/software/bios/main.c b/litex/soc/software/bios/main.c index 11cdb3a5..5c21e6b5 100644 --- a/litex/soc/software/bios/main.c +++ b/litex/soc/software/bios/main.c @@ -31,6 +31,10 @@ #include #endif +#ifdef FLASH_BOOT_ADDRESS +#include +#endif + #include "sdram.h" #include "boot.h" @@ -136,6 +140,40 @@ static void mw(char *addr, char *value, char *count) for (i=0;i [count]\n"); + return; + } + addr2 = strtoul(addr, &c, 0); + if(*c != 0) { + printf("incorrect offset\n"); + return; + } + value2 = strtoul(value, &c, 0); + if(*c != 0) { + printf("incorrect value\n"); + return; + } + if(*count == 0) { + count2 = 1; + } else { + count2 = strtoul(count, &c, 0); + if(*c != 0) { + printf("incorrect count\n"); + return; + } + } + for (i=0;i