Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/68213 )
Change subject: nb/intel/i945/raminit: Use 'size_t' for banksize[] ......................................................................
nb/intel/i945/raminit: Use 'size_t' for banksize[]
Signed-off-by: Elyes Haouas ehaouas@noos.fr Change-Id: I4fb845bb4145d47aea39d7e5493d854d00e289aa --- M src/northbridge/intel/i945/raminit.c M src/northbridge/intel/i945/raminit.h 2 files changed, 16 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/68213/1
diff --git a/src/northbridge/intel/i945/raminit.c b/src/northbridge/intel/i945/raminit.c index 585d562..d249b75 100644 --- a/src/northbridge/intel/i945/raminit.c +++ b/src/northbridge/intel/i945/raminit.c @@ -425,11 +425,11 @@ die("DDR-II rank size smaller than 128MB is not supported.\n");
sysinfo->banksize[i * 2] = dimm_info.ranksize_mb / 32; - printk(BIOS_DEBUG, "DIMM %d side 0 = %d MB\n", i, sysinfo->banksize[i * 2] * 32); + printk(BIOS_DEBUG, "DIMM %d side 0 = %ld MB\n", i, sysinfo->banksize[i * 2] * 32); if (dimm_info.ranks == 2) { sysinfo->banksize[(i * 2) + 1] = dimm_info.ranksize_mb / 32; - printk(BIOS_DEBUG, "DIMM %d side 1 = %d MB\n", + printk(BIOS_DEBUG, "DIMM %d side 1 = %ld MB\n", i, sysinfo->banksize[(i * 2) + 1] * 32); }
@@ -1141,7 +1141,7 @@ static int sdram_program_row_boundaries(struct sys_info *sysinfo) { int i; - int cum0, cum1, tolud, tom, pci_mmio_size; + size_t cum0, cum1, tolud, tom, pci_mmio_size; const struct device *dev; const struct northbridge_intel_i945_config *cfg = NULL;
@@ -2042,8 +2042,8 @@ sysinfo->dimm[1] != SYSINFO_DIMM_NOT_POPULATED); chan1_populated = (sysinfo->dimm[2] != SYSINFO_DIMM_NOT_POPULATED || sysinfo->dimm[3] != SYSINFO_DIMM_NOT_POPULATED); - chan0_dualsided = (sysinfo->banksize[1] || sysinfo->banksize[3]); - chan1_dualsided = (sysinfo->banksize[5] || sysinfo->banksize[7]); + chan0_dualsided = (sysinfo->banksize[1] != 0 || sysinfo->banksize[3] != 0); + chan1_dualsided = (sysinfo->banksize[5] != 0 || sysinfo->banksize[7] != 0);
if (sdram_capabilities_enhanced_addressing_xor()) { if (!sysinfo->interleaved) { diff --git a/src/northbridge/intel/i945/raminit.h b/src/northbridge/intel/i945/raminit.h index d69110e..efaedf4 100644 --- a/src/northbridge/intel/i945/raminit.h +++ b/src/northbridge/intel/i945/raminit.h @@ -49,7 +49,7 @@ #define SYSINFO_DIMM_NOT_POPULATED 0x04
u8 banks[2 * DIMM_SOCKETS]; - u8 banksize[2 * 2 * DIMM_SOCKETS]; + size_t banksize[2 * 2 * DIMM_SOCKETS]; const u8 *spd_addresses;
} __packed;