From 3e6aa907bd0e0b200502fddf8e434259094a2a81 Mon Sep 17 00:00:00 2001 From: anusha Date: Tue, 28 Sep 2021 17:21:14 +0530 Subject: [PATCH] sf: Fix sram size issue for 4GB DDR In this case, the variable sram_end(Base + Size) will hold (0x40000000 + 0xC0000000) and will overflow 32bits. Update the variable type to u64. Change-Id: Iadf008c0ace552b793b9424e5c9ded0873599a64 Signed-off-by: anusha --- common/cmd_sf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cmd_sf.c b/common/cmd_sf.c index 14fae9cc35..6545c9e644 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -267,7 +267,7 @@ static int do_spi_flash_read_write(int argc, char * const argv[]) int ret = 1; int dev = 0; loff_t offset, len, maxsize; - unsigned long sram_end = CONFIG_SYS_SDRAM_BASE + gd->ram_size; + u64 sram_end = CONFIG_SYS_SDRAM_BASE + (u64)gd->ram_size; if (argc < 3) return -1;