Browse Source

feat(stm32mp1): allow to override MTD base offset

Add an external parameter STM32MP_FORCE_MTD_START_OFFSET that allows to
override the default FIP offset used to read the first programmed image.
It can be used for NOR, RAW_NAND or SPI_NAND boot device.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Change-Id: Ibe664aae0e5ee90dd6629e544c9e034d751fffed
pull/1988/head
Lionel Debieve 4 years ago
committed by Yann Gautier
parent
commit
e0bbc190d5
  1. 6
      plat/st/stm32mp1/platform.mk
  2. 4
      plat/st/stm32mp1/stm32mp1_fip_def.h

6
plat/st/stm32mp1/platform.mk

@ -357,6 +357,9 @@ BL2_SOURCES += drivers/mtd/nand/spi_nand.c
endif
ifeq (${STM32MP_SPI_NOR},1)
ifneq (${STM32MP_FORCE_MTD_START_OFFSET},)
$(eval $(call add_define_val,STM32MP_NOR_FIP_OFFSET,${STM32MP_FORCE_MTD_START_OFFSET}))
endif
BL2_SOURCES += drivers/mtd/nor/spi_nor.c
endif
@ -366,6 +369,9 @@ BL2_SOURCES += drivers/mtd/spi-mem/spi_mem.c \
endif
ifneq ($(filter 1,${STM32MP_RAW_NAND} ${STM32MP_SPI_NAND}),)
ifneq (${STM32MP_FORCE_MTD_START_OFFSET},)
$(eval $(call add_define_val,STM32MP_NAND_FIP_OFFSET,${STM32MP_FORCE_MTD_START_OFFSET}))
endif
BL2_SOURCES += drivers/mtd/nand/core.c
endif

4
plat/st/stm32mp1/stm32mp1_fip_def.h

@ -106,7 +106,11 @@
* STM32MP1 RAW partition offset for devices without GPT
******************************************************************************/
#define STM32MP_EMMC_BOOT_FIP_OFFSET U(0x00040000)
#ifndef STM32MP_NOR_FIP_OFFSET
#define STM32MP_NOR_FIP_OFFSET U(0x00080000)
#endif
#ifndef STM32MP_NAND_FIP_OFFSET
#define STM32MP_NAND_FIP_OFFSET U(0x00200000)
#endif
#endif /* STM32MP1_FIP_DEF_H */

Loading…
Cancel
Save