libpayload: Implement new CBFS access API

Hardware / Coreboot - Jakub Czapiga [semihalf.com] - 10 January 2022 14:30 UTC

This commit adds new CBFS API, which is based on the one available in the main coreboot source tree. Libpayload implementation supports RO/RW file lookups and file contents verification.

Change-Id: I00da0658dbac0cddf92ad55611def947932d23c7

63e54275f6 libpayload: Implement new CBFS access API
payloads/libpayload/Kconfig | 6 +-
payloads/libpayload/Makefile.inc | 1 +
payloads/libpayload/include/cbfs.h | 180 +++---
payloads/libpayload/include/cbfs_core.h | 154 +----
payloads/libpayload/include/cbfs_glue.h | 46 ++
payloads/libpayload/include/cbfs_legacy.h | 83 +++
payloads/libpayload/libcbfs/Kconfig | 31 +
payloads/libpayload/libcbfs/Makefile.inc | 6 +
payloads/libpayload/libcbfs/cbfs.c | 363 +++++-------
payloads/libpayload/libcbfs/cbfs_core.c | 1 -
payloads/libpayload/libcbfs/cbfs_legacy.c | 223 +++++++
payloads/libpayload/tests/Makefile.inc | 1 +
.../libpayload/tests/include/mocks/cbfs_util.h | 114 ++++
payloads/libpayload/tests/libcbfs/Makefile.inc | 33 ++
.../libpayload/tests/libcbfs/cbfs-lookup-test.c | 642 +++++++++++++++++++++
.../tests/libcbfs/cbfs-verification-test.c | 247 ++++++++
payloads/libpayload/tests/mocks/cbfs_file_mock.c | 95 +++
payloads/libpayload/tests/mocks/die.c | 16 +
18 files changed, 1810 insertions(+), 432 deletions(-)

Upstream: review.coreboot.org


  • Share