diff mbox series

[U-Boot,v2,1/3] mach-imx: bootaux: print stack pointer and reset vector

Message ID 20191128135621.12719-1-igor.opaniuk@gmail.com
State Accepted
Commit 0ba1b4de0e2d05a9b10cf25b1ee45631606db6ba
Delegated to: Stefano Babic
Headers show
Series [U-Boot,v2,1/3] mach-imx: bootaux: print stack pointer and reset vector | expand

Commit Message

Igor Opaniuk Nov. 28, 2019, 1:56 p.m. UTC
From: Igor Opaniuk <igor.opaniuk@toradex.com>

1. Change information printed about loaded M4 binary, print the stack
pointer and reset vector addressed.
2. Add sanity check for the address provided as param.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 arch/arm/mach-imx/imx_bootaux.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Oleksandr Suvorov Dec. 3, 2019, 2:33 p.m. UTC | #1
On Thu, Nov 28, 2019 at 3:56 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
>
> 1. Change information printed about loaded M4 binary, print the stack
> pointer and reset vector addressed.
> 2. Add sanity check for the address provided as param.
>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

> ---
>
>  arch/arm/mach-imx/imx_bootaux.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-imx/imx_bootaux.c b/arch/arm/mach-imx/imx_bootaux.c
> index 3d9422d5a2..ee786f7d06 100644
> --- a/arch/arm/mach-imx/imx_bootaux.c
> +++ b/arch/arm/mach-imx/imx_bootaux.c
> @@ -20,6 +20,9 @@ int arch_auxiliary_core_up(u32 core_id, ulong boot_private_data)
>         stack = *(u32 *)boot_private_data;
>         pc = *(u32 *)(boot_private_data + 4);
>
> +       printf("## Starting auxiliary core stack = 0x%08lX, pc = 0x%08lX...\n",
> +              stack, pc);
> +
>         /* Set the stack and pc to M4 bootROM */
>         writel(stack, M4_BOOTROM_BASE_ADDR);
>         writel(pc, M4_BOOTROM_BASE_ADDR + 4);
> @@ -80,7 +83,8 @@ static int do_bootaux(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>
>         addr = simple_strtoul(argv[1], NULL, 16);
>
> -       printf("## Starting auxiliary core at 0x%08lX ...\n", addr);
> +       if (!addr)
> +               return CMD_RET_FAILURE;
>
>         ret = arch_auxiliary_core_up(0, addr);
>         if (ret)
> --
> 2.17.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Stefano Babic Dec. 29, 2019, 10:25 a.m. UTC | #2
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
> 1. Change information printed about loaded M4 binary, print the stack
> pointer and reset vector addressed.
> 2. Add sanity check for the address provided as param.
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Applied to u-boot-imx, -next, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/imx_bootaux.c b/arch/arm/mach-imx/imx_bootaux.c
index 3d9422d5a2..ee786f7d06 100644
--- a/arch/arm/mach-imx/imx_bootaux.c
+++ b/arch/arm/mach-imx/imx_bootaux.c
@@ -20,6 +20,9 @@  int arch_auxiliary_core_up(u32 core_id, ulong boot_private_data)
 	stack = *(u32 *)boot_private_data;
 	pc = *(u32 *)(boot_private_data + 4);
 
+	printf("## Starting auxiliary core stack = 0x%08lX, pc = 0x%08lX...\n",
+	       stack, pc);
+
 	/* Set the stack and pc to M4 bootROM */
 	writel(stack, M4_BOOTROM_BASE_ADDR);
 	writel(pc, M4_BOOTROM_BASE_ADDR + 4);
@@ -80,7 +83,8 @@  static int do_bootaux(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	addr = simple_strtoul(argv[1], NULL, 16);
 
-	printf("## Starting auxiliary core at 0x%08lX ...\n", addr);
+	if (!addr)
+		return CMD_RET_FAILURE;
 
 	ret = arch_auxiliary_core_up(0, addr);
 	if (ret)