[U-Boot] [PATCH] Add ability for arch code to make changes before we boot

Kumar Gala galak at kernel.crashing.org
Fri Aug 14 21:31:04 CEST 2009


On Aug 14, 2009, at 2:00 PM, Kumar Gala wrote:

> Added a arch_preboot() 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 at kernel.crashing.org>
> ---
> common/cmd_bootm.c |   10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)

If you can review and ack this if its ok that would be great.  I'd  
like to send this via the 85xx next tree as the patch for fixed IVORs  
depends on it.

- k

>
> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
> index 86c8122..766889a 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(void)
> +{
> +	/* please define platform specific arch_preboot() */
> +}
> +void arch_preboot(void) __attribute__((weak,  
> alias("__arch_preboot")));
> +
> #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();
> 			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();
> +
> 	boot_fn(0, argc, argv, &images);
>
> 	show_boot_progress (-9);
> -- 
> 1.6.0.6
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



More information about the U-Boot mailing list