  Galaxies at high redshifts with strong star formation are sources of
high-energy cosmic rays. These cosmic rays interact with the baryon and
radiation fields of the galactic environment via photo-pair, photo-pion and
proton-proton processes to produce charged and neutral pions, neutrons and
protons. The cosmic rays thereby deposit energy into the interstellar medium
(ISM) as they propagate. We show how energy transport and deposition by ultra
high-energy cosmic rays is regulated by the evolution of the galaxy, in
particular by the development of the galactic magnetic field. We show how the
particle-driven energy deposition can influence the thermal evolution of the
host and its surroundings. Using a parametric protogalaxy model, we calculate
the heating effect on the ISM as the cosmic rays are increasingly confined by
the magnetic evolution of the galaxy.
