Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/68480 )
Change subject: include/programmer.h: Relocal decode_sizes def and complete prog cfg type ......................................................................
include/programmer.h: Relocal decode_sizes def and complete prog cfg type
Change-Id: Ief5ec76a4050f8d5756fe6417732315a1c68f511 Signed-off-by: Edward O'Callaghan quasisec@google.com --- M flashrom.c M include/programmer.h 2 files changed, 25 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/80/68480/1
diff --git a/flashrom.c b/flashrom.c index 0f982c9..8afbd21 100644 --- a/flashrom.c +++ b/flashrom.c @@ -66,10 +66,6 @@ /* Did we change something or was every erase/write skipped (if any)? */ static bool all_skipped = true;
-struct programmer_cfg { - char *params; -}; - /* Register a function to be executed on programmer shutdown. * The advantage over atexit() is that you can supply a void pointer which will * be used as parameter to the registered function upon programmer shutdown. diff --git a/include/programmer.h b/include/programmer.h index 386e6ec..b68c73f 100644 --- a/include/programmer.h +++ b/include/programmer.h @@ -25,12 +25,25 @@
#include "flash.h" /* for chipaddr and flashctx */
+struct decode_sizes { + uint32_t parallel; + uint32_t lpc; + uint32_t fwh; + uint32_t spi; +}; enum programmer_type { PCI = 1, /* to detect uninitialized values */ USB, OTHER, }; -struct programmer_cfg; +struct programmer_cfg { + char *params; + /* + * Programmers supporting multiple buses can have differing size limits on + * each bus. Store the limits for each bus in a common struct. + */ + struct decode_sizes max_rom_decode; +};
struct dev_entry { uint16_t vendor_id; @@ -47,6 +60,7 @@ const struct dev_entry *const dev; const char *const note; } devs; + struct programmer_cfg cfg;
int (*init) (const struct programmer_cfg *cfg);
@@ -276,12 +290,6 @@
/* flashrom.c */ -struct decode_sizes { - uint32_t parallel; - uint32_t lpc; - uint32_t fwh; - uint32_t spi; -}; // FIXME: These need to be local, not global extern struct decode_sizes max_rom_decode; extern bool programmer_may_write;