Commit 4d9f825a authored by Venkatesh Yadav Abbarapu's avatar Venkatesh Yadav Abbarapu
Browse files

xilinx: common: Move ATF handover to common file



ATF handover can be used by Xilinx platforms, so move it to common
file from platform specific files.
Signed-off-by: default avatarVenkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I5f0839351f534619de581d1953c8427a079487e0
parent 29d13744
/*
* 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 */
/*
* 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) {
......
/*
* 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)
......
/*
* 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 */
......@@ -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 \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment