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
David Hendricks has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/42556 )
Change subject: [WIP] Add uncrustify config
......................................................................
[WIP] Add uncrustify config
Similar to CB:38673, this attempts to add a config file for uncrustify
as an alternative to clang-format, which has some limitations as
mentioned in the other patch.
This adds a config file which is a copy of the linux.cfg file. Newer
versions of this patch will tweak the config file as needed for
flashrom.
Change-Id: Ib6bd3ab49e841768f07c2705f71be66e9308bbca
Signed-off-by: David Hendricks <david.hendricks(a)gmail.com>
---
M 82802ab.c
M amd_imc.c
M at45db.c
M atahpt.c
M atapromise.c
M atavia.c
M bitbang_spi.c
M board_enable.c
M buspirate_spi.c
M cbtable.c
M ch341a_spi.c
M chipdrivers.h
M chipset_enable.c
M cli_classic.c
M cli_common.c
M cli_output.c
M coreboot_tables.h
M custom_baud.c
M custom_baud.h
M dediprog.c
M developerbox_spi.c
M digilent_spi.c
M dmi.c
M drkaiser.c
M dummyflasher.c
M edi.c
M edi.h
M en29lv640b.c
M ene.h
M flash.h
M flashchips.c
M flashchips.h
M flashrom.c
M fmap.c
M fmap.h
M ft2232_spi.c
M gfxnvidia.c
M helpers.c
M hwaccess.c
M hwaccess.h
M i2c_helper.h
M i2c_helper_linux.c
M ich_descriptors.c
M ich_descriptors.h
M ichspi.c
M internal.c
M it8212.c
M it85spi.c
M it87spi.c
M jedec.c
M jlink_spi.c
M layout.c
M layout.h
M libflashrom.c
M libflashrom.h
M linux_mtd.c
M linux_spi.c
M lspcon_i2c_spi.c
M mcp6x_spi.c
M mstarddc_spi.c
M ni845x_spi.c
M nic3com.c
M nicintel.c
M nicintel_eeprom.c
M nicintel_spi.c
M nicnatsemi.c
M nicrealtek.c
M ogp_spi.c
M os.h
M pcidev.c
M physmap.c
M pickit2_spi.c
M platform.h
M pony_spi.c
M print.c
M print_wiki.c
M processor_enable.c
M programmer.c
M programmer.h
M raiden_debug_spi.c
M rayer_spi.c
M realtek_mst_i2c_spi.c
M satamv.c
M satasii.c
M sb600spi.c
M serial.c
M serprog.c
M serprog.h
M sfdp.c
M spi.c
M spi.h
M spi25.c
M spi25_statusreg.c
M spi95.c
M sst28sf040.c
M sst_fwhub.c
M stlinkv3_spi.c
M udelay.c
A uncrustify.cfg
M usb_device.c
M usb_device.h
M usbblaster_spi.c
M usbdev.c
M w39.c
M wbsio_spi.c
105 files changed, 17,980 insertions(+), 17,840 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/56/42556/1
--
To view, visit https://review.coreboot.org/c/flashrom/+/42556
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib6bd3ab49e841768f07c2705f71be66e9308bbca
Gerrit-Change-Number: 42556
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-MessageType: newchange
Simon Buhrow has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/40477 )
Change subject: ft2232_spi.c: Pack WREN and op in one ftdi_write_data() call
......................................................................
Patch Set 11:
Anyone having time to give some feedback?
--
To view, visit https://review.coreboot.org/c/flashrom/+/40477
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ie4a07499ec5ef0af23818593f45dc427285a9e8a
Gerrit-Change-Number: 40477
Gerrit-PatchSet: 11
Gerrit-Owner: Simon Buhrow
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Tue, 30 Jun 2020 07:07:55 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment