Martijn Berger has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/39965 )
Change subject: pcidev: On arm64 we are not getting a valid BAR0 address
......................................................................
pcidev: On arm64 we are not getting a valid BAR0 address
It seems that there is some code to work around a possible bug in
old versions of libpci. This trusts libpci if it is new enough
Change-Id: I8bd32c6344b0831a949c3853abeb84905420922a
Signed-off-by: Martijn Berger <martijn.berger(a)gmail.com>
---
M pcidev.c
M programmer.h
2 files changed, 30 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/65/39965/1
diff --git a/pcidev.c b/pcidev.c
index 54c1fd3..973acde 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -30,20 +30,47 @@
TYPE_UNKNOWN
};
+int pci_bar_nuber_from_offset(int offset)
+{
+ switch (offset) {
+ case PCI_BASE_ADDRESS_0:
+ return 0;
+ case PCI_BASE_ADDRESS_1:
+ return 1;
+ case PCI_BASE_ADDRESS_2:
+ return 2;
+ case PCI_BASE_ADDRESS_3:
+ return 3;
+ case PCI_BASE_ADDRESS_4:
+ return 4;
+ case PCI_BASE_ADDRESS_5:
+ return 5;
+ default:
+ return -1;
+ }
+ return -1;
+}
+
uintptr_t pcidev_readbar(struct pci_dev *dev, int bar)
{
uint64_t addr;
uint32_t upperaddr;
uint8_t headertype;
uint16_t supported_cycles;
+ int bar_number;
enum pci_bartype bartype = TYPE_UNKNOWN;
headertype = pci_read_byte(dev, PCI_HEADER_TYPE) & 0x7f;
msg_pspew("PCI header type 0x%02x\n", headertype);
+ bar_number = pci_bar_nuber_from_offset(bar);
- /* Don't use dev->base_addr[x] (as value for 'bar'), won't work on older libpci. */
- addr = pci_read_long(dev, bar);
+ if (PCI_LIB_VERSION >= 0x030500 && bar_number > -1) {
+ addr = dev->base_addr[bar_number];
+ } else {
+ /* Don't use dev->base_addr[x] (as value for 'bar'), won't work on older libpci. */
+ addr = pci_read_long(dev, bar);
+ }
/* Sanity checks. */
switch (headertype) {
diff --git a/programmer.h b/programmer.h
index 9a41be1..5d4c1d7 100644
--- a/programmer.h
+++ b/programmer.h
@@ -190,6 +190,7 @@
// FIXME: This needs to be local, not global(?)
extern struct pci_access *pacc;
int pci_init_common(void);
+int pci_bar_nuber_from_offset(int offset);
uintptr_t pcidev_readbar(struct pci_dev *dev, int bar);
struct pci_dev *pcidev_init(const struct dev_entry *devs, int bar);
/* rpci_write_* are reversible writes. The original PCI config space register
--
To view, visit https://review.coreboot.org/c/flashrom/+/39965
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8bd32c6344b0831a949c3853abeb84905420922a
Gerrit-Change-Number: 39965
Gerrit-PatchSet: 1
Gerrit-Owner: Martijn Berger
Gerrit-MessageType: newchange
Hello build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/43349
to look at the new patch set (#4).
Change subject: Add Gemini Lake support
......................................................................
Add Gemini Lake support
FIXME: Split detailed softstrap printing into its own commit
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
Change-Id: I926a44176558115a2c833ef0954956eeb75061ff
---
M chipset_enable.c
M ich_descriptors.c
M ich_descriptors.h
M ichspi.c
M programmer.h
M util/ich_descriptors_tool/ich_descriptors_tool.c
6 files changed, 638 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/49/43349/4
--
To view, visit https://review.coreboot.org/c/flashrom/+/43349
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I926a44176558115a2c833ef0954956eeb75061ff
Gerrit-Change-Number: 43349
Gerrit-PatchSet: 4
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Hello build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/43349
to look at the new patch set (#3).
Change subject: Add Gemini Lake support
......................................................................
Add Gemini Lake support
FIXME: Split detailed softstrap printing into its own commit
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
Change-Id: I926a44176558115a2c833ef0954956eeb75061ff
---
M chipset_enable.c
M ich_descriptors.c
M ich_descriptors.h
M ichspi.c
M programmer.h
M util/ich_descriptors_tool/ich_descriptors_tool.c
6 files changed, 608 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/49/43349/3
--
To view, visit https://review.coreboot.org/c/flashrom/+/43349
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I926a44176558115a2c833ef0954956eeb75061ff
Gerrit-Change-Number: 43349
Gerrit-PatchSet: 3
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset