The entry function is useful for all Agilex 5 based boards and its easy to get the stack location wrong.
Add a helper function that does the right thing for Agilex 5 and avoid defining the stack location for every board. Signed-off-by: Michael Tretter <[email protected]> --- arch/arm/boards/arrow-axe5-eagle/lowlevel.c | 13 ++----------- include/mach/socfpga/barebox-arm.h | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/arch/arm/boards/arrow-axe5-eagle/lowlevel.c b/arch/arm/boards/arrow-axe5-eagle/lowlevel.c index b5a56a1a8c5f..de5a14b2d503 100644 --- a/arch/arm/boards/arrow-axe5-eagle/lowlevel.c +++ b/arch/arm/boards/arrow-axe5-eagle/lowlevel.c @@ -5,23 +5,14 @@ #include <asm/barebox-arm.h> #include <asm/system.h> #include <pbl.h> +#include <mach/socfpga/barebox-arm.h> #include <mach/socfpga/debug_ll.h> #include <mach/socfpga/init.h> #include <mach/socfpga/generic.h> -#include <mach/socfpga/soc64-handoff.h> #include <mach/socfpga/soc64-regs.h> extern char __dtb_z_socfpga_agilex5_axe5_eagle_start[]; -/* - * The SDM firmware uses the last page in the OCRAM for handoff data. Put the - * stack below the handoff data. - * - * Note: U-Boot puts the stack at 0x71000 (0x80000 - 0xf000) and reserves even - * more space. - */ -#define AXE5_STACKTOP SOC64_HANDOFF_BASE - static noinline void axe5_eagle_continue(void) { agilex5_clk_init(); @@ -52,7 +43,7 @@ static noinline void axe5_eagle_continue(void) agilex5_barebox_entry(__dtb_z_socfpga_agilex5_axe5_eagle_start); } -ENTRY_FUNCTION_WITHSTACK(start_socfpga_agilex5_axe5_eagle, AXE5_STACKTOP, r0, r1, r2) +ENTRY_FUNCTION_AGILEX5(start_socfpga_agilex5_axe5_eagle) { if (current_el() == 3) socfpga_agilex5_cpu_lowlevel_init(); diff --git a/include/mach/socfpga/barebox-arm.h b/include/mach/socfpga/barebox-arm.h new file mode 100644 index 000000000000..60c9ddabea23 --- /dev/null +++ b/include/mach/socfpga/barebox-arm.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef SOCFPGA_BAREBOX_ARM_H_ +#define SOCFPGA_BAREBOX_ARM_H_ + +#include <asm/barebox-arm.h> +#include <mach/socfpga/soc64-handoff.h> + +/* + * The SDM firmware uses the last page in the OCRAM for handoff data. Put the + * stack below the handoff data. + * + * Note: U-Boot puts the stack at 0x71000 (0x80000 - 0xf000) and reserves even + * more space. + */ +#define AGILEX5_STACKTOP SOC64_HANDOFF_BASE + +#define ENTRY_FUNCTION_AGILEX5(name) \ + ENTRY_FUNCTION_WITHSTACK(name, AGILEX5_STACKTOP, r0, r1, r2) + +#endif -- 2.47.3
