summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Include/Protocol/PciHostBridgeFixedResource.h
blob: 5b5cd5ada3540c2c3b33cd12c56f93dc90bedda4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/** @file
  EDKII PCI Host Bridge Fixed Resource Protocol.

  This protocol may be installed by a PCI host bridge driver on the same handle
  as the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL. It permits the PCI
  bus driver to inform the host bridge driver about resources below a root
  bridge that decode a fixed address range, such as BARs described by a PCI
  Enhanced Allocation capability, or PCI-PCI bridge windows that must cover
  such ranges.

  The host bridge driver must ensure that the resources it allocates to the
  root bridges in response to EfiPciHostBridgeAllocateResources do not overlap
  with the submitted fixed ranges, and must report the fixed ranges via the
  Configuration () method of the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.

  Copyright (c) 2026, Google LLC. All rights reserved.<BR>
  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#pragma once

#define EDKII_PCI_HOST_BRIDGE_FIXED_RESOURCE_PROTOCOL_GUID \
  { 0xbb465aea, 0x5165, 0x4fdf, { 0xb4, 0xb0, 0xfd, 0x3a, 0x1d, 0x4c, 0xc6, 0xd8 } }

typedef struct _EDKII_PCI_HOST_BRIDGE_FIXED_RESOURCE_PROTOCOL EDKII_PCI_HOST_BRIDGE_FIXED_RESOURCE_PROTOCOL;

/**
  Submit the fixed I/O and memory ranges decoded by devices below the
  specified PCI root bridge.

  This function must be called after EfiPciHostBridgeBeginResourceAllocation
  and before EfiPciHostBridgeAllocateResources. A subsequent call for the same
  root bridge replaces the previously submitted set of fixed ranges, as long as
  they have not been claimed yet. Fixed ranges are released by
  EfiPciHostBridgeFreeResources.

  @param[in] This              The EDKII_PCI_HOST_BRIDGE_FIXED_RESOURCE_PROTOCOL
                               instance.
  @param[in] RootBridgeHandle  The PCI root bridge below which the fixed ranges
                               are decoded.
  @param[in] Configuration     A list of ACPI QWORD address space descriptors,
                               terminated by an end tag descriptor. Each memory
                               or I/O descriptor describes a fixed range by its
                               device address in AddrRangeMin, and its size in
                               AddrLen. For memory descriptors, SpecificFlag
                               indicates whether the range is prefetchable.
                               Other fields are ignored.

  @retval EFI_SUCCESS            The fixed ranges were accepted.
  @retval EFI_INVALID_PARAMETER  RootBridgeHandle is not a handle of a root
                                 bridge produced by this host bridge.
  @retval EFI_INVALID_PARAMETER  Configuration is NULL, or contains a
                                 descriptor that is malformed or that describes
                                 a range that is not covered by an aperture of
                                 the root bridge.
  @retval EFI_ACCESS_DENIED      Fixed ranges were already claimed for this root
                                 bridge, and have not been released yet.
  @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a
                                 lack of resources.

**/
typedef
EFI_STATUS
(EFIAPI *EDKII_PCI_HOST_BRIDGE_SUBMIT_FIXED_RESOURCES)(
  IN EDKII_PCI_HOST_BRIDGE_FIXED_RESOURCE_PROTOCOL  *This,
  IN EFI_HANDLE                                     RootBridgeHandle,
  IN VOID                                           *Configuration
  );

struct _EDKII_PCI_HOST_BRIDGE_FIXED_RESOURCE_PROTOCOL {
  EDKII_PCI_HOST_BRIDGE_SUBMIT_FIXED_RESOURCES    SubmitFixedResources;
};

extern EFI_GUID  gEdkiiPciHostBridgeFixedResourceProtocolGuid;