refactor(plat/st): check boot device only for BL2

The boot device is now checked inside a dedicated rule, that is only
called during BL2 compilation step

Change-Id: Ie7bcd1f166285224b0c042238989a82f7b6105c6
Signed-off-by: Yann Gautier <yann.gautier@st.com>
This commit is contained in:
Yann Gautier 2020-11-09 11:16:10 +01:00 committed by Yann Gautier
parent 1a2c0ff927
commit d3b0e8702a
1 changed files with 13 additions and 6 deletions

View File

@ -43,11 +43,6 @@ STM32MP_RAW_NAND ?= 0
STM32MP_SPI_NAND ?= 0
STM32MP_SPI_NOR ?= 0
ifeq ($(filter 1,${STM32MP_EMMC} ${STM32MP_SDMMC} ${STM32MP_RAW_NAND} \
${STM32MP_SPI_NAND} ${STM32MP_SPI_NOR}),)
$(error "No boot device driver is enabled")
endif
# Device tree
DTB_FILE_NAME ?= stm32mp157c-ev1.dtb
FDT_SOURCES := $(addprefix fdts/, $(patsubst %.dtb,%.dts,$(DTB_FILE_NAME)))
@ -196,13 +191,25 @@ BL2_SOURCES += lib/optee/optee_utils.c
endif
# Compilation rules
.PHONY: check_dtc_version stm32image clean_stm32image
.PHONY: check_dtc_version stm32image clean_stm32image check_boot_device
.SUFFIXES:
all: check_dtc_version stm32image ${STM32_TF_STM32}
distclean realclean clean: clean_stm32image
bl2: check_boot_device
check_boot_device:
@if [ ${STM32MP_EMMC} != 1 ] && \
[ ${STM32MP_SDMMC} != 1 ] && \
[ ${STM32MP_RAW_NAND} != 1 ] && \
[ ${STM32MP_SPI_NAND} != 1 ] && \
[ ${STM32MP_SPI_NOR} != 1 ]; then \
echo "No boot device driver is enabled"; \
false; \
fi
stm32image: ${STM32IMAGE}
${STM32IMAGE}: ${STM32IMAGE_SRC}