Attention is currently required from: Thomas Heijligen.
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/73293
to look at the new patch set (#2).
Change subject: libpci: drop support for pciutils < 2.2.0
......................................................................
libpci: drop support for pciutils < 2.2.0
This version was releasd in september 2005 and had an breaking api
change. With dropping it we don't need to maintain the old codepath any
longer.
Change-Id: If943db350b561a005d8292a53d9255223db3d571
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
---
M Makefile
D Makefile.d/pci_old_get_dev_test.c
M include/platform/pci.h
M meson.build
M pcidev.c
5 files changed, 30 insertions(+), 40 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/93/73293/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/73293
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If943db350b561a005d8292a53d9255223db3d571
Gerrit-Change-Number: 73293
Gerrit-PatchSet: 2
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newpatchset
Thomas Heijligen has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/73293 )
Change subject: libpci: drop support for pciutils < 2.2.0
......................................................................
libpci: drop support for pciutils < 2.2.0
This version was releasd in september 2005 and had an breaking api
change. With dropping it we don't need to maintain the old codepath any
longer.
Change-Id: If943db350b561a005d8292a53d9255223db3d571
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
---
M Makefile
D Makefile.d/pci_old_get_dev_test.c
M include/platform/pci.h
M meson.build
M pcidev.c
5 files changed, 30 insertions(+), 40 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/93/73293/1
diff --git a/Makefile b/Makefile
index 5283fea..a71a2fa 100644
--- a/Makefile
+++ b/Makefile
@@ -251,7 +251,6 @@
HAS_LIBUSB1 := $(call find_dependency, libusb-1.0)
HAS_LIBPCI := $(call find_dependency, libpci)
-HAS_PCI_OLD_GET_DEV := $(call c_compile_test, Makefile.d/pci_old_get_dev_test.c, $(CONFIG_LIBPCI_CFLAGS))
HAS_FT232H := $(call c_compile_test, Makefile.d/ft232h_test.c, $(CONFIG_LIBFTDI1_CFLAGS))
HAS_UTSNAME := $(call c_compile_test, Makefile.d/utsname_test.c)
HAS_CLOCK_GETTIME := $(call c_compile_test, Makefile.d/clock_gettime_test.c)
@@ -982,7 +981,6 @@
@if [ $(ENDIAN) = unknown ]; then echo Aborting.; exit 1; fi
@echo Dependency libpci found: $(HAS_LIBPCI) $(CONFIG_LIBPCI_VERSION)
@if [ $(HAS_LIBPCI) = yes ]; then \
- echo " Checking for old \"pci_get_dev()\": $(HAS_PCI_OLD_GET_DEV)";\
echo " CFLAGS: $(CONFIG_LIBPCI_CFLAGS)"; \
echo " LDFLAGS: $(CONFIG_LIBPCI_LDFLAGS)"; \
fi
diff --git a/Makefile.d/pci_old_get_dev_test.c b/Makefile.d/pci_old_get_dev_test.c
deleted file mode 100644
index 3223651..0000000
--- a/Makefile.d/pci_old_get_dev_test.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Avoid a failing test due to libpci header symbol shadowing breakage */
-#define index shadow_workaround_index
-#if !defined __NetBSD__
-#include <pci/pci.h>
-#else
-#include <pciutils/pci.h>
-#endif
-struct pci_access *pacc;
-struct pci_dev *dev = {0};
-int main(int argc, char **argv)
-{
- (void) argc;
- (void) argv;
- pacc = pci_alloc();
- dev = pci_get_dev(pacc, dev->bus, dev->dev, 1);
- return 0;
-}
diff --git a/include/platform/pci.h b/include/platform/pci.h
index a0324f8..4ac108f 100644
--- a/include/platform/pci.h
+++ b/include/platform/pci.h
@@ -1,19 +1,23 @@
/*
- * This is a wrapper for libpci.
- * ...
+ * This file is part of the flashrom project.
+ *
+ * Copyright (C) 2022 secunet Security Networks AG
+ * (written by Thomas Heijligen <thomas.heijligen(a)secunet.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*/
-
#ifndef __PLATFORM_PCI_H__
#define __PLATFORM_PCI_H__
-/*
- * An old libpci version seems to use the variable name "index" which triggers
- * shadowing warnings on systems which have the index() function in a default
- * #include or as builtin.
- */
-#define index shadow_workaround_index
-
/* Some NetBSDs are using an other include path for pci.h
* e.g. NetBSD 9.0 on sparc64 pciutils-3.7.0nb2.
* Other NetBSD platforms and versions uses the default path under pci/pci.h
@@ -24,6 +28,4 @@
#include <pci/pci.h>
#endif
-#undef index
-
#endif /* __PLATFORM_PCI_H__ */
diff --git a/meson.build b/meson.build
index d20f24c..11a5130 100644
--- a/meson.build
+++ b/meson.build
@@ -124,7 +124,8 @@
group_internal = get_option('programmer').contains('group_internal')
group_external = get_option('programmer').contains('group_external')
-libpci = dependency('libpci', required : group_pci, static : (host_machine.system() == 'openbsd' ? true : false)) # On openbsd a static version of libpci is needed to get also -libz
+libpci = dependency('libpci', required : group_pci, version : ">=2.2.0",
+ static : (host_machine.system() == 'openbsd' ? true : false)) # On openbsd a static version of libpci is needed to get also -libz
libusb1 = dependency('libusb-1.0', required : group_usb)
libftdi1 = dependency('libftdi1', required : group_ftdi)
libjaylink = dependency('libjaylink', required : group_jlink)
diff --git a/pcidev.c b/pcidev.c
index 0b35944..696510e 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -192,15 +192,7 @@
struct pci_dev *pcidev_getdevfn(struct pci_dev *dev, const int func)
{
-#if !defined(OLD_PCI_GET_DEV)
struct pci_dev *const new = pci_get_dev(pacc, dev->domain, dev->bus, dev->dev, func);
-#else
- /* pciutils/libpci before version 2.2 is too old to support
- * PCI domains. Such old machines usually don't have domains
- * besides domain 0, so this is not a problem.
- */
- struct pci_dev *const new = pci_get_dev(pacc, dev->bus, dev->dev, func);
-#endif
if (new)
pci_fill_info(new, PCI_FILL_IDENT);
return new;
--
To view, visit https://review.coreboot.org/c/flashrom/+/73293
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If943db350b561a005d8292a53d9255223db3d571
Gerrit-Change-Number: 73293
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newchange
Thomas Heijligen has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/73292 )
Change subject: include/pci.h: Use __has_include() macro to test pci.h path
......................................................................
include/pci.h: Use __has_include() macro to test pci.h path
Some NetBSDs have the pci.h under pciutils/ instead of pci/. But we
can't say for sure which variants uses which include path. Just test
them with the __has_include() compiler macro.
https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005finclude.html
Change-Id: Ib20de6bffede910b89937f554b4d56f4799f0762
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
---
M include/platform/pci.h
1 file changed, 22 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/92/73292/1
diff --git a/include/platform/pci.h b/include/platform/pci.h
index 93bc163..a0324f8 100644
--- a/include/platform/pci.h
+++ b/include/platform/pci.h
@@ -14,12 +14,16 @@
*/
#define index shadow_workaround_index
-#if defined (__NetBSD__)
-#include <pci.h>
+/* Some NetBSDs are using an other include path for pci.h
+ * e.g. NetBSD 9.0 on sparc64 pciutils-3.7.0nb2.
+ * Other NetBSD platforms and versions uses the default path under pci/pci.h
+ */
+#if __has_include(<pciutils/pci.h>)
+#include <pciutils/pci.h>
#else
#include <pci/pci.h>
#endif
#undef index
-#endif /* __PLATFORM_PCI_H__ */
\ No newline at end of file
+#endif /* __PLATFORM_PCI_H__ */
--
To view, visit https://review.coreboot.org/c/flashrom/+/73292
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib20de6bffede910b89937f554b4d56f4799f0762
Gerrit-Change-Number: 73292
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newchange
Attention is currently required from: Thomas Heijligen.
Hello build bot (Jenkins), Edward O'Callaghan, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/72619
to look at the new patch set (#11).
Change subject: move manpage to sphinx
......................................................................
move manpage to sphinx
Use sphinx (sphinx-doc.org) to generate the UNIX man page from an
reStructuredText file instead of dealing with plain groff.
Use `meson setup -Dman-pages=enabled` to build the man page, and
`meson setup -Ddocumentation=enabled` to build the web documentation
explicitly. Both are enabled automatically if sphinx-build is found.
The man page will be installed as `<meson_mandir>/man8/flashrom.8` and
The html documentation in <meson_datadir>/doc/flashrom/html`.
The Makefile builds only the man-page format.
Change-Id: Iee9f1164c5913e47385e6f7d51dc7775a58b5a67
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
---
M .gitignore
M Makefile
A doc/classic_cli_manpage.rst
A doc/conf.py
A doc/index.rst
A doc/meson.build
D flashrom.8.tmpl
M meson.build
M meson_options.txt
9 files changed, 1,490 insertions(+), 1,870 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/19/72619/11
--
To view, visit https://review.coreboot.org/c/flashrom/+/72619
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iee9f1164c5913e47385e6f7d51dc7775a58b5a67
Gerrit-Change-Number: 72619
Gerrit-PatchSet: 11
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: Thomas Heijligen.
Hello build bot (Jenkins), Edward O'Callaghan, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/72619
to look at the new patch set (#10).
Change subject: move manpage to sphinx
......................................................................
move manpage to sphinx
Use sphinx (sphinx-doc.org) to generate the UNIX man page from an
reStructuredText file instead of dealing with plain groff.
Use `meson setup -Dman-pages=enabled` to build the man page, and
`meson setup -Ddocumentation=enabled` to build the web documentation
explicitly. Both are enabled automatically if sphinx-build is found.
The man page will be installed as `<meson_mandir>/man8/flashrom.8` and
The html documentation in <meson_datadir>/doc/flashrom/html`.
The Makefile builds only the man-page format.
Change-Id: Iee9f1164c5913e47385e6f7d51dc7775a58b5a67
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
---
M .gitignore
M Makefile
A doc/classic_cli_manpage.rst
A doc/conf.py
A doc/index.rst
A doc/meson.build
D flashrom.8.tmpl
M meson.build
M meson_options.txt
9 files changed, 1,490 insertions(+), 1,870 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/19/72619/10
--
To view, visit https://review.coreboot.org/c/flashrom/+/72619
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iee9f1164c5913e47385e6f7d51dc7775a58b5a67
Gerrit-Change-Number: 72619
Gerrit-PatchSet: 10
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: Thomas Heijligen.
Hello build bot (Jenkins), Edward O'Callaghan,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/72656
to look at the new patch set (#4).
Change subject: meson: use mesons configuration_data for to evaluate cflags
......................................................................
meson: use mesons configuration_data for to evaluate cflags
Use mesons build in system for configurations instead of managing them
by our own.
Change-Id: Ie91b4e1377b9d6d347511d4727c0a26a314b1e57
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
---
M doc/meson.build
M meson.build
2 files changed, 39 insertions(+), 77 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/56/72656/4
--
To view, visit https://review.coreboot.org/c/flashrom/+/72656
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ie91b4e1377b9d6d347511d4727c0a26a314b1e57
Gerrit-Change-Number: 72656
Gerrit-PatchSet: 4
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: Edward O'Callaghan.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/70603 )
Change subject: flashrom.c: Reduce the prog global state machine
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
Why saving the result of `prog == &programmer_internal`? Can we put this just in `static bool is_internal_programmer()`?
--
To view, visit https://review.coreboot.org/c/flashrom/+/70603
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I93dfe09fe877acd32c4f22665921544ccd9323f6
Gerrit-Change-Number: 70603
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Mon, 27 Feb 2023 10:32:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Thomas Heijligen has submitted this change. ( https://review.coreboot.org/c/flashrom/+/67480 )
Change subject: spi: Make 'default_spi_send_command' the default unless defined
......................................................................
spi: Make 'default_spi_send_command' the default unless defined
A NULL func pointer is necessary and sufficient for the
condition `NULL func pointer => default_spi_send_command' as to not
need this explicit specification of 'default'.
Therefore drop the explicit need to specify the 'default_spi_send_command'
callback function pointer in the spi_master struct. This is a reasonable default for every other driver in the tree with only a few exceptions.
This simplifies the code and driver development.
Change-Id: I63abcb8c64f233cdbf58a149a31051fa648305a2
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67480
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Thomas Heijligen <src(a)posteo.de>
---
M ft2232_spi.c
M spi.c
2 files changed, 27 insertions(+), 5 deletions(-)
Approvals:
build bot (Jenkins): Verified
Thomas Heijligen: Looks good to me, approved
diff --git a/ft2232_spi.c b/ft2232_spi.c
index dfec1a0..16bcfe3 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -295,7 +295,6 @@
.features = SPI_MASTER_4BA,
.max_data_read = 64 * 1024,
.max_data_write = 256,
- .command = default_spi_send_command,
.multicommand = ft2232_spi_send_multicommand,
.read = default_spi_read,
.write_256 = default_spi_write_256,
diff --git a/spi.c b/spi.c
index 6c2c4c4..ca27cbb 100644
--- a/spi.c
+++ b/spi.c
@@ -30,8 +30,9 @@
unsigned int readcnt, const unsigned char *writearr,
unsigned char *readarr)
{
- return flash->mst->spi.command(flash, writecnt, readcnt, writearr,
- readarr);
+ if (flash->mst->spi.command)
+ return flash->mst->spi.command(flash, writecnt, readcnt, writearr, readarr);
+ return default_spi_send_command(flash, writecnt, readcnt, writearr, readarr);
}
int spi_send_multicommand(const struct flashctx *flash, struct spi_command *cmds)
@@ -152,9 +153,9 @@
}
}
- if (!mst->write_256 || !mst->read || !mst->command ||
+ if (!mst->write_256 || !mst->read ||
!mst->multicommand || !mst->probe_opcode ||
- ((mst->command == default_spi_send_command) &&
+ ((mst->command == default_spi_send_command || !mst->command) &&
(mst->multicommand == default_spi_send_multicommand))) {
msg_perr("%s called with incomplete master definition. "
"Please report a bug at flashrom(a)flashrom.org\n",
--
To view, visit https://review.coreboot.org/c/flashrom/+/67480
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I63abcb8c64f233cdbf58a149a31051fa648305a2
Gerrit-Change-Number: 67480
Gerrit-PatchSet: 5
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Edward O'Callaghan, Aarya, Anastasia Klimchuk.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/70264 )
Change subject: tree/: Drop default_spi_probe_opcode for NULL case
......................................................................
Patch Set 5:
(1 comment)
Patchset:
PS5:
Needs a manual rebase due to new programmers
--
To view, visit https://review.coreboot.org/c/flashrom/+/70264
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id502c5d2596ad1db52faf05723083620e4c52c12
Gerrit-Change-Number: 70264
Gerrit-PatchSet: 5
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Mon, 27 Feb 2023 10:27:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Thomas Heijligen has submitted this change. ( https://review.coreboot.org/c/flashrom/+/73285 )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: jedec.c: Provide better lexical scope to itermediates
......................................................................
jedec.c: Provide better lexical scope to itermediates
Change-Id: I8e01d471bb33a933b80760df2c69a4bf3589ba76
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/73285
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Reviewed-by: Thomas Heijligen <src(a)posteo.de>
---
M jedec.c
1 file changed, 20 insertions(+), 10 deletions(-)
Approvals:
build bot (Jenkins): Verified
Stefan Reinauer: Looks good to me, approved
Thomas Heijligen: Looks good to me, approved
diff --git a/jedec.c b/jedec.c
index 01c401f..db2e3e8 100644
--- a/jedec.c
+++ b/jedec.c
@@ -38,13 +38,11 @@
static void toggle_ready_jedec_common(const struct flashctx *flash, chipaddr dst, unsigned int delay)
{
unsigned int i = 0;
- uint8_t tmp1, tmp2;
-
- tmp1 = chip_readb(flash, dst) & 0x40;
+ uint8_t tmp1 = chip_readb(flash, dst) & 0x40;
while (i++ < 0xFFFFFFF) {
programmer_delay(flash, delay);
- tmp2 = chip_readb(flash, dst) & 0x40;
+ uint8_t tmp2 = chip_readb(flash, dst) & 0x40;
if (tmp1 == tmp2) {
break;
}
@@ -76,12 +74,11 @@
uint8_t data)
{
unsigned int i = 0;
- uint8_t tmp;
data &= 0x80;
while (i++ < 0xFFFFFFF) {
- tmp = chip_readb(flash, dst) & 0x80;
+ uint8_t tmp = chip_readb(flash, dst) & 0x80;
if (tmp == data) {
break;
}
@@ -377,12 +374,11 @@
int write_jedec_1(struct flashctx *flash, const uint8_t *src, unsigned int start,
unsigned int len)
{
- unsigned int i;
int failed = 0;
chipaddr dst = flash->virtual_memory + start;
const chipaddr olddst = dst;
- for (i = 0; i < len; i++) {
+ for (unsigned int i = 0; i < len; i++) {
if (write_byte_program_jedec_common(flash, src, dst))
failed = 1;
dst++, src++;
@@ -444,7 +440,7 @@
int write_jedec(struct flashctx *flash, const uint8_t *buf, unsigned int start,
int unsigned len)
{
- unsigned int i, starthere, lenhere;
+ unsigned int starthere, lenhere;
/* FIXME: page_size is the wrong variable. We need max_writechunk_size
* in struct flashctx to do this properly. All chips using
* write_jedec have page_size set to max_writechunk_size, so
@@ -462,7 +458,7 @@
* (start + len - 1) / page_size. Since we want to include that last
* page as well, the loop condition uses <=.
*/
- for (i = start / page_size; i <= nwrites; i++) {
+ for (unsigned int i = start / page_size; i <= nwrites; i++) {
/* Byte position of the first byte in the range in this page. */
/* starthere is an offset to the base address of the chip. */
starthere = max(start, i * page_size);
--
To view, visit https://review.coreboot.org/c/flashrom/+/73285
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8e01d471bb33a933b80760df2c69a4bf3589ba76
Gerrit-Change-Number: 73285
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged