aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2020-10-10 07:18:51 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2020-10-10 07:18:51 +0000
commit4a63c1c1ed78c6ae1cc4528314216e0d7945368a (patch)
tree9781b39765c397769bf2f898c9cc83867f7ad1be /sys
parenta4bcd20486f8c20cc875b39bc75aa0d5a047373f (diff)
downloadsrc-4a63c1c1ed78c6ae1cc4528314216e0d7945368a.tar.gz
src-4a63c1c1ed78c6ae1cc4528314216e0d7945368a.zip
Brand our DTS with the Linux version it was imported from
DTS must be synced with the kernel, add a freebsd,dts-version string in the root node of each DTS that we compile so we can later in the kernel check that it contain a correct value. Reviewed by: imp, mmel Differential Revision: https://reviews.freebsd.org/D26724
Notes
Notes: svn path=/head/; revision=366599
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/Makefile.arm3
-rw-r--r--sys/dts/freebsd-compatible.dts3
-rw-r--r--sys/gnu/dts/Makefile3
-rwxr-xr-xsys/tools/fdt/make_dtb.sh4
4 files changed, 12 insertions, 1 deletions
diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm
index 1d0ab347827b..cc827e88c44f 100644
--- a/sys/conf/Makefile.arm
+++ b/sys/conf/Makefile.arm
@@ -32,6 +32,9 @@ S= ../../..
INCLUDES+= -I$S/contrib/libfdt -I$S/gnu/dts/include
+LINUX_DTS_VERSION!= make -C $S/gnu/dts/ -V LINUX_DTS_VERSION
+CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\"
+
.if !defined(DEBUG) && !defined(PROFLEVEL)
STRIP_FLAGS = -S
.endif
diff --git a/sys/dts/freebsd-compatible.dts b/sys/dts/freebsd-compatible.dts
new file mode 100644
index 000000000000..d977cb2b30c8
--- /dev/null
+++ b/sys/dts/freebsd-compatible.dts
@@ -0,0 +1,3 @@
+/ {
+ freebsd,dts-version = LINUX_DTS_VERSION;
+};
diff --git a/sys/gnu/dts/Makefile b/sys/gnu/dts/Makefile
new file mode 100644
index 000000000000..140e5c1bc464
--- /dev/null
+++ b/sys/gnu/dts/Makefile
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+LINUX_DTS_VERSION=5.8
diff --git a/sys/tools/fdt/make_dtb.sh b/sys/tools/fdt/make_dtb.sh
index b33dc39609cb..5c5968711661 100755
--- a/sys/tools/fdt/make_dtb.sh
+++ b/sys/tools/fdt/make_dtb.sh
@@ -20,9 +20,11 @@ fi
: "${ECHO:=echo}"
: "${CPP:=cpp}"
+LINUX_DTS_VERSION=$(make -C $S/gnu/dts -V LINUX_DTS_VERSION)
+
for d in ${dts}; do
dtb="${dtb_path}/$(basename "$d" .dts).dtb"
${ECHO} "converting $d -> $dtb"
- ${CPP} -P -x assembler-with-cpp -I "$S/gnu/dts/include" -I "$S/dts/${MACHINE}" -I "$S/gnu/dts/${MACHINE}" -I "$S/gnu/dts/" -include "$d" /dev/null |
+ ${CPP} -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" -P -x assembler-with-cpp -I "$S/gnu/dts/include" -I "$S/dts/${MACHINE}" -I "$S/gnu/dts/${MACHINE}" -I "$S/gnu/dts/" -include "$d" -include "$S/dts/freebsd-compatible.dts" /dev/null |
${DTC} -@ -O dtb -o "$dtb" -b 0 -p 1024 -i "$S/dts/${MACHINE}" -i "$S/gnu/dts/${MACHINE}" -i "$S/gnu/dts/"
done