pci_rom.h 1.5 KB

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