2005-01-13 19:42:22 +01:00
|
|
|
#ifndef PCI_ROM_H
|
|
|
|
#define PCI_ROM_H
|
Unify byte order macros and clrsetbits
This patch removes quite a bit of code duplication between cpu_to_le32()
and clrsetbits_le32() style macros on the different architectures. This
also syncs those macros back up to the new write32(a, v) style IO
accessor macros that are now used on ARM and ARM64.
CQ-DEPEND=CL:254862
BRANCH=none
BUG=chromium:444723
TEST=Compiled Cosmos, Daisy, Blaze, Falco, Pinky, Pit, Rambi, Ryu,
Storm and Urara. Booted on Jerry. Tried to compare binary images...
unfortunately something about the new macro notation makes the compiler
evaluate it more efficiently (not recalculating the address between the
read and the write), so this was of limited value.
Change-Id: If8ab62912c952d68a67a0f71e82b038732cd1317
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: fd43bf446581bfb84bec4f2ebb56b5de95971c3b
Original-Change-Id: I7d301b5bb5ac0db7f5ff39e3adc2b28a1f402a72
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/254866
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/9838
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-02-23 23:31:09 +01:00
|
|
|
#include <endian.h>
|
2005-01-11 00:16:22 +01:00
|
|
|
#include <stddef.h>
|
2016-03-31 20:04:23 +02:00
|
|
|
#include <arch/acpi.h>
|
2005-01-11 00:16:22 +01:00
|
|
|
|
|
|
|
#define PCI_ROM_HDR 0xAA55
|
2017-03-07 23:31:19 +01:00
|
|
|
#define PCI_DATA_HDR ((uint32_t) (('R' << 24) | ('I' << 16) | ('C' << 8) | 'P'))
|
2005-01-11 00:16:22 +01:00
|
|
|
|
|
|
|
#define PCI_RAM_IMAGE_START 0xD0000
|
|
|
|
#define PCI_VGA_RAM_IMAGE_START 0xC0000
|
|
|
|
|
|
|
|
struct rom_header {
|
|
|
|
uint16_t signature;
|
|
|
|
uint8_t size;
|
|
|
|
uint8_t init[3];
|
|
|
|
uint8_t reserved[0x12];
|
|
|
|
uint16_t data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pci_data {
|
|
|
|
uint32_t signature;
|
|
|
|
uint16_t vendor;
|
|
|
|
uint16_t device;
|
|
|
|
uint16_t reserved_1;
|
|
|
|
uint16_t dlen;
|
|
|
|
uint8_t drevision;
|
2005-01-18 04:10:46 +01:00
|
|
|
uint8_t class_lo;
|
|
|
|
uint16_t class_hi;
|
2005-01-11 00:16:22 +01:00
|
|
|
uint16_t ilen;
|
|
|
|
uint16_t irevision;
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t indicator;
|
|
|
|
uint16_t reserved_2;
|
|
|
|
};
|
2005-01-13 19:42:22 +01:00
|
|
|
|
2009-07-22 03:42:13 +02:00
|
|
|
struct rom_header *pci_rom_probe(struct device *dev);
|
2017-03-08 02:45:12 +01:00
|
|
|
struct rom_header *pci_rom_load(struct device *dev,
|
|
|
|
struct rom_header *rom_header);
|
2016-03-31 20:04:23 +02:00
|
|
|
|
|
|
|
unsigned long
|
|
|
|
pci_rom_write_acpi_tables(struct device *device,
|
|
|
|
unsigned long current,
|
|
|
|
struct acpi_rsdp *rsdp);
|
|
|
|
|
2017-06-06 19:30:55 +02:00
|
|
|
void pci_rom_ssdt(struct device *device);
|
|
|
|
|
2020-02-06 00:46:30 +01:00
|
|
|
void map_oprom_vendev_rev(u32 *vendev, u8 *rev);
|
2014-12-26 12:29:09 +01:00
|
|
|
u32 map_oprom_vendev(u32 vendev);
|
2005-07-06 18:49:59 +02:00
|
|
|
|
2019-10-04 14:06:33 +02:00
|
|
|
int verified_boot_should_run_oprom(struct rom_header *rom_header);
|
2005-01-13 19:42:22 +01:00
|
|
|
#endif
|