mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-22 04:24:19 +00:00
Merge "fix(intel): update Agilex5 warm reset subroutines" into integration
This commit is contained in:
commit
94188b590f
4 changed files with 36 additions and 19 deletions
|
@ -234,6 +234,9 @@ void bl31_plat_set_secondary_cpu_entrypoint(unsigned int cpu_id)
|
||||||
unsigned int pchctlr_new = 0x00;
|
unsigned int pchctlr_new = 0x00;
|
||||||
uint32_t boot_core = 0x00;
|
uint32_t boot_core = 0x00;
|
||||||
|
|
||||||
|
/* Store magic number for SMP secondary cores boot */
|
||||||
|
mmio_write_32(L2_RESET_DONE_REG, SMP_SEC_CORE_BOOT_REQ);
|
||||||
|
|
||||||
boot_core = (mmio_read_32(AGX5_PWRMGR(MPU_BOOTCONFIG)) & 0xC00);
|
boot_core = (mmio_read_32(AGX5_PWRMGR(MPU_BOOTCONFIG)) & 0xC00);
|
||||||
/* Update the p-channel based on cpu id */
|
/* Update the p-channel based on cpu id */
|
||||||
pch_cpu = 1 << cpu_id;
|
pch_cpu = 1 << cpu_id;
|
||||||
|
|
|
@ -98,18 +98,6 @@ func plat_my_core_pos
|
||||||
endfunc plat_my_core_pos
|
endfunc plat_my_core_pos
|
||||||
|
|
||||||
func warm_reset_req
|
func warm_reset_req
|
||||||
#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5
|
|
||||||
bl plat_is_my_cpu_primary
|
|
||||||
cbnz x0, warm_reset
|
|
||||||
warm_reset:
|
|
||||||
mov_imm x1, PLAT_SEC_ENTRY
|
|
||||||
str xzr, [x1]
|
|
||||||
mrs x1, rmr_el3
|
|
||||||
orr x1, x1, #0x02
|
|
||||||
msr rmr_el3, x1
|
|
||||||
isb
|
|
||||||
dsb sy
|
|
||||||
#else
|
|
||||||
str xzr, [x4]
|
str xzr, [x4]
|
||||||
bl plat_is_my_cpu_primary
|
bl plat_is_my_cpu_primary
|
||||||
cbz x0, cpu_in_wfi
|
cbz x0, cpu_in_wfi
|
||||||
|
@ -123,22 +111,35 @@ warm_reset:
|
||||||
cpu_in_wfi:
|
cpu_in_wfi:
|
||||||
wfi
|
wfi
|
||||||
b cpu_in_wfi
|
b cpu_in_wfi
|
||||||
#endif
|
|
||||||
endfunc warm_reset_req
|
endfunc warm_reset_req
|
||||||
|
|
||||||
/* TODO: Zephyr warm reset test */
|
|
||||||
#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5
|
#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5
|
||||||
func plat_get_my_entrypoint
|
func plat_get_my_entrypoint
|
||||||
ldr x4, =L2_RESET_DONE_REG
|
ldr x4, =L2_RESET_DONE_REG
|
||||||
ldr x5, [x4]
|
ldr x5, [x4]
|
||||||
ldr x1, =PLAT_L2_RESET_REQ
|
|
||||||
|
/* Check for warm reset request */
|
||||||
|
ldr x1, =L2_RESET_DONE_STATUS
|
||||||
cmp x1, x5
|
cmp x1, x5
|
||||||
b.eq zephyr_reset_req
|
b.eq warm_reset_req
|
||||||
|
|
||||||
|
/* Check for SMP secondary cores boot request */
|
||||||
|
ldr x1, =SMP_SEC_CORE_BOOT_REQ
|
||||||
|
cmp x1, x5
|
||||||
|
b.eq smp_request
|
||||||
|
|
||||||
|
/* Otherwise it is cold reset */
|
||||||
|
mov x0, #0
|
||||||
|
ret
|
||||||
|
smp_request:
|
||||||
|
/*
|
||||||
|
* Return the address 'bl31_warm_entrypoint', which is passed to
|
||||||
|
* 'psci_setup' routine as part of BL31 initialization.
|
||||||
|
*/
|
||||||
mov_imm x1, PLAT_SEC_ENTRY
|
mov_imm x1, PLAT_SEC_ENTRY
|
||||||
ldr x0, [x1]
|
ldr x0, [x1]
|
||||||
ret
|
/* Clear the mark up before return */
|
||||||
zephyr_reset_req:
|
str xzr, [x4]
|
||||||
ldr x0, =0x00
|
|
||||||
ret
|
ret
|
||||||
endfunc plat_get_my_entrypoint
|
endfunc plat_get_my_entrypoint
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
/* Magic word to indicate L2 reset is completed */
|
/* Magic word to indicate L2 reset is completed */
|
||||||
#define L2_RESET_DONE_STATUS 0x1228E5E7
|
#define L2_RESET_DONE_STATUS 0x1228E5E7
|
||||||
|
|
||||||
|
/* Magic word to differentiate for SMP secondary core boot request */
|
||||||
|
#define SMP_SEC_CORE_BOOT_REQ 0x1228E5E8
|
||||||
|
|
||||||
/* Define next boot image name and offset */
|
/* Define next boot image name and offset */
|
||||||
/* Get non-secure image entrypoint for BL33. Zephyr and Linux */
|
/* Get non-secure image entrypoint for BL33. Zephyr and Linux */
|
||||||
#ifdef PRELOADED_BL33_BASE
|
#ifdef PRELOADED_BL33_BASE
|
||||||
|
|
|
@ -213,6 +213,16 @@ static void __dead2 socfpga_system_reset(void)
|
||||||
static int socfpga_system_reset2(int is_vendor, int reset_type,
|
static int socfpga_system_reset2(int is_vendor, int reset_type,
|
||||||
u_register_t cookie)
|
u_register_t cookie)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if CACHE_FLUSH
|
||||||
|
/*
|
||||||
|
* ATF Flush and Invalidate Cache due to hardware limitation
|
||||||
|
* of auto Flush and Invalidate Cache.
|
||||||
|
*/
|
||||||
|
dcsw_op_all(DCCISW);
|
||||||
|
invalidate_cache_low_el();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5
|
#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5
|
||||||
mailbox_reset_warm(reset_type);
|
mailbox_reset_warm(reset_type);
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Reference in a new issue