On Wed, 12 Nov 2014 12:23:04 +0100, Laszlo Ersek <[email protected]> wrote:
> 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:
> >>> +  //
> >>> +  // 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.

Ah, I remember now :)

> (*) 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.

So, before I even touched anything, PMBA was being enabled either from
AcpiTimerLib.c, or from PlatformPei/Platform.c, in MiscInitialization().

Commit d3a24ff5 removed a prior "mPmba" global from AcpiTimerLib.c to
make it work when used from SEC due to SOURCE_DEBUG_ENABLE being set.

So basically there appear to be three ways for PMBA to require being
enabled, of which SEC is an infrequent (but possible) one.

Thanks,
--Gabriel

------------------------------------------------------------------------------
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

Reply via email to