Thanks a lot to Kyösti Mälkki(kmalkki) for the help on #coreboot IRC channel on Freenode Servers.
Signed-off-by: Denis 'GNUtoo' Carikli GNUtoo@no-log.org --- src/northbridge/amd/amdfam10/northbridge.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c index 3b20684..573c535 100644 --- a/src/northbridge/amd/amdfam10/northbridge.c +++ b/src/northbridge/amd/amdfam10/northbridge.c @@ -1028,6 +1028,11 @@ static void amdfam10_domain_set_resources(device_t dev) unsigned pre_sizek; pre_sizek = mmio_basek - basek; if(pre_sizek>0) { +#if CONFIG_GFXUMA + /* Deduct uma memory before reporting because + * this is what the mtrr code expects */ + pre_sizek -= uma_memory_size / 1024; +#endif ram_resource(dev, (idx | i), basek, pre_sizek); idx += 0x10; sizek -= pre_sizek; @@ -1063,15 +1068,10 @@ static void amdfam10_domain_set_resources(device_t dev) } else { basek = 4*1024*1024; - sizek -= (4*1024*1024 - mmio_basek); + sizek = basek - mmio_basek; } }
-#if CONFIG_GFXUMA - /* Deduct uma memory before reporting because - * this is what the mtrr code expects */ - sizek -= uma_memory_size / 1024; -#endif ram_resource(dev, (idx | i), basek, sizek); idx += 0x10; #if CONFIG_WRITE_HIGH_TABLES