diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | common/aarch64/debug.S | 1 | ||||
-rw-r--r-- | include/lib/xlat_tables/xlat_tables_v2_helpers.h | 2 | ||||
-rw-r--r-- | lib/psci/psci_common.c | 4 | ||||
-rw-r--r-- | lib/psci/psci_suspend.c | 14 | ||||
-rw-r--r-- | make_helpers/build_macros.mk | 2 | ||||
-rw-r--r-- | plat/arm/common/arm_common.mk | 7 | ||||
-rw-r--r-- | plat/common/plat_psci_common.c | 9 | ||||
-rw-r--r-- | plat/hisilicon/hikey/aarch64/hikey_common.c | 8 | ||||
-rw-r--r-- | plat/hisilicon/hikey/hikey_io_storage.c | 2 | ||||
-rw-r--r-- | plat/hisilicon/hikey/include/platform_def.h | 6 | ||||
-rw-r--r-- | plat/hisilicon/hikey960/aarch64/hikey960_common.c | 8 | ||||
-rw-r--r-- | plat/hisilicon/hikey960/include/platform_def.h | 4 | ||||
-rw-r--r-- | plat/rockchip/rk3328/include/platform_def.h | 8 | ||||
-rw-r--r-- | plat/rockchip/rk3399/platform.mk | 2 | ||||
-rw-r--r-- | plat/socionext/uniphier/platform.mk | 2 |
16 files changed, 45 insertions, 36 deletions
@@ -260,6 +260,8 @@ include lib/stack_protector/stack_protector.mk include ${PLAT_MAKEFILE_FULL} +$(eval $(call MAKE_PREREQ_DIR,${BUILD_PLAT})) + # Platform compatibility is not supported in AArch32 ifneq (${ARCH},aarch32) # If the platform has not defined ENABLE_PLAT_COMPAT, then enable it by default diff --git a/common/aarch64/debug.S b/common/aarch64/debug.S index d794d12e..4478d0d0 100644 --- a/common/aarch64/debug.S +++ b/common/aarch64/debug.S @@ -6,6 +6,7 @@ #include <arch.h> #include <asm_macros.S> +#include <debug.h> .globl asm_print_str .globl asm_print_hex diff --git a/include/lib/xlat_tables/xlat_tables_v2_helpers.h b/include/lib/xlat_tables/xlat_tables_v2_helpers.h index 28228c4c..96dee1a0 100644 --- a/include/lib/xlat_tables/xlat_tables_v2_helpers.h +++ b/include/lib/xlat_tables/xlat_tables_v2_helpers.h @@ -168,7 +168,7 @@ struct xlat_ctx { * This IMAGE_EL macro must not to be used outside the library, and it is only * used in AArch64. */ -#if IMAGE_BL1 || IMAGE_BL31 +#if defined(IMAGE_BL1) || defined(IMAGE_BL31) # define IMAGE_EL 3 # define IMAGE_XLAT_DEFAULT_REGIME EL3_REGIME #else diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c index 4502c24b..2220a745 100644 --- a/lib/psci/psci_common.c +++ b/lib/psci/psci_common.c @@ -767,12 +767,12 @@ void psci_warmboot_entrypoint(void) psci_acquire_pwr_domain_locks(end_pwrlvl, cpu_idx); + psci_get_target_local_pwr_states(end_pwrlvl, &state_info); + #if ENABLE_PSCI_STAT plat_psci_stat_accounting_stop(&state_info); #endif - psci_get_target_local_pwr_states(end_pwrlvl, &state_info); - /* * This CPU could be resuming from suspend or it could have just been * turned on. To distinguish between these 2 cases, we examine the diff --git a/lib/psci/psci_suspend.c b/lib/psci/psci_suspend.c index 40ecdeea..d9490672 100644 --- a/lib/psci/psci_suspend.c +++ b/lib/psci/psci_suspend.c @@ -37,6 +37,11 @@ static void psci_suspend_to_standby_finisher(unsigned int cpu_idx, */ psci_get_target_local_pwr_states(end_pwrlvl, &state_info); +#if ENABLE_PSCI_STAT + plat_psci_stat_accounting_stop(&state_info); + psci_stats_update_pwr_up(end_pwrlvl, &state_info); +#endif + /* * Plat. management: Allow the platform to do operations * on waking up from retention. @@ -236,10 +241,6 @@ exit: PMF_NO_CACHE_MAINT); #endif -#if ENABLE_PSCI_STAT - plat_psci_stat_accounting_start(state_info); -#endif - /* * We will reach here if only retention/standby states have been * requested at multiple power levels. This means that the cpu @@ -247,11 +248,6 @@ exit: */ wfi(); -#if ENABLE_PSCI_STAT - plat_psci_stat_accounting_stop(state_info); - psci_stats_update_pwr_up(end_pwrlvl, state_info); -#endif - #if ENABLE_RUNTIME_INSTRUMENTATION PMF_CAPTURE_TIMESTAMP(rt_instr_svc, RT_INSTR_EXIT_HW_LOW_PWR, diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index e59a64b4..7531f6d8 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -291,7 +291,7 @@ define MAKE_BL # Create generators for object directory structure -$(eval $(call MAKE_PREREQ_DIR,${BUILD_DIR},)) +$(eval $(call MAKE_PREREQ_DIR,${BUILD_DIR},${BUILD_PLAT})) $(eval $(foreach objd,${OBJ_DIRS},$(call MAKE_PREREQ_DIR,${objd},${BUILD_DIR}))) diff --git a/plat/arm/common/arm_common.mk b/plat/arm/common/arm_common.mk index e1484d7e..44eb43f6 100644 --- a/plat/arm/common/arm_common.mk +++ b/plat/arm/common/arm_common.mk @@ -26,14 +26,17 @@ ifeq (${ARCH}, aarch64) endif # Process flags - $(eval $(call add_define,ARM_TSP_RAM_LOCATION_ID)) - # Process ARM_BL31_IN_DRAM flag ARM_BL31_IN_DRAM := 0 $(eval $(call assert_boolean,ARM_BL31_IN_DRAM)) $(eval $(call add_define,ARM_BL31_IN_DRAM)) +else + ARM_TSP_RAM_LOCATION_ID = ARM_TRUSTED_SRAM_ID endif +$(eval $(call add_define,ARM_TSP_RAM_LOCATION_ID)) + + # For the original power-state parameter format, the State-ID can be encoded # according to the recommended encoding or zero. This flag determines which # State-ID encoding to be parsed. diff --git a/plat/common/plat_psci_common.c b/plat/common/plat_psci_common.c index 95adb051..0e818d0d 100644 --- a/plat/common/plat_psci_common.c +++ b/plat/common/plat_psci_common.c @@ -18,6 +18,13 @@ /* Ticks elapsed in one second by a signal of 1 MHz */ #define MHZ_TICKS_PER_SEC 1000000 +/* Maximum time-stamp value read from architectural counters */ +#ifdef AARCH32 +#define MAX_TS UINT32_MAX +#else +#define MAX_TS UINT64_MAX +#endif + /* Following are used as ID's to capture time-stamp */ #define PSCI_STAT_ID_ENTER_LOW_PWR 0 #define PSCI_STAT_ID_EXIT_LOW_PWR 1 @@ -45,7 +52,7 @@ static u_register_t calc_stat_residency(unsigned long long pwrupts, assert(residency_div); if (pwrupts < pwrdnts) - res = UINT64_MAX - pwrdnts + pwrupts; + res = MAX_TS - pwrdnts + pwrupts; else res = pwrupts - pwrdnts; diff --git a/plat/hisilicon/hikey/aarch64/hikey_common.c b/plat/hisilicon/hikey/aarch64/hikey_common.c index 02a00ac8..d5b63cc6 100644 --- a/plat/hisilicon/hikey/aarch64/hikey_common.c +++ b/plat/hisilicon/hikey/aarch64/hikey_common.c @@ -59,7 +59,7 @@ * This doesn't include Trusted RAM as the 'mem_layout' argument passed to * hikey_init_mmu_elx() will give the available subset of that, */ -#if IMAGE_BL1 +#ifdef IMAGE_BL1 static const mmap_region_t hikey_mmap[] = { MAP_DEVICE, MAP_ROM_PARAM, @@ -68,7 +68,7 @@ static const mmap_region_t hikey_mmap[] = { }; #endif -#if IMAGE_BL2 +#ifdef IMAGE_BL2 static const mmap_region_t hikey_mmap[] = { MAP_DDR, MAP_DEVICE, @@ -82,7 +82,7 @@ static const mmap_region_t hikey_mmap[] = { }; #endif -#if IMAGE_BL31 +#ifdef IMAGE_BL31 static const mmap_region_t hikey_mmap[] = { MAP_DEVICE, MAP_SRAM, @@ -91,7 +91,7 @@ static const mmap_region_t hikey_mmap[] = { }; #endif -#if IMAGE_BL32 +#ifdef IMAGE_BL32 static const mmap_region_t hikey_mmap[] = { MAP_DEVICE, MAP_DDR, diff --git a/plat/hisilicon/hikey/hikey_io_storage.c b/plat/hisilicon/hikey/hikey_io_storage.c index 60ec42b7..57c66d50 100644 --- a/plat/hisilicon/hikey/hikey_io_storage.c +++ b/plat/hisilicon/hikey/hikey_io_storage.c @@ -47,7 +47,7 @@ static const io_block_spec_t emmc_fip_spec = { static const io_block_dev_spec_t emmc_dev_spec = { /* It's used as temp buffer in block driver. */ -#if IMAGE_BL1 +#ifdef IMAGE_BL1 .buffer = { .offset = HIKEY_BL1_MMC_DATA_BASE, .length = HIKEY_BL1_MMC_DATA_SIZE, diff --git a/plat/hisilicon/hikey/include/platform_def.h b/plat/hisilicon/hikey/include/platform_def.h index 01806542..f4a3fd4e 100644 --- a/plat/hisilicon/hikey/include/platform_def.h +++ b/plat/hisilicon/hikey/include/platform_def.h @@ -151,15 +151,15 @@ */ #define ADDR_SPACE_SIZE (1ull << 32) -#if IMAGE_BL1 || IMAGE_BL32 +#if defined(IMAGE_BL1) || defined(IMAGE_BL32) #define MAX_XLAT_TABLES 3 #endif -#if IMAGE_BL31 +#ifdef IMAGE_BL31 #define MAX_XLAT_TABLES 4 #endif -#if IMAGE_BL2 +#ifdef IMAGE_BL2 #if LOAD_IMAGE_V2 #ifdef SPD_opteed #define MAX_XLAT_TABLES 4 diff --git a/plat/hisilicon/hikey960/aarch64/hikey960_common.c b/plat/hisilicon/hikey960/aarch64/hikey960_common.c index bce0c96a..b1020a68 100644 --- a/plat/hisilicon/hikey960/aarch64/hikey960_common.c +++ b/plat/hisilicon/hikey960/aarch64/hikey960_common.c @@ -55,7 +55,7 @@ * This doesn't include Trusted RAM as the 'mem_layout' argument passed to * hikey960_init_mmu_elx() will give the available subset of that, */ -#if IMAGE_BL1 +#ifdef IMAGE_BL1 static const mmap_region_t hikey960_mmap[] = { MAP_UFS_DATA, MAP_BL1_RW, @@ -65,7 +65,7 @@ static const mmap_region_t hikey960_mmap[] = { }; #endif -#if IMAGE_BL2 +#ifdef IMAGE_BL2 static const mmap_region_t hikey960_mmap[] = { MAP_DDR, MAP_DEVICE, @@ -79,7 +79,7 @@ static const mmap_region_t hikey960_mmap[] = { }; #endif -#if IMAGE_BL31 +#ifdef IMAGE_BL31 static const mmap_region_t hikey960_mmap[] = { MAP_DEVICE, MAP_TSP_MEM, @@ -87,7 +87,7 @@ static const mmap_region_t hikey960_mmap[] = { }; #endif -#if IMAGE_BL32 +#ifdef IMAGE_BL32 static const mmap_region_t hikey960_mmap[] = { MAP_DEVICE, MAP_DDR, diff --git a/plat/hisilicon/hikey960/include/platform_def.h b/plat/hisilicon/hikey960/include/platform_def.h index 202952c5..cb760907 100644 --- a/plat/hisilicon/hikey960/include/platform_def.h +++ b/plat/hisilicon/hikey960/include/platform_def.h @@ -116,11 +116,11 @@ */ #define ADDR_SPACE_SIZE (1ull << 32) -#if IMAGE_BL1 || IMAGE_BL31 || IMAGE_BL32 +#if defined(IMAGE_BL1) || defined(IMAGE_BL31) || defined(IMAGE_BL32) #define MAX_XLAT_TABLES 3 #endif -#if IMAGE_BL2 +#ifdef IMAGE_BL2 #if LOAD_IMAGE_V2 #ifdef SPD_opteed #define MAX_XLAT_TABLES 4 diff --git a/plat/rockchip/rk3328/include/platform_def.h b/plat/rockchip/rk3328/include/platform_def.h index 7304dcfa..39d3c21e 100644 --- a/plat/rockchip/rk3328/include/platform_def.h +++ b/plat/rockchip/rk3328/include/platform_def.h @@ -26,13 +26,13 @@ /* Size of cacheable stacks */ #if DEBUG_XLAT_TABLE #define PLATFORM_STACK_SIZE 0x800 -#elif IMAGE_BL1 +#elif defined(IMAGE_BL1) #define PLATFORM_STACK_SIZE 0x440 -#elif IMAGE_BL2 +#elif defined(IMAGE_BL2) #define PLATFORM_STACK_SIZE 0x400 -#elif IMAGE_BL31 +#elif defined(IMAGE_BL31) #define PLATFORM_STACK_SIZE 0x800 -#elif IMAGE_BL32 +#elif defined(IMAGE_BL32) #define PLATFORM_STACK_SIZE 0x440 #endif diff --git a/plat/rockchip/rk3399/platform.mk b/plat/rockchip/rk3399/platform.mk index 85cca1b6..6cd5b242 100644 --- a/plat/rockchip/rk3399/platform.mk +++ b/plat/rockchip/rk3399/platform.mk @@ -88,7 +88,7 @@ ${RK_PLAT_SOC}/drivers/pmu/pmu_fw.c: $(RK3399M0FW) ${BUILD_PLAT}/bl31/cdn_dp.o: CCACHE_EXTRAFILES=$(HDCPFW) ${RK_PLAT_SOC}/drivers/dp/cdn_dp.c: $(HDCPFW) -$(eval $(call MAKE_PREREQ_DIR,${BUILD_M0},)) +$(eval $(call MAKE_PREREQ_DIR,${BUILD_M0},${BUILD_PLAT})) .PHONY: $(RK3399M0FW) $(RK3399M0FW): | ${BUILD_M0} $(MAKE) -C ${RK_PLAT_SOC}/drivers/m0 BUILD=$(abspath ${BUILD_PLAT}/m0) diff --git a/plat/socionext/uniphier/platform.mk b/plat/socionext/uniphier/platform.mk index e6f510e0..c91abb6b 100644 --- a/plat/socionext/uniphier/platform.mk +++ b/plat/socionext/uniphier/platform.mk @@ -101,7 +101,7 @@ $(BUILD_PLAT)/bl1/uniphier_rotpk.o: $(ROTPK_HASH) $(BUILD_PLAT)/bl2/uniphier_rotpk.o: $(ROTPK_HASH) certificates: $(ROT_KEY) -$(ROT_KEY): +$(ROT_KEY): | $(BUILD_PLAT) @echo " OPENSSL $@" $(Q)openssl genrsa 2048 > $@ 2>/dev/null |