xilinx: Move bootmode detection to separate function