PERFORCE change 175742 for review

Rafal Jaworowski raj at FreeBSD.org
Tue Mar 16 21:16:11 UTC 2010


http://p4web.freebsd.org/chv.cgi?CH=175742

Change 175742 by raj at 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: <platform>.dts -> <platform>.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


More information about the p4-projects mailing list