Renewable energy generators give rise to large and frequent supply-demand power imbalances in modern power systems. In this volatile environment, secondary frequency control (SFC) is becoming a critical functionality of real-time operations and should be now carried out with higher economic efficiency. Motivated by that, in this paper we design an optimal frequency control (OFC) architecture that can be adopted in lieu of the current Automatic Generation Control (AGC) scheme enabling generators and demand response (DR) units to jointly carry out optimal frequency regulation with minimum generation cost and user disutility. The OFC algorithm can improve the economic efficiency of the secondary control layer by allowing the secondary control set-points to converge online to their optimal values. Interestingly, we show that the overall system composed of the physical network and OFC algorithm dynamics is passive. By leveraging this passivity property we establish global asymptotic stability of the equilibrium of the overall system. Our passivity-based methodology is scalable and computationally efficient and can be used to establish guarantees for the performance of a power network that adopts the proposed OFC algorithm particularly attractive for large- scale applications.