From owner-svn-src-all@FreeBSD.ORG Wed Apr 30 18:02:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6438E693; Wed, 30 Apr 2014 18:02:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4541A119A; Wed, 30 Apr 2014 18:02:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UI25bO063370; Wed, 30 Apr 2014 18:02:05 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UI24eV063366; Wed, 30 Apr 2014 18:02:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404301802.s3UI24eV063366@svn.freebsd.org> From: Warner Losh Date: Wed, 30 Apr 2014 18:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265154 - in head: . sys/conf sys/tools/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 18:02:05 -0000 Author: imp Date: Wed Apr 30 18:02:04 2014 New Revision: 265154 URL: http://svnweb.freebsd.org/changeset/base/265154 Log: Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a kernel config file. If you also want to have a static DTB compiled into your kernel, however, it cannot be a list. We have no mechanism in the kernel for picking one, so that doesn't make sense and will result in a compile-time error. Modified: head/Makefile.inc1 head/sys/conf/files head/sys/tools/fdt/make_dtb.sh (contents, props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Apr 30 17:56:05 2014 (r265153) +++ head/Makefile.inc1 Wed Apr 30 18:02:04 2014 (r265154) @@ -1830,24 +1830,12 @@ DTBOUTPUTPATH= ${.CURDIR} # Build 'standalone' Device Tree Blob # builddtb: - @if [ "${FDT_DTS_FILE}" = "" ]; then \ - echo "ERROR: FDT_DTS_FILE must be specified!"; \ - exit 1; \ - fi; \ - if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${TARGET}/${FDT_DTS_FILE} ]; then \ - echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ - exist!"; \ - exit 1; \ - fi; \ - if [ "${DTBOUTPUTPATH}" = "${.CURDIR}" ]; then \ - echo "WARNING: DTB will be placed in the current working \ - directory"; \ - fi - @PATH=${TMPPATH} \ - MACHINE=${TARGET} \ +.if !defined(FDT_DTS_FILE) +.error "FDT_DTS_FILE must be specified!" +.endif + @PATH=${TMPPATH} MACHINE=${TARGET} \ ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ - ${FDT_DTS_FILE} \ - ${DTBOUTPUTPATH}/`basename ${FDT_DTS_FILE} .dts` + "${FDT_DTS_FILE}" ${DTBOUTPUTPATH} ############### Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Apr 30 17:56:05 2014 (r265153) +++ head/sys/conf/files Wed Apr 30 18:02:04 2014 (r265154) @@ -14,7 +14,7 @@ acpi_quirks.h optional acpi \ # from the specified source (DTS) file: .dts -> .dtb # fdt_dtb_file optional fdt fdt_dtb_static \ - compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}/${FDT_DTS_FILE:R}.dtb" \ + compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}" \ no-obj no-implicit-rule before-depend \ clean "${FDT_DTS_FILE:R}.dtb" fdt_static_dtb.h optional fdt fdt_dtb_static \ Modified: head/sys/tools/fdt/make_dtb.sh ============================================================================== --- head/sys/tools/fdt/make_dtb.sh Wed Apr 30 17:56:05 2014 (r265153) +++ head/sys/tools/fdt/make_dtb.sh Wed Apr 30 18:02:04 2014 (r265154) @@ -4,8 +4,12 @@ # Script generates dtb file ($3) from dts source ($2) in build tree S ($1) S=$1 -dts=$2 -dtb=$3 +dts="$2" +dtb_path=$3 -cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $dts /dev/null | +for d in ${dts}; do + dtb=${dtb_path}/`basename $d .dts`.dtb + echo "converting $d -> $dtb" + cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} +done