Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Jun 2010 13:02:43 +0000 (UTC)
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209128 - in head: . gnu/usr.bin sys/conf
Message-ID:  <201006131302.o5DD2hm6032298@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: raj
Date: Sun Jun 13 13:02:43 2010
New Revision: 209128
URL: http://svn.freebsd.org/changeset/base/209128

Log:
  Connect FDT infrastructure to the build system.
  
  Reviewed by:	imp
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/Makefile
  head/Makefile.inc1
  head/gnu/usr.bin/Makefile
  head/sys/conf/files

Modified: head/Makefile
==============================================================================
--- head/Makefile	Sun Jun 13 12:58:31 2010	(r209127)
+++ head/Makefile	Sun Jun 13 13:02:43 2010	(r209128)
@@ -89,7 +89,8 @@ TGTS=	all all-man buildenv buildenvvars 
 	obj objlink regress rerelease showconfig tags toolchain update \
 	_worldtmp _legacy _bootstrap-tools _cleanobj _obj \
 	_build-tools _cross-tools _includes _libraries _depend \
-	build32 distribute32 install32 xdev xdev-build xdev-install
+	build32 builddtb distribute32 install32 xdev xdev-build xdev-install \
+
 TGTS+=	${SUBDIR_TARGETS}
 
 BITGTS=	files includes

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Sun Jun 13 12:58:31 2010	(r209127)
+++ head/Makefile.inc1	Sun Jun 13 13:02:43 2010	(r209128)
@@ -968,6 +968,10 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/
     lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
 .endif
 
+.if ${MK_FDT} != "no"
+_dtc= gnu/usr.bin/dtc
+.endif
+
 bootstrap-tools:
 .for _tool in \
     ${_clang_tblgen} \
@@ -976,6 +980,7 @@ bootstrap-tools:
     ${_gperf} \
     ${_groff} \
     ${_ar} \
+    ${_dtc} \
     usr.bin/lorder \
     usr.bin/makewhatis \
     ${_mklocale} \
@@ -1448,3 +1453,39 @@ _xi-links:
 			    ../../../../usr/bin/${XDDIR}${OSREL}-$$i; \
 		done
 .endif
+
+.if !empty(KRNLOBJDIR) && !empty(KERNCONF)
+DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/
+
+.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE)
+FDT_DTS_FILE!=	 grep "^makeoptions[[:space:]]\+FDT_DTS_FILE" \
+	${KERNCONFDIR}/${KERNCONF} 2> /dev/null | cut -d= -f2
+.endif
+
+.endif
+
+.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH})
+DTBOUTPUTPATH= ${.CURDIR}
+.endif
+
+#
+# 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/${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} \
+	dtc -O dtb -o \
+	    ${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 \
+	    -p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE}

Modified: head/gnu/usr.bin/Makefile
==============================================================================
--- head/gnu/usr.bin/Makefile	Sun Jun 13 12:58:31 2010	(r209127)
+++ head/gnu/usr.bin/Makefile	Sun Jun 13 13:02:43 2010	(r209128)
@@ -8,6 +8,7 @@ SUBDIR= ${_binutils} \
 	dialog \
 	diff \
 	diff3 \
+	${_dtc} \
 	${_gdb} \
 	${_gperf} \
 	${_grep} \
@@ -31,6 +32,10 @@ _groff=		groff
 _cvs=		cvs
 .endif
 
+.if ${MK_FDT}	!= "no"
+_dtc=		dtc
+.endif
+
 .if ${MK_GNU_GREP} != "no"
 _grep=		grep
 .endif

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sun Jun 13 12:58:31 2010	(r209127)
+++ head/sys/conf/files	Sun Jun 13 13:02:43 2010	(r209128)
@@ -55,6 +55,18 @@ emu10k1-alsa%diked.h		optional snd_emu10
 	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 \
+	compile-with "if [ -f $S/boot/fdt/dts/${FDT_DTS_FILE} ]; then dtc -O dtb -o `echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 -p 1024 $S/boot/fdt/dts/${FDT_DTS_FILE}; fi" \
+	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_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" \
@@ -302,6 +314,12 @@ contrib/ipfilter/netinet/ip_sync.c optio
 	compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
 contrib/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \
 	compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
+contrib/libfdt/fdt.c			optional	fdt
+contrib/libfdt/fdt_ro.c			optional	fdt
+contrib/libfdt/fdt_rw.c			optional	fdt
+contrib/libfdt/fdt_strerror.c		optional	fdt
+contrib/libfdt/fdt_sw.c			optional	fdt
+contrib/libfdt/fdt_wip.c		optional	fdt
 contrib/ngatm/netnatm/api/cc_conn.c optional ngatm_ccatm \
 	compile-with "${NORMAL_C_NOWERROR} -I$S/contrib/ngatm"
 contrib/ngatm/netnatm/api/cc_data.c optional ngatm_ccatm \
@@ -961,6 +979,11 @@ dev/ex/if_ex_pccard.c		optional ex pccar
 dev/exca/exca.c			optional cbb
 dev/fatm/if_fatm.c		optional fatm pci
 dev/fb/splash.c			optional splash
+dev/fdt/fdt_common.c		optional fdt
+dev/fdt/fdt_pci.c		optional fdt pci
+dev/fdt/fdt_static_dtb.S	optional fdt fdt_dtb_static
+dev/fdt/fdtbus.c		optional fdt
+dev/fdt/simplebus.c		optional fdt
 dev/fe/if_fe.c			optional fe
 dev/fe/if_fe_pccard.c		optional fe pccard
 dev/firewire/firewire.c		optional firewire
@@ -1659,6 +1682,7 @@ dev/txp/if_txp.c		optional txp inet
 dev/uart/uart_bus_acpi.c	optional uart acpi
 #dev/uart/uart_bus_cbus.c	optional uart cbus
 dev/uart/uart_bus_ebus.c	optional uart ebus
+dev/uart/uart_bus_fdt.c		optional uart fdt
 dev/uart/uart_bus_isa.c		optional uart isa
 dev/uart/uart_bus_pccard.c	optional uart pccard
 dev/uart/uart_bus_pci.c		optional uart pci



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006131302.o5DD2hm6032298>