blob: 8b2674cf87940fbcdd79b456695718a1f822b178 [file] [log] [blame]
Simon Glassf87bbff2014-11-14 20:56:33 -07001/*
2 * From coreboot file of same name
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#ifndef _PCI_ROM_H
8#define _PCI_ROM_H
9
10#define PCI_ROM_HDR 0xaa55
11#define PCI_VGA_RAM_IMAGE_START 0xc0000
12
13struct pci_rom_header {
14 uint16_t signature;
15 uint8_t size;
16 uint8_t init[3];
17 uint8_t reserved[0x12];
18 uint16_t data;
19};
20
21struct pci_rom_data {
22 uint32_t signature;
23 uint16_t vendor;
24 uint16_t device;
25 uint16_t reserved_1;
26 uint16_t dlen;
27 uint8_t drevision;
28 uint8_t class_lo;
29 uint16_t class_hi;
30 uint16_t ilen;
31 uint16_t irevision;
32 uint8_t type;
33 uint8_t indicator;
34 uint16_t reserved_2;
35};
36
37 /**
38 * pci_run_vga_bios() - Run the VGA BIOS in an x86 PC
39 *
40 * @dev: Video device containing the BIOS
41 * @int15_handler: Function to call to handle int 0x15
42 * @emulate: true to use the x86 emulator, false to run native
43 */
44int pci_run_vga_bios(pci_dev_t dev, int (*int15_handler)(void), bool emulate);
45
46/**
47 * board_map_oprom_vendev() - map several PCI IDs to the one the ROM expects
48 *
49 * Some VGA option roms are used for several chipsets but they only have one
50 * PCI ID in their header. If we encounter such an option rom, we need to do
51 * the mapping ourselves.
52 *
53 * @vendev: Vendor and device for the video device
54 * @return standard vendor and device expected by the ROM
55 */
56uint32_t board_map_oprom_vendev(uint32_t vendev);
57
58#endif