From f302af14d5fbdd9ad12f7b08c17a1c2cf25eaaab Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 16 May 2009 21:39:19 +0000 Subject: Add proper workaround for 3COM 3C90xB cards, which need special fixups (the 3C90xC ones don't) This is tested on hardware. Also, add initial support for the Atmel AT29C010A chip (which I inserted in a 3COM 3C90xB card for testing). It can be detected, read works, erase works, but write will need some additional code (will post in another patch later). Corresponding to flashrom svn r520. Signed-off-by: Uwe Hermann Acked-by: Carl-Daniel Hailfinger --- pcidev.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'pcidev.c') diff --git a/pcidev.c b/pcidev.c index f07fe80..41b5f25 100644 --- a/pcidev.c +++ b/pcidev.c @@ -32,6 +32,7 @@ uint32_t io_base_addr; struct pci_access *pacc; struct pci_filter filter; char *pcidev_bdf = NULL; +struct pci_dev *pcidev_dev = NULL; uint32_t pcidev_validate(struct pci_dev *dev, struct pcidev_status *devs) { @@ -67,7 +68,7 @@ uint32_t pcidev_init(uint16_t vendor_id, struct pcidev_status *devs) struct pci_dev *dev; char *msg = NULL; int found = 0; - uint32_t addr = 0; + uint32_t addr = 0, curaddr = 0; pacc = pci_alloc(); /* Get the pci_access structure */ pci_init(pacc); /* Initialize the PCI library */ @@ -85,8 +86,11 @@ uint32_t pcidev_init(uint16_t vendor_id, struct pcidev_status *devs) for (dev = pacc->devices; dev; dev = dev->next) { if (pci_filter_match(&filter, dev)) { - if ((addr = pcidev_validate(dev, devs)) != 0) + if ((addr = pcidev_validate(dev, devs)) != 0) { + curaddr = addr; + pcidev_dev = dev; found++; + } } } @@ -102,7 +106,7 @@ uint32_t pcidev_init(uint16_t vendor_id, struct pcidev_status *devs) exit(1); } - return addr; + return curaddr; } void print_supported_pcidevs(struct pcidev_status *devs) -- cgit v1.1