Commit Graph

23 Commits

Author SHA1 Message Date
Liming Gao ad13d7d2d4 OvmfPkg AcpiTables: Use PcdDebugIoPort to describe QEMU debug console
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-11-16 17:05:17 +01:00
Laszlo Ersek f1cbea148c OvmfPkg: AcpiTables: serialize control methods that create named objects
Bruce Cran reported the following issue:

  With iasl version 20150410-64 building OvmfX64 (using OvmfPkg/build.sh
  -a X64 -t GCC49 -b RELEASE) results in a couple of warnings about
  methods that should be serialized:

  .../OvmfPkg/AcpiTables/AcpiTables/OUTPUT/./Dsdt.iiii
  95:       Method (_CRS, 0) {
  Remark   2120 - Control Method should be made Serialized ^  (due to
  creation of named objects within)

  .../OvmfPkg/AcpiTables/AcpiTables/OUTPUT/./Dsdt.iiii
  235:         Method (PCRS, 1, NotSerialized) {
  Remark   2120 - Control Method should be made Serialized ^  (due to
  creation of named objects within)

The ACPI 6.0 spec justifies the above warnings in "19.6.82 Method (Declare
Control Method)":

  [...] The serialize rule can be used to prevent reentering of a method.
  This is especially useful if the method creates namespace objects.
  Without the serialize rule, the reentering of a method will fail when it
  attempts to create the same namespace object. [...]

Cc: Bruce Cran <bruce@cran.org.uk>
Reported-by: Bruce Cran <bruce@cran.org.uk>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18392 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-02 18:45:40 +00:00
jljusten 0c504abf90 OvmfPkg: set ActiveHigh polarity for the SCI with a dedicated link device
We cannot specify a pin-GSI connection for the SCI directly in the _PRT
because that implies ActiveLow polarity, clashing with both qemu and the
MADT we prepare.

With this patch the RHEL-6 guest logs the following:

    ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
    ACPI: PCI Interrupt Link [LNKS] (IRQs *9)
    ACPI: PCI Interrupt Link [LNKA] (IRQs 5 10 *11)
    ACPI: PCI Interrupt Link [LNKB] (IRQs 5 10 *11)
    ACPI: PCI Interrupt Link [LNKC] (IRQs 5 *10 11)
    ACPI: PCI Interrupt Link [LNKD] (IRQs 5 *10 11)

The patch amends svn rev 13625. Testing it in a RHEL-6 guest, the problems
described in
<http://sourceforge.net/mailarchive/message.php?msg_id=29660862> do not
reappear.

The code is derived from Paolo Bonzini's patch (originally appearing as
SeaBIOS commit f64a472a, "acpi: reintroduce LNKS"). Said original patch is
copyrighted by Red Hat (our common employer), and it has been relicensed
<http://sourceforge.net/mailarchive/message.php?msg_id=30393854> to form
the basis of this derived patch for edk2. The latter is therefore

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14111 6f19259b-4bc3-4df7-8a09-765794883524
2013-01-28 16:55:38 +00:00
jljusten 14430c55c8 OvmfPkg: create \_S3 and \_S4 packages dynamically
Move these states from the DSDT to the SSDT. Override the default
configuration if the host has the following qemu commit:

    commit 459ae5ea5ad682c2b3220beb244d4102c1a4e332
    Author: Gleb Natapov <gleb@redhat.com>
    Date:   Mon Jun 4 14:31:55 2012 +0300

        Add PIIX4 properties to control PM system states.

        This patch adds two things. First it allows QEMU to distinguish
        between regular powerdown and S4 powerdown. Later separate QMP
        notification will be added for S4 powerdown. Second it allows
        S3/S4 states to be disabled from QEMU command line. Some guests
        known to be broken with regards to power management, but allow to
        use it anyway. Using new properties management will be able to
        disable S3/S4 for such guests.

        Supported system state are passed to a firmware using new fw_cfg
        file. The file contains  6 byte array. Each byte represents one
        system state. If byte at offset X has its MSB set it means that
        system state X is supported and to enter it guest should use the
        value from lowest 3 bits.

        Signed-off-by: Gleb Natapov <gleb@redhat.com>
        Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14003 6f19259b-4bc3-4df7-8a09-765794883524
2012-12-17 02:13:14 +00:00
jljusten fb8a1b44a8 OvmfPkg: report S3 state in DSDT
The ACPI 5.0 specification says:

  7.3.4.4 System \_S3 State

  [...]
  * Dynamic RAM context is maintained.
  [...]

This corresponds to the following in the PIIX4 spec:

  PMCNTRL -- POWER MANAGEMENT CONTROL REGISTER (IO)
  [...]
  Bits[12:10]  Suspend Type
  [...]
          001  STR (Suspend To RAM)

Also, this (ie. decimal 1) is the suspend type value that qemu recognizes
as an S3 (suspend to ram) request.

Only the value for PM1a_CNT.SLP_TYP is set (PM1b_CNT.SLP_TYP is left at
zero), since in OVMF we don't report the optional PM1b_EVT_BLK register
block to OSPM. (PM1b_EVT_BLK is defined as 0 in "Platform.h"; see "4.8.1.1
PM1 Event Registers" in the ACPI 5.0 specification.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14002 6f19259b-4bc3-4df7-8a09-765794883524
2012-12-17 02:13:00 +00:00
jljusten 50399ec18f OvmfPkg: fix PIIX4 SUS_TYP value in \_S4 package
The ACPI 5.0 specification says:

  7.3.4.5 System \_S4 State

  [...]
  * DRAM context is not maintained.
  [...]

This corresponds to the following in the PIIX4 spec:

  PMCNTRL -- POWER MANAGEMENT CONTROL REGISTER (IO)
  [...]
  Bits[12:10]  Suspend Type
  [...]
          010  POSCL (Powered On Suspend, Context Lost)

Also, this (ie. decimal 2) is the default suspend type value that qemu
recognizes as an S4 (suspend to disk) request.

Only the value for PM1a_CNT.SLP_TYP is corrected (PM1b_CNT.SLP_TYP is left
at zero), since in OVMF we don't report the optional PM1b_EVT_BLK register
block to OSPM. (PM1b_EVT_BLK is defined as 0 in "Platform.h"; see "4.8.1.1
PM1 Event Registers" in the ACPI 5.0 specification.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14001 6f19259b-4bc3-4df7-8a09-765794883524
2012-12-17 02:12:44 +00:00
jljusten 4ee7f57c0e OvmfPkg: add comments to existing \_Sx packages in DSDT
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14000 6f19259b-4bc3-4df7-8a09-765794883524
2012-12-17 02:12:30 +00:00
jljusten 9388fd3d3a OvmfPkg: fix interrupt routing in the DSDT, bump revision number
Rotate links over devices and pins so that they match qemu.

PIIX4 function 3 (Power Management Module) unconditionally uses the INTA
interrupt pin. SCI from this module requires IRQ9.

Keep other assignments off IRQ9. Only IRQ5, IRQ10, IRQ11 remain for PCI
devices.

Bump OEMRevision in the DSDT.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13625 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-13 15:41:18 +00:00
jljusten cc2f2c41c8 OvmfPkg: add parallel port to the DSDT
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13624 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-13 15:41:07 +00:00
jljusten ba01f3b98f OvmfPkg: fix the _UID of \_SB.PCI0.LPC.LNKD in the DSDT
LNKD is the fourth PNP0C0F.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13623 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-13 15:40:54 +00:00
jljusten b636c6e5ff OvmfPkg: add comments to the DSDT, remove trailing empty line
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13622 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-13 15:40:43 +00:00
jljusten a42bdfccc3 OvmfPkg: _DIS and _SRS methods should have permanent effect
Kill PDIS and PSRS as they are writing to copies of PIR[A-D], not PIR[A-D]
themselves. Use specialized _DIS and _SRS methods that access PIR[A-D]
directly.

(This should be solvable by passing RefOf (PIRA) etc to PDIS/PSRS, however
the RHEL-6.3 kernel AML parser seems to choke on it. The rules described
in ACPIspec5.0 Table 19-316 "Object Storing and Copying Rules" don't seem
to work:

    ACPI Error: Needed [Integer/String/Buffer], found [Reference]
    ffff88003ee02420 (20090903/exresop-422)

    ACPI Exception: AE_AML_OPERAND_TYPE, While resolving operands for
    [OpcodeName unavailable] (20090903/dswexec-445)

    ACPI Error (psparse-0537): Method parse/execution failed
    [\_SB_.PCI0.LPC_.PDIS] (Node ffff88003f638b50), AE_AML_OPERAND_TYPE

    ACPI Error (psparse-0537): Method parse/execution failed
    [\_SB_.PCI0.LPC_.LNKA._DIS] (Node ffff88003f638a10),
    AE_AML_OPERAND_TYPE

When changing the method too, so that it writes to DerefOf (Arg0) instead
of Arg0, ie. explicitly dereferencing rather than expecting the auto-deref
to work:

    ACPI Error: Needed type [Reference], found [RegionField]
    ffff88003f639858 (20090903/exresop-104)

    ACPI Exception: AE_AML_OPERAND_TYPE, While resolving operands for
    [OpcodeName unavailable] (20090903/dswexec-445)

    ACPI Error (psparse-0537): Method parse/execution failed
    [\_SB_.PCI0.LPC_.PDIS] (Node ffff88003f638b50), AE_AML_OPERAND_TYPE

    ACPI Error (psparse-0537): Method parse/execution failed
    [\_SB_.PCI0.LPC_.LNKA._DIS] (Node ffff88003f638a10),
    AE_AML_OPERAND_TYPE

In short, when passing a RefOf, it is recognized as a reference inside the
method but mistakenly refused. When trying to deref it explicitly with
DerefOf, then it's suddenly not recognized as a reference.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13621 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-13 15:40:31 +00:00
jljusten 56daf8b90e OvmfPkg: unlike PIIX4, qemu needs ActiveHigh for interrupt sharing
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13620 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-13 15:40:19 +00:00
jljusten cc16a9298b OvmfPkg: simplify _CRS, _PRS, _SRS methods in the DSDT
Use Extended Interrupt Descriptors in the _CRS, _PRS, _SRS methods of
\_SB.PCI0.LPC.LNK[A-D], eliminating bit shifting.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13619 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-13 15:40:07 +00:00
jljusten 5e57fb754a OvmfPkg: add qemu debug console port to XTRA device
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13618 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-13 15:39:55 +00:00
jljusten 6d4f320d0c OvmfPkg: fix LAPIC RangeLength in DSDT
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13617 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-13 15:39:43 +00:00
jljusten cf98e61d1a OvmfPkg/AcpiTables/Dsdt.asl: report the PCI IO ranges set in FWDT
Based on SeaBIOS commit 2062f2ba by Gerd Hoffmann <kraxel@redhat.com>.

v3: comments on FWDT fields

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13576 6f19259b-4bc3-4df7-8a09-765794883524
2012-07-31 18:18:20 +00:00
jljusten 0228e59863 OvmfPkg/AcpiTables/Dsdt.asl: strip trailing whitespace
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13575 6f19259b-4bc3-4df7-8a09-765794883524
2012-07-31 18:18:11 +00:00
jljusten 834d3ccda0 OvmfPkg/AcpiTables: Change the ACPI PM Base Adress to 0xb000
0xb000 is the address normally used with QEMU.

0x400 also appears to conflict with some debug I/O ports
used by QEMU.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Bei Guan <gbtju85@gmail.com>
Reviewed-by: Bei Guan <gbtju85@gmail.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13279 6f19259b-4bc3-4df7-8a09-765794883524
2012-05-04 15:02:33 +00:00
jljusten b2b1699910 OvmfPkg/AcpiTables: Update GPE0 block address range for QEMU
QEMU hard codes the GPE0 registers at 0xafe0.

Previously the code assumed that the GPE0 block
would move when the PM Base Address of the PIIX4
PCI device was programmed. It appears QEMU does not
emulate this behaviour of the PIIX4 PCI device.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Bei Guan <gbtju85@gmail.com>
Reviewed-by: Bei Guan <gbtju85@gmail.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13276 6f19259b-4bc3-4df7-8a09-765794883524
2012-05-04 15:01:24 +00:00
hhtian 56d7640a53 Update the copyright notice format
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10439 6f19259b-4bc3-4df7-8a09-765794883524
2010-04-28 12:43:04 +00:00
jljusten a495774f69 Remove svn:executable on *.c, *.h, *.asm, *.S, *.inf and *.asl*
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10087 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-25 18:17:41 +00:00
jljusten 49ba9447c9 Add initial version of Open Virtual Machine Firmware (OVMF) platform.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8398 6f19259b-4bc3-4df7-8a09-765794883524
2009-05-27 21:10:18 +00:00