blob: 94ca4ae10f40ecdc2789851d4f7b7f24eea6363e [file] [log] [blame]
Julian Pidancetbc6097b2011-12-19 05:07:54 +00001#ifndef __OPTIONROMS_H
2#define __OPTIONROMS_H
3
4#include "types.h" // u32
5
6#define OPTION_ROM_SIGNATURE 0xaa55
7
8struct rom_header {
9 u16 signature;
10 u8 size;
11 u8 initVector[4];
12 u8 reserved[17];
13 u16 pcioffset;
14 u16 pnpoffset;
15} PACKED;
16
17#define PCI_ROM_SIGNATURE 0x52494350 // "PCIR"
18
19struct pci_data {
20 u32 signature;
21 u16 vendor;
22 u16 device;
23 u16 vitaldata;
24 u16 dlen;
25 u8 drevision;
26 u8 class_lo;
27 u16 class_hi;
28 u16 ilen;
29 u16 irevision;
30 u8 type;
31 u8 indicator;
32 u16 reserved;
33} PACKED;
34
35struct pnp_data {
36 u32 signature;
37 u8 revision;
38 u8 len;
39 u16 nextoffset;
40 u8 reserved_08;
41 u8 checksum;
42 u32 devid;
43 u16 manufacturer;
44 u16 productname;
45 u8 type_lo;
46 u16 type_hi;
47 u8 dev_flags;
48 u16 bcv;
49 u16 dv;
50 u16 bev;
51 u16 reserved_1c;
52 u16 staticresource;
53} PACKED;
54
55#define OPTION_ROM_ALIGN 2048
56#define OPTION_ROM_INITVECTOR offsetof(struct rom_header, initVector[0])
57#define PCIROM_CODETYPE_X86 0
58
Julian Pidancetbc6097b2011-12-19 05:07:54 +000059#endif