diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/conf/files | 4 | ||||
-rwxr-xr-x | sys/tools/fdt/make_dtb.sh | 19 |
2 files changed, 18 insertions, 5 deletions
diff --git a/sys/conf/files b/sys/conf/files index cd33a06..226eb44 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -14,11 +14,11 @@ acpi_quirks.h optional acpi \ # from the specified source (DTS) file: <platform>.dts -> <platform>.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 -c 'MACHINE=${MACHINE} $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 \ - compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}" \ + compile-with "sh -c 'MACHINE=${MACHINE} $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}'" \ dependency "fdt_dtb_file" \ no-obj no-implicit-rule before-depend \ clean "fdt_static_dtb.h" diff --git a/sys/tools/fdt/make_dtb.sh b/sys/tools/fdt/make_dtb.sh index 900ad9b..643fdd6 100755 --- a/sys/tools/fdt/make_dtb.sh +++ b/sys/tools/fdt/make_dtb.sh @@ -4,8 +4,21 @@ # 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 | +if [ -z "$dts" ]; then + echo "No DTS specified" + exit 1 +fi + +if [ -z "${MACHINE}" ]; then + MACHINE=$(uname -m) +fi + +for d in ${dts}; do + dtb=${dtb_path}/`basename $d .dts`.dtb + echo "converting $d -> $dtb" + cpp -P -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 |