xref: /freebsd/sys/tools/fdt/make_dtb.sh (revision 298f5fdc242b760e70cd3494e3a4f1f50b20664d)
1#!/bin/sh
2#
3# $FreeBSD$
4
5# Script generates dtb file ($3) from dts source ($2) in build tree S ($1)
6S=$1
7dts="$2"
8dtb_path=$3
9
10if [ -z "$dts" ]; then
11    echo "No DTS specified"
12    exit 1
13fi
14
15for d in ${dts}; do
16    dtb=${dtb_path}/`basename $d .dts`.dtb
17    echo "converting $d -> $dtb"
18    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 |
19	dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE}
20done
21