[U-Boot] [PATCH 2/6] common/cmd_boot: keep ARM v7M in thumb mode during do_go_exec()

Albert ARIBAUD albert.u.boot at aribaud.net
Thu Apr 16 15:53:56 CEST 2015


Hello Matt,

On Tue, 14 Apr 2015 14:07:18 -0400, Matt Porter <mporter at konsulko.com>
wrote:
> On ARM v7M, the processor will return to ARM mode when executing
> a blx instruction with bit 0 of the address == 0. Always set it
> to 1 to stay in thumb mode.

This should be done for all targets which build with Thumb instruction
set, not only ARMv7M, should it not?

> Signed-off-by: Matt Porter <mporter at konsulko.com>
> ---
>  common/cmd_boot.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/common/cmd_boot.c b/common/cmd_boot.c
> index 8f2e070..20ce652 100644
> --- a/common/cmd_boot.c
> +++ b/common/cmd_boot.c
> @@ -38,6 +38,10 @@ static int do_go(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  	 * pass address parameter as argv[0] (aka command name),
>  	 * and all remaining args
>  	 */
> +#ifdef CONFIG_CPU_V7M
> +	/* For ARM V7M, set bit zero to stay in Thumb mode */
> +	addr++;
> +#endif
>  	rc = do_go_exec ((void *)addr, argc - 1, argv + 1);
>  	if (rc != 0) rcode = 1;
>  
> -- 
> 2.1.0
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



Amicalement,
-- 
Albert.


More information about the U-Boot mailing list