summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2011-10-13 17:03:04 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-10-14 19:12:10 +0200
commit89fcdec9721231a2a6faf96462359bb9a2cdda63 (patch)
tree776ef7004367a32b7b1672cfe6f1b6b335e608e2 /src
parentb9d60c9ac8f878ebd5a69a0f87d9a9406b89c606 (diff)
Fix compilation of VIA CN700 northbridge code with gcc 4.6
Change-Id: Ia52d21c5c467ec08bc7b958ee1a8e37e7d3e025b Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/265 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src')
-rw-r--r--src/northbridge/via/cn700/raminit.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/northbridge/via/cn700/raminit.c b/src/northbridge/via/cn700/raminit.c
index df4010eafd..2c387bb4f6 100644
--- a/src/northbridge/via/cn700/raminit.c
+++ b/src/northbridge/via/cn700/raminit.c
@@ -179,12 +179,20 @@ static void sdram_set_size(const struct mem_controller *ctrl)
case 0x01:
result = 0x10; /* 1GB */
break;
+ default:
+ result = 0;
}
- if (result == 0xff)
+ switch (result) {
+ case 0xff:
die("DRAM module size too big, not supported by CN700\n");
- else
+ break;
+ case 0:
+ die("DRAM module has unknown density\n");
+ break;
+ default:
printk(BIOS_DEBUG, "Found %iMB of ram\n", result * ranks * 64);
+ }
pci_write_config8(ctrl->d0f3, 0x40, result);
pci_write_config8(ctrl->d0f3, 0x48, 0x00);