mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-05-01 08:05:46 +00:00
fix(nxp/common/setup): fix total dram size checking
total_dram_size should be signed value because it is equal to return value of init_ddr(), so if it is lower or equal zero, report error as DDR is not initialized correctly. Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com> Change-Id: Idbc40da103f60f10cb18c5306e97b764c1a9d372
This commit is contained in:
parent
3ccc8ac3e5
commit
0259a3e828
2 changed files with 5 additions and 3 deletions
|
@ -113,7 +113,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t num_dram_regions;
|
uint64_t num_dram_regions;
|
||||||
uint64_t total_dram_size;
|
int64_t total_dram_size;
|
||||||
region_info_t region[NUM_DRAM_REGIONS];
|
region_info_t region[NUM_DRAM_REGIONS];
|
||||||
} dram_regions_info_t;
|
} dram_regions_info_t;
|
||||||
|
|
||||||
|
|
|
@ -279,10 +279,12 @@ void bl2_plat_preload_setup(void)
|
||||||
|
|
||||||
soc_preload_setup();
|
soc_preload_setup();
|
||||||
|
|
||||||
if (dram_regions_info.total_dram_size < NXP_DRAM0_SIZE) {
|
#ifdef DDR_INIT
|
||||||
NOTICE("ERROR: DRAM0 Size is not correctly configured.");
|
if (dram_regions_info.total_dram_size <= 0) {
|
||||||
|
ERROR("Asserting as the DDR is not initialized yet.");
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((dram_regions_info.region[0].addr == 0)
|
if ((dram_regions_info.region[0].addr == 0)
|
||||||
&& (dram_regions_info.total_dram_size > 0)) {
|
&& (dram_regions_info.total_dram_size > 0)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue