util/cbfstool: Add AMD BIOS compression tool for PSP
Add a utility to generate a compressed BIOS image for AMD Family 17h. If the input is an elf file, the utility extracts the program portion for compression. Otherwise the file is compressed as-is. In modern AMD systems, the PSP brings up DRAM then uncompresses the BIOS image into memory prior to x86 beginning execution. The PSP supports a zlib engine, and interprets the first 256 bytes as a header, where offset 0x14 containing the uncompressed size. For further details, see AMD Platform Security Processor BIOS Architecture Design Guide for AMD Family 17h Processors (NDA only, #55758). BUG=b:127766506 TEST=Use with WIP Picasso Change-Id: Id1c54e0a6dae9e4a0362c6635fe8b8aa48a369d8 Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33401 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
committed by
Martin Roth
parent
5e4a26a76e
commit
30cf155168
@@ -98,6 +98,12 @@ cbfscompobj :=
|
||||
cbfscompobj += $(compressionobj)
|
||||
cbfscompobj += cbfscomptool.o
|
||||
|
||||
amdcompobj :=
|
||||
amdcompobj += amdcompress.o
|
||||
amdcompobj += elfheaders.o
|
||||
amdcompobj += common.o
|
||||
amdcompobj += xdr.o
|
||||
|
||||
TOOLCFLAGS ?= -Werror -Wall -Wextra
|
||||
TOOLCFLAGS += -Wcast-qual -Wmissing-prototypes -Wredundant-decls -Wshadow
|
||||
TOOLCFLAGS += -Wstrict-prototypes -Wwrite-strings
|
||||
@@ -185,6 +191,10 @@ $(objutil)/cbfstool/cbfs-compression-tool: $(addprefix $(objutil)/cbfstool/,$(cb
|
||||
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
||||
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfscompobj))
|
||||
|
||||
$(objutil)/cbfstool/amdcompress: $(addprefix $(objutil)/cbfstool/,$(amdcompobj))
|
||||
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
||||
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(amdcompobj)) -lz
|
||||
|
||||
# Yacc source is superset of header
|
||||
$(objutil)/cbfstool/fmd.o: TOOLCFLAGS += -Wno-redundant-decls
|
||||
$(objutil)/cbfstool/fmd_parser.o: TOOLCFLAGS += -Wno-redundant-decls
|
||||
|
Reference in New Issue
Block a user