public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: edk2-devel-01 <edk2-devel@lists.01.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>,
	Marcel Apfelbaum <marcel@redhat.com>,
	Ruiyu Ni <ruiyu.ni@intel.com>
Subject: [PATCH 2/7] OvmfPkg/IndustryStandard: define PCI Capabilities for QEMU's PCI Bridges
Date: Mon, 25 Sep 2017 21:58:19 +0200	[thread overview]
Message-ID: <20170925195824.10866-3-lersek@redhat.com> (raw)
In-Reply-To: <20170925195824.10866-1-lersek@redhat.com>

QEMU has recently gained the ability to provide various hints about its
PCI bridges. The hints take the form of vendor-specific PCI capabilities.
Define macros and types under "OvmfPkg/Include/IndustryStandard" to
describe these capabilities.

The definitions correspond to "docs/pcie_pci_bridge.txt" in the QEMU tree.
Said documentation was added in the last commit of the following series:

  a35fe226558a hw/pci: introduce pcie-pci-bridge device
  70e1ee59bb94 hw/pci: introduce bridge-only vendor-specific capability to
               provide some hints to firmware
  226263fb5cda hw/pci: add QEMU-specific PCI capability to the Generic PCI
               Express Root Port
  c1800a162765 docs: update documentation considering PCIE-PCI bridge

We are going to parse the Resource Reservation Capability in
OvmfPkg/PciHotPlugInitDxe, and return the reservation requests to
PciBusDxe.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h | 60 ++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h b/OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h
new file mode 100644
index 000000000000..bf2373c556c4
--- /dev/null
+++ b/OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h
@@ -0,0 +1,60 @@
+/** @file
+  Macro and type definitions for QEMU's Red Hat vendor-specific PCI
+  capabilities that provide various hints about PCI Bridges.
+
+  Refer to "docs/pcie_pci_bridge.txt" in the QEMU source directory.
+
+  Copyright (C) 2017, Red Hat, Inc.
+
+  This program and the accompanying materials are licensed and made available
+  under the terms and conditions of the BSD License which accompanies this
+  distribution. The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#ifndef __QEMU_PCI_BRIDGE_CAPABILITIES_H__
+#define __QEMU_PCI_BRIDGE_CAPABILITIES_H__
+
+#include <IndustryStandard/Pci23.h>
+
+//
+// The hints apply to PCI Bridges whose PCI_DEVICE_INDEPENDENT_REGION.VendorId
+// equals the following value.
+//
+#define QEMU_PCI_BRIDGE_VENDOR_ID_REDHAT 0x1B36
+
+//
+// Common capability header for all hints.
+//
+#pragma pack (1)
+typedef struct {
+  EFI_PCI_CAPABILITY_VENDOR_HDR VendorHdr;
+  UINT8                         Type;
+} QEMU_PCI_BRIDGE_CAPABILITY_HDR;
+#pragma pack ()
+
+//
+// Values defined for QEMU_PCI_BRIDGE_CAPABILITY_HDR.Type.
+//
+#define QEMU_PCI_BRIDGE_CAPABILITY_TYPE_RESOURCE_RESERVATION 0x01
+
+//
+// PCI Resource Reservation structure for when
+// QEMU_PCI_BRIDGE_CAPABILITY_HDR.Type equals
+// QEMU_PCI_BRIDGE_CAPABILITY_TYPE_RESOURCE_RESERVATION.
+//
+#pragma pack (1)
+typedef struct {
+  QEMU_PCI_BRIDGE_CAPABILITY_HDR BridgeHdr;
+  UINT32                         BusNumbers;
+  UINT64                         Io;
+  UINT32                         NonPrefetchable32BitMmio;
+  UINT32                         Prefetchable32BitMmio;
+  UINT64                         Prefetchable64BitMmio;
+} QEMU_PCI_BRIDGE_CAPABILITY_RESOURCE_RESERVATION;
+#pragma pack ()
+
+#endif
-- 
2.14.1.3.gb7cf6e02401b




  parent reply	other threads:[~2017-09-25 19:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25 19:58 [PATCH 0/7] OvmfPkg/PciHotPlugInitDxe: obey PCI resource reservation hints from QEMU Laszlo Ersek
2017-09-25 19:58 ` [PATCH 1/7] MdePkg/IndustryStandard/Pci23: add vendor-specific capability header Laszlo Ersek
2017-09-27  6:26   ` Gao, Liming
2017-09-25 19:58 ` Laszlo Ersek [this message]
2017-09-25 19:58 ` [PATCH 3/7] OvmfPkg/PciHotPlugInitDxe: clean up protocol usage comment Laszlo Ersek
2017-09-25 19:58 ` [PATCH 4/7] OvmfPkg/PciHotPlugInitDxe: clean up addr. range for non-prefetchable MMIO Laszlo Ersek
2017-09-25 19:58 ` [PATCH 5/7] OvmfPkg/PciHotPlugInitDxe: generalize RESOURCE_PADDING composition Laszlo Ersek
2017-09-25 19:58 ` [PATCH 6/7] OvmfPkg/PciHotPlugInitDxe: add helper functions for setting up paddings Laszlo Ersek
2017-09-25 19:58 ` [PATCH 7/7] OvmfPkg/PciHotPlugInitDxe: translate QEMU's resource reservation hints Laszlo Ersek
2017-10-02 17:43   ` Jordan Justen
2017-10-02 20:00     ` Laszlo Ersek
2017-10-03 14:09 ` [PATCH 0/7] OvmfPkg/PciHotPlugInitDxe: obey PCI resource reservation hints from QEMU Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170925195824.10866-3-lersek@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox