[tools][lkboot] split commandline tool and protocol code