aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Fedorov <Alexei.Fedorov@arm.com>2020-01-23 17:16:02 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-01-23 17:16:02 +0000
commit744a1d6e06492ef0a744fe0e0ffae8d05e2dad58 (patch)
treea6ccef1800d1ee80fb41f85656ea56c5612b9f35
parent4302e045fd435868be6c24a1da842b512d0ab315 (diff)
parent4d9f825a5616e15975abc0e8ffef4fd8afe09634 (diff)
downloadtrusted-firmware-a-744a1d6e06492ef0a744fe0e0ffae8d05e2dad58.tar.gz
Merge "xilinx: common: Move ATF handover to common file" into integration
-rw-r--r--plat/xilinx/common/include/plat_startup.h22
-rw-r--r--plat/xilinx/common/plat_startup.c (renamed from plat/xilinx/zynqmp/plat_startup.c)14
-rw-r--r--plat/xilinx/zynqmp/bl31_zynqmp_setup.c11
-rw-r--r--plat/xilinx/zynqmp/include/plat_private.h12
-rw-r--r--plat/xilinx/zynqmp/platform.mk2
5 files changed, 39 insertions, 22 deletions
diff --git a/plat/xilinx/common/include/plat_startup.h b/plat/xilinx/common/include/plat_startup.h
new file mode 100644
index 000000000..66e793373
--- /dev/null
+++ b/plat/xilinx/common/include/plat_startup.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2020, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef PLAT_STARTUP_H
+#define PLAT_STARTUP_H
+
+/* For FSBL handover */
+enum fsbl_handoff {
+ FSBL_HANDOFF_SUCCESS = 0,
+ FSBL_HANDOFF_NO_STRUCT,
+ FSBL_HANDOFF_INVAL_STRUCT,
+ FSBL_HANDOFF_TOO_MANY_PARTS
+};
+
+enum fsbl_handoff fsbl_atf_handover(entry_point_info_t *bl32_image_ep_info,
+ entry_point_info_t *bl33_image_ep_info,
+ uint64_t atf_handoff_addr);
+
+#endif /* PLAT_STARTUP_H */
diff --git a/plat/xilinx/zynqmp/plat_startup.c b/plat/xilinx/common/plat_startup.c
index cd2c3bac6..8c9a049dd 100644
--- a/plat/xilinx/zynqmp/plat_startup.c
+++ b/plat/xilinx/common/plat_startup.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -8,10 +8,8 @@
#include <arch_helpers.h>
#include <common/debug.h>
-#include <lib/mmio.h>
-#include <plat_private.h>
+#include <plat_startup.h>
-#include "zynqmp_def.h"
/*
* ATFHandoffParams
@@ -147,6 +145,7 @@ static int get_fsbl_estate(const struct xfsbl_partition *partition)
* Populates the bl32 and bl33 image info structures
* @bl32: BL32 image info structure
* @bl33: BL33 image info structure
+ * atf_handoff_addr: ATF handoff address
*
* Process the handoff paramters from the FSBL and populate the BL32 and BL33
* image info structures accordingly.
@@ -154,12 +153,11 @@ static int get_fsbl_estate(const struct xfsbl_partition *partition)
* Return: Return the status of the handoff. The value will be from the
* fsbl_handoff enum.
*/
-enum fsbl_handoff fsbl_atf_handover(entry_point_info_t *bl32, entry_point_info_t *bl33)
+enum fsbl_handoff fsbl_atf_handover(entry_point_info_t *bl32,
+ entry_point_info_t *bl33,
+ uint64_t atf_handoff_addr)
{
- uint64_t atf_handoff_addr;
const struct xfsbl_atf_handoff_params *ATFHandoffParams;
-
- atf_handoff_addr = mmio_read_32(PMU_GLOBAL_GEN_STORAGE6);
assert((atf_handoff_addr < BL31_BASE) ||
(atf_handoff_addr > (uint64_t)&__BL31_END__));
if (!atf_handoff_addr) {
diff --git a/plat/xilinx/zynqmp/bl31_zynqmp_setup.c b/plat/xilinx/zynqmp/bl31_zynqmp_setup.c
index 285a4eb8b..6e0e811d4 100644
--- a/plat/xilinx/zynqmp/bl31_zynqmp_setup.c
+++ b/plat/xilinx/zynqmp/bl31_zynqmp_setup.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -13,8 +13,11 @@
#include <drivers/console.h>
#include <plat/arm/common/plat_arm.h>
#include <plat/common/platform.h>
+#include <lib/mmio.h>
+#include <plat_startup.h>
#include <plat_private.h>
+#include <zynqmp_def.h>
static entry_point_info_t bl32_image_ep_info;
static entry_point_info_t bl33_image_ep_info;
@@ -57,6 +60,7 @@ static inline void bl31_set_default_config(void)
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
u_register_t arg2, u_register_t arg3)
{
+ uint64_t atf_handoff_addr;
/* Register the console to provide early debug support */
static console_cdns_t bl31_boot_console;
(void)console_cdns_register(ZYNQMP_UART_BASE,
@@ -86,12 +90,15 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
SET_PARAM_HEAD(&bl33_image_ep_info, PARAM_EP, VERSION_1, 0);
SET_SECURITY_STATE(bl33_image_ep_info.h.attr, NON_SECURE);
+ atf_handoff_addr = mmio_read_32(PMU_GLOBAL_GEN_STORAGE6);
+
if (zynqmp_get_bootmode() == ZYNQMP_BOOTMODE_JTAG) {
bl31_set_default_config();
} else {
/* use parameters from FSBL */
enum fsbl_handoff ret = fsbl_atf_handover(&bl32_image_ep_info,
- &bl33_image_ep_info);
+ &bl33_image_ep_info,
+ atf_handoff_addr);
if (ret == FSBL_HANDOFF_NO_STRUCT)
bl31_set_default_config();
else if (ret != FSBL_HANDOFF_SUCCESS)
diff --git a/plat/xilinx/zynqmp/include/plat_private.h b/plat/xilinx/zynqmp/include/plat_private.h
index 8bdf42967..288cc5301 100644
--- a/plat/xilinx/zynqmp/include/plat_private.h
+++ b/plat/xilinx/zynqmp/include/plat_private.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2019, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -21,13 +21,6 @@ unsigned int zynqmp_calc_core_pos(u_register_t mpidr);
unsigned int zynqmp_get_uart_clk(void);
unsigned int zynqmp_get_bootmode(void);
-/* For FSBL handover */
-enum fsbl_handoff {
- FSBL_HANDOFF_SUCCESS = 0,
- FSBL_HANDOFF_NO_STRUCT,
- FSBL_HANDOFF_INVAL_STRUCT,
- FSBL_HANDOFF_TOO_MANY_PARTS,
-};
#if ZYNQMP_WDT_RESTART
/*
@@ -37,7 +30,4 @@ enum fsbl_handoff {
int request_intr_type_el3(uint32_t, interrupt_type_handler_t);
#endif
-enum fsbl_handoff fsbl_atf_handover(entry_point_info_t *bl32_image_ep_info,
- entry_point_info_t *bl33_image_ep_info);
-
#endif /* PLAT_PRIVATE_H */
diff --git a/plat/xilinx/zynqmp/platform.mk b/plat/xilinx/zynqmp/platform.mk
index de4bf3a0b..44f20f69f 100644
--- a/plat/xilinx/zynqmp/platform.mk
+++ b/plat/xilinx/zynqmp/platform.mk
@@ -82,10 +82,10 @@ BL31_SOURCES += drivers/arm/cci/cci.c \
plat/common/plat_psci_common.c \
plat/xilinx/common/ipi_mailbox_service/ipi_mailbox_svc.c \
plat/xilinx/common/pm_service/pm_ipi.c \
+ plat/xilinx/common/plat_startup.c \
plat/xilinx/zynqmp/bl31_zynqmp_setup.c \
plat/xilinx/zynqmp/plat_psci.c \
plat/xilinx/zynqmp/plat_zynqmp.c \
- plat/xilinx/zynqmp/plat_startup.c \
plat/xilinx/zynqmp/plat_topology.c \
plat/xilinx/zynqmp/sip_svc_setup.c \
plat/xilinx/zynqmp/pm_service/pm_svc_main.c \