Hi,
Here is v2 of the two-pass pci initialization code.
Changed code according to Kevin's review:
* Fixed the bus check.
* Using a pci region type array now, which indeed made
the code simpler and shorter.
* The memory hole stuff is gone, there is a single
address space area now.
cheers,
Gerd
PS: also available here: http://www.kraxel.org/cgit/seabios/log/?h=pci.2
Gerd Hoffmann (4):
pci: add two-pass pci initialization code
pci: activate two-pass pci initialization code
pci: remove old pci initilaization code
pci: init boot devices only on address space shortage
Makefile | 2 +-
src/pci.c | 3 +
src/pci.h | 8 +
src/pci_region.c | 77 --------
src/pciinit.c | 538 ++++++++++++++++++++++++++++++++++++------------------
src/util.h | 31 +---
6 files changed, 377 insertions(+), 282 deletions(-)
delete mode 100644 src/pci_region.c
Instead of defining the bus id of each extra root bus, define the
number of extra root buses. The bus id isn't necessarily stable from
one boot to the next.
---
src/Kconfig | 20 ++++++++------------
src/pci.c | 10 ++++------
2 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/src/Kconfig b/src/Kconfig
index bbed963..70e3509 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -201,19 +201,15 @@ menu "Hardware support"
Support parallel ports. This also enables int 17 parallel port calls.
config EXTRA_PCI_ROOTS
- bool "Extra root buses"
- default n
+ int "Number of extra root buses"
+ default 0
help
- If the target machine has multiple independent root buses,
- the extra buses may be specified here.
- config PCI_ROOT1
- depends on EXTRA_PCI_ROOTS
- hex "Extra primary PCI root bus number"
- default 0x00
- config PCI_ROOT2
- depends on EXTRA_PCI_ROOTS
- hex "Extra secondary PCI root bus number"
- default 0x00
+ If the target machine has multiple independent root buses
+ set this to a positive value. The SeaBIOS PCI probe will
+ then search for the given number of extra root buses.
+
+ Most machines do not have multiple root buses and this
+ setting should be zero.
config USE_SMM
depends on !COREBOOT
diff --git a/src/pci.c b/src/pci.c
index 0de8ec5..23a6878 100644
--- a/src/pci.c
+++ b/src/pci.c
@@ -93,16 +93,12 @@ void
pci_probe(void)
{
dprintf(3, "PCI probe\n");
- if (CONFIG_PCI_ROOT1 && CONFIG_PCI_ROOT1 > MaxPCIBus)
- MaxPCIBus = CONFIG_PCI_ROOT1;
- if (CONFIG_PCI_ROOT2 && CONFIG_PCI_ROOT2 > MaxPCIBus)
- MaxPCIBus = CONFIG_PCI_ROOT2;
-
struct pci_device *busdevs[256];
memset(busdevs, 0, sizeof(busdevs));
struct pci_device **pprev = &PCIDevices;
int bus = -1, lastbus = 0, rootbuses = 0, count=0;
- while (bus < MaxPCIBus) {
+ while (bus < 0xff && (bus < MaxPCIBus
+ || rootbuses < CONFIG_EXTRA_PCI_ROOTS)) {
bus++;
int bdf;
foreachbdf(bdf, bus) {
@@ -125,6 +121,8 @@ pci_probe(void)
rootbuses++;
lastbus = bus;
rootbus = rootbuses;
+ if (bus > MaxPCIBus)
+ MaxPCIBus = bus;
} else {
rootbus = parent->rootbus;
}
--
1.7.4.4
More cleanups and enhancements. This series simplifies pci_next() so
that it no longer needs to check for pci bridges.
The vgahook changes in the first patch were compile tested only.
-Kevin
Kevin O'Connor (4):
Calculate vgahook responses during setup instead of in 16bit code.
Convert pci_find_device/class to use 'struct pci_device'.
Convert remaining callers of foreachbdf to foreachbdf_in_bus.
Rename foreachbdf_in_bus to foreachbdf and simplify it.
src/acpi.c | 2 +-
src/coreboot.c | 9 +-
src/floppy.c | 4 +-
src/optionroms.c | 3 +-
src/pci.c | 173 ++++++++++++++++------------------
src/pci.h | 21 ++---
src/pcibios.c | 55 ++++++-----
src/pciinit.c | 6 +-
src/shadow.c | 4 +-
src/smm.c | 10 +-
src/usb-ehci.c | 3 +-
src/util.h | 5 +-
src/vgahooks.c | 274 ++++++++++++++++++++++--------------------------------
13 files changed, 255 insertions(+), 314 deletions(-)
--
1.7.4.4
Hi, I wanted to directly sent the qemu binaries for test, but it
seems too big, so I attach the patch for qemu about the feature, to
help validate the seabios patch.
With the patched qemu compiled:
Alternate the bios.bin that qemu used to the patched, put the
logo picture in the pc-bios folder or other place, invoker it as
following:
qemu-system-x86_64 -boot splash_time=<N>,splash_filename=<N>
Time unit is ms. Default splash picture is bootsplash.bmp stored
in the directory where bios.bin stay.
eg:
qemu-system-x86_64 -boot
splash_time=20000,splash_filename=/home/xiawenc/bootsplash.bmp
qemu in 32bit mode could be applied also.
limitation:
jpeg decoder have its limitation, it only accept jpg file with
width=16*N, height=16*N. Strange thing is for some picture it have a
good visual effect, while some with observable quality loss.
bmp decoder only accept 24bpp file, with a resolution that a VESA
mode could support. Recommended is 640x480(mostly used).
note:
It seems the latest qemu code from git have some problem in
compiling and its TCG. If this problem still exist when u get it,
following could solve it:
git reset --hard f44c99607a46484c52f03aed373e3a3a194af721
invoke it with option --enable-kvm, to bypass TCG.
If you get a better method to share the testing binaries, pls let
me know. Feel free to put any comments.
Best Regards
Wayne Xia
mail:xiawenc@linux.vnet.ibm.com
tel:86-010-82450803