From owner-p4-projects@FreeBSD.ORG Tue Mar 16 21:16:11 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E6E241065807; Tue, 16 Mar 2010 21:16:10 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92D221065805 for ; Tue, 16 Mar 2010 21:16:10 +0000 (UTC) (envelope-from raj@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8091F8FC0C for ; Tue, 16 Mar 2010 21:16:10 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o2GLGAxR097474 for ; Tue, 16 Mar 2010 21:16:10 GMT (envelope-from raj@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o2GLGAcW097472 for perforce@freebsd.org; Tue, 16 Mar 2010 21:16:10 GMT (envelope-from raj@freebsd.org) Date: Tue, 16 Mar 2010 21:16:10 GMT Message-Id: <201003162116.o2GLGAcW097472@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to raj@freebsd.org using -f From: Rafal Jaworowski To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 175742 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Mar 2010 21:16:11 -0000 http://p4web.freebsd.org/chv.cgi?CH=175742 Change 175742 by raj@raj_fdt on 2010/03/16 21:15:45 Improve handling of the statically embedded device tree blob. o Enable building 'dtc' as part of the bootstrap-tools building stage. o Make extracting DTS file name from the kernel config file more robust. o Have WITH_FDT world built on ARM and PowerPC by default. Affected files ... .. //depot/projects/fdt/Makefile.inc1#10 edit .. //depot/projects/fdt/share/mk/bsd.own.mk#4 edit .. //depot/projects/fdt/sys/conf/files#18 edit .. //depot/projects/fdt/sys/tools/fdt/make_dtbh.sh#2 edit Differences ... ==== //depot/projects/fdt/Makefile.inc1#10 (text+ko) ==== @@ -1444,24 +1444,28 @@ .endif .if ${MK_FDT} != "no" -DTBOUTPUTFILE= ${FDT_DTS_FILE}.dtb .if defined(FDT_DTS_OUTPUT) DTBOUTPUTPATH= ${FDT_DTS_OUTPUT} .else -DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/${DTBOUTPUTFILE} +DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ .endif -DTC_PATH?= ${WORLDTMP}${.CURDIR}/gnu/usr.bin/dtc +.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) +FDT_DTS_FILE!= grep "makeoptions[[:space:]]\+FDT_DTS_FILE" \ + ${KERNCONFDIR}/${KERNCONF} | cut -d= -f2 +.endif # # Build 'standalone' Device Tree Blob # builddtb: +.if !empty(FDT_DTS_FILE) .if !exists(${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE}) .error ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} not found! .endif - PATH=${DTC_PATH} \ - dtc -O dtb -o ${DTBOUTPUTPATH} -b 0 -p 1024 \ - ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} + PATH=${TMPPATH} \ + dtc -O dtb -o ${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1` \ + -b 0 -p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} +.endif .endif ==== //depot/projects/fdt/share/mk/bsd.own.mk#4 (text+ko) ==== @@ -278,6 +278,13 @@ WITH_IDEA= .endif +# Enable FDT by default for selected platforms. +.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "powerpc" +_fdt= FDT +.else +_no_fdt= FDT +.endif + # # MK_* options which default to "yes". # @@ -313,6 +320,7 @@ DICT \ DYNAMICROOT \ EXAMPLES \ + ${_fdt} \ FLOPPY \ FORTH \ FP_LIBC \ @@ -407,7 +415,7 @@ BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ - FDT \ + ${_no_fdt} \ GNU_CPIO \ HESIOD \ IDEA ==== //depot/projects/fdt/sys/conf/files#18 (text+ko) ==== @@ -55,14 +55,19 @@ compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h emu10k1-alsa%diked.h" \ no-obj no-implicit-rule before-depend \ clean "emu10k1-alsa%diked.h" +# +# The 'fdt_dtb_file' target covers an actual DTB file name, which is derived +# from the specified source (DTS) file: .dts -> .dtb +# +fdt_dtb_file optional fdt fdt_dtb_static \ + dependency "$S/boot/fdt/dts/${FDT_DTS_FILE}" \ + compile-with "dtc -O dtb -o `echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 -p 1024 $S/boot/fdt/dts/${FDT_DTS_FILE}" \ + no-obj no-implicit-rule before-depend \ + clean "`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb" fdt_static_dtb.h optional fdt fdt_dtb_static \ compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ." \ no-obj no-implicit-rule before-depend \ - clean "${FDT_DTS_FILE}.dtb fdt_static_dtb.h" -${FDT_DTS_FILE}.dtb optional fdt fdt_dtb_static \ - dependency "$S/boot/fdt/dts/${FDT_DTS_FILE}" \ - compile-with "dtc -O dtb -o ${FDT_DTS_FILE}.dtb -b 0 -p 1024 $S/boot/fdt/dts/${FDT_DTS_FILE}" \ - no-obj no-implicit-rule before-depend + clean "fdt_static_dtb.h" p16v-alsa%diked.h optional snd_emu10kx pci \ dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h" \ compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h p16v-alsa%diked.h" \ ==== //depot/projects/fdt/sys/tools/fdt/make_dtbh.sh#2 (text+ko) ==== @@ -2,4 +2,5 @@ # # Script generates a $2/fdt_static_dtb.h file. -echo '#define FDT_DTB_FILE "'$1.dtb'"' > $2/fdt_static_dtb.h +dtb_base_name=`basename $1 .dts` +echo '#define FDT_DTB_FILE "'${dtb_base_name}.dtb'"' > $2/fdt_static_dtb.h