mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-08-15 17:07:04 +02:00
Enforce full include path for includes. Deprecate old paths. The following folders inside include/lib have been left unchanged: - include/lib/cpus/${ARCH} - include/lib/el3_runtime/${ARCH} The reason for this change is that having a global namespace for includes isn't a good idea. It defeats one of the advantages of having folders and it introduces problems that are sometimes subtle (because you may not know the header you are actually including if there are two of them). For example, this patch had to be created because two headers were called the same way:e0ea0928d5
("Fix gpio includes of mt8173 platform to avoid collision."). More recently, this patch has had similar problems:46f9b2c3a2
("drivers: add tzc380 support"). This problem was introduced in commit4ecca33988
("Move include and source files to logical locations"). At that time, there weren't too many headers so it wasn't a real issue. However, time has shown that this creates problems. Platforms that want to preserve the way they include headers may add the removed paths to PLAT_INCLUDES, but this is discouraged. Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
119 lines
2.3 KiB
C
119 lines
2.3 KiB
C
/*
|
|
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <arch_helpers.h>
|
|
#include <common/bl_common.h>
|
|
#include <common/debug.h>
|
|
#include <drivers/arm/cci.h>
|
|
#include <drivers/console.h>
|
|
#include <lib/mmio.h>
|
|
#include <lib/xlat_tables/xlat_tables.h>
|
|
#include <plat/common/platform.h>
|
|
|
|
#include <mtk_plat_common.h>
|
|
#include <mtk_sip_svc.h>
|
|
#include <plat_private.h>
|
|
|
|
struct atf_arg_t gteearg;
|
|
|
|
void clean_top_32b_of_param(uint32_t smc_fid,
|
|
u_register_t *px1,
|
|
u_register_t *px2,
|
|
u_register_t *px3,
|
|
u_register_t *px4)
|
|
{
|
|
/* if parameters from SMC32. Clean top 32 bits */
|
|
if (0 == (smc_fid & SMC_AARCH64_BIT)) {
|
|
*px1 = *px1 & SMC32_PARAM_MASK;
|
|
*px2 = *px2 & SMC32_PARAM_MASK;
|
|
*px3 = *px3 & SMC32_PARAM_MASK;
|
|
*px4 = *px4 & SMC32_PARAM_MASK;
|
|
}
|
|
}
|
|
|
|
#if MTK_SIP_KERNEL_BOOT_ENABLE
|
|
static struct kernel_info k_info;
|
|
|
|
static void save_kernel_info(uint64_t pc,
|
|
uint64_t r0,
|
|
uint64_t r1,
|
|
uint64_t k32_64)
|
|
{
|
|
k_info.k32_64 = k32_64;
|
|
k_info.pc = pc;
|
|
|
|
if (LINUX_KERNEL_32 == k32_64) {
|
|
/* for 32 bits kernel */
|
|
k_info.r0 = 0;
|
|
/* machtype */
|
|
k_info.r1 = r0;
|
|
/* tags */
|
|
k_info.r2 = r1;
|
|
} else {
|
|
/* for 64 bits kernel */
|
|
k_info.r0 = r0;
|
|
k_info.r1 = r1;
|
|
}
|
|
}
|
|
|
|
uint64_t get_kernel_info_pc(void)
|
|
{
|
|
return k_info.pc;
|
|
}
|
|
|
|
uint64_t get_kernel_info_r0(void)
|
|
{
|
|
return k_info.r0;
|
|
}
|
|
|
|
uint64_t get_kernel_info_r1(void)
|
|
{
|
|
return k_info.r1;
|
|
}
|
|
|
|
uint64_t get_kernel_info_r2(void)
|
|
{
|
|
return k_info.r2;
|
|
}
|
|
|
|
void boot_to_kernel(uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4)
|
|
{
|
|
static uint8_t kernel_boot_once_flag;
|
|
/* only support in booting flow */
|
|
if (0 == kernel_boot_once_flag) {
|
|
kernel_boot_once_flag = 1;
|
|
|
|
console_init(gteearg.atf_log_port,
|
|
UART_CLOCK, UART_BAUDRATE);
|
|
INFO("save kernel info\n");
|
|
save_kernel_info(x1, x2, x3, x4);
|
|
bl31_prepare_kernel_entry(x4);
|
|
INFO("el3_exit\n");
|
|
console_uninit();
|
|
}
|
|
}
|
|
#endif
|
|
|
|
uint32_t plat_get_spsr_for_bl33_entry(void)
|
|
{
|
|
unsigned int mode;
|
|
uint32_t spsr;
|
|
unsigned int ee;
|
|
unsigned long daif;
|
|
|
|
INFO("Secondary bootloader is AArch32\n");
|
|
mode = MODE32_svc;
|
|
ee = 0;
|
|
/*
|
|
* TODO: Choose async. exception bits if HYP mode is not
|
|
* implemented according to the values of SCR.{AW, FW} bits
|
|
*/
|
|
daif = DAIF_ABT_BIT | DAIF_IRQ_BIT | DAIF_FIQ_BIT;
|
|
|
|
spsr = SPSR_MODE32(mode, 0, ee, daif);
|
|
return spsr;
|
|
}
|