Commit 98ab1805 authored by Mark Dykes's avatar Mark Dykes Committed by TrustedFirmware Code Review
Browse files

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.
parents 95605938 41286590
...@@ -207,9 +207,10 @@ AS = $(CC) -c -x assembler-with-cpp $(TF_CFLAGS_$(ARCH)) ...@@ -207,9 +207,10 @@ AS = $(CC) -c -x assembler-with-cpp $(TF_CFLAGS_$(ARCH))
CPP = $(CC) -E $(TF_CFLAGS_$(ARCH)) CPP = $(CC) -E $(TF_CFLAGS_$(ARCH))
PP = $(CC) -E $(TF_CFLAGS_$(ARCH)) PP = $(CC) -E $(TF_CFLAGS_$(ARCH))
else ifneq ($(findstring clang,$(notdir $(CC))),) else ifneq ($(findstring clang,$(notdir $(CC))),)
CLANG_CCDIR = $(if $(filter-out ./,$(dir $(CC))),$(dir $(CC)),)
TF_CFLAGS_aarch32 = $(target32-directive) $(march32-directive) TF_CFLAGS_aarch32 = $(target32-directive) $(march32-directive)
TF_CFLAGS_aarch64 = -target aarch64-elf $(march64-directive) TF_CFLAGS_aarch64 = -target aarch64-elf $(march64-directive)
LD = ld.lld LD = $(CLANG_CCDIR)ld.lld
ifeq (, $(shell which $(LD))) ifeq (, $(shell which $(LD)))
$(error "No $(LD) in PATH, make sure it is installed or set LD to a different linker") $(error "No $(LD) in PATH, make sure it is installed or set LD to a different linker")
endif endif
......
...@@ -65,8 +65,13 @@ SECTIONS ...@@ -65,8 +65,13 @@ SECTIONS
* No need to pad out the .rodata section to a page boundary. Next is * 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 * the .data section, which can mapped in ROM with the same memory
* attributes as the .rodata section. * 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__ = .; __RODATA_END__ = .;
. = ALIGN(16);
} >ROM } >ROM
#else #else
ro . : { ro . : {
...@@ -92,6 +97,13 @@ SECTIONS ...@@ -92,6 +97,13 @@ SECTIONS
*(.vectors) *(.vectors)
__RO_END__ = .; __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 } >ROM
#endif #endif
......
...@@ -12,6 +12,22 @@ ...@@ -12,6 +12,22 @@
#include "generic-arm64-smcall.h" #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; int trusty_disable_serial_debug;
struct dputc_state { struct dputc_state {
...@@ -48,12 +64,15 @@ static void trusty_dputc(char ch, int secure) ...@@ -48,12 +64,15 @@ static void trusty_dputc(char ch, int secure)
static uint64_t trusty_get_reg_base(uint32_t reg) static uint64_t trusty_get_reg_base(uint32_t reg)
{ {
switch (reg) { switch (reg) {
case 0: case SMC_GET_GIC_BASE_GICD:
return PLAT_ARM_GICD_BASE; return PLAT_ARM_GICD_BASE;
case 1: case SMC_GET_GIC_BASE_GICC:
return PLAT_ARM_GICC_BASE; return PLAT_ARM_GICC_BASE;
case SMC_GET_GIC_BASE_GICR:
return PLAT_ARM_GICR_BASE;
default: default:
NOTICE("%s(0x%x) unknown reg\n", __func__, reg); NOTICE("%s(0x%x) unknown reg\n", __func__, reg);
return SMC_UNK; return SMC_UNK;
......
...@@ -23,5 +23,6 @@ ...@@ -23,5 +23,6 @@
*/ */
#define SMC_GET_GIC_BASE_GICD 0 #define SMC_GET_GIC_BASE_GICD 0
#define SMC_GET_GIC_BASE_GICC 1 #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_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) #define SMC_FC64_GET_REG_BASE SMC_FASTCALL64_NR(SMC_ENTITY_PLATFORM_MONITOR, 0x1)
...@@ -390,6 +390,10 @@ static const spd_pm_ops_t trusty_pm = { ...@@ -390,6 +390,10 @@ static const spd_pm_ops_t trusty_pm = {
void plat_trusty_set_boot_args(aapcs64_params_t *args); 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 #ifdef TSP_SEC_MEM_SIZE
#pragma weak plat_trusty_set_boot_args #pragma weak plat_trusty_set_boot_args
void plat_trusty_set_boot_args(aapcs64_params_t *args) void plat_trusty_set_boot_args(aapcs64_params_t *args)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment