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"
|
2021-01-15 14:28:46 +00:00
|
|
|
${CPP} -P -x assembler-with-cpp -I "$S/contrib/device-tree/include" -I "$S/dts/${MACHINE}" -I "$S/contrib/device-tree/src/${MACHINE}" -include "$d" /dev/null |
|
|
|
|
${DTC} -@ -O dtb -o "$dtb" -i "$S/dts/${MACHINE}" -i "$S/contrib/device-tree/src/${MACHINE}"
|
2018-03-24 21:30:24 +00:00
|
|
|
done
|