From 552d287cc9c558a4818b7454777808fa2cf3386c Mon Sep 17 00:00:00 2001 From: Fred Reitberger Date: Fri, 10 Feb 2023 12:31:22 -0500 Subject: 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 Change-Id: I1afaf65b9b2f9fb856aefc3ff37fb3a3442f6369 Reviewed-on: https://review.coreboot.org/c/coreboot/+/72924 Reviewed-by: Karthik Ramasubramanian Tested-by: build bot (Jenkins) --- src/soc/amd/common/Makefile.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/soc') diff --git a/src/soc/amd/common/Makefile.inc b/src/soc/amd/common/Makefile.inc index dc782c99d8..ec434e0734 100644 --- a/src/soc/amd/common/Makefile.inc +++ b/src/soc/amd/common/Makefile.inc @@ -28,10 +28,13 @@ add_bootblock = \ endif # ifeq ($(CONFIG_RESET_VECTOR_IN_RAM),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 | \ - awk --non-decimal-data '/$(1)/ {printf "%x:%x", $$3, $$4}' +$(obj)/ro-amdfw-list: $(AMDFWREAD) + $(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 ( \ range=$$($(call amdfwread-offset-size-cmd,$(1))) ;\ -- cgit v1.2.3