freebsd-dev/sys/tools/fdt/make_dtb.sh
Adrian Chadd 8e53cd7099 ipq4018: add TCSR definitions from Linux.
These are hardware configuration options which are required in
the linux/openwrt device trees for the IPQ4018/IPQ4019 devices.

Since this isn't obtained from linux upstream but instead from
openwrt, this can't go in contrib; instead it is going in
sys/dts/include/ .

Obtained from: OpenWRT

Tested:

* IPQ4019 ASUS RT-AC58U AP, initial bootstrapping
2021-10-18 19:18:01 +00:00

29 lines
808 B
Bash
Executable File

#!/bin/sh
#
# $FreeBSD$
# Script generates dtb file ($3) from dts source ($2) in build tree S ($1)
S=$1
dts="$2"
dtb_path=$3
if [ -z "$dts" ]; then
echo "No DTS specified"
exit 1
fi
if [ -z "${MACHINE}" ]; then
MACHINE=$(uname -m)
fi
: "${DTC:=dtc}"
: "${ECHO:=echo}"
: "${CPP:=cpp}"
for d in ${dts}; do
dtb="${dtb_path}/$(basename "$d" .dts).dtb"
${ECHO} "converting $d -> $dtb"
${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 |
${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/"
done