~ubuntu-branches/ubuntu/oneiric/seabios/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/0045-seabios-pciinit-make-pci-memory-space-assignment-64b.patch

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn, Serge Hallyn, Dustin Kirkland
  • Date: 2011-02-14 14:38:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110214143850-cmzexufi3dlrt7ga
Tags: 0.6.1.2-0ubuntu1
[ Serge Hallyn ]
* upstream merge
  - updated debian/watch
  - remove all patches as they are applied upstream
  - removed debian-changes-0.6.0-0ubuntu2 - I'm not certain about this one,
    so it may re-introduce a regression

[ Dustin Kirkland ]
* debian/rules: fix lintian warnings, install changelog, make binary build
  arch indep
* debian/control: update standards version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From dfd94fafc2a157f4fc64014069e19dc6e6bbac52 Mon Sep 17 00:00:00 2001
2
 
From: Isaku Yamahata <yamahata@valinux.co.jp>
3
 
Date: Tue, 22 Jun 2010 17:57:48 +0900
4
 
Subject: [PATCH 45/54] seabios: pciinit: make pci memory space assignment 64bit aware.
5
 
 
6
 
make pci memory space assignment 64bit aware.
7
 
If 64bit memory space is found while assigning pci memory space,
8
 
clear higher bit and skip to next bar.
9
 
 
10
 
This patch is preparation for q35 chipset initialization which
11
 
has 64bit bar.
12
 
 
13
 
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
14
 
---
15
 
 src/pciinit.c |   19 +++++++++++++++++--
16
 
 1 files changed, 17 insertions(+), 2 deletions(-)
17
 
 
18
 
diff --git a/src/pciinit.c b/src/pciinit.c
19
 
index 488c77b..b635e44 100644
20
 
--- a/src/pciinit.c
21
 
+++ b/src/pciinit.c
22
 
@@ -37,7 +37,12 @@ static void pci_set_io_region_addr(u16 bdf, int region_num, u32 addr)
23
 
     dprintf(1, "region %d: 0x%08x\n", region_num, addr);
24
 
 }
25
 
 
26
 
-static void pci_bios_allocate_region(u16 bdf, int region_num)
27
 
+/*
28
 
+ * return value
29
 
+ *      0:     32bit BAR
30
 
+ *      non 0: 64bit BAR
31
 
+ */
32
 
+static int pci_bios_allocate_region(u16 bdf, int region_num)
33
 
 {
34
 
     u32 *paddr;
35
 
     int ofs;
36
 
@@ -71,13 +76,23 @@ static void pci_bios_allocate_region(u16 bdf, int region_num)
37
 
         pci_set_io_region_addr(bdf, region_num, *paddr);
38
 
         *paddr += size;
39
 
     }
40
 
+
41
 
+    int is_64bit = !(val & PCI_BASE_ADDRESS_SPACE_IO) &&
42
 
+        (val & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == PCI_BASE_ADDRESS_MEM_TYPE_64;
43
 
+    if (is_64bit) {
44
 
+        pci_config_writel(bdf, ofs + 4, 0);
45
 
+    }
46
 
+    return is_64bit;
47
 
 }
48
 
 
49
 
 static void pci_bios_allocate_regions(u16 bdf)
50
 
 {
51
 
     int i;
52
 
     for (i = 0; i < PCI_NUM_REGIONS; i++) {
53
 
-        pci_bios_allocate_region(bdf, i);
54
 
+        int is_64bit = pci_bios_allocate_region(bdf, i);
55
 
+        if (is_64bit){
56
 
+            i++;
57
 
+        }
58
 
     }
59
 
 }
60
 
 
61
 
1.7.1
62