From: Florent Kermarrec Date: Mon, 6 Aug 2018 10:23:50 +0000 (+0200) Subject: soc/software/bios: add reboot command X-Git-Tag: 24jan2021_ls180~1658 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0429ee9f8fd75dd99b4085c4dde802de166bbe93;p=litex.git soc/software/bios: add reboot command --- diff --git a/litex/soc/software/bios/main.c b/litex/soc/software/bios/main.c index 4d06d131..73613a0e 100644 --- a/litex/soc/software/bios/main.c +++ b/litex/soc/software/bios/main.c @@ -313,6 +313,9 @@ static void help(void) puts("rcsr - read processor CSR"); puts("wcsr - write processor CSR"); #endif +#ifdef CSR_CTRL_BASE + puts("reboot - reset processor"); +#endif #ifdef CSR_ETHMAC_BASE puts("netboot - boot via TFTP"); #endif @@ -344,6 +347,13 @@ static char *get_token(char **str) return d; } +#ifdef CSR_CTRL_BASE +static void reboot(void) +{ + ctrl_reset_write(1); +} +#endif + static void do_command(char *c) { char *token; @@ -359,7 +369,9 @@ static void do_command(char *c) #ifdef L2_SIZE else if(strcmp(token, "flushl2") == 0) flush_l2_cache(); #endif - +#ifdef CSR_CTRL_BASE + else if(strcmp(token, "reboot") == 0) reboot(); +#endif #ifdef FLASH_BOOT_ADDRESS else if(strcmp(token, "flashboot") == 0) flashboot(); #endif