How to create a customized u-boot that is loaded with the cape information

Hey everyone

I have a project that uses BBG and a customized cape with antenna to sniff wireless packets.
It worked okay with the old kernel from 2017, but it had some bugs of dropping packets if the packet rate was too high.

After some debugging, I thought the bug was located in the kernel driver level and I thought about upgrading it the latest one and try again.
I have successfully upgraded the kernel and I tried to initialize the cape(sniffer) as below. However, after initialization, BBG won’t boot up with the cape on top.(If it is removed, BBG can boot up as normal)

function setup_sniffer()
{
  sed -i -e "s:enable_uboot_cape_universal=1:#enable_uboot_cape_universal=1:g" /boot/uEnv.txt
  sed -i -e "s:enable_uboot_overlays=1:#enable_uboot_overlays=1:g" /boot/uEnv.txt
  sed -i -e "s:#dtb=:dtb=am335x-bonegreen-overlay-NI2C2.dtb:g" /boot/uEnv.txt
  dtc -I dts /home/debian/dtree/blobs/am335x-bonegreen-overlay-ni2i2.dts -O dtb -o /boot/dtbs/4.19.94-ti-r42/am335x-bonegreen-overlay-ni2c2.dtb
  cd /home/debian/driver
  make clean
  make

  cd /home/debian/dtree
  ./load_all.sh

  cd /home/debian
}

In load_all.sh, it loads all the DT files.
#!/bin/bash
FILES=/home/debian/dtree/src/*
for f in $FILES
do
  if [[ $f == *dts ]]
  then
    echo "Compiling $f ..."
    filename=$(basename $f .dts)
    capename=$(basename $filename -00A0)
    dtc -o /home/debian/dtree/blobs/$(basename $f .dts).dtbo  -b 0 -@ $f
    cp /home/debian/dtree/blobs/$(basename $f .dts).dtbo /lib/firmware
  fi 
done 

All the .dts files I used is put here
After some investigation, the main problem could be the latest kernel doesn’t support overlays any more.
It used to load directly from the right overlay, now this needs to be done in uboot.
I don’t have the eeprom for providing default cap configuration and this may make detection by uboot difficult.

Do you know how to create a customized u-boot that is loaded with the cape information?

Thank you in advance

BR/Marco