summaryrefslogtreecommitdiffstats
path: root/util/amdfwtool/Makefile
diff options
context:
space:
mode:
authorKangheui Won <khwon@chromium.org>2021-12-21 15:45:06 +1100
committerMartin Roth <martin.roth@amd.corp-partner.google.com>2022-10-02 22:13:38 +0000
commit5b84dfd1c15955bcbd8ee43b941576da1f619922 (patch)
tree4b42919d67db660846ceafe8a0137331c0572967 /util/amdfwtool/Makefile
parentbb31562e9e452b3a927579a5330f55cf36906bef (diff)
downloadcoreboot-5b84dfd1c15955bcbd8ee43b941576da1f619922.tar.gz
coreboot-5b84dfd1c15955bcbd8ee43b941576da1f619922.tar.bz2
coreboot-5b84dfd1c15955bcbd8ee43b941576da1f619922.zip
util/amdfwtool: Generate hashes for signed AMDFW components
Generate SHA256/SHA384 hash of the signed firmware so that PSP verstage can pass it to PSP. The PSP will use these hashes to verify the integrity of those signed firmwares. BUG=b:203597980 TEST=Build Skyrim BIOS image. Change-Id: I50d278536ba1eac754eb8a39c4c2e428a2371c44 Signed-off-by: Kangheui Won <khwon@chromium.org> Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60290 Reviewed-by: Jon Murphy <jpmurphy@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/amdfwtool/Makefile')
-rw-r--r--util/amdfwtool/Makefile18
1 files changed, 15 insertions, 3 deletions
diff --git a/util/amdfwtool/Makefile b/util/amdfwtool/Makefile
index e0ce3b76ab78..53dce4c8c780 100644
--- a/util/amdfwtool/Makefile
+++ b/util/amdfwtool/Makefile
@@ -1,7 +1,11 @@
# SPDX-License-Identifier: BSD-3-Clause
top ?= $(abspath ../..)
+ifneq ($(CC),)
+HOSTCC ?= $(CC)
+else
HOSTCC ?= cc
+endif
READ_SRC = amdfwread.c
READ_OBJ = $(READ_SRC:%.c=%.o)
@@ -13,16 +17,24 @@ WERROR=-Werror
CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR}
CFLAGS += -I $(top)/src/commonlib/bsd/include
+ifneq ($(PKG_CONFIG),)
+HOSTPKGCONFIG ?= $(PKG_CONFIG)
+else
+HOSTPKGCONFIG ?= pkg-config
+endif
+CFLAGS += $(shell $(HOSTPKGCONFIG) --cflags libcrypto)
+LDFLAGS += $(shell $(HOSTPKGCONFIG) --libs libcrypto)
+
all: $(TARGETS)
amdfwread: $(READ_OBJ)
- $(CC) $(READ_OBJ) $(LDFLAGS) -o $@
+ $(HOSTCC) $(READ_OBJ) $(LDFLAGS) -o $@
amdfwtool: $(TOOL_OBJ)
- $(CC) $(TOOL_OBJ) $(LDFLAGS) -o $@
+ $(HOSTCC) $(TOOL_OBJ) $(LDFLAGS) -o $@
%.o: %.c $(HEADER)
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(HOSTCC) $(CFLAGS) -c -o $@ $<
clean:
@rm -f $(TARGETS) $(READ_OBJ) $(TOOL_OBJ)