Attention is currently required from: Zheng Bao. Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/55602
to review the following change.
Change subject: amdfwtool: Decorate the comment and blank ......................................................................
amdfwtool: Decorate the comment and blank
Add more details about AMD PSP and BDT layout.
Change-Id: I6f64c9a240503f9d0bf240916c1066944fa39d27 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M util/amdfwtool/amdfwtool.c 1 file changed, 29 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/55602/1
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 9fb6497..529628e 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -1,13 +1,17 @@ /* SPDX-License-Identifier: GPL-2.0-only */
/* - * ROMSIG At ROMBASE + 0x20000: + * ROMSIG At ROMBASE + 0x(*)20000: * 0 4 8 C * +------------+---------------+----------------+------------+ * | 0x55AA55AA |EC ROM Address |GEC ROM Address |USB3 ROM | * +------------+---------------+----------------+------------+ - * | PSPDIR ADDR|PSPDIR ADDR |<-- Field 0x14 could be either - * +------------+---------------+ 2nd PSP directory or PSP COMBO directory + * | PSPDIR ADDR|PSPDIR ADDR(C) | BDT ADDR 0 | BDT ADDR 1 | + * +------------+---------------+----------------+------------+ + * | BDT ADDR 2 | | BDT ADDR 3(C) | | + * +------------+---------------+----------------+------------+ + * (C): Could be a combo header + * * EC ROM should be 64K aligned. * * PSP directory (Where "PSPDIR ADDR" points) @@ -24,10 +28,24 @@ * +------------+---------------+----------------+------------+ * | | * | | - * | Other PSP Firmware | + * | Other PSP Firmwares | + * | | + * +------------+---------------+----------------+------------+ + * | 40 | size | Base address | Reserved |---+ + * +------------+---------------+----------------+------------+ | + * | + * | + * | + * +------------+---------------+----------------+------------+ | + * | '2LP$' | Fletcher | Count | Reserved |<--+ + * +------------+---------------+----------------+------------+ + * | | + * | | + * | PSP Firmwares | * | | * | | * +------------+---------------+----------------+------------+ + * BDT is similar * * PSP Combo directory * +------------+---------------+----------------+------------+ @@ -35,15 +53,15 @@ * +------------+---------------+----------------+------------+ * | R e s e r v e d | * +------------+---------------+----------------+------------+ - * | ID-Sel | PSP ID | PSPDIR ADDR | | 2nd PSP directory + * | ID-Sel | PSP ID | PSPDIR ADDR | | 1st PSP directory * +------------+---------------+----------------+------------+ - * | ID-Sel | PSP ID | PSPDIR ADDR | | 3rd PSP directory + * | ID-Sel | PSP ID | PSPDIR ADDR | | 2nd PSP directory * +------------+---------------+----------------+------------+ * | | * | Other PSP | * | | * +------------+---------------+----------------+------------+ - * + * BDT Combo is similar */
#include <fcntl.h> @@ -127,10 +145,10 @@ while (length) { index = length >= 359 ? 359 : length; length -= index; - do { - c0 += *(pptr++); - c1 += c0; - } while (--index); + do { + c0 += *(pptr++); + c1 += c0; + } while (--index); c0 = (c0 & 0xFFFF) + (c0 >> 16); c1 = (c1 & 0xFFFF) + (c1 >> 16); }