From owner-dev-commits-src-main@freebsd.org Fri Jan 15 19:10:14 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D24044EFB99; Fri, 15 Jan 2021 19:10:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DHW394Y8bz3Qcr; Fri, 15 Jan 2021 19:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 277B721A11; Fri, 15 Jan 2021 19:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10FJAD5x079944; Fri, 15 Jan 2021 19:10:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10FJADng079938; Fri, 15 Jan 2021 19:10:13 GMT (envelope-from git) Date: Fri, 15 Jan 2021 19:10:13 GMT Message-Id: <202101151910.10FJADng079938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: efdf807990c3 - main - Switch to the new device-tree vendor tree MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: efdf807990c3b58353286174e5e6bbd601a31c33 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 19:10:15 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=efdf807990c3b58353286174e5e6bbd601a31c33 commit efdf807990c3b58353286174e5e6bbd601a31c33 Author: Emmanuel Vadot AuthorDate: 2021-01-15 14:28:46 +0000 Commit: Emmanuel Vadot CommitDate: 2021-01-15 19:08:39 +0000 Switch to the new device-tree vendor tree The old vendor tree was never fully merged and doing partial merge isn't supported with git subtree merge so a new one was created. Switch the build to use the new DTS from sys/contrib/device-tree This also bump the DTS used to be in sync with Linux 5.9 While here change the way to get the linux version, simply hardcode the value in sys/dts/freebsd-compatible.dts and use awk to get that to put it in the CFLAGS. As a bonus we now have the bindings docs available in sys/contrib/device-tree/Bindings/ so no need to link to the Linux repo or to the vendor tree. --- sys/conf/Makefile.arm | 4 ++-- sys/conf/Makefile.arm64 | 2 +- sys/conf/dtb.build.mk | 2 +- sys/conf/files.arm64 | 2 +- sys/dts/freebsd-compatible.dts | 2 +- sys/tools/fdt/make_dtb.sh | 6 ++---- sys/tools/fdt/make_dtbo.sh | 4 ++-- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm index cc827e88c44f..31dc542e8e6c 100644 --- a/sys/conf/Makefile.arm +++ b/sys/conf/Makefile.arm @@ -30,9 +30,9 @@ S= ../../.. .endif .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt -I$S/gnu/dts/include +INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include -LINUX_DTS_VERSION!= make -C $S/gnu/dts/ -V LINUX_DTS_VERSION +LINUX_DTS_VERSION!= awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" .if !defined(DEBUG) && !defined(PROFLEVEL) diff --git a/sys/conf/Makefile.arm64 b/sys/conf/Makefile.arm64 index 08b5a5fc90b7..c7951872ca2d 100644 --- a/sys/conf/Makefile.arm64 +++ b/sys/conf/Makefile.arm64 @@ -25,7 +25,7 @@ S= ../../.. .endif .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt -I$S/gnu/dts/include +INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include # Use a custom SYSTEM_LD command to generate the elf kernel, so we can # set the text segment start address, and also strip the "arm mapping diff --git a/sys/conf/dtb.build.mk b/sys/conf/dtb.build.mk index edaa6db225c8..8d106615822f 100644 --- a/sys/conf/dtb.build.mk +++ b/sys/conf/dtb.build.mk @@ -32,7 +32,7 @@ DTB+= ${_dts:T:R:S/$/.dtb/} DTBO=${DTSO:T:R:S/$/.dtbo/} .SUFFIXES: .dtb .dts .dtbo .dtso -.PATH.dts: ${SYSDIR}/gnu/dts/${MACHINE} ${SYSDIR}/dts/${MACHINE} +.PATH.dts: ${SYSDIR}/contrib/device-tree/src/${MACHINE} ${SYSDIR}/dts/${MACHINE} .PATH.dtso: ${SYSDIR}/dts/${MACHINE}/overlays .export DTC ECHO diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 8ee422f23e26..fb001f95a672 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -34,7 +34,7 @@ arm/allwinner/aw_dwc3.c optional aw_dwc3 fdt arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt | mmccam aw_mmc fdt arm/allwinner/aw_nmi.c optional aw_nmi fdt \ - compile-with "${NORMAL_C} -I$S/gnu/dts/include" + compile-with "${NORMAL_C} -I$S/contrib/device-tree/include" arm/allwinner/aw_pwm.c optional aw_pwm fdt arm/allwinner/aw_rsb.c optional aw_rsb fdt arm/allwinner/aw_rtc.c optional aw_rtc fdt diff --git a/sys/dts/freebsd-compatible.dts b/sys/dts/freebsd-compatible.dts index d977cb2b30c8..3621ac45901a 100644 --- a/sys/dts/freebsd-compatible.dts +++ b/sys/dts/freebsd-compatible.dts @@ -1,3 +1,3 @@ / { - freebsd,dts-version = LINUX_DTS_VERSION; + freebsd,dts-version = "5.9"; }; diff --git a/sys/tools/fdt/make_dtb.sh b/sys/tools/fdt/make_dtb.sh index 5c5968711661..09d0b3bd9f42 100755 --- a/sys/tools/fdt/make_dtb.sh +++ b/sys/tools/fdt/make_dtb.sh @@ -20,11 +20,9 @@ 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} -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/" + ${CPP} -P -x assembler-with-cpp -I "$S/contrib/device-tree/include" -I "$S/dts/${MACHINE}" -I "$S/contrib/device-tree/src/${MACHINE}" -I "$S/contrib/device-tree/src/" -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/contrib/device-tree/src/${MACHINE}" -i "$S/contrib/device-tree/src/" done diff --git a/sys/tools/fdt/make_dtbo.sh b/sys/tools/fdt/make_dtbo.sh index edc5d7fd8d41..1fcab87a6465 100755 --- a/sys/tools/fdt/make_dtbo.sh +++ b/sys/tools/fdt/make_dtbo.sh @@ -23,6 +23,6 @@ fi for d in ${dtso}; do dtb="${dtbo_path}/$(basename "$d" .dtso).dtbo" ${ECHO} "converting $d -> $dtb" - ${CPP} -P -x assembler-with-cpp -I "$S/gnu/dts/include" -I "$S/dts/${MACHINE}" -I "$S/gnu/dts/${MACHINE}" -include "$d" /dev/null | - ${DTC} -@ -O dtb -o "$dtb" -i "$S/dts/${MACHINE}" -i "$S/gnu/dts/${MACHINE}" + ${CPP} -P -x assembler-with-cpp -I "$S/contrib/device-tree/include" -I "$S/dts/${MACHINE}" -I "$S/contrib/device-tree/src/${MACHINE}" -include "$d" /dev/null | + ${DTC} -@ -O dtb -o "$dtb" -i "$S/dts/${MACHINE}" -i "$S/contrib/device-tree/src/${MACHINE}" done