diff options
author | Nicolas Le Bayon <nicolas.le.bayon@st.com> | 2019-09-03 09:52:05 +0200 |
---|---|---|
committer | Lionel Debieve <lionel.debieve@st.com> | 2020-01-20 11:32:59 +0100 |
commit | 46554b6470350ece72578d9bc4b9fd1d7cd41258 (patch) | |
tree | abeb38d9bafea99ee8f0d63595cffebd2cefe002 /plat/st | |
parent | e76d9fc422698a88cee13e960154e185670861dc (diff) | |
download | platform_external_arm-trusted-firmware-46554b6470350ece72578d9bc4b9fd1d7cd41258.tar.gz platform_external_arm-trusted-firmware-46554b6470350ece72578d9bc4b9fd1d7cd41258.tar.bz2 platform_external_arm-trusted-firmware-46554b6470350ece72578d9bc4b9fd1d7cd41258.zip |
stm32mp1: add compilation flags for boot devices
Adds compilation flags to specify which drivers will be
embedded in the generated firmware.
Change-Id: Ie9decc89c3f26cf17e7148a3a4cf337fd35940f7
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Diffstat (limited to 'plat/st')
-rw-r--r-- | plat/st/common/bl2_io_storage.c | 16 | ||||
-rw-r--r-- | plat/st/stm32mp1/platform.mk | 15 |
2 files changed, 28 insertions, 3 deletions
diff --git a/plat/st/common/bl2_io_storage.c b/plat/st/common/bl2_io_storage.c index 38b2a0bd7..d7f53ceec 100644 --- a/plat/st/common/bl2_io_storage.c +++ b/plat/st/common/bl2_io_storage.c @@ -30,7 +30,9 @@ static uintptr_t dummy_dev_handle; static uintptr_t dummy_dev_spec; static uintptr_t image_dev_handle; +static uintptr_t storage_dev_handle; +#if STM32MP_SDMMC || STM32MP_EMMC static io_block_spec_t gpt_block_spec = { .offset = 0, .length = 34 * MMC_BLOCK_SIZE, /* Size of GPT table */ @@ -51,8 +53,8 @@ static const io_block_dev_spec_t mmc_block_dev_spec = { .block_size = MMC_BLOCK_SIZE, }; -static uintptr_t storage_dev_handle; static const io_dev_connector_t *mmc_dev_con; +#endif /* STM32MP_SDMMC || STM32MP_EMMC */ #ifdef AARCH32_SP_OPTEE static const struct stm32image_part_info optee_header_partition_spec = { @@ -96,7 +98,7 @@ enum { IMG_IDX_NUM }; -static struct stm32image_device_info stm32image_dev_info_spec = { +static struct stm32image_device_info stm32image_dev_info_spec __unused = { .lba_size = MMC_BLOCK_SIZE, .part_info[IMG_IDX_BL33] = { .name = BL33_IMAGE_NAME, @@ -123,7 +125,7 @@ static io_block_spec_t stm32image_block_spec = { .length = 0, }; -static const io_dev_connector_t *stm32image_dev_con; +static const io_dev_connector_t *stm32image_dev_con __unused; static int open_dummy(const uintptr_t spec); static int open_image(const uintptr_t spec); @@ -169,11 +171,13 @@ static const struct plat_io_policy policies[] = { .image_spec = (uintptr_t)&bl33_partition_spec, .check = open_image }, +#if STM32MP_SDMMC || STM32MP_EMMC [GPT_IMAGE_ID] = { .dev_handle = &storage_dev_handle, .image_spec = (uintptr_t)&gpt_block_spec, .check = open_storage }, +#endif [STM32_IMAGE_ID] = { .dev_handle = &storage_dev_handle, .image_spec = (uintptr_t)&stm32image_block_spec, @@ -216,6 +220,7 @@ static void print_boot_device(boot_api_context_t *boot_context) } } +#if STM32MP_SDMMC || STM32MP_EMMC static void boot_mmc(enum mmc_device_type mmc_dev_type, uint16_t boot_interface_instance) { @@ -305,6 +310,7 @@ static void boot_mmc(enum mmc_device_type mmc_dev_type, &image_dev_handle); assert(io_result == 0); } +#endif /* STM32MP_SDMMC || STM32MP_EMMC */ void stm32mp_io_setup(void) { @@ -328,14 +334,18 @@ void stm32mp_io_setup(void) assert(io_result == 0); switch (boot_context->boot_interface_selected) { +#if STM32MP_SDMMC case BOOT_API_CTX_BOOT_INTERFACE_SEL_FLASH_SD: dmbsy(); boot_mmc(MMC_IS_SD, boot_context->boot_interface_instance); break; +#endif +#if STM32MP_EMMC case BOOT_API_CTX_BOOT_INTERFACE_SEL_FLASH_EMMC: dmbsy(); boot_mmc(MMC_IS_EMMC, boot_context->boot_interface_instance); break; +#endif default: ERROR("Boot interface %d not supported\n", diff --git a/plat/st/stm32mp1/platform.mk b/plat/st/stm32mp1/platform.mk index 90b3e3c1e..a14a9abbb 100644 --- a/plat/st/stm32mp1/platform.mk +++ b/plat/st/stm32mp1/platform.mk @@ -24,6 +24,19 @@ PLAT_PARTITION_MAX_ENTRIES := $(shell echo $$(($(STM32_TF_A_COPIES) + 1))) endif $(eval $(call add_define,PLAT_PARTITION_MAX_ENTRIES)) +# Boot devices +STM32MP_EMMC ?= 0 +STM32MP_SDMMC ?= 0 + +ifeq ($(filter 1,${STM32MP_EMMC} ${STM32MP_SDMMC}),) +$(error "No boot device driver is enabled") +endif + +$(eval $(call assert_boolean,STM32MP_EMMC)) +$(eval $(call assert_boolean,STM32MP_SDMMC)) +$(eval $(call add_define,STM32MP_EMMC)) +$(eval $(call add_define,STM32MP_SDMMC)) + PLAT_INCLUDES := -Iplat/st/common/include/ PLAT_INCLUDES += -Iplat/st/stm32mp1/include/ @@ -77,11 +90,13 @@ BL2_SOURCES += drivers/io/io_block.c \ plat/st/common/bl2_io_storage.c \ plat/st/stm32mp1/bl2_plat_setup.c +ifneq ($(filter 1,${STM32MP_EMMC} ${STM32MP_SDMMC}),) BL2_SOURCES += drivers/mmc/mmc.c \ drivers/partition/gpt.c \ drivers/partition/partition.c \ drivers/st/io/io_mmc.c \ drivers/st/mmc/stm32_sdmmc2.c +endif BL2_SOURCES += drivers/st/ddr/stm32mp1_ddr.c \ drivers/st/ddr/stm32mp1_ram.c |