diff --git a/meta/recipes-kernel/dtc/dtc/0001-meson-get-version-as-parameter-instead-of-querying-g.patch b/meta/recipes-kernel/dtc/dtc/0001-meson-get-version-as-parameter-instead-of-querying-g.patch
new file mode 100644
index 0000000000..d7906bd6f9
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc/0001-meson-get-version-as-parameter-instead-of-querying-g.patch
@@ -0,0 +1,49 @@
+From f32056f825b926b5820d43478d11e92eee1ec91f Mon Sep 17 00:00:00 2001
+From: Peter Marko <peter.marko@siemens.com>
+Date: Wed, 13 Dec 2023 21:18:14 +0100
+Subject: [PATCH] meson: get version as parameter instead of querying git
+
+When using shallow tarballs, git tag is not available.
+This causes version to be git hash.
+This prevents application from checking minimal required version.
+
+Example error for trusted-firmware-a from meta-arm:
+dtc version too old (039a994), you need at least version 1.4.4
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Peter Marko <peter.marko@siemens.com>
+---
+ meson.build       | 3 ++-
+ meson_options.txt | 2 ++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 78251eb..8a25163 100644
+--- a/meson.build
++++ b/meson.build
+@@ -55,9 +55,10 @@ py = import('python')
+ py = py.find_installation(required: get_option('python'))
+ swig = find_program('swig', required: get_option('python'))
+ 
+-version_gen_h = vcs_tag(
++version_gen_h = configure_file(
+   input: 'version_gen.h.in',
+   output: 'version_gen.h',
++  configuration: { 'VCS_TAG': get_option('PV')},
+ )
+ 
+ subdir('libfdt')
+diff --git a/meson_options.txt b/meson_options.txt
+index 82621c3..c313d32 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -10,3 +10,5 @@ option('python', type: 'feature', value: 'auto',
+        description: 'Build pylibfdt Python library')
+ option('static-build', type: 'boolean', value: false,
+        description: 'Build static binaries')
++option('PV', type: 'string', value: 'undefined',
++       description: 'version string to be used instead of getting it from git')
+-- 
+2.30.2
+
diff --git a/meta/recipes-kernel/dtc/dtc_1.7.0.bb b/meta/recipes-kernel/dtc/dtc_1.7.0.bb
index 1a78a0c079..586a5f91bd 100644
--- a/meta/recipes-kernel/dtc/dtc_1.7.0.bb
+++ b/meta/recipes-kernel/dtc/dtc_1.7.0.bb
@@ -8,7 +8,10 @@ LIC_FILES_CHKSUM = "file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927 \
                     file://README.license;md5=a1eb22e37f09df5b5511b8a278992d0e"
 
-SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=main;protocol=https" 
+SRC_URI = " \
+    git://git.kernel.org/pub/scm/utils/dtc/dtc.git;branch=main;protocol=https \
+    file://0001-meson-get-version-as-parameter-instead-of-querying-g.patch \
+"
 SRCREV = "039a99414e778332d8f9c04cbd3072e1dcc62798"
 
 UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
@@ -17,7 +20,7 @@ S = "${WORKDIR}/git"
 
 inherit meson pkgconfig
 
-EXTRA_OEMESON = "-Dpython=disabled -Dvalgrind=disabled"
+EXTRA_OEMESON = "-Dpython=disabled -Dvalgrind=disabled -DPV=v${PV}"
 
 PACKAGECONFIG ??= "tools"
 PACKAGECONFIG[tools] = "-Dtools=true,-Dtools=false,flex-native bison-native"
