aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2009-08-27 08:23:55 -0500
committerWolfgang Denk <wd@denx.de>2009-09-04 22:11:23 +0200
commit3dfad40a0459f63099e177dc15a1df39d048f860 (patch)
tree48bebaedba3c6230fc922fa7e538d082ec9636b7 /common
parent9ea005fb4428c922536fa75991ce9972304a02fb (diff)
downloadu-boot-midas-3dfad40a0459f63099e177dc15a1df39d048f860.tar.gz
u-boot-midas-3dfad40a0459f63099e177dc15a1df39d048f860.tar.bz2
u-boot-midas-3dfad40a0459f63099e177dc15a1df39d048f860.zip
Add ability for arch code to make changes before we boot
Added a arch_preboot_os() function that cpu specific code can implement to allow for various modifications to the state of the machine right before we boot. This can be useful to setup register state to a specific configuration. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_bootm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 86c81220d2..365ceebdf0 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb)
}
void arch_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__arch_lmb_reserve")));
+/* Allow for arch specific config before we boot */
+void __arch_preboot_os(void)
+{
+ /* please define platform specific arch_preboot_os() */
+}
+void arch_preboot_os(void) __attribute__((weak, alias("__arch_preboot_os")));
+
#if defined(__ARM__)
#define IH_INITRD_ARCH IH_ARCH_ARM
#elif defined(__avr32__)
@@ -543,6 +550,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
break;
case BOOTM_STATE_OS_GO:
disable_interrupts();
+ arch_preboot_os();
boot_fn(BOOTM_STATE_OS_GO, argc, argv, &images);
break;
}
@@ -673,6 +681,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1;
}
+ arch_preboot_os();
+
boot_fn(0, argc, argv, &images);
show_boot_progress (-9);