fix bootloader code to make it work with new unified firmware