1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 22:21:16 +02:00

pcidev: Avoid internal programmer relying on pacc global

Make progress towards the goal of removing pacc from global
state as noted in the FIXME of programmer.h

BUG=b:220950271
TEST=```sudo ./flashrom -p internal --flash-size
<snip>
Found Programmer flash chip "Opaque flash chip" (16384 kB, Programmer-specific) mapped at physical address 0x0000000000000000.
16777216
```

Change-Id: Id83bfd41f785f907e52a65a6689e8c7016fc1b77
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/59275
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
This commit is contained in:
Edward O'Callaghan
2021-11-13 13:14:06 +11:00
committed by Edward O'Callaghan
parent 2740a52dbd
commit 634707a42d
3 changed files with 25 additions and 23 deletions

View File

@ -148,6 +148,15 @@ uintptr_t pcidev_readbar(struct pci_dev *dev, int bar)
return (uintptr_t)addr;
}
struct pci_dev *pcidev_scandev(struct pci_filter *filter, struct pci_dev *start)
{
struct pci_dev *temp;
for (temp = start ? start->next : pacc->devices; temp; temp = temp->next)
if (pci_filter_match(filter, temp))
return temp;
return NULL;
}
static int pcidev_shutdown(void *data)
{
if (pacc == NULL) {