Hello
I'm working with imx8dual. I'm trying to start M4 from Uboot, using the bootaux command. I've found that bootaux will only succeed if the source address passed to it is 8-byte aligned.
e.g.
If bootaux 0x90000000, M4 can start to run successfully.
If bootaux 0x90000004, M4 cannot.
Reading the source code of bootaux, we can see that basically, bootaux calls arch_auxiliary_core_up, which, in turn, calls memcpy((void *)aux_core_ram, (void *)addr, size)
In the case of bootaux 0x90000004, however, M4 can also start by any of the following means:
(1) calls memset((void *)aux_core_ram, 0, size) before
memcpy((void *)aux_core_ram, (void *)addr, size)
(2) calls memset((void *)aux_core_ram, 0xff, size)before
memcpy((void *)aux_core_ram, (void *)addr, size)
(3) replace memcpy((void *)aux_core_ram, (void *)addr, size) with
for (int i=0; i<size/4; i++)
*((uint32_t*)aux_core_ram+i) = *((uint32_t*)addr+i);
I must add that
for (int i=0; i<size; i++)
*((uint8_t*)aux_core_ram+i) = *((uint8_t*)addr+i);
doesn't help.
Can anyone explain this?