[coreboot-gerrit] New patch to review for coreboot: ce5b7f7 AMD Fam14: Use all memory on systems with more than 4 GB RAM

Paul Menzel (paulepanter@users.sourceforge.net) gerrit at coreboot.org
Wed Jun 5 09:46:01 CEST 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/3375

-gerrit

commit ce5b7f7e6cb9b0e9f983225afeafb7bcc27b1d5d
Author: Paul Menzel <paulepanter at users.sourceforge.net>
Date:   Tue Jun 4 23:57:42 2013 +0200

    AMD Fam14: Use all memory on systems with more than 4 GB RAM
    
    On the ASRock E350M1 with two 4 GB memory modules, so 8 GB of RAM,
    not all memory is available.
    
        $ more /proc/meminfo
        MemTotal:        7902748 kB
        […]
    
    On AMD Family 14h processors with internal graphics card, 384 MB
    of VRAM is used.
    
        [   18.519505] calling  radeon_init+0x0/0x1000 [radeon] @ 493
        [   18.519515] [drm] radeon kernel modesetting enabled.
        [   18.525842] [drm] initializing kernel modesetting (PALM 0x1002:0x9802 0x1002:0x9802).
        [   18.525906] [drm] register mmio base: 0xF0100000
        [   18.525910] [drm] register mmio size: 262144
        [   18.526010] ATOM BIOS: AMD
        [   18.526062] radeon 0000:00:01.0: VRAM: 384M 0x0000000000000000 - 0x0000000017FFFFFF (384M used)
        [   18.526069] radeon 0000:00:01.0: GTT: 512M 0x0000000018000000 - 0x0000000037FFFFFF
        [   18.526316] [drm] Detected VRAM RAM=384M, BAR=256M
        [   18.526325] [drm] RAM width 32bits DDR
        [   18.529909] calling  irqfd_module_init+0x0/0x1000 [kvm] @ 546
        [   18.530436] [TTM] Zone  kernel: Available graphics memory: 417614 kiB
        [   18.530444] [TTM] Zone highmem: Available graphics memory: 3951374 kiB
        [   18.530447] [TTM] Initializing pool allocator
        [   18.530457] [TTM] Initializing DMA pool allocator
        [   18.530508] [drm] radeon: 384M of VRAM memory ready
        [   18.530512] [drm] radeon: 512M of GTT memory ready.
    
    So 90 MB are lost.
    
        ((8 * 1024 * 1024 - 7902748) / 1024) = 474 MB
        474 MB - 384 MB = 90 MB
    
    Using topmem2()
    
        uint64_t topmem2 = bsp_topmem2();
        basek = 4 * 1024 * 1024;
        sizek = topmem2 / 1024 - basek;
    
    as in commit (3a145713) [1]
    
        AMD Fam 15tn: Use all memory on systems with more than 4 GB
    
    only 8 kB are recovered though.
    
        $ more /proc/meminfo
        MemTotal:        7902756 kB
        […]
    
        7902756 kb - 7902748 kB = 8 kb
    
    [1] http://review.coreboot.org/3198
    
    Change-Id: I5f297ddad3212fc86140f49e96b81318cb4e41bd
    Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
 src/northbridge/amd/agesa/family14/northbridge.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c
index e7de273..de3148f 100644
--- a/src/northbridge/amd/agesa/family14/northbridge.c
+++ b/src/northbridge/amd/agesa/family14/northbridge.c
@@ -734,8 +734,9 @@ static void domain_set_resources(device_t dev)
 			if ((basek + sizek) <= 4 * 1024 * 1024) {
 				sizek = 0;
 			} else {
+				uint64_t topmem2 = bsp_topmem2();
 				basek = 4 * 1024 * 1024;
-				sizek -= (4 * 1024 * 1024 - mmio_basek);
+				sizek = topmem2 / 1024 - basek;
 			}
 		}
 



More information about the coreboot-gerrit mailing list