summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzbao <fishbaozi@gmail.com>2012-08-03 16:06:08 +0800
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2012-08-05 16:18:47 +0200
commitffb6bddea274e2476327efe59661a62cf904de40 (patch)
tree1dd22047ff8c3911d022213e3e0a01c2b236b86b
parent366f0fc30a6b0439cfa2867b3d435975512bd9b8 (diff)
downloadcoreboot-ffb6bddea274e2476327efe59661a62cf904de40.tar.xz
AMD f15: Change multiply ONE_MB to bit shifting (Propagation)
Apply the change http://review.coreboot.org/1263 to family15 northbridge. Change-Id: If1109f20ffd833a716e092c5e4f6f16ee6b968c7 Signed-off-by: Zheng Bao <zheng.bao@amd.com> Signed-off-by: zbao <fishbaozi@gmail.com> [km: rebased] Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/1405 Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Tested-by: build bot (Jenkins)
-rw-r--r--src/northbridge/amd/agesa/family15/northbridge.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/northbridge/amd/agesa/family15/northbridge.c b/src/northbridge/amd/agesa/family15/northbridge.c
index d7e952122f..d9a153b53b 100644
--- a/src/northbridge/amd/agesa/family15/northbridge.c
+++ b/src/northbridge/amd/agesa/family15/northbridge.c
@@ -627,7 +627,7 @@ static struct hw_mem_hole_info get_hw_mem_hole_info(void)
}
#endif
-#define ONE_MB 0x100000
+#define ONE_MB_SHIFT 20
static void setup_uma_memory(void)
{
@@ -654,13 +654,13 @@ static void setup_uma_memory(void)
* >=1G 256M
* <1G 64M
*/
- sys_mem = msr.lo + 16 * ONE_MB; // Ignore 16MB allocated for C6 when finding UMA size
- if ((msr2.hi & 0x0000000F) || (sys_mem >= 2048 * ONE_MB)) {
- uma_memory_size = 512 * ONE_MB;
- } else if (sys_mem >= 1024 * ONE_MB) {
- uma_memory_size = 256 * ONE_MB;
+ sys_mem = msr.lo + (16 << ONE_MB_SHIFT); // Ignore 16MB allocated for C6 when finding UMA size
+ if ((msr2.hi & 0x0000000F) || (sys_mem >= 2048 << ONE_MB_SHIFT)) {
+ uma_memory_size = 512 << ONE_MB_SHIFT;
+ } else if (sys_mem >= 1024 << ONE_MB_SHIFT) {
+ uma_memory_size = 256 << ONE_MB_SHIFT;
} else {
- uma_memory_size = 64 * ONE_MB;
+ uma_memory_size = 64 << ONE_MB_SHIFT;
}
uma_memory_base = msr.lo - uma_memory_size; /* TOP_MEM1 */