blob: decd806e94cf7c84152ac4cb330b00be1ccd3517 [file] [log] [blame]
Yinghai Lu6308d582005-01-13 18:42:22 +00001#ifndef PCI_ROM_H
2#define PCI_ROM_H
Julius Werner9ff8f6f2015-02-23 14:31:09 -08003#include <endian.h>
Li-Ta Lo883b8792005-01-10 23:16:22 +00004#include <stddef.h>
Patrick Rudolpha5c2ac62016-03-31 20:04:23 +02005#include <arch/acpi.h>
Li-Ta Lo883b8792005-01-10 23:16:22 +00006
7#define PCI_ROM_HDR 0xAA55
Lee Leahyf00e4462017-03-07 13:17:49 -08008#define PCI_DATA_HDR ((uint32_t) ( ('R' << 24) | ('I' << 16) | ('C' << 8) | 'P' ))
Li-Ta Lo883b8792005-01-10 23:16:22 +00009
10#define PCI_RAM_IMAGE_START 0xD0000
11#define PCI_VGA_RAM_IMAGE_START 0xC0000
12
13struct 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_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;
Yinghai Lu54ab3112005-01-18 03:10:46 +000028 uint8_t class_lo;
29 uint16_t class_hi;
Li-Ta Lo883b8792005-01-10 23:16:22 +000030 uint16_t ilen;
31 uint16_t irevision;
32 uint8_t type;
33 uint8_t indicator;
34 uint16_t reserved_2;
35};
Yinghai Lu6308d582005-01-13 18:42:22 +000036
Stefan Reinauerf5c38c02009-07-22 01:42:13 +000037struct rom_header *pci_rom_probe(struct device *dev);
38struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_header);
Patrick Rudolpha5c2ac62016-03-31 20:04:23 +020039
40unsigned long
41pci_rom_write_acpi_tables(struct device *device,
42 unsigned long current,
43 struct acpi_rsdp *rsdp);
44
Kyösti Mälkki1bdd3212014-12-26 13:29:09 +020045u32 map_oprom_vendev(u32 vendev);
arch import user (historical)23053642005-07-06 16:49:59 +000046
Yinghai Lu6308d582005-01-13 18:42:22 +000047#endif