Solar magnetism is believed to originate through dynamo action in the tachocline. Statistical mechanics, in turn, tells us that dynamo action is an inherent property of magnetohydrodynamic (MHD) turbulence, depending essentially on magnetic helicity. Here, we model the tachocline as a rotating, thin spherical shell containing MHD turbulence. Using this model, we find an expression for the entropy and from this develop the thermodynamics of MHD turbulence. This allows us to introduce the macroscopic parameters that affect magnetic self-organization and dynamo action, parameters that include magnetic helicity, as well as tachocline thickness and turbulent energy.