arm: k3: config.mk: Read software revision information from file on HS
authorAndrew Davis <afd@ti.com>
Fri, 15 Jul 2022 16:38:54 +0000 (11:38 -0500)
committerTom Rini <trini@konsulko.com>
Mon, 25 Jul 2022 18:57:27 +0000 (14:57 -0400)
Read the swrv.txt file from the TI Security Development Tools when
TI_SECURE_DEVICE is enabled. This allows us to set our software
revision in one place and have it used by all the tools that create
TI x509 boot certificates.

Signed-off-by: Andrew Davis <afd@ti.com>
arch/arm/mach-k3/config.mk

index 4feb579..9306f26 100644 (file)
@@ -30,6 +30,14 @@ endif
 
 # X509 SWRV default
 SWRV = $(CONFIG_K3_X509_SWRV)
+# On HS use SECDEV provided software revision or warn if not available
+ifeq ($(CONFIG_TI_SECURE_DEVICE),y)
+ifneq ($(wildcard $(TI_SECURE_DEV_PKG)/keys/swrv.txt),)
+SWRV= $(shell cat $(TI_SECURE_DEV_PKG)/keys/swrv.txt)
+else
+$(warning "WARNING: Software revision file not found. Default may not work on HS hardware.")
+endif
+endif
 
 # tiboot3.bin is mandated by ROM and ROM only supports R5 boot.
 # So restrict tiboot3.bin creation for CPU_V7R.