arm-trusted-firmware-mvebu: pass commit ids to a3700-utils/mv-ddr-marvell
authorAndre Heider <a.heider@gmail.com>
Mon, 18 Jan 2021 15:54:26 +0000 (16:54 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 30 Jan 2021 13:46:32 +0000 (14:46 +0100)
The two required tools fail to identify their version when not compiling
from a git clone, patch that in and pass on the used commit hashes.

Upon boot it now prints "WTMI-devel-18.12.1-5598e150".

Signed-off-by: Andre Heider <a.heider@gmail.com>
package/boot/arm-trusted-firmware-mvebu/Makefile
package/boot/arm-trusted-firmware-mvebu/patches-a3700-utils/001-version.patch [new file with mode: 0644]
package/boot/arm-trusted-firmware-mvebu/patches-mv-ddr-marvell/001-version.patch [new file with mode: 0644]

index a72fd53c75e6bda833c81b8aafaa53399fe74394..c4669edb52b2bac87de3d3ee76338db6c8efcadd 100644 (file)
@@ -113,6 +113,8 @@ TFA_MAKE_FLAGS += \
                WTP=$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME) \
                DDR_TOPOLOGY=$(DDR_TOPOLOGY) \
                CLOCKSPRESET=$(CLOCKSPRESET) \
+               A3700_UTILS_COMMIT_ID=$(A3700_UTILS_RELEASE) \
+               MV_DDR_COMMIT_ID=$(MV_DDR_RELEASE) \
                all \
                mrvl_flash
 
@@ -163,7 +165,9 @@ define Build/Prepare
 
        mkdir -p $(STAGING_DIR_IMAGE)
        $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(A3700_UTILS_SOURCE)
+       $(call PatchDir/Default,$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME),./patches-a3700-utils)
        $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(MV_DDR_SOURCE)
+       $(call PatchDir/Default,$(STAGING_DIR_IMAGE)/$(MV_DDR_NAME),./patches-mv-ddr-marvell)
        $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(LINARO_SOURCE)
 endef
 
diff --git a/package/boot/arm-trusted-firmware-mvebu/patches-a3700-utils/001-version.patch b/package/boot/arm-trusted-firmware-mvebu/patches-a3700-utils/001-version.patch
new file mode 100644 (file)
index 0000000..745e615
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/wtmi/sys_init/Makefile b/wtmi/sys_init/Makefile
+--- a/wtmi/sys_init/Makefile
++++ b/wtmi/sys_init/Makefile
+@@ -51,7 +51,8 @@ ECHO     = @echo
+ SED      = @sed
+ LOCAL_VERSION_STRING  ?= -armada
+-BUILD_STRING          := $(shell git log -n 1 --pretty=format:"%h")
++A3700_UTILS_COMMIT_ID ?= $(shell git log -n 1 --pretty=format:"%h")
++BUILD_STRING          := $(A3700_UTILS_COMMIT_ID)
+ VERSION_STRING                := $(LOCAL_VERSION_STRING)-$(BUILD_STRING)
+ CPUOPTS  = -mthumb -mcpu=cortex-m3 -mlittle-endian
diff --git a/package/boot/arm-trusted-firmware-mvebu/patches-mv-ddr-marvell/001-version.patch b/package/boot/arm-trusted-firmware-mvebu/patches-mv-ddr-marvell/001-version.patch
new file mode 100644 (file)
index 0000000..1c7c61d
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/scripts/localversion.sh b/scripts/localversion.sh
+--- a/scripts/localversion.sh
++++ b/scripts/localversion.sh
+@@ -103,7 +103,7 @@ MV_DDR_ROOT=$1
+ MV_DDR_VER_CSRC=$2
+ # get mv_ddr git commit id
+-MV_DDR_COMMIT_ID=`git -C $MV_DDR_ROOT rev-parse --verify --quiet --short HEAD 2> /dev/null`
++test -z "$MV_DDR_COMMIT_ID" && MV_DDR_COMMIT_ID=`git -C $MV_DDR_ROOT rev-parse --verify --quiet --short HEAD 2> /dev/null`
+ # check for uncommitted changes in mv_ddr git
+ MV_DDR_DIRTY_CHK=`git -C $MV_DDR_ROOT diff-index --name-only HEAD 2> /dev/null`