Skip to content

Commit

Permalink
firmware: reboot device using CSR if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Binkowski committed Jan 23, 2020
1 parent e34dc9b commit 14a5150
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions firmware/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@

extern void boot_helper(unsigned int r1, unsigned int r2, unsigned int r3, unsigned int addr);

#ifdef CSR_CTRL_BASE
void reboot(void)
{
ctrl_reset_write(1);
}
#else
void reboot(void)
{
boot(0, 0, 0, CONFIG_CPU_RESET_ADDR);
}
#endif

void __attribute__((noreturn)) boot(unsigned int r1, unsigned int r2, unsigned int r3, unsigned int addr)
{
Expand Down

0 comments on commit 14a5150

Please sign in to comment.