# regression check against each new kernel. Will fail if upstream changes the D0 tree:
# This compares to the version we ship (a patched version) in the 'a/hwm-bw-raspberrypi' package.
# If this fails, we need to update the patch.

rpi5dtb=/boot/dtb/broadcom/bcm2712-rpi-5-b.dtb

fdtoverlay -i ${rpi5dtb} \
   -o /tmp/d0.dtb \
   $PKG/usr/share/hwm-bw-raspberrypi/bootloader-firmware/overlays/bcm2712d0.dtbo || exit 1

diff <(dtc -q -I dtb -O dts -s /tmp/d0.dtb) \
     <(dtc -q -I dtb -O dts -s ${rpi5dtb} ) \
     || { echo "bcm2712d0 overlay out of sync with kernel"; exit 1; }
