  We present a unified study of the effect of periodic, quasiperiodic and
disordered potentials on topological phases that are characterized by Majorana
end modes in 1D p-wave superconducting systems. We define a topological
invariant derived from the equations of motion for Majorana modes and, as our
first application, employ it to characterize the phase diagram for simple
periodic structures. Our general result is a relation between the topological
invariant and the normal state localization length. This link allows us to
leverage the considerable literature on localization physics and obtain the
topological phase diagrams and their salient features for quasiperiodic and
disordered systems for the entire region of parameter space.
