2014-02-28 18:29:09 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
# Script generates dtb file ($3) from dts source ($2) in build tree S ($1)
|
|
|
|
S=$1
|
2014-04-30 18:02:04 +00:00
|
|
|
dts="$2"
|
|
|
|
dtb_path=$3
|
2014-02-28 18:29:09 +00:00
|
|
|
|
2014-04-30 20:52:38 +00:00
|
|
|
if [ -z "$dts" ]; then
|
2014-04-30 20:47:40 +00:00
|
|
|
echo "No DTS specified"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2014-08-30 22:39:15 +00:00
|
|
|
if [ -z "${MACHINE}" ]; then
|
|
|
|
MACHINE=$(uname -m)
|
|
|
|
fi
|
|
|
|
|
2014-04-30 18:02:04 +00:00
|
|
|
for d in ${dts}; do
|
|
|
|
dtb=${dtb_path}/`basename $d .dts`.dtb
|
|
|
|
echo "converting $d -> $dtb"
|
2014-06-10 06:24:01 +00:00
|
|
|
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 |
|
2014-02-28 22:37:35 +00:00
|
|
|
dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE}
|
2014-04-30 18:02:04 +00:00
|
|
|
done
|