2018-03-24 21:30:24 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
# Script generates dtbo file ($3) from dtso source ($2) in build tree S ($1)
|
|
|
|
S=$1
|
|
|
|
dtso="$2"
|
|
|
|
dtbo_path=$3
|
|
|
|
|
|
|
|
if [ -z "$dtso" ]; then
|
|
|
|
echo "No DTS overlays specified"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${MACHINE}" ]; then
|
|
|
|
MACHINE=$(uname -m)
|
|
|
|
fi
|
|
|
|
|
2018-12-14 23:53:28 +00:00
|
|
|
: "${DTC:=dtc}"
|
|
|
|
: "${ECHO:=echo}"
|
|
|
|
: "${CPP:=cpp}"
|
2018-03-24 21:30:24 +00:00
|
|
|
|
|
|
|
for d in ${dtso}; do
|
2018-12-14 23:53:28 +00:00
|
|
|
dtb="${dtbo_path}/$(basename "$d" .dtso).dtbo"
|
2018-11-09 18:56:40 +00:00
|
|
|
${ECHO} "converting $d -> $dtb"
|
2018-12-14 23:53:28 +00:00
|
|
|
${CPP} -P -x assembler-with-cpp -I "$S/gnu/dts/include" -I "$S/dts/${MACHINE}" -I "$S/gnu/dts/${MACHINE}" -include "$d" /dev/null |
|
|
|
|
${DTC} -@ -O dtb -o "$dtb" -i "$S/dts/${MACHINE}" -i "$S/gnu/dts/${MACHINE}"
|
2018-03-24 21:30:24 +00:00
|
|
|
done
|