If you use the mtd write like this (-e option) the flash section (firmware) is erased 1st and your build shall work with no problem.
mtd -e firmware write openwrt-sunxi-cortexa7-xunlong_orangepi-r1-squashfs-sysupgrade.bin firmware
If you build the version with this correct configs, you shall be able to sysupgrade.
Try it!