diff mbox series

[V2,22/30] imx: bootaux: Fix bootaux issue when running on ARM64

Message ID 20230615100928.25767-23-peng.fan@oss.nxp.com
State Accepted
Commit 8d84a8f48702861b6bb99944c34cab76e0dd1cf3
Delegated to: Stefano Babic
Headers show
Series imx: misc update and fix | expand

Commit Message

Peng Fan (OSS) June 15, 2023, 10:09 a.m. UTC
From: Ye Li <ye.li@nxp.com>

The bootaux uses ulong to read private data and write to M4 TCM,
this cause problem on ARM64 platform where the ulong is 8bytes.
Fix it by using u32 to replace ulong.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/mach-imx/imx_bootaux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Stefano Babic July 11, 2023, 7:45 p.m. UTC | #1
> From: Ye Li <ye.li@nxp.com>
> The bootaux uses ulong to read private data and write to M4 TCM,
> this cause problem on ARM64 platform where the ulong is 8bytes.
> Fix it by using u32 to replace ulong.
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
> Signed-off-by: Ye Li <ye.li@nxp.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Applied to u-boot-imx, master, 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 2b97aae3a23..ab7a41fd11d 100644
--- a/arch/arm/mach-imx/imx_bootaux.c
+++ b/arch/arm/mach-imx/imx_bootaux.c
@@ -45,7 +45,7 @@  static const struct rproc_att *get_host_mapping(unsigned long auxcore)
  * is valid, returns the entry point address.
  * Translates load addresses in the elf file to the U-Boot address space.
  */
-static unsigned long load_elf_image_m_core_phdr(unsigned long addr, ulong *stack)
+static u32 load_elf_image_m_core_phdr(unsigned long addr, u32 *stack)
 {
 	Elf32_Ehdr *ehdr; /* ELF header structure pointer */
 	Elf32_Phdr *phdr; /* Program header structure pointer */
@@ -95,7 +95,7 @@  static unsigned long load_elf_image_m_core_phdr(unsigned long addr, ulong *stack
 
 int arch_auxiliary_core_up(u32 core_id, ulong addr)
 {
-	ulong stack, pc;
+	u32 stack, pc;
 
 	if (!addr)
 		return -EINVAL;
@@ -121,7 +121,7 @@  int arch_auxiliary_core_up(u32 core_id, ulong addr)
 		pc = *(u32 *)(addr + 4);
 	}
 
-	printf("## Starting auxiliary core stack = 0x%08lX, pc = 0x%08lX...\n",
+	printf("## Starting auxiliary core stack = 0x%08X, pc = 0x%08X...\n",
 	       stack, pc);
 
 	/* Set the stack and pc to MCU bootROM */