2014-11-14 01:37:16 +01:00
|
|
|
/** @file
|
|
|
|
OVMF Platform definitions
|
|
|
|
|
2015-05-13 11:31:10 +02:00
|
|
|
Copyright (C) 2015, Red Hat, Inc.
|
2014-11-14 01:37:16 +01:00
|
|
|
Copyright (c) 2014, Gabriel L. Somlo <somlo@cmu.edu>
|
|
|
|
|
2019-04-04 01:06:33 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2014-11-14 01:37:16 +01:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __OVMF_PLATFORMS_H__
|
|
|
|
#define __OVMF_PLATFORMS_H__
|
|
|
|
|
|
|
|
#include <Library/PciLib.h>
|
|
|
|
#include <IndustryStandard/Pci22.h>
|
2015-05-13 11:31:10 +02:00
|
|
|
#include <IndustryStandard/Q35MchIch9.h>
|
|
|
|
#include <IndustryStandard/I440FxPiix4.h>
|
2020-04-30 03:12:12 +02:00
|
|
|
#include <IndustryStandard/Bhyve.h>
|
2021-09-08 11:01:14 +02:00
|
|
|
#include <IndustryStandard/Microvm.h>
|
2021-12-10 15:41:54 +01:00
|
|
|
#include <IndustryStandard/CloudHv.h>
|
2014-11-14 01:37:16 +01:00
|
|
|
|
|
|
|
//
|
|
|
|
// OVMF Host Bridge DID Address
|
|
|
|
//
|
|
|
|
#define OVMF_HOSTBRIDGE_DID \
|
|
|
|
PCI_LIB_ADDRESS (0, 0, 0, PCI_DEVICE_ID_OFFSET)
|
|
|
|
|
2016-05-09 19:26:37 +02:00
|
|
|
//
|
|
|
|
// Values we program into the PM base address registers
|
|
|
|
//
|
|
|
|
#define PIIX4_PMBA_VALUE 0xB000
|
OvmfPkg: introduce ICH9_PMBASE_VALUE
According to the ICH9 spec, PMBASE "provides 128 bytes of I/O space for
ACPI, GPIO, and TCO logic. This is placed on a 128-byte boundary".
On the Q35 machine type of QEMU, our current PMBASE setting of 0xB000 is
the only thing that prevents us from lowering the base of the PCI IO port
aperture from 0xC000. (The base must be aligned to 0x1000 due to PCI
bridge requirements.)
By moving our PMBASE to 0x0600 (moving the register block to
0x0600..0x067F inclusive), which is also what SeaBIOS uses on Q35, we will
be able to lower the PCI IO port aperture base to 0x6000 (the next IO port
under it being taken by the "vmport" device, at fixed 0x5658), while
steering clear of other QEMU devices.
On PIIX4, freeing up the 0x1000 IO ports at 0xB000 wouldn't help much,
because the 0xA000 block right below it is occupied by unmovable devices
(see <https://bugzilla.redhat.com/show_bug.cgi?id=1333238#c19> for
details).
Doing this for Q35 only has two more benefits:
- It won't interfere with Xen guests,
- The Q35 machine type with the smallest version number is "pc-q35-2.4",
which is guaranteed to have an ACPI generator. This matters because the
ACPI tables (FACP, DSDT) have to reflect the PM base address that we
program.
Cc: Gabriel Somlo <somlo@cmu.edu>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1333238
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
2016-05-09 19:46:00 +02:00
|
|
|
#define ICH9_PMBASE_VALUE 0x0600
|
2016-05-09 19:26:37 +02:00
|
|
|
|
2015-05-13 11:31:53 +02:00
|
|
|
//
|
|
|
|
// Common bits in same-purpose registers
|
|
|
|
//
|
|
|
|
#define PMBA_RTE BIT0
|
|
|
|
|
|
|
|
//
|
|
|
|
// Common IO ports relative to the Power Management Base Address
|
|
|
|
//
|
|
|
|
#define ACPI_TIMER_OFFSET 0x8
|
|
|
|
|
2014-11-14 01:37:16 +01:00
|
|
|
#endif
|