summaryrefslogtreecommitdiffstats
path: root/util/fletcher
Commit message (Collapse)AuthorAgeFilesLines
* util/fletcher: fix debug option parsingPatrick Georgi2014-10-181-1/+1
| | | | | | | | | | | | | | sizeof(char[]-type+1) isn't very useful. Since one of the strings is constant, we also don't need to use strncmp that string's length. While at it, str*cmp don't return booleans, so check for value instead of faux bools. Change-Id: Iebb194a60eac454dafeade75f135df92068cf4ab Found-by: Coverity Scan Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/6988 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
* AMD Steppe Eagle: Add 32-bit Fletcher's Checksum computationBruce Griffith2014-08-302-0/+165
The AMD Platform Security Processor (PSP) requires a Fletcher's Checksum at the end of the PSP directory. This code implements a Fletcher's Checksum by reading bytes from stdin and writes the bytes back to stdout with a checksum inserted into the byte stream at the appropriate offset. This utility is used on PSP binaries during coreboot build. Include a runtime debug option such that the command: fletcher --print <file.bin >file_with_cksum.bin will print out the computed checksum value for debugging. The compile-time debug option is retained that allows -DDEBUG to be added to the compilation line. This option has the same effect as "--print". Change-Id: I506a479d8204ca4f8267d53aa152ac4b473dbc75 Signed-off-by: Bruce Griffith <Bruce.Griffith@se-eng.com> Reviewed-on: http://review.coreboot.org/6676 Reviewed-by: WANG Siyuan <wangsiyuanbuaa@gmail.com> Tested-by: build bot (Jenkins) Reviewed-by: Zheng Bao <zheng.bao@amd.com>