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.
This commit is contained in:
Warner Losh 2014-04-30 18:02:04 +00:00
parent 82ce008538
commit 0edb735169
3 changed files with 13 additions and 21 deletions

View File

@ -1830,24 +1830,12 @@ DTBOUTPUTPATH= ${.CURDIR}
# Build 'standalone' Device Tree Blob # Build 'standalone' Device Tree Blob
# #
builddtb: builddtb:
@if [ "${FDT_DTS_FILE}" = "" ]; then \ .if !defined(FDT_DTS_FILE)
echo "ERROR: FDT_DTS_FILE must be specified!"; \ .error "FDT_DTS_FILE must be specified!"
exit 1; \ .endif
fi; \ @PATH=${TMPPATH} MACHINE=${TARGET} \
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} \
${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
${FDT_DTS_FILE} \ "${FDT_DTS_FILE}" ${DTBOUTPUTPATH}
${DTBOUTPUTPATH}/`basename ${FDT_DTS_FILE} .dts`
############### ###############

View File

@ -14,7 +14,7 @@ acpi_quirks.h optional acpi \
# from the specified source (DTS) file: <platform>.dts -> <platform>.dtb # from the specified source (DTS) file: <platform>.dts -> <platform>.dtb
# #
fdt_dtb_file optional fdt fdt_dtb_static \ 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 \ no-obj no-implicit-rule before-depend \
clean "${FDT_DTS_FILE:R}.dtb" clean "${FDT_DTS_FILE:R}.dtb"
fdt_static_dtb.h optional fdt fdt_dtb_static \ fdt_static_dtb.h optional fdt fdt_dtb_static \

View File

@ -4,8 +4,12 @@
# Script generates dtb file ($3) from dts source ($2) in build tree S ($1) # Script generates dtb file ($3) from dts source ($2) in build tree S ($1)
S=$1 S=$1
dts=$2 dts="$2"
dtb=$3 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} dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE}
done