mirror of
https://review.coreboot.org/flashrom.git
synced 2025-09-18 02:45:23 +02:00
pcidev.h: Extract pcidev declarations to a separate header
This patch moves all the declarations relevant to PCI into their own header in include/pcidev.h This is a simple refactor that aims to simplify maintenance and to clarify file dependency inside the project. Currently, most of the declarations reside in programmer.h making it difficult to really understand file dependency. Change-Id: Ie7cefa012d43e03d2d3886f1567ad9b3fe1b148c Signed-off-by: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/89094 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:

committed by
Anastasia Klimchuk

parent
b6843e012e
commit
05976c7e93
@@ -120,33 +120,9 @@ struct bitbang_spi_master {
|
||||
unsigned int half_period;
|
||||
};
|
||||
|
||||
struct pci_dev;
|
||||
struct pci_filter;
|
||||
|
||||
/* pcidev.c */
|
||||
// FIXME: This needs to be local, not global(?)
|
||||
extern struct pci_access *pacc;
|
||||
int pci_init_common(void);
|
||||
uintptr_t pcidev_readbar(struct pci_dev *dev, int bar);
|
||||
struct pci_dev *pcidev_init(const struct programmer_cfg *cfg, const struct dev_entry *devs, int bar);
|
||||
struct pci_dev *pcidev_scandev(struct pci_filter *filter, struct pci_dev *start);
|
||||
struct pci_dev *pcidev_getdevfn(struct pci_dev *dev, const int func);
|
||||
struct pci_dev *pcidev_find_vendorclass(uint16_t vendor, uint16_t devclass);
|
||||
struct pci_dev *pcidev_card_find(uint16_t vendor, uint16_t device, uint16_t card_vendor, uint16_t card_device);
|
||||
struct pci_dev *pcidev_find(uint16_t vendor, uint16_t device);
|
||||
/* rpci_write_* are reversible writes. The original PCI config space register
|
||||
* contents will be restored on shutdown.
|
||||
* To clone the pci_dev instances internally, the `pacc` global
|
||||
* variable has to reference a pci_access method that is compatible
|
||||
* with the given pci_dev handle. The referenced pci_access (not
|
||||
* the variable) has to stay valid until the shutdown handlers are
|
||||
* finished.
|
||||
*/
|
||||
int rpci_write_byte(struct pci_dev *dev, int reg, uint8_t data);
|
||||
int rpci_write_word(struct pci_dev *dev, int reg, uint16_t data);
|
||||
int rpci_write_long(struct pci_dev *dev, int reg, uint32_t data);
|
||||
|
||||
#if CONFIG_INTERNAL == 1
|
||||
struct pci_dev;
|
||||
struct penable {
|
||||
uint16_t vendor_id;
|
||||
uint16_t device_id;
|
||||
|
Reference in New Issue
Block a user