1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 07:02:34 +02:00

53 Commits

Author SHA1 Message Date
Nico Huber
e8e7a80e6b fixup! Add a convenient libflashrom interface
Update `enum flashrom_log_level` to match `enum msglevel` again.

They diverged already. Found by clang.

Change-Id: Icf175c5f2a415365bd756ca813e724f6797459b2
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20267
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2017-06-20 13:26:20 +02:00
Nico Huber
305f417ea5 Add option to read ROM layout from IFD
Add an option --ifd to read the ROM layout from an Intel Firmware
Descriptor (IFD). Works the same as the -l option, if given, -i
specifies the images to update.

v2: o Rebased on libflashrom, use libflashrom interface.
    o Use functions from ich_descriptors.c.

v3: o Move ich_descriptors.o to LIB_OBJS, thus build it independent
      of arch and programmers.
    o Bail out if we aren't compiled for little endian.
    o Update flashrom.8.tmpl.

v4: o Incorporated David's comments.
    o Removed single-character `-d` option.

v5: Changed region names to match the output of `ifdtool --layout ...`

Change-Id: Ifafff2bf6d5c5e62283416b3269723f81fdc0fa3
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17953
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-14 11:43:32 +02:00
Nico Huber
454f613382 Add a convenient libflashrom interface
This adds a minimal libflashrom interface based on the draft in the
wiki. While the glue code in libflashrom.c is build on top of the
existing code instead on overhauling it, the interface in libflashrom.h
is supposed to be stable. So we can keep the interface and adapt
internals later if favoured, without breaking clients.

A new make target, libinstall, is also added. It installs libflashrom.a
and libflashrom.h in lib/ and include/ dirs respectively.

Hooking this into the build would break linking of the CLI and is post-
poned until that got fixed.

v2: Rebase and fixes by Anton Kochkov.

v3: o fl_image_*() rewritten with layout support (touch only included regions).
    o Moved read/erase/write/verify operations to flashrom.c.
    o Added layout pointer and flags to the flash context.

v4: Removed libflashrom.o from LIB_OBJS until CLI is adapted.

v5: o Incorporated David's comments.
    o Added `fl_flashprog_t` as dummy parameter to hide the fact that
      we have global state all around, and for future-proofness ofc.

v6: o Change namespace prefix to flashrom_.
    o Remove typedefs.

Change-Id: I00f169990830aa17b7dfae5eb74010d40c476181
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17946
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2017-06-03 20:13:06 +02:00