]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-firmware/system-firmware-image-gen.git/blobdiff - Makefile
include: Add AM65X specific headers corresponding to SYSFW
[processor-firmware/system-firmware-image-gen.git] / Makefile
index 95ee273183305153d10c0e3ba14b8e4227d7f14d..85e7b20b13aa47a49d490c56cb3971bcd8c84b26 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,8 @@
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
+SOC ?= am65x
+
 # The HS SYSFW will only work on HS hardware when signed with valid
 # keys, warn HS users if the SECDEV environment variable is not set
 ifdef HS
@@ -45,10 +47,10 @@ endif
 
 # If using the default SYSFW make sure to manually copy/populate the unsigned
 # image into the root folder of this repository.
-SYSFW_PATH ?= ti-sci-firmware-am65x-gp.bin
-SYSFW_HS_PATH ?= ti-sci-firmware-am65x-hs-enc.bin
-SYSFW_HS_INNER_CERT_PATH ?= ti-sci-firmware-am65x-hs-cert.bin
-SYSFW_HS_CERTS_PATH ?= ti-sci-firmware-am65x-hs-certs.bin
+SYSFW_PATH ?= ti-sci-firmware-${SOC}-gp.bin
+SYSFW_HS_PATH ?= ti-sci-firmware-${SOC}-hs-enc.bin
+SYSFW_HS_INNER_CERT_PATH ?= ti-sci-firmware-${SOC}-hs-cert.bin
+SYSFW_HS_CERTS_PATH ?= ti-sci-firmware-${SOC}-hs-certs.bin
 
 # Must use FULL Git hash below, as it is used as part of an URL for direct DL
 SYSFW_GIT_HASH ?= b41c4f097ab6f341462645f76059f48f78bbd17e
@@ -61,13 +63,16 @@ SYSFW_HS_INNER_CERT_DL_URL ?= https://git.ti.com/processor-firmware/ti-linux-fir
 # Set HS SYSFW image signing key
 ifdef HS
 KEY ?= $(TI_SECURE_DEV_PKG)/keys/custMpk.pem
+else
+KEY ?= ti-degenerate-key.pem
 endif
 
 CROSS_COMPILE ?= arm-linux-gnueabihf-
 
 CFLAGS ?= \
        -fno-builtin \
-       -Wall
+       -Wall \
+       -Iinclude/soc/${SOC}/
 
 BINS ?= \
        sysfw.bin \
@@ -84,9 +89,6 @@ MKIMAGE ?= mkimage
 .PHONY: all
 all: $(ITB)
 
-%.o: %.S
-       $(CROSS_COMPILE)as -o $@ $<
-
 %.o: %.c
        $(CROSS_COMPILE)gcc $(CFLAGS) -c -o $@ $<
 
@@ -117,8 +119,13 @@ sysfw.bin: $(SYSFW_HS_CERTS_PATH) $(SYSFW_HS_PATH)
        cat $^ > $@
 else
 sysfw.bin: $(SYSFW_PATH) sysfw_version
-       @echo "Signing the SYSFW release image with random key..."
-       ./gen_x509_cert.sh -c m3 -b $< -o $@ -l 0x40000
+       @if [ -n "$(KEY)" ]; then \
+               echo "Signing the SYSFW release image with $(KEY) key..."; \
+               ./gen_x509_cert.sh -c m3 -b $< -o $@ -l 0x40000 -k $(KEY); \
+       else \
+               echo "Signing the SYSFW release image with random key..."; \
+               ./gen_x509_cert.sh -c m3 -b $< -o $@ -l 0x40000; \
+       fi
 endif
 
 $(ITS): $(BINS)
@@ -133,13 +140,13 @@ sysfw_version: $(SYSFW_PATH)
 
 .PHONY: clean
 clean:
-       -rm $(BINS)
-       -rm $(ITB)
-       -rm $(ITS)
-       -rm $(SYSFW_HS_CERTS_PATH)
+       -rm -f $(BINS)
+       -rm -f $(ITB)
+       -rm -f $(ITS)
+       -rm -f $(SYSFW_HS_CERTS_PATH)
 
 .PHONY: mrproper
 mrproper: clean
-       -rm $(SYSFW_PATH)
-       -rm $(SYSFW_HS_PATH)
-       -rm $(SYSFW_HS_INNER_CERT_PATH)
+       -rm -f $(SYSFW_PATH)
+       -rm -f $(SYSFW_HS_PATH)
+       -rm -f $(SYSFW_HS_INNER_CERT_PATH)