Author: manu
Date: Sat Oct 10 07:18:51 2020
New Revision: 366599
URL: https://svnweb.freebsd.org/changeset/base/366599

Log:
  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

Added:
  head/sys/dts/freebsd-compatible.dts   (contents, props changed)
  head/sys/gnu/dts/Makefile   (contents, props changed)
Modified:
  head/sys/conf/Makefile.arm
  head/sys/tools/fdt/make_dtb.sh

Modified: head/sys/conf/Makefile.arm
==============================================================================
--- head/sys/conf/Makefile.arm  Sat Oct 10 04:18:49 2020        (r366598)
+++ head/sys/conf/Makefile.arm  Sat Oct 10 07:18:51 2020        (r366599)
@@ -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

Added: head/sys/dts/freebsd-compatible.dts
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dts/freebsd-compatible.dts Sat Oct 10 07:18:51 2020        
(r366599)
@@ -0,0 +1,3 @@
+/ {
+       freebsd,dts-version = LINUX_DTS_VERSION;
+};

Added: head/sys/gnu/dts/Makefile
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/gnu/dts/Makefile   Sat Oct 10 07:18:51 2020        (r366599)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+LINUX_DTS_VERSION=5.8

Modified: head/sys/tools/fdt/make_dtb.sh
==============================================================================
--- head/sys/tools/fdt/make_dtb.sh      Sat Oct 10 04:18:49 2020        
(r366598)
+++ head/sys/tools/fdt/make_dtb.sh      Sat Oct 10 07:18:51 2020        
(r366599)
@@ -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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to