~ubuntu-branches/ubuntu/saucy/seabios/saucy-proposed

« back to all changes in this revision

Viewing changes to debian/patches/1.7.2.1.diff

  • Committer: Package Import Robot
  • Author(s): Michael Tokarev
  • Date: 2013-05-13 19:45:38 UTC
  • Revision ID: package-import@ubuntu.com-20130513194538-rzjp5kaagp9a8i2c
Tags: 1.7.2-2
* bump Standards-Version to 3.9.4 (no changes needed)
* add a versioned dependency on iasl (<< 20130214), see #707454
* add upstream 1.7.2.1 (as a patch since upstream didn't release source)
  (Closes: #707645)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff --git a/Makefile b/Makefile
 
2
index f28d86c..20da6d0 100644
 
3
--- a/Makefile
 
4
+++ b/Makefile
 
5
@@ -84,7 +84,7 @@ vpath %.S src vgasrc
 
6
 ################ Common build rules
 
7
 
 
8
 # Verify the build environment works.
 
9
-TESTGCC:=$(shell CC="$(CC)" LD="$(LD)" IASL="$(IASL)" tools/test-build.sh)
 
10
+TESTGCC:=$(shell OUT="$(OUT)" CC="$(CC)" LD="$(LD)" IASL="$(IASL)" tools/test-build.sh)
 
11
 ifeq "$(TESTGCC)" "-1"
 
12
 $(error "Please upgrade the build environment")
 
13
 endif
 
14
@@ -97,7 +97,7 @@ endif
 
15
 # Do a whole file compile by textually including all C code.
 
16
 define whole-compile
 
17
 @echo "  Compiling whole program $3"
 
18
-$(Q)printf '$(foreach i,$2,#include "../$i"\n)' > $3.tmp.c
 
19
+$(Q)printf '$(foreach i,$2,#include "$(CURDIR)/$i"\n)' > $3.tmp.c
 
20
 $(Q)$(CC) $1 $(CFLAGSWHOLE) -c $3.tmp.c -o $3
 
21
 endef
 
22
 
 
23
@@ -126,11 +126,11 @@ $(OUT)asm-offsets.h: $(OUT)asm-offsets.s
 
24
        @echo "  Generating offset file $@"
 
25
        $(Q)./tools/gen-offsets.sh $< $@
 
26
 
 
27
-$(OUT)ccode16.o: $(OUT)autoconf.h $(patsubst %.c, out/%.o,$(SRC16)) ; $(call whole-compile, $(CFLAGS16), $(addprefix src/, $(SRC16)),$@)
 
28
+$(OUT)ccode16.o: $(OUT)autoconf.h $(patsubst %.c, $(OUT)%.o,$(SRC16)) ; $(call whole-compile, $(CFLAGS16), $(addprefix src/, $(SRC16)),$@)
 
29
 
 
30
-$(OUT)code32seg.o: $(OUT)autoconf.h $(patsubst %.c, out/%.o,$(SRC32SEG)) ; $(call whole-compile, $(CFLAGS32SEG), $(addprefix src/, $(SRC32SEG)),$@)
 
31
+$(OUT)code32seg.o: $(OUT)autoconf.h $(patsubst %.c, $(OUT)%.o,$(SRC32SEG)) ; $(call whole-compile, $(CFLAGS32SEG), $(addprefix src/, $(SRC32SEG)),$@)
 
32
 
 
33
-$(OUT)ccode32flat.o: $(OUT)autoconf.h $(patsubst %.c, out/%.o,$(SRC32FLAT)) ; $(call whole-compile, $(CFLAGS32FLAT), $(addprefix src/, $(SRC32FLAT)),$@)
 
34
+$(OUT)ccode32flat.o: $(OUT)autoconf.h $(patsubst %.c, $(OUT)%.o,$(SRC32FLAT)) ; $(call whole-compile, $(CFLAGS32FLAT), $(addprefix src/, $(SRC32FLAT)),$@)
 
35
 
 
36
 $(OUT)romlayout.o: romlayout.S $(OUT)asm-offsets.h
 
37
        @echo "  Compiling (16bit) $@"
 
38
diff --git a/src/Kconfig b/src/Kconfig
 
39
index 0b112ed..2c9100d 100644
 
40
--- a/src/Kconfig
 
41
+++ b/src/Kconfig
 
42
@@ -367,7 +367,7 @@ menu "BIOS Tables"
 
43
             Support generation of ACPI tables.
 
44
 endmenu
 
45
 
 
46
-source ../vgasrc/Kconfig
 
47
+source vgasrc/Kconfig
 
48
 
 
49
 menu "Debugging"
 
50
     config DEBUG_LEVEL
 
51
diff --git a/src/pciinit.c b/src/pciinit.c
 
52
index a406bbd..b3f359f 100644
 
53
--- a/src/pciinit.c
 
54
+++ b/src/pciinit.c
 
55
@@ -91,8 +91,18 @@ const u8 pci_irqs[4] = {
 
56
     10, 10, 11, 11
 
57
 };
 
58
 
 
59
+static int dummy_pci_slot_get_irq(struct pci_device *pci, int pin)
 
60
+{
 
61
+    dprintf(1, "pci_slot_get_irq called with unknown routing\n");
 
62
+
 
63
+    return 0xff; /* PCI defined "unknown" or "no connection" for x86 */
 
64
+}
 
65
+
 
66
+static int (*pci_slot_get_irq)(struct pci_device *pci, int pin) =
 
67
+    dummy_pci_slot_get_irq;
 
68
+
 
69
 // Return the global irq number corresponding to a host bus device irq pin.
 
70
-static int pci_slot_get_irq(struct pci_device *pci, int pin)
 
71
+static int piix_pci_slot_get_irq(struct pci_device *pci, int pin)
 
72
 {
 
73
     int slot_addend = 0;
 
74
 
 
75
@@ -104,6 +114,31 @@ static int pci_slot_get_irq(struct pci_device *pci, int pin)
 
76
     return pci_irqs[(pin - 1 + slot_addend) & 3];
 
77
 }
 
78
 
 
79
+static int mch_pci_slot_get_irq(struct pci_device *pci, int pin)
 
80
+{
 
81
+    int irq, slot, pin_addend = 0;
 
82
+
 
83
+    while (pci->parent != NULL) {
 
84
+        pin_addend += pci_bdf_to_dev(pci->bdf);
 
85
+        pci = pci->parent;
 
86
+    }
 
87
+    slot = pci_bdf_to_dev(pci->bdf);
 
88
+
 
89
+    switch (slot) {
 
90
+    /* Slots 0-24 rotate slot:pin mapping similar to piix above, but
 
91
+       with a different starting index - see q35-acpi-dsdt.dsl */
 
92
+    case 0 ... 24:
 
93
+        irq = pci_irqs[(pin - 1 + pin_addend + slot) & 3];
 
94
+        break;
 
95
+    /* Slots 25-31 all use LNKA mapping (or LNKE, but A:D = E:H) */
 
96
+    case 25 ... 31:
 
97
+        irq = pci_irqs[(pin - 1 + pin_addend) & 3];
 
98
+        break;
 
99
+    }
 
100
+
 
101
+    return irq;
 
102
+}
 
103
+
 
104
 /* PIIX3/PIIX4 PCI to ISA bridge */
 
105
 static void piix_isa_bridge_init(struct pci_device *pci, void *arg)
 
106
 {
 
107
@@ -143,11 +178,9 @@ void mch_isa_bridge_init(struct pci_device *dev, void *arg)
 
108
         /* activate irq remapping in LPC */
 
109
 
 
110
         /* PIRQ[A-D] routing */
 
111
-        pci_config_writeb(bdf, ICH9_LPC_PIRQA_ROUT + i,
 
112
-                          irq | ICH9_LPC_PIRQ_ROUT_IRQEN);
 
113
+        pci_config_writeb(bdf, ICH9_LPC_PIRQA_ROUT + i, irq);
 
114
         /* PIRQ[E-H] routing */
 
115
-        pci_config_writeb(bdf, ICH9_LPC_PIRQE_ROUT + i,
 
116
-                          irq | ICH9_LPC_PIRQ_ROUT_IRQEN);
 
117
+        pci_config_writeb(bdf, ICH9_LPC_PIRQE_ROUT + i, irq);
 
118
     }
 
119
     outb(elcr[0], ICH9_LPC_PORT_ELCR1);
 
120
     outb(elcr[1], ICH9_LPC_PORT_ELCR2);
 
121
@@ -294,6 +327,8 @@ void i440fx_mem_addr_init(struct pci_device *dev, void *arg)
 
122
         pcimem_start = 0x80000000;
 
123
     else if (RamSize <= 0xc0000000)
 
124
         pcimem_start = 0xc0000000;
 
125
+
 
126
+    pci_slot_get_irq = piix_pci_slot_get_irq;
 
127
 }
 
128
 
 
129
 void mch_mem_addr_init(struct pci_device *dev, void *arg)
 
130
@@ -312,6 +347,8 @@ void mch_mem_addr_init(struct pci_device *dev, void *arg)
 
131
 
 
132
     /* setup pci i/o window (above mmconfig) */
 
133
     pcimem_start = addr + size;
 
134
+
 
135
+    pci_slot_get_irq = mch_pci_slot_get_irq;
 
136
 }
 
137
 
 
138
 static const struct pci_device_id pci_platform_tbl[] = {
 
139
diff --git a/src/usb-ehci.c b/src/usb-ehci.c
 
140
index 2676615..8580f1d 100644
 
141
--- a/src/usb-ehci.c
 
142
+++ b/src/usb-ehci.c
 
143
@@ -347,9 +347,9 @@ ehci_init(struct pci_device *pci, int busid, struct pci_device *comppci)
 
144
     cntl->usb.pci = pci;
 
145
     cntl->usb.type = USB_TYPE_EHCI;
 
146
     cntl->caps = caps;
 
147
+    cntl->regs = (void*)caps + readb(&caps->caplength);
 
148
     if (hcc_params & HCC_64BIT_ADDR)
 
149
         cntl->regs->ctrldssegment = 0;
 
150
-    cntl->regs = (void*)caps + readb(&caps->caplength);
 
151
 
 
152
     dprintf(1, "EHCI init on dev %02x:%02x.%x (regs=%p)\n"
 
153
             , pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf)
 
154
diff --git a/tools/acpi_extract.py b/tools/acpi_extract.py
 
155
index 3295678..dd3ccfd 100755
 
156
--- a/tools/acpi_extract.py
 
157
+++ b/tools/acpi_extract.py
 
158
@@ -225,12 +225,12 @@ for line in fileinput.input():
 
159
     lineno = lineno + 1
 
160
     debug = "input line %d: %s" % (lineno, line)
 
161
     #ASL listing: space, then line#, then ...., then code
 
162
-    pasl = re.compile('^\s+([0-9]+)\.\.\.\.\s*')
 
163
+    pasl = re.compile('^\s+([0-9]+)(:\s\s|\.\.\.\.)\s*')
 
164
     m = pasl.search(line)
 
165
     if (m):
 
166
         add_asl(lineno, pasl.sub("", line));
 
167
     # AML listing: offset in hex, then ...., then code
 
168
-    paml = re.compile('^([0-9A-Fa-f]+)\.\.\.\.\s*')
 
169
+    paml = re.compile('^([0-9A-Fa-f]+)(:\s\s|\.\.\.\.)\s*')
 
170
     m = paml.search(line)
 
171
     if (m):
 
172
         add_aml(m.group(1), paml.sub("", line))
 
173
diff --git a/tools/test-build.sh b/tools/test-build.sh
 
174
index 7bd6d1f..081f9fd 100755
 
175
--- a/tools/test-build.sh
 
176
+++ b/tools/test-build.sh
 
177
@@ -14,13 +14,13 @@ if [ $? -ne 0 ]; then
 
178
     exit 0
 
179
 fi
 
180
 
 
181
-mkdir -p out
 
182
-TMPFILE1=out/tmp_testcompile1.c
 
183
-TMPFILE1o=out/tmp_testcompile1.o
 
184
-TMPFILE1_ld=out/tmp_testcompile1.lds
 
185
-TMPFILE2=out/tmp_testcompile2.c
 
186
-TMPFILE2o=out/tmp_testcompile2.o
 
187
-TMPFILE3o=out/tmp_testcompile3.o
 
188
+mkdir -p ${OUT}
 
189
+TMPFILE1=${OUT}/tmp_testcompile1.c
 
190
+TMPFILE1o=${OUT}/tmp_testcompile1.o
 
191
+TMPFILE1_ld=${OUT}/tmp_testcompile1.lds
 
192
+TMPFILE2=${OUT}/tmp_testcompile2.c
 
193
+TMPFILE2o=${OUT}/tmp_testcompile2.o
 
194
+TMPFILE3o=${OUT}/tmp_testcompile3.o
 
195
 
 
196
 # Test if ld's alignment handling is correct.  This is a known problem
 
197
 # with the linker that ships with Ubuntu 11.04.
 
198
@@ -41,9 +41,16 @@ SECTIONS
 
199
 }
 
200
 EOF
 
201
 $CC -O -g -c $TMPFILE1 -o $TMPFILE1o > /dev/null 2>&1
 
202
+if [ $? -ne 0 ]; then
 
203
+    echo "Unable to execute the C compiler ($CC)." >&2
 
204
+    echo "" >&2
 
205
+    echo "Please install a working compiler and retry." >&2
 
206
+    echo -1
 
207
+    exit 0
 
208
+fi
 
209
 $LD -T $TMPFILE1_ld $TMPFILE1o -o $TMPFILE2o > /dev/null 2>&1
 
210
 if [ $? -ne 0 ]; then
 
211
-    echo "The version of LD on this system does not properly handle" >&2
 
212
+    echo "The version of LD on this system ($LD) does not properly handle" >&2
 
213
     echo "alignments.  As a result, this project can not be built." >&2
 
214
     echo "" >&2
 
215
     echo "The problem may be the result of this LD bug report:" >&2