On 04/11/13 23:38, Duane Voth wrote:
> So EDK2 changes since that original setup (October 2012 I believe, where
> I was told to "mv CirrusLogic5446.rom vgabios-cirrus.bin") have rendered
> the need for that rom obsolete, but also maybe are not backward
> compatable with that rom?  The OVMF.fd in that .zip does work with that
> rom, the OVMF.fd's that I build don't.

Indeed.

If you check out svn r11337, this is what you find:
- CirrusLogic5430Dxe depends on TimerLib,
- OvmfPkgX64.dsc builds CirrusLogic5430Dxe,
- OvmfPkgX64.dsc resolves the TimerLib dependecy of CirrusLogic5430Dxe
  with OvmfPkg/Library/AcpiTimerLib.

The resultant "CirrusLogic5446.rom" UEFI binary contains a static copy
of AcpiTimerLib *at svn r11337*, including the function
AcpiTimerLibConstructor(). Which is:

  /* OLD, at r11337 */
  RETURN_STATUS
  EFIAPI
  AcpiTimerLibConstructor (
    VOID
    )
  {
    UINT8 Device;

    Device = 1;
    // Device = 7;

    //
    // ACPI Timer enable is in Bus 0, Device ?, Function 3
    //
    PciOr8         (PCI_LIB_ADDRESS (0,Device,3,0x04), 0x01);
    PciAndThenOr32 (PCI_LIB_ADDRESS (0,Device,3,0x40), (UINT32) ~0xfc0, 0x400);
    PciOr8         (PCI_LIB_ADDRESS (0,Device,3,0x80), 0x01);  return 
RETURN_SUCCESS;
  }

Doesn't care about the current PMBA, just barges in and sets 0x400. (BTW
the mask used at that time was incorrect too.) Furthermore,

  /* OLD, at r11337 */
  STATIC
  UINT32
  InternalAcpiGetTimerTick (
    VOID
    )
  {
    return IoRead32 (0x408);
  }

(This is the origin of your disassembly.)

Worse, once AcpiTimerLibConstructor()@r11337 has run, we wouldn't even
need InternalAcpiGetTimerTick()@r11337 to hang us (ie. inside
CirrusLogic5446.rom): after the above reprogramming, which should happen
at oprom load time, our *current* InternalAcpiGetTimerTick() function
(which is very polite now, thanks to Mike's and others' recent patches)
will readily defer to the garbled PMBA:

  /* fresh, at 14242 */
  UINT32
  InternalAcpiGetTimerTick (
    VOID
    )
  {
    //
    //   Read PMBA to read and return the current ACPI timer value.
    //
    return IoRead32 ((PciRead32 (PMBA) & ~PMBA_RTE) + ACPI_TIMER_OFFSET);
  }

(I'll note that setting a breakpoint on pm_io_space_update(), host side
qemu-1.2 process, might have helped us understand, because we would have
seen PMBA programming happen twice.)

Laszlo

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to