mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-09-08 07:11:26 +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: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform to avoid collision."). More recently, this patch has had similar problems: 46f9b2c3a282 ("drivers: add tzc380 support"). This problem was introduced in commit 4ecca33988b9 ("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>
80 lines
2.3 KiB
C
80 lines
2.3 KiB
C
/*
|
|
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <common/debug.h>
|
|
#include <common/interrupt_props.h>
|
|
#include <drivers/arm/gicv2.h>
|
|
|
|
#include "ls_16550.h"
|
|
#include "plat_ls.h"
|
|
#include "soc.h"
|
|
|
|
#define BL32_END (unsigned long)(&__BL32_END__)
|
|
|
|
static const interrupt_prop_t g0_interrupt_props[] = {
|
|
INTR_PROP_DESC(9, GIC_HIGHEST_SEC_PRIORITY,
|
|
GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
|
|
};
|
|
|
|
gicv2_driver_data_t ls_gic_data = {
|
|
.gicd_base = GICD_BASE,
|
|
.gicc_base = GICC_BASE,
|
|
.interrupt_props = g0_interrupt_props,
|
|
.interrupt_props_num = ARRAY_SIZE(g0_interrupt_props),
|
|
};
|
|
|
|
/*******************************************************************************
|
|
* Initialize the UART
|
|
******************************************************************************/
|
|
void ls_tsp_early_platform_setup(void)
|
|
{
|
|
static console_ls_16550_t console;
|
|
/*
|
|
* Initialize a different console than already in use to display
|
|
* messages from TSP
|
|
*/
|
|
console_ls_16550_register(PLAT_LS1043_UART2_BASE, PLAT_LS1043_UART_CLOCK,
|
|
PLAT_LS1043_UART_BAUDRATE, &console);
|
|
NOTICE(FIRMWARE_WELCOME_STR_LS1043_BL32);
|
|
}
|
|
|
|
/*******************************************************************************
|
|
* Perform platform specific setup placeholder
|
|
******************************************************************************/
|
|
void tsp_platform_setup(void)
|
|
{
|
|
uint32_t gicc_base, gicd_base;
|
|
|
|
/* Initialize the GIC driver, cpu and distributor interfaces */
|
|
get_gic_offset(&gicc_base, &gicd_base);
|
|
ls_gic_data.gicd_base = (uintptr_t)gicd_base;
|
|
ls_gic_data.gicc_base = (uintptr_t)gicc_base;
|
|
gicv2_driver_init(&ls_gic_data);
|
|
gicv2_distif_init();
|
|
gicv2_pcpu_distif_init();
|
|
gicv2_cpuif_enable();
|
|
}
|
|
|
|
/*******************************************************************************
|
|
* Perform the very early platform specific architectural setup here. At the
|
|
* moment this is only intializes the MMU
|
|
******************************************************************************/
|
|
void tsp_plat_arch_setup(void)
|
|
{
|
|
ls_setup_page_tables(BL32_BASE,
|
|
(BL32_END - BL32_BASE),
|
|
BL_CODE_BASE,
|
|
BL_CODE_END,
|
|
BL_RO_DATA_BASE,
|
|
BL_RO_DATA_END
|
|
#if USE_COHERENT_MEM
|
|
, BL_COHERENT_RAM_BASE,
|
|
BL_COHERENT_RAM_END
|
|
#endif
|
|
);
|
|
enable_mmu_el1(0);
|
|
}
|