soc/amd/common/Makefile: Only run amdfwread once

By saving the results of amdfwread into a file, it only needs to be run
once instead of every time amdfwread-offset-size-cmd is called.

Signed-off-by: Fred Reitberger <reitbergerfred@gmail.com>
Change-Id: I1afaf65b9b2f9fb856aefc3ff37fb3a3442f6369
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72924
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Fred Reitberger 2023-02-10 12:31:22 -05:00 committed by Felix Held
parent fd8854ec0f
commit 552d287cc9

View File

@ -28,10 +28,13 @@ add_bootblock = \
endif # ifeq ($(CONFIG_RESET_VECTOR_IN_RAM),y) endif # ifeq ($(CONFIG_RESET_VECTOR_IN_RAM),y)
ifeq ($(CONFIG_VBOOT_GSCVD),y) ifeq ($(CONFIG_VBOOT_GSCVD),y)
build_complete:: $(AMDFWREAD) build_complete:: $(obj)/ro-amdfw-list
amdfwread-offset-size-cmd = $(AMDFWREAD) --ro-list $(obj)/coreboot.rom | \ $(obj)/ro-amdfw-list: $(AMDFWREAD)
awk --non-decimal-data '/$(1)/ {printf "%x:%x", $$3, $$4}' $(AMDFWREAD) --ro-list $(obj)/coreboot.rom > $@
amdfwread-offset-size-cmd = grep '$(1)' $(obj)/ro-amdfw-list | \
sed 's/^.* 0x0*\(.*\) 0x0*\(.*\)$$/\1:\2/'
amdfwread-range-cmd = $(shell ( \ amdfwread-range-cmd = $(shell ( \
range=$$($(call amdfwread-offset-size-cmd,$(1))) ;\ range=$$($(call amdfwread-offset-size-cmd,$(1))) ;\