aboutsummaryrefslogtreecommitdiff
path: root/arch/nios2
diff options
context:
space:
mode:
authorTom Rini2023-12-21 16:10:00 -0500
committerTom Rini2023-12-21 16:10:00 -0500
commit7c4647b8fb448ac658a9bc726681ad9e75e6b9e8 (patch)
tree5ecb1a3c90c2fc5c16176914748ad207005772a3 /arch/nios2
parentced928b1994b6dd8d133797f506c0991b0e6196d (diff)
parentd37086a95f4b2c39f9ecfe602b792df8ab3bd8f9 (diff)
Merge patch series "Complete decoupling of bootm logic from commands"
Simon Glass <sjg@chromium.org> says: This series continues refactoring the bootm code to allow it to be used with CONFIG_COMMAND disabled. The OS-handling code is refactored and a new bootm_run() function is created to run through the bootm stages. This completes the work. A booti_go() function is created also, in case it proves useful, but at last for now standard boot does not use this. This is cmdd (part d of CMDLINE refactoring) It depends on dm/bootstda-working which depends on dm/cmdc-working
Diffstat (limited to 'arch/nios2')
-rw-r--r--arch/nios2/cpu/cpu.c8
-rw-r--r--arch/nios2/lib/bootm.c10
2 files changed, 13 insertions, 5 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;
}
diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c
index 06c094d0f1c..657a17c7204 100644
--- a/arch/nios2/lib/bootm.c
+++ b/arch/nios2/lib/bootm.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <bootm.h>
#include <cpu_func.h>
#include <env.h>
#include <image.h>
@@ -16,9 +17,9 @@ DECLARE_GLOBAL_DATA_PTR;
#define NIOS_MAGIC 0x534f494e /* enable command line and initrd passing */
-int do_bootm_linux(int flag, int argc, char *const argv[],
- struct bootm_headers *images)
+int do_bootm_linux(int flag, struct bootm_info *bmi)
{
+ struct bootm_headers *images = bmi->images;
void (*kernel)(int, int, int, char *) = (void *)images->ep;
char *commandline = env_get("bootargs");
ulong initrd_start = images->rd_start;
@@ -29,8 +30,9 @@ int do_bootm_linux(int flag, int argc, char *const argv[],
if (images->ft_len)
of_flat_tree = images->ft_addr;
#endif
- if (!of_flat_tree && argc > 1)
- of_flat_tree = (char *)hextoul(argv[1], NULL);
+ /* TODO: Clean this up - the DT should already be set up */
+ if (!of_flat_tree && bmi->argc > 1)
+ of_flat_tree = (char *)hextoul(bmi->argv[1], NULL);
if (of_flat_tree)
initrd_end = (ulong)of_flat_tree;