[coreboot] New patch to review for coreboot: b7893bd AMD f15 nb: fix limitk calculation
Aladyshev Konstantin (kostr@list.ru)
gerrit at coreboot.org
Wed Jan 30 16:38:36 CET 2013
Aladyshev Konstantin (kostr at list.ru) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2231
-gerrit
commit b7893bd9f9992bbe30b2d0d9d206f61a4bad3f83
Author: Aladyshev Konstantin <aladyshev at nicevt.ru>
Date: Fri Jan 25 21:23:38 2013 +0400
AMD f15 nb: fix limitk calculation
Revert change:
"AMD f15 nb: Remove the misleading 0x100 from the limitk (Propagation)"
http://review.coreboot.org/#/c/1404/
This commit leads to wrong limit calculation which causes memory loose. Example from coreboot memory table:
....
5. 0000000100000000-0000000417ffffff: RAM
6. 0000000420000000-0000000817ffffff: RAM
7. 0000000820000000-0000000c17ffffff: RAM
8. 0000000c20000000-0000001017ffffff: RAM
9. 0000001020000000-0000001417ffffff: RAM
10. 0000001420000000-0000001817ffffff: RAM
11. 0000001820000000-0000001c17ffffff: RAM
12. 0000001c20000000-0000002017ffffff: RAM
Reverting this commit fix this issue:
......
5. 0000000100000000-0000000420000000: RAM
6. 0000000420000000-0000000820000000: RAM
7. 0000000820000000-0000000c20000000: RAM
8. 0000000c20000000-0000001020000000: RAM
9. 0000001020000000-0000001420000000: RAM
10. 0000001420000000-0000001820000000: RAM
11. 0000001820000000-0000001c20000000: RAM
12. 0000001c20000000-0000002020000000: RAM
Limitk is calculated from mask field in dram_base_mask_t struct.
u32 mask field contains [47:27] bits of dram_limit in its [28:8] bits.
0x100 is used to show that bits [7:0] are masked out.
Change-Id: I49b171cd4e519a0e57f0f0dbd452d1b5a17f7383
Signed-off-by: Konstantin Aladyshev <aladyshev at nicevt.ru>
---
src/northbridge/amd/agesa/family15/northbridge.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/northbridge/amd/agesa/family15/northbridge.c b/src/northbridge/amd/agesa/family15/northbridge.c
index abd53b2..f4c830b 100644
--- a/src/northbridge/amd/agesa/family15/northbridge.c
+++ b/src/northbridge/amd/agesa/family15/northbridge.c
@@ -617,7 +617,7 @@ static struct hw_mem_hole_info get_hw_mem_hole_info(void)
mem_hole.node_id = i;
break; //only one hole
}
- limit_k = ((resource_t)(((d.mask & ~1) + 0x000FF) & 0x1fffff00)) << 9;
+ limit_k = ((resource_t)((d.mask + 0x00000100) & 0x1fffff00)) << 9;
limitk_pri = limit_k;
}
}
@@ -762,7 +762,7 @@ static void domain_set_resources(device_t dev)
if (!(d.mask & 1)) continue;
basek = ((resource_t)(d.base & 0x1fffff00)) << 9; // could overflow, we may lost 6 bit here
- limitk = ((resource_t)(((d.mask & ~1) + 0x000FF) & 0x1fffff00)) << 9;
+ limitk = ((resource_t)((d.mask + 0x00000100) & 0x1fffff00)) << 9 ;
sizek = limitk - basek;
More information about the coreboot
mailing list