AMD Steppe Eagle: Add 32-bit Fletcher's Checksum computation
commit3a2310e05c971e3b46e9e91886bbc467ae49cdb6
authorBruce Griffith <Bruce.Griffith@se-eng.com>
Wed, 16 Jul 2014 17:25:21 +0000 (16 11:25 -0600)
committerBruce Griffith <Bruce.Griffith@se-eng.com>
Fri, 29 Aug 2014 22:28:06 +0000 (30 00:28 +0200)
tree26c8d9981dd2bb83f39cd2731ee8c61f9e4c80a0
parent71c0bf6202bee2c17b3e64b377038207f6018dc6
AMD Steppe Eagle: Add 32-bit Fletcher's Checksum computation

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>
util/fletcher/Makefile [new file with mode: 0644]
util/fletcher/fletcher.c [new file with mode: 0644]