mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
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:
|
||
---|---|---|
.. | ||
blobtool.l | ||
blobtool.y | ||
gbe-ich9m.set | ||
gbe-ich9m.spec | ||
ifd-x200.set | ||
ifd-x200.spec | ||
it8718f-ec.spec | ||
Makefile |