include/spd_bin.h: Add SPD IO layer
[coreboot2.git] / src / include / device / pci_rom.h
blob531ec18ffa68196cf3c97b30c08b1b13e6ad7844
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef PCI_ROM_H
4 #define PCI_ROM_H
6 #include <endian.h>
7 #include <acpi/acpi.h>
8 #include <cbfs.h>
9 #include <stdint.h>
11 #define PCI_ROM_HDR 0xAA55
12 #define PCI_DATA_HDR ((uint32_t)(('R' << 24) | ('I' << 16) | ('C' << 8) | 'P'))
14 #define PCI_RAM_IMAGE_START 0xD0000
15 #define PCI_VGA_RAM_IMAGE_START 0xC0000
17 struct rom_header {
18 uint16_t signature;
19 uint8_t size;
20 uint8_t init[3];
21 uint8_t reserved[0x12];
22 uint16_t data;
25 struct pci_data {
26 uint32_t signature;
27 uint16_t vendor;
28 uint16_t device;
29 uint16_t reserved_1;
30 uint16_t dlen;
31 uint8_t drevision;
32 uint8_t class_lo;
33 uint16_t class_hi;
34 uint16_t ilen;
35 uint16_t irevision;
36 uint8_t type;
37 uint8_t indicator;
38 uint16_t reserved_2;
41 void vga_oprom_preload(void);
42 struct rom_header *pci_rom_probe(const struct device *dev);
43 struct rom_header *pci_rom_load(struct device *dev,
44 struct rom_header *rom_header);
46 static inline void pci_rom_free(struct rom_header *rom_header)
48 cbfs_unmap(rom_header);
51 unsigned long
52 pci_rom_write_acpi_tables(const struct device *device,
53 unsigned long current,
54 struct acpi_rsdp *rsdp);
56 void pci_rom_ssdt(const struct device *device);
58 u32 map_oprom_vendev(u32 vendev);
60 int verified_boot_should_run_oprom(struct rom_header *rom_header);
61 #endif