Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/86383?usp=email )
(
2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: device/pci_rom: Use correct endian conversion ......................................................................
device/pci_rom: Use correct endian conversion
The Option ROM contains lots of 16bit values that are being used, thus use the 16bit endianness conversion function over the 32bit variant to avoid confusion.
TEST: Still works on amd/birman+.
Change-Id: I571be97a930ad018e1d1316117cefe5bd1c68f9b Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/86383 Reviewed-by: Felix Held felix-coreboot@felixheld.de Reviewed-by: Andy Ebrahiem ahmet.ebrahiem@9elements.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/device/pci_rom.c 1 file changed, 7 insertions(+), 7 deletions(-)
Approvals: Andy Ebrahiem: Looks good to me, but someone else must approve Felix Held: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c index d60720e..7e19646d 100644 --- a/src/device/pci_rom.c +++ b/src/device/pci_rom.c @@ -93,16 +93,16 @@
printk(BIOS_SPEW, "PCI expansion ROM, signature 0x%04x, INIT size 0x%04x, data ptr 0x%04x\n", - le32_to_cpu(rom_header->signature), - rom_header->size * 512, le32_to_cpu(rom_header->data)); + le16_to_cpu(rom_header->signature), + rom_header->size * 512, le16_to_cpu(rom_header->data));
- if (le32_to_cpu(rom_header->signature) != PCI_ROM_HDR) { + if (le16_to_cpu(rom_header->signature) != PCI_ROM_HDR) { printk(BIOS_ERR, "Incorrect expansion ROM header signature %04x\n", - le32_to_cpu(rom_header->signature)); + le16_to_cpu(rom_header->signature)); return NULL; }
- rom_data = (((void *)rom_header) + le32_to_cpu(rom_header->data)); + rom_data = (((void *)rom_header) + le16_to_cpu(rom_header->data));
printk(BIOS_SPEW, "PCI ROM image, vendor ID %04x, device ID %04x,\n", rom_data->vendor, rom_data->device); @@ -144,9 +144,9 @@ + image_size);
rom_data = (struct pci_data *)((void *)rom_header - + le32_to_cpu(rom_header->data)); + + le16_to_cpu(rom_header->data));
- image_size = le32_to_cpu(rom_data->ilen) * 512; + image_size = le16_to_cpu(rom_data->ilen) * 512; } while ((rom_data->type != 0) && (rom_data->indicator != 0)); // make sure we got x86 version
if (rom_data->type != 0)