Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
208ebe7c
"vscode:/vscode.git/clone" did not exist on "a61d58716fb7a15a2bbedc5e7d8260f5b7bf0974"
Commit
208ebe7c
authored
Jan 23, 2020
by
Alexei Fedorov
Committed by
TrustedFirmware Code Review
Jan 23, 2020
Browse files
Merge "xilinx: versal: PLM to ATF handover" into integration
parents
744a1d6e
31ce893e
Changes
6
Hide whitespace changes
Inline
Side-by-side
docs/plat/xilinx-versal.rst
View file @
208ebe7c
...
@@ -33,3 +33,11 @@ Xilinx Versal platform specific build options
...
@@ -33,3 +33,11 @@ Xilinx Versal platform specific build options
* `VERSAL_PLATFORM`: Select the platform. Options:
* `VERSAL_PLATFORM`: Select the platform. Options:
- `versal_virt` : Versal Virtual platform
- `versal_virt` : Versal Virtual platform
# PLM->TF-A Parameter Passing
------------------------------
The PLM populates a data structure with image information for the TF-A. The TF-A
uses that data to hand off to the loaded images. The address of the handoff
data structure is passed in the ```PMC_GLOBAL_GLOB_GEN_STORAGE4``` register.
The register is free to be used by other software once the TF-A is bringing up
further firmware images.
plat/xilinx/versal/aarch64/versal_common.c
View file @
208ebe7c
/*
/*
* Copyright (c) 2018-20
19
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018-20
20
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -67,11 +67,3 @@ unsigned int plat_get_syscnt_freq2(void)
...
@@ -67,11 +67,3 @@ unsigned int plat_get_syscnt_freq2(void)
return
VERSAL_CPU_CLOCK
;
return
VERSAL_CPU_CLOCK
;
}
}
uintptr_t
plat_get_ns_image_entrypoint
(
void
)
{
#ifdef PRELOADED_BL33_BASE
return
PRELOADED_BL33_BASE
;
#else
return
PLAT_VERSAL_NS_IMAGE_OFFSET
;
#endif
}
plat/xilinx/versal/bl31_versal_setup.c
View file @
208ebe7c
/*
/*
* Copyright (c) 2018-20
19
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018-20
20
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -13,8 +13,12 @@
...
@@ -13,8 +13,12 @@
#include <common/debug.h>
#include <common/debug.h>
#include <drivers/arm/pl011.h>
#include <drivers/arm/pl011.h>
#include <drivers/console.h>
#include <drivers/console.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/platform.h>
#include <plat/common/platform.h>
#include <versal_def.h>
#include <plat_private.h>
#include <plat_startup.h>
static
entry_point_info_t
bl32_image_ep_info
;
static
entry_point_info_t
bl32_image_ep_info
;
static
entry_point_info_t
bl33_image_ep_info
;
static
entry_point_info_t
bl33_image_ep_info
;
...
@@ -36,6 +40,18 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
...
@@ -36,6 +40,18 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
return
&
bl32_image_ep_info
;
return
&
bl32_image_ep_info
;
}
}
/*
* Set the build time defaults,if we can't find any config data.
*/
static
inline
void
bl31_set_default_config
(
void
)
{
bl32_image_ep_info
.
pc
=
BL32_BASE
;
bl32_image_ep_info
.
spsr
=
arm_get_spsr_for_bl32_entry
();
bl33_image_ep_info
.
pc
=
plat_get_ns_image_entrypoint
();
bl33_image_ep_info
.
spsr
=
SPSR_64
(
MODE_EL2
,
MODE_SP_ELX
,
DISABLE_ALL_EXCEPTIONS
);
}
/*
/*
* Perform any BL31 specific platform actions. Here is an opportunity to copy
* Perform any BL31 specific platform actions. Here is an opportunity to copy
* parameters passed by the calling EL (S-EL1 in BL2 & S-EL3 in BL1) before they
* parameters passed by the calling EL (S-EL1 in BL2 & S-EL3 in BL1) before they
...
@@ -45,6 +61,7 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
...
@@ -45,6 +61,7 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
void
bl31_early_platform_setup2
(
u_register_t
arg0
,
u_register_t
arg1
,
void
bl31_early_platform_setup2
(
u_register_t
arg0
,
u_register_t
arg1
,
u_register_t
arg2
,
u_register_t
arg3
)
u_register_t
arg2
,
u_register_t
arg3
)
{
{
uint64_t
atf_handoff_addr
;
/* Initialize the console to provide early debug support */
/* Initialize the console to provide early debug support */
int
rc
=
console_pl011_register
(
VERSAL_UART_BASE
,
int
rc
=
console_pl011_register
(
VERSAL_UART_BASE
,
...
@@ -76,12 +93,15 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
...
@@ -76,12 +93,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_PARAM_HEAD
(
&
bl33_image_ep_info
,
PARAM_EP
,
VERSION_1
,
0
);
SET_SECURITY_STATE
(
bl33_image_ep_info
.
h
.
attr
,
NON_SECURE
);
SET_SECURITY_STATE
(
bl33_image_ep_info
.
h
.
attr
,
NON_SECURE
);
/* use build time defaults in JTAG boot mode */
atf_handoff_addr
=
mmio_read_32
(
PMC_GLOBAL_GLOB_GEN_STORAGE4
);
bl32_image_ep_info
.
pc
=
BL32_BASE
;
enum
fsbl_handoff
ret
=
fsbl_atf_handover
(
&
bl32_image_ep_info
,
bl32_image_ep_info
.
spsr
=
0
;
&
bl33_image_ep_info
,
bl33_image_ep_info
.
pc
=
plat_get_ns_image_entrypoint
();
atf_handoff_addr
);
bl33_image_ep_info
.
spsr
=
SPSR_64
(
MODE_EL2
,
MODE_SP_ELX
,
if
(
ret
==
FSBL_HANDOFF_NO_STRUCT
)
{
DISABLE_ALL_EXCEPTIONS
);
bl31_set_default_config
();
}
else
if
(
ret
!=
FSBL_HANDOFF_SUCCESS
)
{
panic
();
}
NOTICE
(
"BL31: Secure code at 0x%lx
\n
"
,
bl32_image_ep_info
.
pc
);
NOTICE
(
"BL31: Secure code at 0x%lx
\n
"
,
bl32_image_ep_info
.
pc
);
NOTICE
(
"BL31: Non secure code at 0x%lx
\n
"
,
bl33_image_ep_info
.
pc
);
NOTICE
(
"BL31: Non secure code at 0x%lx
\n
"
,
bl33_image_ep_info
.
pc
);
...
...
plat/xilinx/versal/include/platform_def.h
View file @
208ebe7c
/*
/*
* Copyright (c) 2018-20
19
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018-20
20
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -56,9 +56,9 @@
...
@@ -56,9 +56,9 @@
* BL33 specific defines.
* BL33 specific defines.
******************************************************************************/
******************************************************************************/
#ifndef PRELOADED_BL33_BASE
#ifndef PRELOADED_BL33_BASE
# define PLAT_
VERSAL
_NS_IMAGE_
OFF
SE
T
0x8000000
# define PLAT_
ARM
_NS_IMAGE_
BA
SE
0x8000000
#else
#else
# define PLAT_
VERSAL
_NS_IMAGE_
OFF
SE
T
PRELOADED_BL33_BASE
# define PLAT_
ARM
_NS_IMAGE_
BA
SE
PRELOADED_BL33_BASE
#endif
#endif
/*******************************************************************************
/*******************************************************************************
...
...
plat/xilinx/versal/include/versal_def.h
View file @
208ebe7c
/*
/*
* Copyright (c) 2018-20
19
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018-20
20
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -121,6 +121,10 @@
...
@@ -121,6 +121,10 @@
#define APU_0_PWRCTL_CPUPWRDWNREQ_MASK 1
#define APU_0_PWRCTL_CPUPWRDWNREQ_MASK 1
#define APU_1_PWRCTL_CPUPWRDWNREQ_MASK 2
#define APU_1_PWRCTL_CPUPWRDWNREQ_MASK 2
/* PMC registers and bitfields */
#define PMC_GLOBAL_BASE 0xF1110000
#define PMC_GLOBAL_GLOB_GEN_STORAGE4 (PMC_GLOBAL_BASE + 0x40)
/* IPI registers and bitfields */
/* IPI registers and bitfields */
#define IPI0_REG_BASE 0xFF330000
#define IPI0_REG_BASE 0xFF330000
#define IPI0_TRIG_BIT (1 << 2)
#define IPI0_TRIG_BIT (1 << 2)
...
...
plat/xilinx/versal/platform.mk
View file @
208ebe7c
# Copyright (c) 2018-20
19
, ARM Limited and Contributors. All rights reserved.
# Copyright (c) 2018-20
20
, ARM Limited and Contributors. All rights reserved.
#
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: BSD-3-Clause
...
@@ -55,6 +55,7 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \
...
@@ -55,6 +55,7 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \
drivers/arm/pl011/aarch64/pl011_console.S
\
drivers/arm/pl011/aarch64/pl011_console.S
\
plat/common/aarch64/crash_console_helpers.S
\
plat/common/aarch64/crash_console_helpers.S
\
plat/arm/common/arm_cci.c
\
plat/arm/common/arm_cci.c
\
plat/arm/common/arm_common.c
\
plat/common/plat_gicv3.c
\
plat/common/plat_gicv3.c
\
plat/xilinx/versal/aarch64/versal_helpers.S
\
plat/xilinx/versal/aarch64/versal_helpers.S
\
plat/xilinx/versal/aarch64/versal_common.c
plat/xilinx/versal/aarch64/versal_common.c
...
@@ -64,6 +65,7 @@ BL31_SOURCES += drivers/arm/cci/cci.c \
...
@@ -64,6 +65,7 @@ BL31_SOURCES += drivers/arm/cci/cci.c \
lib/cpus/aarch64/cortex_a72.S
\
lib/cpus/aarch64/cortex_a72.S
\
plat/common/plat_psci_common.c
\
plat/common/plat_psci_common.c
\
plat/xilinx/common/ipi.c
\
plat/xilinx/common/ipi.c
\
plat/xilinx/common/plat_startup.c
\
plat/xilinx/common/ipi_mailbox_service/ipi_mailbox_svc.c
\
plat/xilinx/common/ipi_mailbox_service/ipi_mailbox_svc.c
\
plat/xilinx/common/pm_service/pm_ipi.c
\
plat/xilinx/common/pm_service/pm_ipi.c
\
plat/xilinx/versal/bl31_versal_setup.c
\
plat/xilinx/versal/bl31_versal_setup.c
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment