Hello,
I am writing a custom BL2 boot loader using ATF reference code.
I saw that BL1 uses the low addresses of OCRAM in boot process, and also that BL31 uses a portion at the end of OCRAM.
What are the exact areas reserved for BL1/BL31 use? Which area is considered "safe" for BL2 execution?
Thanks,
Dmitri
解決済! 解決策の投稿を見る。
Please refer to the following code in plat/nxp/soc-lx2160a/soc.def, the size of NXP_ROM_RSVD OCRAM memory space is used for bootrom, after this reserved area, all other OCRAM memory space can be used for BL2.
# Location of BL2 on OCRAM
BL2_BASE_ADDR := $(shell echo $$(( $(OCRAM_START_ADDR) + $(NXP_ROM_RSVD) + $(CSF_HDR_SZ) )))
# Covert to HEX to be used by create_pbl.mk
BL2_BASE := $(shell echo "0x"$$(echo "obase=16; ${BL2_BASE_ADDR}" | bc))
# BL2_HDR_LOC is at (OCRAM_ADDR + NXP_ROM_RSVD)
# This value BL2_HDR_LOC + CSF_HDR_SZ should not overalp with BL2_BASE
BL2_HDR_LOC_HDR ?= $(shell echo $$(( $(OCRAM_START_ADDR) + $(NXP_ROM_RSVD) )))
# Covert to HEX to be used by create_pbl.mk
BL2_HDR_LOC := $$(echo "obase=16; ${BL2_HDR_LOC_HDR}" | bc)
In addition, BL31 uses DDR memory space, didn't use OCRAM.
Please refer to the following in plat/nxp/common/include/default/plat_default_def.h.
#define BL31_BASE NXP_SECURE_DRAM_ADDR
Please refer to the following code in plat/nxp/soc-lx2160a/soc.def, the size of NXP_ROM_RSVD OCRAM memory space is used for bootrom, after this reserved area, all other OCRAM memory space can be used for BL2.
# Location of BL2 on OCRAM
BL2_BASE_ADDR := $(shell echo $$(( $(OCRAM_START_ADDR) + $(NXP_ROM_RSVD) + $(CSF_HDR_SZ) )))
# Covert to HEX to be used by create_pbl.mk
BL2_BASE := $(shell echo "0x"$$(echo "obase=16; ${BL2_BASE_ADDR}" | bc))
# BL2_HDR_LOC is at (OCRAM_ADDR + NXP_ROM_RSVD)
# This value BL2_HDR_LOC + CSF_HDR_SZ should not overalp with BL2_BASE
BL2_HDR_LOC_HDR ?= $(shell echo $$(( $(OCRAM_START_ADDR) + $(NXP_ROM_RSVD) )))
# Covert to HEX to be used by create_pbl.mk
BL2_HDR_LOC := $$(echo "obase=16; ${BL2_HDR_LOC_HDR}" | bc)
In addition, BL31 uses DDR memory space, didn't use OCRAM.
Please refer to the following in plat/nxp/common/include/default/plat_default_def.h.
#define BL31_BASE NXP_SECURE_DRAM_ADDR