29bc79fddb
Amdfwtool creates AMD firmware images however there is currently no way to get information from an existing image. This commit adds amdfwread to support that functionality. At the moment only reading PSP soft fuse flags is supported. Example usage: `amdfwread --soft-fuse bios.bin`, example output: `Soft-fuse:0x400000030000041`. BUG=b:202397678 TEST=Ran amdfwread and verified that it correctly reads the soft fuse bits, verified that built AMD FW still boots on DUT Signed-off-by: Robert Zieba <robertzieba@google.com> Change-Id: I15fa07c9cad8e4640e9c40e5539b0dab44424850 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62795 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Rob Barnes <robbarnes@google.com>
36 lines
788 B
Makefile
36 lines
788 B
Makefile
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
HOSTCC ?= cc
|
|
|
|
READ_SRC = amdfwread.c
|
|
READ_OBJ = $(READ_SRC:%.c=%.o)
|
|
TOOL_SRC = amdfwtool.c data_parse.c
|
|
TOOL_OBJ = $(TOOL_SRC:%.c=%.o)
|
|
HEADER=amdfwtool.h
|
|
TARGETS = amdfwread amdfwtool
|
|
WERROR=-Werror
|
|
CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR}
|
|
|
|
all: $(TARGETS)
|
|
|
|
amdfwread: $(READ_OBJ)
|
|
$(CC) $(READ_OBJ) $(LDFLAGS) -o $@
|
|
|
|
amdfwtool: $(TOOL_OBJ)
|
|
$(CC) $(TOOL_OBJ) $(LDFLAGS) -o $@
|
|
|
|
%.o: %.c $(HEADER)
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
clean:
|
|
@rm -f $(TARGETS) $(READ_OBJ) $(TOOL_OBJ)
|
|
|
|
distclean: clean
|
|
|
|
help:
|
|
@echo "${TARGETS}: Tools to create and read from AMD firmware combinations"
|
|
@echo "Targets: all, clean, distclean, help"
|
|
@echo "To disable warnings as errors, run make as:"
|
|
@echo " make all WERROR=\"\""
|
|
|
|
.PHONY: all clean distclean help
|