arm: armv8: Improve SPL data save and restore implementation
authorAlif Zakuan Yuslaimi <alif.zakuan.yuslaimi@intel.com>
Tue, 18 Feb 2025 08:35:06 +0000 (16:35 +0800)
committerTom Rini <trini@konsulko.com>
Tue, 25 Feb 2025 16:54:02 +0000 (10:54 -0600)
commit1c37e59bfbbae14dcc15894c8367339d16dda95a
tree1d84bc06893718e60b0a154c364f49740113a0af
parentb005eca0c91ce1b0136f4ac088fb98b7d93bbb51
arm: armv8: Improve SPL data save and restore implementation

Introduce a new symbol in the beginning of .data section in
the common ARMv8 linker script and use that as a reference
for data save and restore.

Previously, the code would rely on calculating the start of
the .data section address via data size, however, we observed
that the data size does not really reflect the SPL mapped
addresses.

In our case, the binman_sym section size was not included in
the data size, which will result in a wrong address for the
.data start section, which prevents us from properly saving
and restoring SPL data.

This approach skips the calculation for the starting address
of the .data section, and instead just defines the beginning
address of the .data section and calling the symbol as needed,
in which we think as a simpler and much more robust method.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
arch/arm/cpu/armv8/spl_data.c
arch/arm/cpu/armv8/u-boot-spl.lds
arch/arm/mach-socfpga/spl_agilex5.c
configs/socfpga_agilex5_defconfig