[U-Boot] [PATCH v3 09/11] riscv: hang if relocation of secondary harts fails

Anup Patel Anup.Patel at wdc.com
Mon Mar 18 13:00:50 UTC 2019



> -----Original Message-----
> From: Lukas Auer <lukas.auer at aisec.fraunhofer.de>
> Sent: Sunday, March 17, 2019 11:59 PM
> To: u-boot at lists.denx.de
> Cc: Anup Patel <Anup.Patel at wdc.com>; Andreas Schwab
> <schwab at suse.de>; Bin Meng <bmeng.cn at gmail.com>; Atish Patra
> <Atish.Patra at wdc.com>; Palmer Dabbelt <palmer at sifive.com>; Lukas Auer
> <lukas.auer at aisec.fraunhofer.de>; Atish Patra <Atish.Patra at wdc.com>;
> Anup Patel <anup at brainfault.org>; Rick Chen <rick at andestech.com>
> Subject: [PATCH v3 09/11] riscv: hang if relocation of secondary harts fails
> 
> Print an error message and hang if smp_call_function() returns an error,
> indicating that relocation of the secondary harts has failed.
> 
> Signed-off-by: Lukas Auer <lukas.auer at aisec.fraunhofer.de>
> ---
> 
> Changes in v3:
> - New patch to hang if relocation of secondary harts fails
> 
> Changes in v2: None
> 
>  arch/riscv/cpu/start.S | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S index
> 5ac899b141..a4433fbd6b 100644
> --- a/arch/riscv/cpu/start.S
> +++ b/arch/riscv/cpu/start.S
> @@ -33,6 +33,10 @@
>  #define SYM_SIZE		0x18
>  #endif
> 
> +.section .data
> +secondary_harts_relocation_error:
> +	.ascii "Relocation of secondary harts has failed, error %d\n"
> +
>  .section .text
>  .globl _start
>  _start:
> @@ -274,8 +278,15 @@ relocate_secondary_harts:
>  	mv	a2, s3
>  	jal	smp_call_function
> 
> +	/* hang if relocation of secondary harts has failed */
> +	beqz	a0, 1f
> +	mv	a1, a0
> +	la	a0, secondary_harts_relocation_error
> +	jal	printf
> +	jal	hang
> +
>  	/* restore relocation offset */
> -	mv	t6, s5
> +1:	mv	t6, s5
>  #endif
> 
>  /*
> --
> 2.20.1

Reviewed-by: Anup Patel <anup.patel at wdc.com>


More information about the U-Boot mailing list