Skip to content

Commit

Permalink
mediatek: common: add support to boot BL33 in AArch64 mode
Browse files Browse the repository at this point in the history
Add support to boot BL33 in AArch64 mode.
Make this function being empty when building for ARMv7.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  • Loading branch information
hackpascal committed Aug 31, 2022
1 parent d1e20a7 commit bfffb62
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion plat/mediatek/common/mtk_plat_common.c
Expand Up @@ -101,8 +101,11 @@ void boot_to_kernel(uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4)

uint32_t plat_get_spsr_for_bl33_entry(void)
{
uint32_t spsr = 0;

#if (ARM_ARCH_MAJOR > 7)
#ifndef KERNEL_IS_DEFAULT_64BIT
unsigned int mode;
uint32_t spsr;
unsigned int ee;
unsigned long daif;

Expand All @@ -116,6 +119,13 @@ uint32_t plat_get_spsr_for_bl33_entry(void)
daif = DAIF_ABT_BIT | DAIF_IRQ_BIT | DAIF_FIQ_BIT;

spsr = SPSR_MODE32(mode, 0, ee, daif);
#else
INFO("Secondary bootloader is AArch64\n");

spsr = SPSR_64(MODE_EL2, MODE_SP_ELX, DISABLE_ALL_EXCEPTIONS);
#endif
#endif

return spsr;
}

Expand Down

0 comments on commit bfffb62

Please sign in to comment.