Patch Set 1:

Patch Set 1:

Patch Set 1:

What does the patch do? The description only says that it's required for various ChromeOS devices and I would like to understand the background.

This patch alone doesn't quite paint the full picture, I suspect others will be added to the chain.

The idea came about when ECs started appearing on different buses on different platforms - Some had an EC connected via LPC, some via I2C, and some on SPI. The problem was that `-p internal:bus=<lpc|i2c|spi>` became ambiguous and very cumbersome to use when trying to target ECs. Probing an EC could interfere with system operation so we wanted to bail out immediately when the probe function was called if we didn't actually intend to target an EC.

Similarly, this approach helped when host firmware ROMs started using linux_spi and linux_mtd programmer interfaces.

In both cases, this helps eliminate ambiguity (and potentially disruptive behavior) when flashrom is probing and obviates the need for every program and script that calls flashrom to have platform-specific logic to map component (host firmware ROM or EC) to programmer argument.

Thanks David for the enriched background! That is super helpful as I could only surmise a limited understanding just by digging alone. As Carl I suppose is getting at - can we get away with not needing to upstream it or do you see this is something we definitely envision should to be part of the overall convergence effort? The answer now seems to be yes however I thought I would ask explicitly as some of this stuff is unclear if it should be rewritten or ported near verbatim or just dropped without knowing some context lost to history.

Sure thing! Personally I think the idea is useful upstream just to help users avoid certain EC pitfalls since many of our users are using laptops these days. It might also be nice to have `-p usb` or `-p serial` for external programmers as a convenient shorthand, though they might require some additional argument parsing for things like setting voltage correctly. I'm sure any addition to upstream syntax will be met with a fair bit of resistance/bikeshedding, though maybe it's not such a bad thing if the premise is at least accepted...

For better or worse I suspect it's already in several of places in the ChromeOS codebase including the `vpd` tool as Wim pointed out, factory scripts, update scripts, and test suites [2].

For the benefit of others in this thread, here is the original and a follow-up patch that uses it:
[1] https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/58013
[2] https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/226951

View Change

To view, visit change 38671. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I73766451cd8900a9e0fe08efc7a4d81b2a35ac8d
Gerrit-Change-Number: 38671
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer@coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Gerrit-CC: Wim Vervoorn <wvervoorn@eltan.com>
Gerrit-Comment-Date: Wed, 05 Feb 2020 06:46:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment