LX2160A OCRAM usage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LX2160A OCRAM usage

Jump to solution
1,601 Views
dmitri_lechtchinski
Contributor III

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

0 Kudos
1 Solution
1,592 Views
yipingwang
NXP TechSupport
NXP TechSupport

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

View solution in original post

1 Reply
1,593 Views
yipingwang
NXP TechSupport
NXP TechSupport

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