diff options
-rw-r--r-- | common/runtime_svc.c | 3 | ||||
-rw-r--r-- | docs/user-guide.md | 13 | ||||
-rw-r--r-- | drivers/arm/gic/v3/gicv3_private.h | 2 | ||||
-rw-r--r-- | include/drivers/arm/gicv3.h | 6 | ||||
-rw-r--r-- | include/plat/arm/board/common/board_arm_def.h | 28 | ||||
-rw-r--r-- | plat/arm/board/common/board_common.mk | 6 | ||||
-rw-r--r-- | plat/arm/board/fvp/include/platform_def.h | 22 | ||||
-rw-r--r-- | plat/arm/board/juno/include/platform_def.h | 58 | ||||
-rw-r--r-- | plat/arm/board/juno/platform.mk | 2 |
9 files changed, 74 insertions, 66 deletions
diff --git a/common/runtime_svc.c b/common/runtime_svc.c index 7a5855b6..b8af6cd8 100644 --- a/common/runtime_svc.c +++ b/common/runtime_svc.c @@ -87,7 +87,8 @@ void runtime_svc_init(void) int rc = 0, index, start_idx, end_idx; /* Assert the number of descriptors detected are less than maximum indices */ - assert((RT_SVC_DECS_NUM >= 0) && (RT_SVC_DECS_NUM < MAX_RT_SVCS)); + assert((RT_SVC_DESCS_END >= RT_SVC_DESCS_START) && + (RT_SVC_DECS_NUM < MAX_RT_SVCS)); /* If no runtime services are implemented then simply bail out */ if (RT_SVC_DECS_NUM == 0) diff --git a/docs/user-guide.md b/docs/user-guide.md index 41a272fa..c9312f2c 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -465,12 +465,13 @@ map is explained in the [Firmware Design]. match the frame used by the Non-Secure image (normally the Linux kernel). Default is true (access to the frame is allowed). -* `ARM_BOARD_OPTIMISE_MMAP`: Boolean option to enable or disable optimisation - of page table and MMU related macros `PLAT_ARM_MMAP_ENTRIES` and - `MAX_XLAT_TABLES`. By default this flag is 0, which means it uses the - default unoptimised values for these macros. ARM development platforms - that wish to optimise memory usage for page tables need to set this flag to 1 - and must override the related macros. +* `ARM_BOARD_OPTIMISE_MEM`: Boolean option to enable or disable optimisation + of the memory reserved for each image. This affects the maximum size of each + BL image as well as the number of allocated memory regions and translation + tables. By default this flag is 0, which means it uses the default + unoptimised values for these macros. ARM development platforms that wish to + optimise memory usage need to set this flag to 1 and must override the + related macros. * 'ARM_BL31_IN_DRAM': Boolean option to select loading of BL31 in TZC secured DRAM. By default, BL31 is in the secure SRAM. Set this flag to 1 to load diff --git a/drivers/arm/gic/v3/gicv3_private.h b/drivers/arm/gic/v3/gicv3_private.h index 5e2409fc..9aa83382 100644 --- a/drivers/arm/gic/v3/gicv3_private.h +++ b/drivers/arm/gic/v3/gicv3_private.h @@ -141,6 +141,7 @@ static inline unsigned int gicd_read_pidr2(uintptr_t base) static inline unsigned long long gicd_read_irouter(uintptr_t base, unsigned int id) { + assert(id >= MIN_SPI_ID); return mmio_read_64(base + GICD_IROUTER + (id << 3)); } @@ -148,6 +149,7 @@ static inline void gicd_write_irouter(uintptr_t base, unsigned int id, unsigned long long affinity) { + assert(id >= MIN_SPI_ID); mmio_write_64(base + GICD_IROUTER + (id << 3), affinity); } diff --git a/include/drivers/arm/gicv3.h b/include/drivers/arm/gicv3.h index e915c072..b7ad7785 100644 --- a/include/drivers/arm/gicv3.h +++ b/include/drivers/arm/gicv3.h @@ -55,7 +55,11 @@ #define GICD_SETSPI_SR 0x50 #define GICD_CLRSPI_SR 0x50 #define GICD_IGRPMODR 0xd00 -#define GICD_IROUTER 0x6100 +/* + * GICD_IROUTER<n> register is at 0x6000 + 8n, where n is the interrupt id and + * n >= 32, making the effective offset as 0x6100. + */ +#define GICD_IROUTER 0x6000 #define GICD_PIDR2_GICV3 0xffe8 #define IGRPMODR_SHIFT 5 diff --git a/include/plat/arm/board/common/board_arm_def.h b/include/plat/arm/board/common/board_arm_def.h index d70fbb46..ad82923e 100644 --- a/include/plat/arm/board/common/board_arm_def.h +++ b/include/plat/arm/board/common/board_arm_def.h @@ -61,10 +61,10 @@ /* * The constants below are not optimised for memory usage. Platforms that wish - * to optimise these constants should set `ARM_BOARD_OPTIMISE_MMAP` to 1 and + * to optimise these constants should set `ARM_BOARD_OPTIMISE_MEM` to 1 and * provide there own values. */ -#if !ARM_BOARD_OPTIMISE_MMAP +#if !ARM_BOARD_OPTIMISE_MEM /* * PLAT_ARM_MMAP_ENTRIES depends on the number of entries in the * plat_arm_mmap array defined for each BL stage. @@ -81,7 +81,29 @@ # define MAX_XLAT_TABLES 5 #endif -#endif /* ARM_BOARD_OPTIMISE_MMAP */ +/* + * PLAT_ARM_MAX_BL1_RW_SIZE is calculated using the current BL1 RW debug size + * plus a little space for growth. + */ +#define PLAT_ARM_MAX_BL1_RW_SIZE 0xA000 + +/* + * PLAT_ARM_MAX_BL2_SIZE is calculated using the current BL2 debug size plus a + * little space for growth. + */ +#if TRUSTED_BOARD_BOOT +# define PLAT_ARM_MAX_BL2_SIZE 0x1D000 +#else +# define PLAT_ARM_MAX_BL2_SIZE 0xF000 +#endif + +/* + * PLAT_ARM_MAX_BL31_SIZE is calculated using the current BL31 debug size plus a + * little space for growth. + */ +#define PLAT_ARM_MAX_BL31_SIZE 0x1D000 + +#endif /* ARM_BOARD_OPTIMISE_MEM */ #define MAX_IO_DEVICES 3 #define MAX_IO_HANDLES 4 diff --git a/plat/arm/board/common/board_common.mk b/plat/arm/board/common/board_common.mk index 6ddc0c92..a5636d5e 100644 --- a/plat/arm/board/common/board_common.mk +++ b/plat/arm/board/common/board_common.mk @@ -61,8 +61,8 @@ ifneq (${TRUSTED_BOARD_BOOT},0) endif # This flag controls whether memory usage needs to be optimised -ARM_BOARD_OPTIMISE_MMAP ?= 0 +ARM_BOARD_OPTIMISE_MEM ?= 0 # Process flags -$(eval $(call assert_boolean,ARM_BOARD_OPTIMISE_MMAP)) -$(eval $(call add_define,ARM_BOARD_OPTIMISE_MMAP)) +$(eval $(call assert_boolean,ARM_BOARD_OPTIMISE_MEM)) +$(eval $(call add_define,ARM_BOARD_OPTIMISE_MEM)) diff --git a/plat/arm/board/fvp/include/platform_def.h b/plat/arm/board/fvp/include/platform_def.h index 1e906d82..d0898adc 100644 --- a/plat/arm/board/fvp/include/platform_def.h +++ b/plat/arm/board/fvp/include/platform_def.h @@ -146,26 +146,4 @@ #define PLAT_ARM_G0_IRQS ARM_G0_IRQS -/* - * PLAT_ARM_MAX_BL1_RW_SIZE is calculated using the current BL1 RW debug size - * plus a little space for growth. - */ -#define PLAT_ARM_MAX_BL1_RW_SIZE 0xA000 - -/* - * PLAT_ARM_MAX_BL2_SIZE is calculated using the current BL2 debug size plus a - * little space for growth. - */ -#if TRUSTED_BOARD_BOOT -# define PLAT_ARM_MAX_BL2_SIZE 0x1D000 -#else -# define PLAT_ARM_MAX_BL2_SIZE 0xC000 -#endif - -/* - * PLAT_ARM_MAX_BL31_SIZE is calculated using the current BL31 debug size plus a - * little space for growth. - */ -#define PLAT_ARM_MAX_BL31_SIZE 0x1D000 - #endif /* __PLATFORM_DEF_H__ */ diff --git a/plat/arm/board/juno/include/platform_def.h b/plat/arm/board/juno/include/platform_def.h index a2cf0368..c53e938f 100644 --- a/plat/arm/board/juno/include/platform_def.h +++ b/plat/arm/board/juno/include/platform_def.h @@ -74,10 +74,10 @@ #endif /* TRUSTED_BOARD_BOOT */ /* - * If ARM_BOARD_OPTIMISE_MMAP=0 then Juno uses the default, unoptimised values + * If ARM_BOARD_OPTIMISE_MEM=0 then Juno uses the default, unoptimised values * defined for ARM development platforms. */ -#if ARM_BOARD_OPTIMISE_MMAP +#if ARM_BOARD_OPTIMISE_MEM /* * PLAT_ARM_MMAP_ENTRIES depends on the number of entries in the * plat_arm_mmap array defined for each BL stage. @@ -107,7 +107,33 @@ # define MAX_XLAT_TABLES 3 #endif -#endif /* ARM_BOARD_OPTIMISE_MMAP */ +/* + * PLAT_ARM_MAX_BL1_RW_SIZE is calculated using the current BL1 RW debug size + * plus a little space for growth. + */ +#if TRUSTED_BOARD_BOOT +# define PLAT_ARM_MAX_BL1_RW_SIZE 0x9000 +#else +# define PLAT_ARM_MAX_BL1_RW_SIZE 0x6000 +#endif + +/* + * PLAT_ARM_MAX_BL2_SIZE is calculated using the current BL2 debug size plus a + * little space for growth. + */ +#if TRUSTED_BOARD_BOOT +# define PLAT_ARM_MAX_BL2_SIZE 0x1D000 +#else +# define PLAT_ARM_MAX_BL2_SIZE 0xC000 +#endif + +/* + * PLAT_ARM_MAX_BL31_SIZE is calculated using the current BL31 debug size plus a + * little space for growth. + */ +#define PLAT_ARM_MAX_BL31_SIZE 0x1D000 + +#endif /* ARM_BOARD_OPTIMISE_MEM */ /* CCI related constants */ #define PLAT_ARM_CCI_BASE 0x2c090000 @@ -183,30 +209,4 @@ /* CSS SoC NIC-400 Global Programmers View (GPV) */ #define PLAT_SOC_CSS_NIC400_BASE 0x2a000000 -/* - * PLAT_ARM_MAX_BL1_RW_SIZE is calculated using the current BL1 RW debug size - * plus a little space for growth. - */ -#if TRUSTED_BOARD_BOOT -# define PLAT_ARM_MAX_BL1_RW_SIZE 0x9000 -#else -# define PLAT_ARM_MAX_BL1_RW_SIZE 0x6000 -#endif - -/* - * PLAT_ARM_MAX_BL2_SIZE is calculated using the current BL2 debug size plus a - * little space for growth. - */ -#if TRUSTED_BOARD_BOOT -# define PLAT_ARM_MAX_BL2_SIZE 0x1D000 -#else -# define PLAT_ARM_MAX_BL2_SIZE 0xC000 -#endif - -/* - * PLAT_ARM_MAX_BL31_SIZE is calculated using the current BL31 debug size plus a - * little space for growth. - */ -#define PLAT_ARM_MAX_BL31_SIZE 0x1D000 - #endif /* __PLATFORM_DEF_H__ */ diff --git a/plat/arm/board/juno/platform.mk b/plat/arm/board/juno/platform.mk index 4fda4ca1..c1cfffc4 100644 --- a/plat/arm/board/juno/platform.mk +++ b/plat/arm/board/juno/platform.mk @@ -79,7 +79,7 @@ SKIP_A57_L1_FLUSH_PWR_DWN := 1 ENABLE_PLAT_COMPAT := 0 # Enable memory map related constants optimisation -ARM_BOARD_OPTIMISE_MMAP := 1 +ARM_BOARD_OPTIMISE_MEM := 1 include plat/arm/board/common/board_css.mk include plat/arm/common/arm_common.mk |