diff options
| author | Simon Glass <[email protected]> | 2023-12-15 20:14:08 -0700 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-12-21 16:07:52 -0500 |
| commit | 6557eb73d65428cd1364c823c85fe3e4f8736deb (patch) | |
| tree | 0e7d55bca850c0047c551501f1eb566192050b9e | |
| parent | 5ee545a9db7455abec8c33bae0cbda0b1c3b66d4 (diff) | |
nios2: Add a reset_cpu() function
The current do_reset() is called from a command context. Add a function
which can be used from anywhere, as is done on ARM.
Signed-off-by: Simon Glass <[email protected]>
| -rw-r--r-- | arch/nios2/cpu/cpu.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c index 79a54d1bc25..de7bfa947f1 100644 --- a/arch/nios2/cpu/cpu.c +++ b/arch/nios2/cpu/cpu.c @@ -35,11 +35,17 @@ int checkboard(void) } #endif -int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +void reset_cpu(void) { disable_interrupts(); /* indirect call to go beyond 256MB limitation of toolchain */ nios2_callr(gd->arch.reset_addr); +} + +int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +{ + reset_cpu(); + return 0; } |
