Yinghai Lu | 6308d58 | 2005-01-13 18:42:22 +0000 | [diff] [blame] | 1 | #ifndef PCI_ROM_H |
| 2 | #define PCI_ROM_H |
Li-Ta Lo | 883b879 | 2005-01-10 23:16:22 +0000 | [diff] [blame] | 3 | #include <arch/byteorder.h> |
| 4 | #include <stddef.h> |
| 5 | |
| 6 | #define PCI_ROM_HDR 0xAA55 |
| 7 | #define PCI_DATA_HDR (uint32_t) ( ('R' << 24) | ('I' << 16) | ('C' << 8) | 'P' ) |
| 8 | |
| 9 | #define PCI_RAM_IMAGE_START 0xD0000 |
| 10 | #define PCI_VGA_RAM_IMAGE_START 0xC0000 |
| 11 | |
| 12 | struct rom_header { |
| 13 | uint16_t signature; |
| 14 | uint8_t size; |
| 15 | uint8_t init[3]; |
| 16 | uint8_t reserved[0x12]; |
| 17 | uint16_t data; |
| 18 | }; |
| 19 | |
| 20 | struct pci_data { |
| 21 | uint32_t signature; |
| 22 | uint16_t vendor; |
| 23 | uint16_t device; |
| 24 | uint16_t reserved_1; |
| 25 | uint16_t dlen; |
| 26 | uint8_t drevision; |
Yinghai Lu | 54ab311 | 2005-01-18 03:10:46 +0000 | [diff] [blame] | 27 | uint8_t class_lo; |
| 28 | uint16_t class_hi; |
Li-Ta Lo | 883b879 | 2005-01-10 23:16:22 +0000 | [diff] [blame] | 29 | uint16_t ilen; |
| 30 | uint16_t irevision; |
| 31 | uint8_t type; |
| 32 | uint8_t indicator; |
| 33 | uint16_t reserved_2; |
| 34 | }; |
Yinghai Lu | 6308d58 | 2005-01-13 18:42:22 +0000 | [diff] [blame] | 35 | |
| 36 | extern struct rom_header * pci_rom_probe(struct device *dev); |
| 37 | extern struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_header); |
| 38 | |
| 39 | #endif |