summaryrefslogtreecommitdiff
path: root/arch/arm/mach-zynqmp
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2019-12-19 18:16:16 +0100
committerMichal Simek <michal.simek@xilinx.com>2020-01-14 09:05:54 +0100
commit3b26c860d363e0aad05ce5fb6b4290ed67d76aca (patch)
treedb36ad2f678764f2286adadc7f3a1e6551832458 /arch/arm/mach-zynqmp
parent5c03c990d1fb928048bf76f2fc03ee70276d4c4a (diff)
arm: zynqmp: Wire SPL/ATF handoff structure properly
handoff_setup() was used to generate fixed handoff structure for ATF on ZynqMP platform. Switching to bl2_plat_get_bl31_params() platform brings more flexibility because information can be taken from fit image where /fit-images node is created at run time. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/arm/mach-zynqmp')
-rw-r--r--arch/arm/mach-zynqmp/handoff.c17
-rw-r--r--arch/arm/mach-zynqmp/include/mach/sys_proto.h2
-rw-r--r--arch/arm/mach-zynqmp/spl.c2
3 files changed, 12 insertions, 9 deletions
diff --git a/arch/arm/mach-zynqmp/handoff.c b/arch/arm/mach-zynqmp/handoff.c
index f71ff7b3d2..64e5320acc 100644
--- a/arch/arm/mach-zynqmp/handoff.c
+++ b/arch/arm/mach-zynqmp/handoff.c
@@ -66,7 +66,9 @@ struct xfsbl_atf_handoff_params {
};
#ifdef CONFIG_SPL_OS_BOOT
-void handoff_setup(void)
+struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
+ uintptr_t bl33_entry,
+ uintptr_t fdt_addr)
{
struct xfsbl_atf_handoff_params *atfhandoffparams;
@@ -76,11 +78,16 @@ void handoff_setup(void)
atfhandoffparams->magic[2] = 'N';
atfhandoffparams->magic[3] = 'X';
- atfhandoffparams->num_entries = 1;
- atfhandoffparams->partition[0].entry_point = CONFIG_SYS_TEXT_BASE;
- atfhandoffparams->partition[0].flags = FSBL_FLAGS_EL2 <<
- FSBL_FLAGS_EL_SHIFT;
+ atfhandoffparams->num_entries = 0;
+ if (bl33_entry) {
+ atfhandoffparams->partition[0].entry_point = bl33_entry;
+ atfhandoffparams->partition[0].flags = FSBL_FLAGS_EL2 <<
+ FSBL_FLAGS_EL_SHIFT;
+ atfhandoffparams->num_entries++;
+ }
writel(CONFIG_SPL_TEXT_BASE, &pmu_base->gen_storage6);
+
+ return NULL;
}
#endif
diff --git a/arch/arm/mach-zynqmp/include/mach/sys_proto.h b/arch/arm/mach-zynqmp/include/mach/sys_proto.h
index 10b70761de..2974ffbc2f 100644
--- a/arch/arm/mach-zynqmp/include/mach/sys_proto.h
+++ b/arch/arm/mach-zynqmp/include/mach/sys_proto.h
@@ -46,8 +46,6 @@ struct zynqmp_ipi_msg {
int zynq_board_read_rom_ethaddr(unsigned char *ethaddr);
unsigned int zynqmp_get_silicon_version(void);
-void handoff_setup(void);
-
int zynqmp_mmio_write(const u32 address, const u32 mask, const u32 value);
int zynqmp_mmio_read(const u32 address, u32 *value);
diff --git a/arch/arm/mach-zynqmp/spl.c b/arch/arm/mach-zynqmp/spl.c
index 095b4e61a5..896657f51c 100644
--- a/arch/arm/mach-zynqmp/spl.c
+++ b/arch/arm/mach-zynqmp/spl.c
@@ -120,8 +120,6 @@ u32 spl_boot_device(void)
#ifdef CONFIG_SPL_OS_BOOT
int spl_start_uboot(void)
{
- handoff_setup();
-
return 0;
}
#endif