Merge changes I4e95678f,Ia7c28704,I1bb04bb4,I93d96dca,I50aef5dd into integration

* changes:
  Fix boot failures on some builds linked with ld.lld.
  trusty: generic-arm64-smcall: Support gicr address
  trusty: Allow gic base to be specified with GICD_BASE
  trusty: Allow getting trusty memsize from BL32_MEM_SIZE instead of TSP_SEC_MEM_SIZE
  Fix clang build if CC is not in the path.
This commit is contained in:
Mark Dykes 2020-02-18 16:24:33 +00:00 committed by TrustedFirmware Code Review
commit 98ab180565
5 changed files with 40 additions and 3 deletions

View File

@ -207,9 +207,10 @@ AS = $(CC) -c -x assembler-with-cpp $(TF_CFLAGS_$(ARCH))
CPP = $(CC) -E $(TF_CFLAGS_$(ARCH))
PP = $(CC) -E $(TF_CFLAGS_$(ARCH))
else ifneq ($(findstring clang,$(notdir $(CC))),)
CLANG_CCDIR = $(if $(filter-out ./,$(dir $(CC))),$(dir $(CC)),)
TF_CFLAGS_aarch32 = $(target32-directive) $(march32-directive)
TF_CFLAGS_aarch64 = -target aarch64-elf $(march64-directive)
LD = ld.lld
LD = $(CLANG_CCDIR)ld.lld
ifeq (, $(shell which $(LD)))
$(error "No $(LD) in PATH, make sure it is installed or set LD to a different linker")
endif

View File

@ -65,8 +65,13 @@ SECTIONS
* No need to pad out the .rodata section to a page boundary. Next is
* the .data section, which can mapped in ROM with the same memory
* attributes as the .rodata section.
*
* Pad out to 16 bytes though as .data section needs to be 16 byte
* aligned and lld does not align the LMA to the aligment specified
* on the .data section.
*/
__RODATA_END__ = .;
. = ALIGN(16);
} >ROM
#else
ro . : {
@ -92,6 +97,13 @@ SECTIONS
*(.vectors)
__RO_END__ = .;
/*
* Pad out to 16 bytes as .data section needs to be 16 byte aligned and
* lld does not align the LMA to the aligment specified on the .data
* section.
*/
. = ALIGN(16);
} >ROM
#endif

View File

@ -12,6 +12,22 @@
#include "generic-arm64-smcall.h"
#ifndef PLAT_ARM_GICD_BASE
#ifdef GICD_BASE
#define PLAT_ARM_GICD_BASE GICD_BASE
#define PLAT_ARM_GICC_BASE GICC_BASE
#ifdef GICR_BASE
#define PLAT_ARM_GICR_BASE GICR_BASE
#endif
#else
#error PLAT_ARM_GICD_BASE or GICD_BASE must be defined
#endif
#endif
#ifndef PLAT_ARM_GICR_BASE
#define PLAT_ARM_GICR_BASE SMC_UNK
#endif
int trusty_disable_serial_debug;
struct dputc_state {
@ -48,12 +64,15 @@ static void trusty_dputc(char ch, int secure)
static uint64_t trusty_get_reg_base(uint32_t reg)
{
switch (reg) {
case 0:
case SMC_GET_GIC_BASE_GICD:
return PLAT_ARM_GICD_BASE;
case 1:
case SMC_GET_GIC_BASE_GICC:
return PLAT_ARM_GICC_BASE;
case SMC_GET_GIC_BASE_GICR:
return PLAT_ARM_GICR_BASE;
default:
NOTICE("%s(0x%x) unknown reg\n", __func__, reg);
return SMC_UNK;

View File

@ -23,5 +23,6 @@
*/
#define SMC_GET_GIC_BASE_GICD 0
#define SMC_GET_GIC_BASE_GICC 1
#define SMC_GET_GIC_BASE_GICR 2
#define SMC_FC_GET_REG_BASE SMC_FASTCALL_NR(SMC_ENTITY_PLATFORM_MONITOR, 0x1)
#define SMC_FC64_GET_REG_BASE SMC_FASTCALL64_NR(SMC_ENTITY_PLATFORM_MONITOR, 0x1)

View File

@ -390,6 +390,10 @@ static const spd_pm_ops_t trusty_pm = {
void plat_trusty_set_boot_args(aapcs64_params_t *args);
#if !defined(TSP_SEC_MEM_SIZE) && defined(BL32_MEM_SIZE)
#define TSP_SEC_MEM_SIZE BL32_MEM_SIZE
#endif
#ifdef TSP_SEC_MEM_SIZE
#pragma weak plat_trusty_set_boot_args
void plat_trusty_set_boot_args(aapcs64_params_t *args)