On 11/11/14 22:34, Gabriel Somlo wrote: > On Sun, Nov 09, 2014 at 10:13:54AM -0800, Jordan Justen wrote: >> On 2014-11-08 14:02:00, Gabriel L. Somlo wrote: >>> Since in OVMF both PEI_CORE and PEIM run from RAM, and thus may >>> utilize global variables, use the "Base" AcpiTimerLib instance >>> (instead of BaseRom) to take advantage of the improved efficiency >>> of storing the timer register IO address in a global variable. >>> >>> This leaves only SEC using the BaseRomAcpiTimerLib instance. >>> >>> Contributed-under: TianoCore Contribution Agreement 1.0 >>> Signed-off-by: Gabriel Somlo <[email protected]> >>> --- >>> >>> [...] >>> >>> + // >>> + // Check to see if the Power Management Base Address is already enabled >>> + // >>> + if ((PciRead8 (PmRegMisc) & PMIOSE) == 0) { >>> + // >>> + // If the Power Management Base Address is not programmed, >>> + // then program the Power Management Base Address from a PCD. >>> + // >>> + PciAndThenOr32 (Pmba, (UINT32) ~0xFFC0, PcdGet16 >>> (PcdAcpiPmBaseAddress)); >>> + >>> + // >>> + // Enable PMBA I/O port decodes in PMREGMISC >>> + // >>> + PciOr8 (PmRegMisc, PMIOSE); >> >> Wouldn't the 'Rom' version program this during SEC? >> >> I don't think we should access the PCD in BaseAcpiTimerLib. > > I seem to remember someone earlier in the thread mentioning that it's > possible for SEC *not* to run, in which case it's PEI's job to enable > PMBA. Laszlo ? :)
SEC always runs, but whether or not SEC depends on TimerLib is conditional on -D SOURCE_DEBUG_ENABLE. If it is absent, then the debug agent is not pulled in (*), and then SEC doesn't inherit the TimerLib dependency, and the BaseRomAcpiTimerLib constructor won't run in SEC. (*) Meaning, DebugAgentLib is resolved to DebugAgentLibNull as opposed to SecPeiDebugAgentLib. Please see <http://thread.gmane.org/gmane.comp.bios.tianocore.devel/10859/focus=10897>. Jordan -- can you please go through that message, and see if you agree. If we disagree on points in that message, we need to sort out that first; otherwise we'll jerk Gabriel in different directions. Thanks! Laszlo ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
