MLK-20654 imx8: Recover SPL data section for partition reboot
authorYe Li <ye.li@nxp.com>
Wed, 26 Dec 2018 08:28:31 +0000 (00:28 -0800)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 09:39:11 +0000 (02:39 -0700)
commit035a9c991c02e8ddee16dcccfc883bfb998047b5
tree26a3b3f6d1af520b7b94a7142193814a95dc32eb
parentb1ccebcdb1e2e0821efd703a54f4d31c00cb8aee
MLK-20654 imx8: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section for partition
reboot. It adds a new section in image for saving data section. When from cold
boot, the data section will be saved to that new section at SPL early phase.
When from partition reboot, the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 9e406ea46a93013b4b5370d0d45fe892e9f52583)
arch/arm/cpu/armv8/u-boot-spl.lds
arch/arm/mach-imx/imx8/Kconfig
arch/arm/mach-imx/imx8/cpu.c