pci_rom.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * From coreboot file of same name
  4. */
  5. #ifndef _PCI_ROM_H
  6. #define _PCI_ROM_H
  7. #define PCI_ROM_HDR 0xaa55
  8. struct pci_rom_header {
  9. uint16_t signature;
  10. uint8_t size;
  11. uint8_t init[3];
  12. uint8_t reserved[0x12];
  13. uint16_t data;
  14. };
  15. struct pci_rom_data {
  16. uint32_t signature;
  17. uint16_t vendor;
  18. uint16_t device;
  19. uint16_t reserved_1;
  20. uint16_t dlen;
  21. uint8_t drevision;
  22. uint8_t class_lo;
  23. uint16_t class_hi;
  24. uint16_t ilen;
  25. uint16_t irevision;
  26. uint8_t type;
  27. uint8_t indicator;
  28. uint16_t reserved_2;
  29. };
  30. /*
  31. * Determines which execution method is used and whether we allow falling back
  32. * to the other if the requested method is not available.
  33. */
  34. enum pci_rom_emul {
  35. PCI_ROM_EMULATE = 0 << 0,
  36. PCI_ROM_USE_NATIVE = 1 << 0,
  37. PCI_ROM_ALLOW_FALLBACK = 1 << 1,
  38. };
  39. /**
  40. * dm_pci_run_vga_bios() - Run the VGA BIOS in an x86 PC
  41. *
  42. * @dev: Video device containing the BIOS
  43. * @int15_handler: Function to call to handle int 0x15
  44. * @exec_method: flags from enum pci_rom_emul
  45. */
  46. int dm_pci_run_vga_bios(struct udevice *dev, int (*int15_handler)(void),
  47. int exec_method);
  48. /**
  49. * board_map_oprom_vendev() - map several PCI IDs to the one the ROM expects
  50. *
  51. * Some VGA option roms are used for several chipsets but they only have one
  52. * PCI ID in their header. If we encounter such an option rom, we need to do
  53. * the mapping ourselves.
  54. *
  55. * @vendev: Vendor and device for the video device
  56. * @return standard vendor and device expected by the ROM
  57. */
  58. uint32_t board_map_oprom_vendev(uint32_t vendev);
  59. #endif