From 2ee194b2595ecf32b9241f957b2ee016d237bdbd Mon Sep 17 00:00:00 2001 From: Mateusz Holenko Date: Tue, 25 Jun 2019 11:59:22 +0200 Subject: [PATCH] bios: add fw (flash write) command --- litex/soc/software/bios/main.c | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) 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