[coreboot] Patch set updated for coreboot: a271849 AMD f15 nb: fix limitk calculation

Paul Menzel (paulepanter@users.sourceforge.net) gerrit at coreboot.org
Wed Jan 30 16:54:43 CET 2013


Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2231

-gerrit

commit a271849ede0a84b06d8f22584431e046627b1bec
Author: Konstantin Aladyshev <aladyshev at nicevt.ru>
Date:   Fri Jan 25 21:23:38 2013 +0400

    AMD f15 nb: fix limitk calculation
    
    Revert change:
    
        commit 15dc3ccaab5a431b1a0b99aaba9d61457b219343
        Author: zbao <fishbaozi at gmail.com>
        Date:   Fri Aug 3 15:56:21 2012 +0800
    
            AMD f15 nb: Remove the misleading 0x100 from the limitk (Propagation)
    
        Apply the change
        http://review.coreboot.org/1265
        to all the AMD northbridge.
    
        Reviewed-on: http://review.coreboot.org/#/c/1404/
    
    This commit leads to wrong limit calculation which causes memory loss. 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>
    Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
 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