1 .. SPDX-License-Identifier: GPL-2.0 2 3 ======================================== 4 ACPI considerations for PCI host bridges 5 ======================================== 6 7 The general rule is that the ACPI namespace sh 8 OS might use unless there's another way for th 9 10 For example, there's no standard hardware mech 11 host bridges, so the ACPI namespace must descr 12 method for accessing PCI config space below it 13 the host bridge forwards to PCI (using _CRS), 14 INTx interrupts (using _PRT). 15 16 PCI devices, which are below the host bridge, 17 described via ACPI. The OS can discover them 18 enumeration mechanism, using config accesses t 19 devices and read and size their BARs. However 20 devices if it provides power management or hot 21 or if the device has INTx interrupts connected 22 controllers and a _PRT is needed to describe t 23 24 ACPI resource description is done via _CRS obj 25 namespace [2]. The _CRS is like a generalize 26 _CRS and figure out what resource is being con 27 a driver for the device [3]. That's important 28 can work correctly even on a system with new d 29 The new devices might not do anything, but the 30 resources conflict with them. 31 32 Static tables like MCFG, HPET, ECDT, etc., are 33 reserving address space. The static tables ar 34 know early in boot, before it can parse the AC 35 is defined, an old OS needs to operate correct 36 table. _CRS allows that because it is generic 37 OS; a static table does not. 38 39 If the OS is expected to manage a non-discover 40 ACPI, that device will have a specific _HID/_C 41 driver to bind to it, and the _CRS tells the O 42 device's registers are. 43 44 PCI host bridges are PNP0A03 or PNP0A08 device 45 describe all the address space they consume. 46 they forward down to the PCI bus, as well as r 47 itself that are not forwarded to PCI. The hos 48 things like secondary/subordinate bus register 49 range below the bridge, window registers that 50 These are all device-specific, non-architected 51 PNP0A03/PNP0A08 driver can manage them is via 52 the device-specific details. The host bridge 53 space, since it is consumed by the host bridge 54 55 ACPI defines a Consumer/Producer bit to distin 56 ("Consumer") from the bridge apertures ("Produ 57 BIOSes didn't use that bit correctly. The res 58 spec defines Consumer/Producer only for the Ex 59 descriptors; the bit should be ignored in the 60 Address Space descriptors. Consequently, OSes 61 QWord/DWord/Word descriptors are windows. 62 63 Prior to the addition of Extended Address Spac 64 Consumer/Producer meant there was no way to de 65 the PNP0A03/PNP0A08 device itself. The workar 66 bridge registers (including ECAM space) in PNP 67 With the exception of ECAM, the bridge registe 68 anyway, so the generic PNP0A03/PNP0A08 driver 69 know about it. 70 71 New architectures should be able to use "Consu 72 descriptors in the PNP0A03 device for bridge r 73 although a strict interpretation of [6] might 74 ia64 kernels assume all address space descript 75 Extended Address Space ones, are windows, so i 76 describe bridge registers this way on those ar 77 78 PNP0C02 "motherboard" devices are basically a 79 programming model for them other than "don't u 80 anything else." So a PNP0C02 _CRS should clai 81 (1) not claimed by _CRS under any other device 82 and (2) should not be assigned by the OS to so 83 84 The PCIe spec requires the Enhanced Configurat 85 unless there's a standard firmware interface f 86 ia64 SAL interface [7]. A host bridge consume 87 and converts memory accesses into PCI configur 88 defines the ECAM address space layout and func 89 the address space is device-specific. An ACPI 90 from either the static MCFG table or a _CBA me 91 92 The MCFG table must describe the ECAM space of 93 bridges [8]. Since MCFG is a static table and 94 a _CBA method in the PNP0A03 device describes 95 hot-pluggable host bridge [9]. Note that for 96 address always corresponds to bus 0, even if t 97 (which is reported via _CRS) doesn't start at 98 99 100 [1] ACPI 6.2, sec 6.1: 101 For any device that is on a non-enumerable 102 ISA bus), OSPM enumerates the devices' ide 103 system firmware must supply an _HID object 104 enable OSPM to do that. 105 106 [2] ACPI 6.2, sec 3.7: 107 The OS enumerates motherboard devices simp 108 ACPI Namespace looking for devices with ha 109 110 Each device enumerated by ACPI includes AC 111 ACPI Namespace that report the hardware re 112 occupy [_PRS], an object that reports the 113 used by the device [_CRS], and objects for 114 [_SRS]. The information is used by the Pl 115 configure the devices. 116 117 [3] ACPI 6.2, sec 6.2: 118 OSPM uses device configuration objects to 119 for devices enumerated via ACPI. Device c 120 information about current and possible res 121 relationship between shared resources, and 122 hardware resources. 123 124 When OSPM enumerates a device, it calls _P 125 requirements of the device. It may also c 126 resource settings for the device. Using t 127 Play system determines what resources the 128 sets those resources by calling the device 129 130 In ACPI, devices can consume resources (fo 131 provide resources (for example, a propriet 132 Unless otherwise specified, resources for 133 taken from the nearest matching resource a 134 hierarchy. 135 136 [4] ACPI 6.2, sec 6.4.3.5.1, 2, 3, 4: 137 QWord/DWord/Word Address Space Descriptor 138 General Flags: Bit [0] Ignored 139 140 Extended Address Space Descriptor (.4) 141 General Flags: Bit [0] Consumer/Producer 142 143 * 1 – This device consumes this reso 144 * 0 – This device produces and consu 145 146 [5] ACPI 6.2, sec 19.6.43: 147 ResourceUsage specifies whether the Memory 148 this device (ResourceConsumer) or passed o 149 (ResourceProducer). If nothing is specifi 150 ResourceConsumer is assumed. 151 152 [6] PCI Firmware 3.2, sec 4.1.2: 153 If the operating system does not natively 154 MMCFG region, the MMCFG region must be res 155 address range reported in the MCFG table o 156 4.1.3) must be reserved by declaring a mot 157 systems, the motherboard resource would ap 158 namespace (under \_SB) in a node with a _H 159 the resources in this case should not be c 160 _CRS. The resources can optionally be ret 161 EFIGetMemoryMap as reserved memory but mus 162 ACPI as a motherboard resource. 163 164 [7] PCI Express 4.0, sec 7.2.2: 165 For systems that are PC-compatible, or tha 166 processor-architecture-specific firmware i 167 access to the Configuration Space, the ECA 168 this section. 169 170 [8] PCI Firmware 3.2, sec 4.1.2: 171 The MCFG table is an ACPI table that is us 172 addresses corresponding to the non-hot rem 173 range within a PCI Segment Group available 174 boot. This is required for the PC-compatib 175 176 The MCFG table is only used to communicate 177 corresponding to the PCI Segment Groups av 178 boot. 179 180 [9] PCI Firmware 3.2, sec 4.1.3: 181 The _CBA (Memory mapped Configuration Base 182 an optional ACPI object that returns the 6 183 configuration base address for the hot plu 184 base address returned by _CBA is processor 185 control method evaluates to an Integer. 186 187 This control method appears under a host b 188 method appears under an active host bridge 189 evaluates this structure to identify the m 190 base address corresponding to the PCI Segm 191 range specified in _CRS method. An ACPI na 192 the _CBA method must also contain a corres
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.