summaryrefslogtreecommitdiffstats
path: root/pcidev.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2009-05-16 21:39:19 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2009-05-16 21:39:19 +0000
commitf302af14d5fbdd9ad12f7b08c17a1c2cf25eaaab (patch)
tree464c74c283c1800bb426667b9e2f1277bd743fc5 /pcidev.c
parent2237dda98204032ae12004f41a99ef9286a28166 (diff)
downloadflashrom-f302af14d5fbdd9ad12f7b08c17a1c2cf25eaaab.zip
flashrom-f302af14d5fbdd9ad12f7b08c17a1c2cf25eaaab.tar.gz
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 <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'pcidev.c')
-rw-r--r--pcidev.c10
1 files changed, 7 insertions, 3 deletions
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)
OpenPOWER on IntegriCloud