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
|
|
|
|
|
2018-12-14 23:53:28 +00:00
|
|
|
: "${DTC:=dtc}"
|
|
|
|
: "${ECHO:=echo}"
|
|
|
|
: "${CPP:=cpp}"
|
2017-06-17 23:34:53 +00:00
|
|
|
|
2014-04-30 18:02:04 +00:00
|
|
|
for d in ${dts}; do
|
2018-12-14 23:53:28 +00:00
|
|
|
dtb="${dtb_path}/$(basename "$d" .dts).dtb"
|
2021-10-16 03:11:46 +00:00
|
|
|
${CPP} -P -x assembler-with-cpp -I "$S/dts/include" -I "$S/contrib/device-tree/include" -I "$S/dts/${MACHINE}" -I "$S/contrib/device-tree/src/${MACHINE}" -I "$S/contrib/device-tree/src/" -include "$d" -include "$S/dts/freebsd-compatible.dts" /dev/null |
|
2021-01-15 14:28:46 +00:00
|
|
|
${DTC} -@ -O dtb -o "$dtb" -b 0 -p 1024 -i "$S/dts/${MACHINE}" -i "$S/contrib/device-tree/src/${MACHINE}" -i "$S/contrib/device-tree/src/"
|
2014-04-30 18:02:04 +00:00
|
|
|
done
|