mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-16 05:58:49 +00:00
ddr: altera: soc64: Integer fix overflow that caused DDR size mismatched
Convert the constant integer to 'phys_size_t' to avoid overflow when calculating the SDRAM size. Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com> Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
This commit is contained in:
parent
d192adafeb
commit
32e0379143
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2016-2021 Intel Corporation <www.intel.com>
|
||||
* Copyright (C) 2016-2022 Intel Corporation <www.intel.com>
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -239,7 +239,8 @@ phys_size_t sdram_calculate_size(struct altera_sdram_plat *plat)
|
|||
{
|
||||
u32 dramaddrw = hmc_readl(plat, DRAMADDRW);
|
||||
|
||||
phys_size_t size = 1 << (DRAMADDRW_CFG_CS_ADDR_WIDTH(dramaddrw) +
|
||||
phys_size_t size = (phys_size_t)1 <<
|
||||
(DRAMADDRW_CFG_CS_ADDR_WIDTH(dramaddrw) +
|
||||
DRAMADDRW_CFG_BANK_GRP_ADDR_WIDTH(dramaddrw) +
|
||||
DRAMADDRW_CFG_BANK_ADDR_WIDTH(dramaddrw) +
|
||||
DRAMADDRW_CFG_ROW_ADDR_WIDTH(dramaddrw) +
|
||||
|
|
Loading…
Add table
Reference in a new issue