In ACPI 6.4, s6.2.13, _PRT objects describing PCI legacy interrupts can be defined following 2 models. In the first model, _PRT entries reference link devices. Link devices then describe interrupts. This allows to dynamically modify interrupts through _SRS and _PRS objects and to choose exactly the interrupt type (level/edge triggered, active high/low). In the second model, interrupt numbder are described in the _PRT entry. The interrupt type is then assumed by the OS. The Arm BSA, sE.6 "Legacy interrupts" states that PCI legacy interrupts must be converted to SPIs, and programmed level-sensitive, active high. Thus any OS must configure interrupts as such and there is no need to specify the interrupt type. Plus it is not possible to dynamically configure PCI interrupts. Thus remove the link device generation and use the second model for _PRT. Suggested-by: Ard Biesheuvel <ardb+tianocore@kernel.org> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
77 lines
1.9 KiB
C
77 lines
1.9 KiB
C
/** @file
|
|
SSDT Pcie Table Generator.
|
|
|
|
Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
@par Reference(s):
|
|
- PCI Firmware Specification - Revision 3.0
|
|
- ACPI 6.4 specification:
|
|
- s6.2.13 "_PRT (PCI Routing Table)"
|
|
- s6.1.1 "_ADR (Address)"
|
|
- linux kernel code
|
|
- Arm Base Boot Requirements v1.0
|
|
**/
|
|
|
|
#ifndef SSDT_PCIE_GENERATOR_H_
|
|
#define SSDT_PCIE_GENERATOR_H_
|
|
|
|
/** Pci address attributes.
|
|
|
|
This can also be denoted as space code, address space or ss.
|
|
*/
|
|
#define PCI_SS_CONFIG 0
|
|
#define PCI_SS_IO 1
|
|
#define PCI_SS_M32 2
|
|
#define PCI_SS_M64 3
|
|
|
|
/** Maximum Pci root complexes supported by this generator.
|
|
|
|
Note: This is not a hard limitation and can be extended if needed.
|
|
Corresponding changes would be needed to support the Name and
|
|
UID fields describing the Pci root complexes.
|
|
*/
|
|
#define MAX_PCI_ROOT_COMPLEXES_SUPPORTED 16
|
|
|
|
// _SB scope of the AML namespace.
|
|
#define SB_SCOPE "\\_SB_"
|
|
|
|
/** C array containing the compiled AML template.
|
|
This symbol is defined in the auto generated C file
|
|
containing the AML bytecode array.
|
|
*/
|
|
extern CHAR8 ssdtpcieosctemplate_aml_code[];
|
|
|
|
#pragma pack(1)
|
|
|
|
/** Structure used to map integer to an index.
|
|
*/
|
|
typedef struct MappingTable {
|
|
/// Mapping table.
|
|
/// Contains the Index <-> integer mapping
|
|
UINT32 *Table;
|
|
|
|
/// Last used index of the Table.
|
|
/// Bound by MaxIndex.
|
|
UINT32 LastIndex;
|
|
|
|
/// Number of entries in the Table.
|
|
UINT32 MaxIndex;
|
|
} MAPPING_TABLE;
|
|
|
|
/** A structure holding the Pcie generator and additional private data.
|
|
*/
|
|
typedef struct AcpiPcieGenerator {
|
|
/// ACPI Table generator header
|
|
ACPI_TABLE_GENERATOR Header;
|
|
|
|
// Private fields are defined from here.
|
|
|
|
/// Table to map: Index <-> Pci device
|
|
MAPPING_TABLE DeviceTable;
|
|
} ACPI_PCI_GENERATOR;
|
|
|
|
#pragma pack()
|
|
|
|
#endif // SSDT_PCIE_GENERATOR_H_
|