Attention is currently required from: Anastasia Klimchuk, Dmitry Zhadinets.
Hello Anastasia Klimchuk, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/87251?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Verified-1 by build bot (Jenkins)
Change subject: libflashrom: Add API for capabilitible chips
......................................................................
libflashrom: Add API for capabilitible chips
There were no options available to obtain the list of
compatible chips for the programmer. The implementation is based
on flashrom_supported_flash_chips and flashrom_flash_probe.
Arrays of constant strings are returned, and the array must be
freed using flashrom_data_free.
Testing: Both unit tests and CLI tools serve as libflashrom clients.
All unit tests run successfully.
Tests are moved because there is a bug in spi test. It does
not clean everything. WIP
Change-Id: Id33fac2935b4098586526bda87b25231c9a6ab39
Signed-off-by: Dmitry Zhadinets <dzhadinets(a)gmail.com>
---
M include/libflashrom.h
M libflashrom.c
M libflashrom.map
M tests/libflashrom.c
M tests/tests.c
M tests/tests.h
6 files changed, 69 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/51/87251/4
--
To view, visit https://review.coreboot.org/c/flashrom/+/87251?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Id33fac2935b4098586526bda87b25231c9a6ab39
Gerrit-Change-Number: 87251
Gerrit-PatchSet: 4
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Anastasia Klimchuk.
Hello Anastasia Klimchuk, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/87251?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Verified-1 by build bot (Jenkins)
Change subject: libflashrom: Add API for capabilitible chips
......................................................................
libflashrom: Add API for capabilitible chips
There were no options available to obtain the list of
compatible chips for the programmer. The implementation is based
on flashrom_supported_flash_chips and flashrom_flash_probe.
Arrays of constant strings are returned, and the array must be
freed using flashrom_data_free.
Testing: Both unit tests and CLI tools serve as libflashrom clients.
All unit tests run successfully.
Tests are moved because there is a bug in spi test. It does
not clean everything. WIP
Change-Id: Id33fac2935b4098586526bda87b25231c9a6ab39
Signed-off-by: Dmitry Zhadinets <dzhadinets(a)gmail.com>
---
M include/libflashrom.h
M libflashrom.c
M libflashrom.map
M tests/libflashrom.c
M tests/tests.c
M tests/tests.h
6 files changed, 63 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/51/87251/3
--
To view, visit https://review.coreboot.org/c/flashrom/+/87251?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Id33fac2935b4098586526bda87b25231c9a6ab39
Gerrit-Change-Number: 87251
Gerrit-PatchSet: 3
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Attention is currently required from: Anastasia Klimchuk.
Dmitry Zhadinets has posted comments on this change by Dmitry Zhadinets. ( https://review.coreboot.org/c/flashrom/+/87251?usp=email )
Change subject: libflashrom: Add API for capabilitible chips
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
I need help with the test. What dummy chip can be definitely compatible with some specific dummy parameters
--
To view, visit https://review.coreboot.org/c/flashrom/+/87251?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Id33fac2935b4098586526bda87b25231c9a6ab39
Gerrit-Change-Number: 87251
Gerrit-PatchSet: 2
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Thu, 10 Apr 2025 04:45:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: Anastasia Klimchuk, Dmitry Zhadinets.
Hello Anastasia Klimchuk, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/87251?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by build bot (Jenkins)
Change subject: libflashrom: Add API for capabilitible chips
......................................................................
libflashrom: Add API for capabilitible chips
There were no options available to obtain the list of
compatible chips for the programmer. The implementation is based
on flashrom_supported_flash_chips and flashrom_flash_probe.
Arrays of constant strings are returned, and the array must be
freed using flashrom_data_free.
Testing: Both unit tests and CLI tools serve as libflashrom clients.
All unit tests run successfully.
Tests are moved because there is a bug in spi test. It does
not clean everything. WIP
Change-Id: Id33fac2935b4098586526bda87b25231c9a6ab39
Signed-off-by: Dmitry Zhadinets <dzhadinets(a)gmail.com>
---
M include/libflashrom.h
M libflashrom.c
M libflashrom.map
M tests/libflashrom.c
M tests/tests.c
M tests/tests.h
6 files changed, 63 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/51/87251/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/87251?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Id33fac2935b4098586526bda87b25231c9a6ab39
Gerrit-Change-Number: 87251
Gerrit-PatchSet: 2
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/86921?usp=email )
Change subject: libflashrom: Add API to get the list of supported programmers
......................................................................
libflashrom: Add API to get the list of supported programmers
There were no options available to obtain the list of programmers.
The implementation is based on flashrom_supported_flash_chips.
Arrays of constant strings are returned, and the array must be
freed using flashrom_data_free.
Testing: Both unit tests and CLI tools serve as libflashrom clients.
All unit tests run successfully.
Change-Id: Ib5275b742b849183b1fe701900040fee369a1d78
Signed-off-by: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/86921
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Peter Marheine <pmarheine(a)chromium.org>
Reviewed-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M include/libflashrom.h
M libflashrom.c
M libflashrom.map
M tests/libflashrom.c
M tests/tests.c
M tests/tests.h
6 files changed, 42 insertions(+), 2 deletions(-)
Approvals:
Dmitry Zhadinets: Looks good to me, but someone else must approve
Peter Marheine: Looks good to me, approved
build bot (Jenkins): Verified
Anastasia Klimchuk: Looks good to me, approved
diff --git a/include/libflashrom.h b/include/libflashrom.h
index b9b0d17..f30ad6b 100644
--- a/include/libflashrom.h
+++ b/include/libflashrom.h
@@ -194,6 +194,14 @@
*/
const char *flashrom_version_info(void);
/**
+ * @brief Returns list of supported programmers
+ * The last entry in the returned list is followed by a NULL.
+ *
+ * @return List of supported programmers, or NULL if an error occurred.
+ * The pointer must be freed after using flashrom_data_free
+ */
+const char **flashrom_supported_programmers(void);
+/**
* @brief Returns list of supported flash chips
* @return List of supported flash chips, or NULL if an error occurred
*/
diff --git a/libflashrom.c b/libflashrom.c
index 888ca05..d6bd098 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -194,6 +194,18 @@
return flashrom_version;
}
+const char **flashrom_supported_programmers(void)
+{
+ const char **result = malloc(sizeof(char*) * (programmer_table_size + 1));
+ if (!result)
+ return NULL;
+ for (unsigned int i = 0; i < programmer_table_size; ++i) {
+ result[i] = programmer_table[i]->name;
+ }
+ result[programmer_table_size] = 0;
+ return result;
+}
+
struct flashrom_flashchip_info *flashrom_supported_flash_chips(void)
{
struct flashrom_flashchip_info *supported_flashchips =
diff --git a/libflashrom.map b/libflashrom.map
index a12a95c..fc6724a 100644
--- a/libflashrom.map
+++ b/libflashrom.map
@@ -32,6 +32,7 @@
flashrom_supported_boards;
flashrom_supported_chipsets;
flashrom_supported_flash_chips;
+ flashrom_supported_programmers;
flashrom_version_info;
flashrom_wp_cfg_new;
flashrom_wp_cfg_release;
diff --git a/tests/libflashrom.c b/tests/libflashrom.c
index 3320597..59ffeaf 100644
--- a/tests/libflashrom.c
+++ b/tests/libflashrom.c
@@ -1,7 +1,7 @@
/*
* This file is part of the flashrom project.
*
- * Copyright 2025 Dmitry Zhadinets (dzhadinets(a)gmail.com)
+ * Copyright 2025 Dmitry Zhadinets <dzhadinets(a)gmail.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
@@ -96,4 +96,21 @@
/* check that callback is called after the change*/
assert_int_equal(print(FLASHROM_MSG_INFO, "1%s", "\n"), 0x666 + (int)FLASHROM_MSG_INFO);
flashrom_set_log_callback(NULL);
-}
\ No newline at end of file
+}
+
+void flashrom_supported_programmers_test_success(void **state)
+{
+ (void) state; /* unused */
+ const char **array = flashrom_supported_programmers();
+ const char **ptr = array;
+
+ assert_non_null(array);
+
+ do {
+ assert_non_null(*ptr);
+ }while (*(++ptr));
+
+ flashrom_data_free(array);
+
+ assert_int_not_equal(ptr - array, 0);
+}
diff --git a/tests/tests.c b/tests/tests.c
index ef71967..2a79d32 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -482,6 +482,7 @@
cmocka_unit_test(flashrom_set_log_callback_test_success),
cmocka_unit_test(flashrom_set_log_callback_v2_test_success),
cmocka_unit_test(flashrom_set_log_level_test_success),
+ cmocka_unit_test(flashrom_supported_programmers_test_success),
};
ret |= cmocka_run_group_tests_name("libflashrom.c tests", libflashrom_tests, NULL, NULL);
diff --git a/tests/tests.h b/tests/tests.h
index e358e86..e87c00c 100644
--- a/tests/tests.h
+++ b/tests/tests.h
@@ -35,6 +35,7 @@
void flashrom_set_log_callback_test_success(void **state);
void flashrom_set_log_callback_v2_test_success(void **state);
void flashrom_set_log_level_test_success(void **state);
+void flashrom_supported_programmers_test_success(void **state);
/* spi25.c */
void spi_write_enable_test_success(void **state);
--
To view, visit https://review.coreboot.org/c/flashrom/+/86921?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ib5275b742b849183b1fe701900040fee369a1d78
Gerrit-Change-Number: 86921
Gerrit-PatchSet: 13
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Attention is currently required from: Dmitry Zhadinets.
Anastasia Klimchuk has posted comments on this change by Dmitry Zhadinets. ( https://review.coreboot.org/c/flashrom/+/86921?usp=email )
Change subject: libflashrom: Add API to get the list of supported programmers
......................................................................
Patch Set 12: Code-Review+2
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/86921/comment/06005584_3d862a9a?us… :
PS10, Line 7: libflashrom: Added API to enumerate supported programmers
> Done
As a note, you don't have to vote on your own patch: we assume the author of the patch approves their own work. Also in any case, every patch needs to be approved by someone who is not the author.
You don't have to change anything here, this is a note for future.
--
To view, visit https://review.coreboot.org/c/flashrom/+/86921?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ib5275b742b849183b1fe701900040fee369a1d78
Gerrit-Change-Number: 86921
Gerrit-PatchSet: 12
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Comment-Date: Thu, 10 Apr 2025 00:51:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Dmitry Zhadinets has posted comments on this change by Dmitry Zhadinets. ( https://review.coreboot.org/c/flashrom/+/87195?usp=email )
Change subject: cli: Use flashrom_supported_programmers API in cli
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
I think that this change is not needed because the code has become more complex
Up to the reviewers’ consideration
--
To view, visit https://review.coreboot.org/c/flashrom/+/87195?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I86ac83ee0ef4e850e69aa4e7b607e28ebab9d3d5
Gerrit-Change-Number: 87195
Gerrit-PatchSet: 2
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-CC: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Mon, 07 Apr 2025 23:16:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Dmitry Zhadinets has posted comments on this change by Dmitry Zhadinets. ( https://review.coreboot.org/c/flashrom/+/86921?usp=email )
Change subject: libflashrom: Add API to get the list of supported programmers
......................................................................
Patch Set 12: Code-Review+1
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/86921/comment/bb8a270c_67dec252?us… :
PS10, Line 7: libflashrom: Added API to enumerate supported programmers
> But you haven't changed the commit title :) It still says enumerate. […]
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/86921?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ib5275b742b849183b1fe701900040fee369a1d78
Gerrit-Change-Number: 86921
Gerrit-PatchSet: 12
Gerrit-Owner: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Mon, 07 Apr 2025 23:13:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Dmitry Zhadinets <dzhadinets(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>