Attention is currently required from: Felix Singer, Nico Huber, Michał Żygowski, Paul Menzel, Michael Niewöhner. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/55715 )
Change subject: tuxedo_ec: Implement support for flashing ECs on TUXEDO laptops ......................................................................
Patch Set 4:
(4 comments)
File flashrom.8.tmpl:
https://review.coreboot.org/c/flashrom/+/55715/comment/979a13a3_85ed865f PS4, Line 1376: The default is 1 I don't see the code for this?
File tuxedo_ec.c:
https://review.coreboot.org/c/flashrom/+/55715/comment/edc61093_61fc0ffb PS4, Line 661: dmi_init(); : : if (!dmi_match("^TUXEDO$")) { : msg_perr("Not a TUXEDO device\n"); : return 1; : } : : for (i = 0; i < ARRAY_SIZE(tuxedo_supported_boards); i++) { : if (dmi_match(tuxedo_supported_boards[i])) { : match = true; : break; : } : } : : if (!match) { : msg_perr("TUXEDO EC programmer not yet supported on this device\n"); : return 1; : } I'd move this into a separate function, and refactor to allow adding support for non-TUXEDO machines easily:
static const char *const tuxedo_boards[] = { "^InfinityBook S 14 Gen6$", "^InfinityBook S 15 Gen6$", };
struct dmi_vendor_entry { const char *vendor; const char **boards; size_t num_boards; };
static const struct dmi_vendor_entry ite_ecfw_supported_boards[] = { {"^TUXEDO$", tuxedo_boards, ARRAY_SIZE(tuxedo_boards)}, };
static bool is_board_supported(void) { size_t v, b;
dmi_init();
for (v = 0; v < ARRAY_SIZE(ite_ecfw_supported_boards); v++) { const struct dmi_vendor_entry *entry = &ite_ecfw_supported_boards[v]; if (!dmi_match(entry->vendor)) continue;
for (b = 0; b < entry->num_boards; b++) { if (dmi_match(entry->boards[b])) return true; }
msg_perr("Found DMI match for vendor %s, but device is not supported\n", entry->vendor); }
msg_perr("ITE ECFW programmer not (yet) supported on this device\n"); return false; }
https://review.coreboot.org/c/flashrom/+/55715/comment/5f8eee6c_c05d7985 PS4, Line 688: sizeof(struct tuxedo_ec_data) sizeof(*ctx_data)
https://review.coreboot.org/c/flashrom/+/55715/comment/e88a0e4c_285712f0 PS4, Line 740: uint8_t *const contents, char *buf nit: I'd flip the parameter order to match the natural assignment semantics (leftmost parameter is the destination:
char *buf, uint8_t *const contents
This order matches what the code does:
buf[i] = contents[i];