i945: Fix resource bases for UMA and TSEG
TSEG appears in memory below graphics UMA region. Seems boards with i945 had TSEG disabled, so the incorrect order did not make a difference. Change-Id: Ie293aab17b60b5f06a871a773cd42577c7dc7c7b Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/5891 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
This commit is contained in:
parent
9c65978f38
commit
15935ebe24
|
@ -106,6 +106,29 @@ static void pci_domain_set_resources(device_t dev)
|
|||
tomk_stolen = tomk;
|
||||
|
||||
/* Note: subtract IGD device and TSEG */
|
||||
reg16 = pci_read_config16(dev_find_slot(0, PCI_DEVFN(0, 0)), GGC);
|
||||
if (!(reg16 & 2)) {
|
||||
int uma_size = 0;
|
||||
printk(BIOS_DEBUG, "IGD decoded, subtracting ");
|
||||
reg16 >>= 4;
|
||||
reg16 &= 7;
|
||||
switch (reg16) {
|
||||
case 1:
|
||||
uma_size = 1024;
|
||||
break;
|
||||
case 3:
|
||||
uma_size = 8192;
|
||||
break;
|
||||
}
|
||||
|
||||
printk(BIOS_DEBUG, "%dM UMA\n", uma_size >> 10);
|
||||
tomk_stolen -= uma_size;
|
||||
|
||||
/* For reserving UMA memory in the memory map */
|
||||
uma_memory_base = tomk_stolen * 1024ULL;
|
||||
uma_memory_size = uma_size * 1024ULL;
|
||||
}
|
||||
|
||||
reg8 = pci_read_config8(dev_find_slot(0, PCI_DEVFN(0, 0)), 0x9e);
|
||||
if (reg8 & 1) {
|
||||
int tseg_size = 0;
|
||||
|
@ -132,29 +155,6 @@ static void pci_domain_set_resources(device_t dev)
|
|||
tseg_memory_size = tseg_size * 1024ULL;
|
||||
}
|
||||
|
||||
reg16 = pci_read_config16(dev_find_slot(0, PCI_DEVFN(0, 0)), GGC);
|
||||
if (!(reg16 & 2)) {
|
||||
int uma_size = 0;
|
||||
printk(BIOS_DEBUG, "IGD decoded, subtracting ");
|
||||
reg16 >>= 4;
|
||||
reg16 &= 7;
|
||||
switch (reg16) {
|
||||
case 1:
|
||||
uma_size = 1024;
|
||||
break;
|
||||
case 3:
|
||||
uma_size = 8192;
|
||||
break;
|
||||
}
|
||||
|
||||
printk(BIOS_DEBUG, "%dM UMA\n", uma_size >> 10);
|
||||
tomk_stolen -= uma_size;
|
||||
|
||||
/* For reserving UMA memory in the memory map */
|
||||
uma_memory_base = tomk_stolen * 1024ULL;
|
||||
uma_memory_size = uma_size * 1024ULL;
|
||||
}
|
||||
|
||||
/* The following needs to be 2 lines, otherwise the second
|
||||
* number is always 0
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue