Thomas Heijligen has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/73101 )
Change subject: meson.build: Use library() to build libflashrom
......................................................................
meson.build: Use library() to build libflashrom
Use library() instead of both_libraries() to build libflashrom. The
build-in option `default-library` can be used to decide which kind of
libraries should be build. Make `both` the default and throw an error in
the case someone tries to build the classic_cli with a shared library.
Change-Id: I27f10fdf1227795a9a3b4e050a2d708b58f10ee7
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
---
M meson.build
1 file changed, 27 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/01/73101/1
diff --git a/meson.build b/meson.build
index 2f11c3f..a3f1d84 100644
--- a/meson.build
+++ b/meson.build
@@ -8,9 +8,17 @@
'werror=true',
'optimization=s',
'debug=false',
+ 'default_library=both'
],
)
+if get_option('classic_cli').enabled() and get_option('default_library') == 'shared'
+ error('''
+ Cannot build cli_classic with shared libflashrom. Use \'-Dclassic_cli=disabled\' to disable the cli,
+ or use \'--default-library=both\' to build also the classic_cli
+ ''')
+endif
+
# libtool versioning
lt_current = '1'
lt_revision = '0'
@@ -570,7 +578,7 @@
else
vflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile)
endif
-libflashrom = both_libraries(
+libflashrom = library(
'flashrom',
sources : [
srcs,
@@ -618,7 +626,7 @@
install_dir: join_paths(get_option('mandir'), 'man8'),
)
-if get_option('classic_cli').auto() or get_option('classic_cli').enabled()
+if get_option('classic_cli').enabled() or get_option('classic_cli').auto() and not get_option('default_library') == 'shared'
classic_cli = executable(
'flashrom',
files(
@@ -631,7 +639,8 @@
install : true,
install_dir : get_option('sbindir'),
link_args : link_args,
- link_with : libflashrom.get_static_lib(), # flashrom needs internal symbols of libflashrom
+ # flashrom needs internal symbols of libflashrom
+ link_with : get_option('default_library') == 'static' ? libflashrom : libflashrom.get_static_lib(),
)
if get_option('llvm_cov').enabled()
run_target('llvm-cov-cli', command : ['scripts/llvm-cov', classic_cli])
--
To view, visit https://review.coreboot.org/c/flashrom/+/73101
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I27f10fdf1227795a9a3b4e050a2d708b58f10ee7
Gerrit-Change-Number: 73101
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newchange
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/73040
to look at the new patch set (#2).
Change subject: printf: Use inttype.h macros for format strings
......................................................................
printf: Use inttype.h macros for format strings
DJGPP for compiling DOS has other sizes for the normal int types and
therefore throwing errors when when using %i %d or %x with uint32_t.
Fix these warnings by using the macros created for it and provided in
inttypes.h.
Change-Id: Ia75b6df981ce60c891161fe553c7ceab8570178d
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.com>
---
M cli_classic.c
M dummyflasher.c
M erasure_layout.c
M flashrom.c
M ich_descriptors.c
M jedec.c
M layout.c
M s25f.c
M sfdp.c
M spi25.c
M spi95.c
11 files changed, 90 insertions(+), 74 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/40/73040/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/73040
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia75b6df981ce60c891161fe553c7ceab8570178d
Gerrit-Change-Number: 73040
Gerrit-PatchSet: 2
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Edward O'Callaghan.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72691 )
Change subject: jedec.c: Fold up dst into toggle_ready_jedec()
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/72691
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib7a3fdbc6e0a888093dc8da6f5567a7301ec5040
Gerrit-Change-Number: 72691
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Mon, 20 Feb 2023 11:57:09 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Aarya.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73041 )
Change subject: erasure_layout.c: Test erasefn_count before using it to allocate memory
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/73041
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If13b050ac8525fee44d3f3bf74a9c9b6a8d38399
Gerrit-Change-Number: 73041
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Aarya <aarya.chaumal(a)gmail.com>
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-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Comment-Date: Mon, 20 Feb 2023 11:54:10 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: ChrisEric1 CECL, Thomas Heijligen.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72057 )
Change subject: Add support for VIA VL805 USB controller flashing
......................................................................
Patch Set 22: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/72057
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I71435afcacdf97e14d627e35bce3d29de9657f38
Gerrit-Change-Number: 72057
Gerrit-PatchSet: 22
Gerrit-Owner: ChrisEric1 CECL <christopherericlentocha(a)gmail.com>
Gerrit-Reviewer: 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-CC: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Attention: ChrisEric1 CECL <christopherericlentocha(a)gmail.com>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Comment-Date: Mon, 20 Feb 2023 11:44:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Alex Badea.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73037 )
Change subject: asm106x: add programmer for ASM106x SATA controllers
......................................................................
Patch Set 7: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/73037
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I591b117be911bdb8249247c20530c1cf70f6e70d
Gerrit-Change-Number: 73037
Gerrit-PatchSet: 7
Gerrit-Owner: Alex Badea <vamposdecampos(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Alex Badea <vamposdecampos(a)gmail.com>
Gerrit-Comment-Date: Mon, 20 Feb 2023 11:43:39 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72619 )
Change subject: move manpage to sphinx
......................................................................
Patch Set 7:
(1 comment)
Patchset:
PS6:
> Waiting on https://mail.coreboot.org/hyperkitty/list/flashrom@flashrom. […]
One week later there was a single, positive, reply. So I mark this as resolved.
--
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: 7
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-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Comment-Date: Mon, 20 Feb 2023 10:43:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: comment
Hello build bot (Jenkins), Edward O'Callaghan,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/72619
to look at the new patch set (#7).
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. Both are enabled automaticly if sphix-build is found.
The install paths are `share/man/man8/flashrom.8` and
`share/doc/flashrom/index.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,461 insertions(+), 1,861 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/19/72619/7
--
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: 7
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-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-CC: Felix Singer <felixsinger(a)posteo.net>
Gerrit-MessageType: newpatchset
Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/72408 )
Change subject: dummyflasher: use new API to register shutdown function
......................................................................
dummyflasher: use new API to register shutdown function
This allows masters to register shutdown function in *_master
struct, which means there is no need to call register_shutdown in init
function, since this call is now a part of register_*_master.
A dummy programmer can register masters for multiple buses that share a
programmer's data (a pointer to struct emu_data) with each other. To
avoid unexpected memory freeing by shutdown function, we need to keep
track of how many buses are using the shared resource. Use the
reference counting technique to achieve this.
TEST=ninja test
Change-Id: I0c67c25b0f53cd8c564c4ea0f09f2728e856f6ea
Signed-off-by: Alexander Goncharov <chat(a)joursoir.net>
Ticket: https://ticket.coreboot.org/issues/391
Reviewed-on: https://review.coreboot.org/c/flashrom/+/72408
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M dummyflasher.c
1 file changed, 52 insertions(+), 15 deletions(-)
Approvals:
build bot (Jenkins): Verified
Anastasia Klimchuk: Looks good to me, approved
diff --git a/dummyflasher.c b/dummyflasher.c
index 2bdd10c..0897332 100644
--- a/dummyflasher.c
+++ b/dummyflasher.c
@@ -75,6 +75,10 @@
unsigned int spi_write_256_chunksize;
uint8_t *flashchip_contents;
+
+ /* An instance of this structure is shared between multiple masters, so
+ * store the number of references to clean up only once at shutdown time. */
+ uint8_t refs_cnt;
};
/* A legit complete SFDP table based on the MX25L6436E (rev. 1.8) datasheet. */
@@ -905,6 +909,11 @@
{
msg_pspew("%s\n", __func__);
struct emu_data *emu_data = (struct emu_data *)data;
+
+ emu_data->refs_cnt--;
+ if (emu_data->refs_cnt != 0)
+ return 0;
+
if (emu_data->emu_chip != EMULATE_NONE) {
if (emu_data->emu_persistent_image && emu_data->emu_modified) {
msg_pdbg("Writing %s\n", emu_data->emu_persistent_image);
@@ -933,6 +942,7 @@
.multicommand = default_spi_send_multicommand,
.read = default_spi_read,
.write_256 = dummy_spi_write_256,
+ .shutdown = dummy_shutdown,
.probe_opcode = dummy_spi_probe_opcode,
.delay = dummy_nop_delay,
};
@@ -948,15 +958,17 @@
.chip_writew = dummy_chip_writew,
.chip_writel = dummy_chip_writel,
.chip_writen = dummy_chip_writen,
+ .shutdown = dummy_shutdown,
.delay = dummy_nop_delay,
};
static const struct opaque_master opaque_master_dummyflasher = {
- .probe = probe_variable_size,
- .read = dummy_opaque_read,
- .write = dummy_opaque_write,
- .erase = dummy_opaque_erase,
- .delay = dummy_nop_delay,
+ .probe = probe_variable_size,
+ .read = dummy_opaque_read,
+ .write = dummy_opaque_write,
+ .erase = dummy_opaque_erase,
+ .shutdown = dummy_shutdown,
+ .delay = dummy_nop_delay,
};
static int init_data(const struct programmer_cfg *cfg,
@@ -1410,21 +1422,20 @@
}
dummy_init_out:
- if (register_shutdown(dummy_shutdown, data)) {
- free(data->emu_persistent_image);
- free(data->flashchip_contents);
- free(data);
- return 1;
- }
-
- if (dummy_buses_supported & BUS_PROG)
+ if (dummy_buses_supported & BUS_PROG) {
+ data->refs_cnt++;
ret |= register_opaque_master(&opaque_master_dummyflasher, data);
- if (dummy_buses_supported & BUS_NONSPI)
+ }
+ if ((dummy_buses_supported & BUS_NONSPI) && !ret) {
+ data->refs_cnt++;
ret |= register_par_master(&par_master_dummyflasher,
dummy_buses_supported & BUS_NONSPI,
data);
- if (dummy_buses_supported & BUS_SPI)
+ }
+ if ((dummy_buses_supported & BUS_SPI) && !ret) {
+ data->refs_cnt++;
ret |= register_spi_master(&spi_master_dummyflasher, data);
+ }
return ret;
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/72408
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0c67c25b0f53cd8c564c4ea0f09f2728e856f6ea
Gerrit-Change-Number: 72408
Gerrit-PatchSet: 5
Gerrit-Owner: Alexander Goncharov <chat(a)joursoir.net>
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-MessageType: merged