seabios: pciinit: fix 64bit bar initilization.
authorIsaku Yamahata <yamahata@valinux.co.jp>
Mon, 26 Jul 2010 05:02:45 +0000 (14:02 +0900)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 27 Jul 2010 01:29:15 +0000 (21:29 -0400)
When 64bit bar allocation failed, leave it untouched as 32bit bar case.
There is no point to set higher bit to all 1, it is just leftover from
debug code.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
src/pciinit.c

index b1105311dc2714e1f7aa385f150fd296c38da811..f75e5527c68a8bc37ebf338ee76427cd0aae114a 100644 (file)
@@ -116,12 +116,8 @@ static int pci_bios_allocate_region(u16 bdf, int region_num)
 
     int is_64bit = !(val & PCI_BASE_ADDRESS_SPACE_IO) &&
         (val & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == PCI_BASE_ADDRESS_MEM_TYPE_64;
-    if (is_64bit) {
-        if (size > 0) {
-            pci_config_writel(bdf, ofs + 4, 0);
-        } else {
-            pci_config_writel(bdf, ofs + 4, ~0);
-        }
+    if (is_64bit && size > 0) {
+        pci_config_writel(bdf, ofs + 4, 0);
     }
     return is_64bit;
 }