soc/amd/picasso/acpi: Improve PCI Interrupt Link Devices
The PCI interrupt devices were only partially implemented.
* Lacked support for _DIS to disable the bus. Something the kernel does
while booting.
* Lacked support for APIC vs PIC. This means the devices can only be
used when using the PIC. By looking at the PMOD variable we can handle
both PIC and APIC. This means we can stop hard coding the PCI interrupt
numbers in the ACPI tables.
* I removed INT[E-H] since they are not used.
BUG=b:139429446, b:147042464
BRANCH=none
TEST=Boot with both the APIC and PIC and saw that the link devices work
as expected:
PIC MODE:
[ 1.959345] ACPI: PCI Interrupt Link [IRQA] (IRQs 1 3 4 5 *6 7 8 9 10 11 12 14 15)
[ 2.007344] ACPI: PCI Interrupt Link [IRQB] (IRQs 1 3 4 5 *6 7 8 9 10 11 12 14 15)
[ 2.056344] ACPI: PCI Interrupt Link [IRQC] (IRQs 1 3 4 5 6 7 8 9 10 11 12 *14 15)
[ 2.104344] ACPI: PCI Interrupt Link [IRQD] (IRQs 1 3 4 5 6 7 8 9 10 11 12 14 *15)
[ 13.752676] PCI Interrupt Link [IRQA] enabled at IRQ 6
[ 13.816755] PCI Interrupt Link [IRQD] enabled at IRQ 15
[ 27.788798] PCI Interrupt Link [IRQB] enabled at IRQ 6
[ 27.852873] PCI Interrupt Link [IRQC] enabled at IRQ 14
APIC MODE:
[ 19.311764] ACPI: PCI Interrupt Link [IRQA] (IRQs *16 17 18 19 20 21 22 23)
[ 19.374765] ACPI: PCI Interrupt Link [IRQB] (IRQs 16 *17 18 19 20 21 22 23)
[ 19.438770] ACPI: PCI Interrupt Link [IRQC] (IRQs 16 17 *18 19 20 21 22 23)
[ 19.501764] ACPI: PCI Interrupt Link [IRQD] (IRQs 16 17 18 *19 20 21 22 23)
[ 34.719072] PCI Interrupt Link [IRQA] enabled at IRQ 23
[ 34.798994] PCI Interrupt Link [IRQD] enabled at IRQ 22
[ 66.469510] PCI Interrupt Link [IRQB] enabled at IRQ 21
[ 66.542395] PCI Interrupt Link [IRQC] enabled at IRQ 20
Change-Id: I1bb84813b65c89b4b5479602be3e9a9fedb7333d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/coreboot/+/2095683
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41438
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
diff --git a/src/soc/amd/picasso/acpi/northbridge.asl b/src/soc/amd/picasso/acpi/northbridge.asl
index 3227c71..f2a709f 100644
--- a/src/soc/amd/picasso/acpi/northbridge.asl
+++ b/src/soc/amd/picasso/acpi/northbridge.asl
@@ -18,60 +18,38 @@
Return(0x0B) /* Status is visible */
}
+/* PCI Routing Table */
+Name(PR0, Package(){
+ /* Bus 0, Dev 0x00 - F2: IOMMU */
+ Package() { 0x0000FFFF, 0, INTA, 0 },
+ Package() { 0x0000FFFF, 0, INTB, 0 },
+ Package() { 0x0000FFFF, 0, INTC, 0 },
+ Package() { 0x0000FFFF, 0, INTD, 0 },
+
+ /* Bus 0, Dev 0x01 - F[1-7]: GPP PCI Bridges */
+ Package() { 0x0001FFFF, 0, INTA, 0 },
+ Package() { 0x0001FFFF, 1, INTB, 0 },
+ Package() { 0x0001FFFF, 2, INTC, 0 },
+ Package() { 0x0001FFFF, 3, INTD, 0 },
+
+ /* Bus 0, Dev 0x08 - F[1:PCI Bridge to Bus A, 2: PCI Bridge to Bus B] */
+ Package() { 0x0008FFFF, 0, INTA, 0 },
+ Package() { 0x0008FFFF, 1, INTB, 0 },
+ Package() { 0x0008FFFF, 2, INTC, 0 },
+ Package() { 0x0008FFFF, 3, INTD, 0 },
+
+ /* Bus 0, Dev 0x14 - F[0:SMBus 3:LPC] */
+ Package() { 0x0014FFFF, 0, INTA, 0 },
+ Package() { 0x0014FFFF, 1, INTB, 0 },
+ Package() { 0x0014FFFF, 2, INTC, 0 },
+ Package() { 0x0014FFFF, 3, INTD, 0 },
+})
+
Method(_PRT,0, NotSerialized)
{
- If(PMOD)
- {
- Return(APR0) /* APIC mode */
- }
- Return (PR0) /* PIC Mode */
+ Return(PR0)
}
Device(AMRT) {
Name(_ADR, 0x00000000)
} /* end AMRT */
-
-/* Gpp 0 */
-Device(PBR4) {
- Name(_ADR, 0x00020001)
- Method(_PRT,0) {
- If(PMOD){ Return(APS4) } /* APIC mode */
- Return (PS4) /* PIC Mode */
- } /* end _PRT */
-} /* end PBR4 */
-
-/* Gpp 1 */
-Device(PBR5) {
- Name(_ADR, 0x00020002)
- Method(_PRT,0) {
- If(PMOD){ Return(APS5) } /* APIC mode */
- Return (PS5) /* PIC Mode */
- } /* end _PRT */
-} /* end PBR5 */
-
-/* Gpp 2 */
-Device(PBR6) {
- Name(_ADR, 0x00020003)
- Method(_PRT,0) {
- If(PMOD){ Return(APS6) } /* APIC mode */
- Return (PS6) /* PIC Mode */
- } /* end _PRT */
-} /* end PBR6 */
-
-/* Gpp 3 */
-Device(PBR7) {
- Name(_ADR, 0x00020004)
- Method(_PRT,0) {
- If(PMOD){ Return(APS7) } /* APIC mode */
- Return (PS7) /* PIC Mode */
- } /* end _PRT */
-} /* end PBR7 */
-
-/* Gpp 4 */
-Device(PBR8) {
- Name(_ADR, 0x00020005)
- Method(_PRT,0) {
- If(PMOD){ Return(APS8) } /* APIC mode */
- Return (PS8) /* PIC Mode */
- } /* end _PRT */
-} /* end PBR8 */