Skip to content

Commit aed43dc

Browse files
committed
nb/amd/pi/00730F01,dsdt_top: Add hook for _PIC method
Per family 16h models 30h-3fh BKDG the IoapicSbFeatureEn must be configured according to the interrupt routing mode selecte by OS. If OS chose APIC mode, the IoapicSbFeatureEn must be cleared. Otherwise, it must be set, meaning PIC mode is used. Add a hook to _PIC method to call SoC/northbridge specific code to set/clear the bit to configure GNB IOAPIC properly. ACPI specification says that _PIC method is optional and can be called by OSPM to provide the interrupt routing mode information to the firmware. However, if the method is not called, the firmware must assume PIC mode is used. AGESA sets the IoapicSbFeatureEn already to be compliant with ACPI. Previously, coreboot cleared the bit unconditionally and left a comment to move that part to DSDT. The hook allows to clear the IoapicSbFeatureEn bit if OS chooses APIC mode for interrupt routing. Signed-off-by: Michał Żygowski <[email protected]>
1 parent c7b472a commit aed43dc

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

src/acpi/dsdt_top.asl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <vendorcode/google/chromeos/acpi/chromeos.asl>
88
#endif
99

10+
External (\_SB.PCI0.NAPE, MethodObj)
11+
1012
/* Operating system enumeration. */
1113
Name (OSYS, 0)
1214

@@ -28,6 +30,11 @@ Method (_PIC, 1)
2830
{
2931
/* Remember the OS' IRQ routing choice. */
3032
PICM = Arg0
33+
34+
If (CondRefOf (\_SB.PCI0.NAPE))
35+
{
36+
\_SB.PCI0.NAPE(Arg0 & 1)
37+
}
3138
}
3239

3340
#if CONFIG(ECAM_MMCONF_SUPPORT)

src/northbridge/amd/pi/00730F01/acpi/northbridge.asl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,36 @@ External (TOM2)
66
Name(_HID, EISAID("PNP0A08")) /* PCI Express Root Bridge */
77
Name(_CID, EISAID("PNP0A03")) /* PCI Root Bridge */
88

9+
OperationRegion (NAPC, PCI_Config, 0xF8, 0x08)
10+
Field (NAPC, DWordAcc, NoLock, Preserve)
11+
{
12+
NAPX, 32, /* Northbridge IOAPIC Index */
13+
NAPD, 32 /* Northbridge IOAPIC Data */
14+
}
15+
16+
IndexField (NAPX, NAPD, DWordAcc, NoLock, Preserve)
17+
{
18+
NAFC, 32 /* Northbridge IOAPIC Feature Control */
19+
}
20+
21+
Mutex (NAPM, 0x00)
22+
Method (NAPE, 1, NotSerialized)
23+
{
24+
Acquire (NAPM, 0xFFFF)
25+
26+
Local0 = NAFC
27+
Local0 &= 0xFFFFFFEF /* Clear IoapicSbFeatureEn for APIC mode */
28+
29+
/* Set IoapicSbFeatureEn if OS chose to use PIC mode */
30+
If (Arg0 == 0) {
31+
Local0 |= (1 << 4)
32+
}
33+
34+
NAFC = Local0
35+
36+
Release (NAPM)
37+
}
38+
939
/* Describe the Northbridge devices */
1040

1141
Method(_BBN, 0, NotSerialized) /* Bus number = 0 */

0 commit comments

Comments
 (0)