diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-04-14 09:59:59 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-04-15 12:20:06 +0100 |
commit | 40de41276218ef1bca9f47fd166e83deb1c1f536 (patch) | |
tree | 562afc7b9a25b5af8192d5b37abaa26d8e45c719 /src/arch | |
parent | fb31365db4d7312d286b73e75b4511ce7f88e727 (diff) | |
download | ipxe-40de41276218ef1bca9f47fd166e83deb1c1f536.tar.gz |
[build] Allow building PCI ROMs with device ID lists
PCI v3.0 supports a "device list" which allows the ROM to claim
support for multiple PCI device IDs (but only a single vendor ID).
Add support for building such ROMs by scanning the build target
element list and incorporating any device IDs into the ROM's device
list header. For example:
make bin/8086153a--8086153b.mrom
would build a ROM claiming support for both 8086:153a and 8086:153b.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/i386/prefix/romprefix.S | 13 | ||||
-rw-r--r-- | src/arch/i386/scripts/i386.lds | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S index 27b1627f..18dda2b3 100644 --- a/src/arch/i386/prefix/romprefix.S +++ b/src/arch/i386/prefix/romprefix.S @@ -91,7 +91,7 @@ pciheader: .ascii "PCIR" /* Signature */ .word pci_vendor_id /* Vendor identification */ .word pci_device_id /* Device identification */ - .word 0x0000 /* Device list pointer */ + .word ( pci_devlist - pciheader ) /* Device list pointer */ .word pciheader_len /* PCI data structure length */ .byte 0x03 /* PCI data structure revision */ .byte 0x02, 0x00, 0x00 /* Class code */ @@ -107,6 +107,17 @@ pciheader_runtime_length: .equ pciheader_len, . - pciheader .size pciheader, . - pciheader + /* PCI additional device list (filled in by linker) */ + .section ".pci_devlist.00000000", "a", @progbits +pci_devlist: + .previous + .section ".pci_devlist.ffffffff", "a", @progbits +pci_devlist_end: + .short 0x0000 /* List terminator */ + .previous + /* Ensure that terminator is always present */ + .reloc pciheader, RELOC_TYPE_NONE, pci_devlist_end + .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */ .ascii ZINFO_TYPE_ADxW .long pciheader_image_length diff --git a/src/arch/i386/scripts/i386.lds b/src/arch/i386/scripts/i386.lds index 348dfefa..38c89e14 100644 --- a/src/arch/i386/scripts/i386.lds +++ b/src/arch/i386/scripts/i386.lds @@ -41,6 +41,7 @@ SECTIONS { .prefix 0x0 : AT ( _prefix_lma ) { _prefix = .; *(.prefix) + *(SORT(.pci_devlist.*)) *(.prefix.*) _mprefix = .; } .bss.prefix (NOLOAD) : AT ( _end_lma ) { |