2021-01-21 07:17:00 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2021-01-19 13:12:19 +01:00
|
|
|
|
|
|
|
#include <acpi/acpigen_extern.asl>
|
2021-01-12 14:23:25 +01:00
|
|
|
|
2021-02-10 16:53:34 +01:00
|
|
|
#if CONFIG(CHROMEOS_NVS)
|
2022-06-28 18:36:23 +02:00
|
|
|
/* ChromeOS specific */
|
2021-01-20 22:02:16 +01:00
|
|
|
#include <vendorcode/google/chromeos/acpi/chromeos.asl>
|
2021-01-12 14:23:25 +01:00
|
|
|
#endif
|
2021-01-15 12:46:11 +01:00
|
|
|
|
2020-12-29 08:04:30 +01:00
|
|
|
/* Operating system enumeration. */
|
|
|
|
Name (OSYS, 0)
|
|
|
|
|
2022-12-26 09:43:07 +01:00
|
|
|
/* 0 => PIC mode, 1 => APIC Mode */
|
|
|
|
Name (PICM, 0)
|
2021-01-25 16:05:35 +01:00
|
|
|
|
2021-01-15 12:46:11 +01:00
|
|
|
/* Power state (AC = 1) */
|
2022-12-26 08:45:56 +01:00
|
|
|
Name (PWRS, 1)
|
2021-01-25 16:05:35 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The _PIC method is called by the OS to choose between interrupt
|
|
|
|
* routing via the i8259 interrupt controller or the APIC.
|
|
|
|
*
|
|
|
|
* _PIC is called with a parameter of 0 for i8259 configuration and
|
|
|
|
* with a parameter of 1 for Local Apic/IOAPIC configuration.
|
|
|
|
*/
|
|
|
|
|
|
|
|
Method (_PIC, 1)
|
|
|
|
{
|
|
|
|
/* Remember the OS' IRQ routing choice. */
|
|
|
|
PICM = Arg0
|
|
|
|
}
|
2021-02-13 23:06:39 +01:00
|
|
|
|
2021-10-21 00:43:45 +02:00
|
|
|
#if CONFIG(ECAM_MMCONF_SUPPORT)
|
2021-02-14 05:58:39 +01:00
|
|
|
Scope(\_SB) {
|
|
|
|
/* Base address of PCIe config space */
|
2021-10-21 00:43:45 +02:00
|
|
|
Name(PCBA, CONFIG_ECAM_MMCONF_BASE_ADDRESS)
|
2021-02-13 23:06:39 +01:00
|
|
|
|
2021-02-14 05:58:39 +01:00
|
|
|
/* Length of PCIe config space, 1MB each bus */
|
2021-10-21 00:43:45 +02:00
|
|
|
Name(PCLN, CONFIG_ECAM_MMCONF_LENGTH)
|
2021-02-14 05:58:39 +01:00
|
|
|
|
|
|
|
/* PCIe Configuration Space */
|
|
|
|
OperationRegion(PCFG, SystemMemory, PCBA, PCLN) /* Each bus consumes 1MB */
|
2023-06-08 15:22:27 +02:00
|
|
|
|
|
|
|
/* From the Linux documentation (Documentation/PCI/acpi-info.rst):
|
|
|
|
* [6] PCI Firmware 3.2, sec 4.1.2:
|
|
|
|
* If the operating system does not natively comprehend reserving the
|
|
|
|
* MMCFG region, the MMCFG region must be reserved by firmware. The
|
|
|
|
* address range reported in the MCFG table or by _CBA method (see Section
|
|
|
|
* 4.1.3) must be reserved by declaring a motherboard resource. For most
|
|
|
|
* systems, the motherboard resource would appear at the root of the ACPI
|
|
|
|
* namespace (under \_SB) in a node with a _HID of EISAID (PNP0C02), and
|
|
|
|
* the resources in this case should not be claimed in the root PCI bus's
|
|
|
|
* _CRS. The resources can optionally be returned in Int15 E820 or
|
|
|
|
* EFIGetMemoryMap as reserved memory but must always be reported through
|
|
|
|
* ACPI as a motherboard resource.
|
|
|
|
*/
|
|
|
|
Device (PERC) // PCI ECAM Resource Consumption
|
|
|
|
{
|
|
|
|
Name (_HID, EisaId("PNP0C02"))
|
|
|
|
Name (_CRS, ResourceTemplate()
|
|
|
|
{
|
|
|
|
Memory32Fixed (ReadWrite, CONFIG_ECAM_MMCONF_BASE_ADDRESS,
|
|
|
|
CONFIG_ECAM_MMCONF_LENGTH)
|
|
|
|
})
|
|
|
|
}
|
2021-02-14 05:58:39 +01:00
|
|
|
}
|
2021-02-13 23:06:39 +01:00
|
|
|
#endif
|