We propose a model for motor proteins based on a hierarchical Hamiltonian that we have previously introduced to describe protein folding. The proposed motor model has high efficiency and is consistent with a linear load-velocity response. The main improvement with respect to previous models is that this description suggests a connection between folding and function of allosteric proteins.