firmware/main: Use defines for misc CSR
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
aa3768a257
commit
7e50002216
|
@ -13,14 +13,17 @@
|
|||
|
||||
|
||||
struct wb_misc {
|
||||
uint32_t warmboot;
|
||||
uint32_t csr;
|
||||
} __attribute__((packed,aligned(4)));
|
||||
|
||||
#define MISC_CSR_WARMBOOT_NOW (1 << 2)
|
||||
#define MISC_CSR_WARMBOOT_SEL(x) (x)
|
||||
|
||||
static volatile struct wb_misc * const misc_regs = (void*)(MISC_BASE);
|
||||
|
||||
|
||||
void
|
||||
reboot(int fw)
|
||||
{
|
||||
misc_regs->warmboot = (1 << 2) | (fw << 0);
|
||||
misc_regs->csr = MISC_CSR_WARMBOOT_NOW | MISC_CSR_WARMBOOT_SEL(fw);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue