Commit graph

3 commits

Author SHA1 Message Date
Martin Roth
d8d6955aff UPSTREAM: util/blobtool & sconfig: Update GENPARSER Kconfig question
blobtool uses the same sort of update mechanism for the .l & .y files,
so update the SCONFIG_GENPARSER Kconfig question to encompass both
utilities.

- Change the name to UTIL_GENPARSER, and update the help text.
- Update sconfig's makefile.
- Add the check to blobtool's makefile.
- Update the makefiles to check for y, not defined.

BUG=none
BRANCH=none
TEST=none

Change-Id: I64dbc906e3e027978cdcad1c1bd39eee4e7788b0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: f411b701c5
Original-Change-Id: I6215791c9a019bce37d4a150b65d1fdbb9073156
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/19229
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/480283
2017-04-18 13:19:01 -07:00
Martin Roth
fff26e9c01 UPSTREAM: util/blobtool: Hook into coreboot build
Add a Makefile.inc, based on sconfig's, to use the _shipped variants
so that the build doesn't have to generate them with flex & bison.

The GENPARSER check is inactive, and will be updated in the next
commit.

Add the c_shipped & h_shipped files for the current .l & .y files.

BUG=none
BRANCH=none
TEST=none

Change-Id: Id5065158c990b06a03d4e7ef55244248879b57a6
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: cfce793052
Original-Change-Id: Ia6c68bfb6e0611ceb6bc76cc66e43266bafc98ad
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/19228
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/480282
2017-04-18 13:19:00 -07:00
Damien Zammit
4f27904291 UPSTREAM: util/blobtool: Add new tool for compiling/decompiling data blobs
Given a specification of bitfields defined e.g. as follows:

        specfile:
                {
                        "field1" : 8,
                        "field2" : 4,
                        "field3" : 4
                }
and a set of values for setting defaults:
        setterfile:
                {
                        "field1" = 0xff,
                        "field2" = 0xf,
                        "field3" = 0xf
                }

You can generate a binary packed blob as follows:
        ./blobtool specfile setterfile binaryoutput
        binaryoutput:   ff ff

The reverse is also possible, i.e. you can regenerate the setter:
        ./blobtool -d specfile binaryoutput setterorig
        setterorig:
                # AUTOGENERATED SETTER BY BLOBTOOL
                {
                        "field1" = 0xff,
                        "field2" = 0xf,
                        "field3" = 0xf
                }

This tool comes with spec/set files for X200 flash descriptor
and ICH9M GbE region, and can be extended or used to decompile
other data blobs with known specs.

BUG=none
BRANCH=none
TEST=none

Change-Id: Ie8421c67f404631376d83e26f18301b34881cb5a
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 0685322f4a
Original-Change-Id: I744d6b421003feb4fc460133603af7e6bd80b1d6
Original-Signed-off-by: Damien Zammit <damien@zamaudio.com>
Original-Reviewed-on: https://review.coreboot.org/17445
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Jonathan Neuschfer <j.neuschaefer@gmx.net>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/438059
2017-02-06 10:37:43 -08:00