From 4d6c39d4f41b4d7dbfbb1df04390ccafbc487b42 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 1 Jun 2023 23:03:13 +0200 Subject: soc/amd/picasso/acpi: rename sb_fch.asl to mmio.asl This file only contain the ACPI code describing the MMIO devices in the FCH, so rename it to mmio.asl. This also brings the Picasso ACPI code a bit more in line with the ACPI code of the newer SoCs. Signed-off-by: Felix Held Change-Id: I64490ba8e34ae1fbe6aea1ab6496b5b04ac4d0aa Reviewed-on: https://review.coreboot.org/c/coreboot/+/75591 Reviewed-by: Raul Rangel Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) --- src/soc/amd/picasso/acpi/mmio.asl | 394 ++++++++++++++++++++++++++++++++++++ src/soc/amd/picasso/acpi/sb_fch.asl | 394 ------------------------------------ src/soc/amd/picasso/acpi/soc.asl | 4 +- 3 files changed, 396 insertions(+), 396 deletions(-) create mode 100644 src/soc/amd/picasso/acpi/mmio.asl delete mode 100644 src/soc/amd/picasso/acpi/sb_fch.asl (limited to 'src') diff --git a/src/soc/amd/picasso/acpi/mmio.asl b/src/soc/amd/picasso/acpi/mmio.asl new file mode 100644 index 0000000000..c229284eb0 --- /dev/null +++ b/src/soc/amd/picasso/acpi/mmio.asl @@ -0,0 +1,394 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include +#include + +Device (AAHB) +{ + Name (_HID, "AAHB0000") + Name (_UID, 0x0) + Name (_CRS, ResourceTemplate() + { + Memory32Fixed (ReadWrite, ALINK_AHB_ADDRESS, 0x2000) + }) + Method (_STA, 0x0, NotSerialized) + { + Return (0x0b) + } +} + +Device (GPIO) +{ + Name (_HID, GPIO_DEVICE_NAME) + Name (_CID, GPIO_DEVICE_NAME) + Name (_UID, 0) + Name (_DDN, GPIO_DEVICE_DESC) + + Method (_CRS, 0) { + Local0 = ResourceTemplate() { + Interrupt ( + ResourceConsumer, + Level, + ActiveLow, + Shared, , , IRQR) + { 0 } + Memory32Fixed (ReadWrite, ACPIMMIO_GPIO0_BASE, 0x400) + } + CreateDWordField (Local0, IRQR._INT, IRQN) + If (PICM) { + IRQN = IGPI + } Else { + IRQN = PGPI + } + If (IRQN == 0x1f) { + Return (ResourceTemplate() { + Memory32Fixed (ReadWrite, ACPIMMIO_GPIO0_BASE, 0x400) + }) + } Else { + Return (Local0) + } + } + + Method (_STA, 0x0, NotSerialized) + { + Return (0x0F) + } +} + +Device (MMC0) +{ + Name (_HID, "AMDI0040") + Name (_UID, 0x0) + Method (_CRS, 0) { + Local0 = ResourceTemplate() { + Interrupt ( + ResourceConsumer, + Level, + ActiveLow, + Exclusive, , , IRQR) + { 0 } + Memory32Fixed (ReadWrite, APU_EMMC_BASE, 0x1000) + } + CreateDWordField (Local0, IRQR._INT, IRQN) + If (PICM) { + IRQN = IMMC + } Else { + IRQN = PMMC + } + If (IRQN == 0x1f) { + Return (ResourceTemplate(){ + Memory32Fixed (ReadWrite, APU_EMMC_BASE, 0x1000) + }) + } Else { + Return (Local0) + } + } + + Method (_STA, 0x0, NotSerialized) + { + Return (0x0F) + } +} + +Device (FUR0) +{ + Name (_HID, "AMDI0020") + Name (_UID, 0x0) + Method (_CRS, 0) { + Local0 = ResourceTemplate() { + Interrupt ( + ResourceConsumer, + Edge, + ActiveHigh, + Exclusive, , , IRQR) + { 0 } + Memory32Fixed (ReadWrite, APU_UART0_BASE, 0x1000) + Memory32Fixed (ReadWrite, APU_DMAC0_BASE, 0x1000) + } + CreateDWordField (Local0, IRQR._INT, IRQN) + If (PICM) { + IRQN = IUA0 + } Else { + IRQN = PUA0 + } + If (IRQN == 0x1f) { + Return (ResourceTemplate() { + Memory32Fixed (ReadWrite, APU_UART0_BASE, 0x1000) + Memory32Fixed (ReadWrite, APU_DMAC0_BASE, 0x1000) + }) + } Else { + Return (Local0) + } + } + + AOAC_DEVICE(FCH_AOAC_DEV_UART0, 0) +} + +Device (FUR1) { + Name (_HID, "AMDI0020") + Name (_UID, 0x1) + Method (_CRS, 0) { + Local0 = ResourceTemplate() { + Interrupt ( + ResourceConsumer, + Edge, + ActiveHigh, + Exclusive, , , IRQR) + { 0 } + Memory32Fixed (ReadWrite, APU_UART1_BASE, 0x1000) + Memory32Fixed (ReadWrite, APU_DMAC1_BASE, 0x1000) + } + CreateDWordField (Local0, IRQR._INT, IRQN) + If (PICM) { + IRQN = IUA1 + } Else { + IRQN = PUA1 + } + If (IRQN == 0x1f) { + Return (ResourceTemplate() { + Memory32Fixed (ReadWrite, APU_UART1_BASE, 0x1000) + Memory32Fixed (ReadWrite, APU_DMAC1_BASE, 0x1000) + }) + } Else { + Return (Local0) + } + } + + AOAC_DEVICE(FCH_AOAC_DEV_UART1, 0) +} + +Device (FUR2) { + Name (_HID, "AMDI0020") + Name (_UID, 0x2) + Method (_CRS, 0) { + Local0 = ResourceTemplate() { + Interrupt ( + ResourceConsumer, + Edge, + ActiveHigh, + Exclusive, , , IRQR) + { 0 } + Memory32Fixed (ReadWrite, APU_UART2_BASE, 0x1000) + Memory32Fixed (ReadWrite, APU_DMAC2_BASE, 0x1000) + } + CreateDWordField (Local0, IRQR._INT, IRQN) + If (PICM) { + IRQN = IUA2 + } Else { + IRQN = PUA2 + } + If (IRQN == 0x1f) { + Return (ResourceTemplate() { + Memory32Fixed (ReadWrite, APU_UART2_BASE, 0x1000) + Memory32Fixed (ReadWrite, APU_DMAC2_BASE, 0x1000) + }) + } Else { + Return (Local0) + } + } + + AOAC_DEVICE(FCH_AOAC_DEV_UART2, 0) +} + +Device (FUR3) { + Name (_HID, "AMDI0020") + Name (_UID, 0x3) + Method (_CRS, 0) { + Local0 = ResourceTemplate() { + Interrupt ( + ResourceConsumer, + Edge, + ActiveHigh, + Exclusive, , , IRQR) + { 0 } + Memory32Fixed (ReadWrite, APU_UART3_BASE, 0x1000) + Memory32Fixed (ReadWrite, APU_DMAC3_BASE, 0x1000) + } + CreateDWordField (Local0, IRQR._INT, IRQN) + If (PICM) { + IRQN = IUA3 + } Else { + IRQN = PUA3 + } + If (IRQN == 0x1f) { + Return (ResourceTemplate() { + Memory32Fixed (ReadWrite, APU_UART3_BASE, 0x1000) + Memory32Fixed (ReadWrite, APU_DMAC3_BASE, 0x1000) + }) + } Else { + Return (Local0) + } + } + + AOAC_DEVICE(FCH_AOAC_DEV_UART3, 0) +} + +#if CONFIG(PSP_LOAD_MP2_FW) +Device (I2C0) { + Name (_HID, "AMDI0011") + Name (_UID, 0x0) + Method (_CRS, 0) { + Local0 = ResourceTemplate() { + Interrupt ( + ResourceConsumer, + Edge, + ActiveHigh, + Exclusive, , , IRQR) + { 0 } + Memory32Fixed (ReadWrite, APU_I2C0_BASE, 0x1000) + } + CreateDWordField (Local0, IRQR._INT, IRQN) + If (PICM) { + IRQN = II20 + } Else { + IRQN = PI20 + } + If (IRQN == 0x1f) { + Return (ResourceTemplate() { + Memory32Fixed (ReadWrite, APU_I2C0_BASE, 0x1000) + }) + } Else { + Return (Local0) + } + } + + Method (_STA, 0x0, NotSerialized) + { + Return (0x0F) + } + + AOAC_DEVICE(5, 0) +} + +Device (I2C1) { + Name (_HID, "AMDI0011") + Name (_UID, 0x1) + Method (_CRS, 0) { + Local0 = ResourceTemplate() { + Interrupt ( + ResourceConsumer, + Edge, + ActiveHigh, + Exclusive, , , IRQR) + { 0 } + Memory32Fixed (ReadWrite, APU_I2C1_BASE, 0x1000) + } + CreateDWordField (Local0, IRQR._INT, IRQN) + If (PICM) { + IRQN = II21 + } Else { + IRQN = PI21 + } + If (IRQN == 0x1f) { + Return (ResourceTemplate() { + Memory32Fixed (ReadWrite, APU_I2C1_BASE, 0x1000) + }) + } Else { + Return (Local0) + } + } + + Method (_STA, 0x0, NotSerialized) + { + Return (0x0F) + } + + AOAC_DEVICE(6, 0) +} +#endif /* CONFIG(PSP_LOAD_MP2_FW) */ + +Device (I2C2) { + Name (_HID, "AMDI0010") + Name (_UID, 0x2) + Method (_CRS, 0) { + Local0 = ResourceTemplate() { + Interrupt ( + ResourceConsumer, + Edge, + ActiveHigh, + Exclusive, , , IRQR) + { 0 } + Memory32Fixed (ReadWrite, APU_I2C2_BASE, 0x1000) + } + CreateDWordField (Local0, IRQR._INT, IRQN) + If (PICM) { + IRQN = II22 + } Else { + IRQN = PI22 + } + If (IRQN == 0x1f) { + Return (ResourceTemplate() { + Memory32Fixed (ReadWrite, APU_I2C2_BASE, 0x1000) + }) + } Else { + Return (Local0) + } + } + + Method (_STA, 0x0, NotSerialized) + { + Return (0x0F) + } + + AOAC_DEVICE(FCH_AOAC_DEV_I2C2, 0) +} + +Device (I2C3) +{ + Name (_HID, "AMDI0010") + Name (_UID, 0x3) + Method (_CRS, 0) { + Local0 = ResourceTemplate() { + Interrupt ( + ResourceConsumer, + Edge, + ActiveHigh, + Exclusive, , , IRQR) + { 0 } + Memory32Fixed (ReadWrite, APU_I2C3_BASE, 0x1000) + } + CreateDWordField (Local0, IRQR._INT, IRQN) + If (PICM) { + IRQN = II23 + } Else { + IRQN = PI23 + } + If (IRQN == 0x1f) { + Return (ResourceTemplate() { + Memory32Fixed (ReadWrite, APU_I2C3_BASE, 0x1000) + }) + } Else { + Return (Local0) + } + } + Method (_STA, 0x0, NotSerialized) + { + Return (0x0F) + } + + AOAC_DEVICE(FCH_AOAC_DEV_I2C3, 0) +} + +Device (MISC) +{ + Name (_HID, "AMD0040") + Name (_UID, 0x3) + Name (_CRS, ResourceTemplate() { + Memory32Fixed (ReadWrite, ACPIMMIO_MISC_BASE, 0x100) + }) + Name (_DSD, Package () + { + ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () + { + Package () { "is-rv", 1 }, + }, + }) + Method (_STA, 0x0, NotSerialized) + { + Return (0x0b) + } +} diff --git a/src/soc/amd/picasso/acpi/sb_fch.asl b/src/soc/amd/picasso/acpi/sb_fch.asl deleted file mode 100644 index c229284eb0..0000000000 --- a/src/soc/amd/picasso/acpi/sb_fch.asl +++ /dev/null @@ -1,394 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include -#include - -Device (AAHB) -{ - Name (_HID, "AAHB0000") - Name (_UID, 0x0) - Name (_CRS, ResourceTemplate() - { - Memory32Fixed (ReadWrite, ALINK_AHB_ADDRESS, 0x2000) - }) - Method (_STA, 0x0, NotSerialized) - { - Return (0x0b) - } -} - -Device (GPIO) -{ - Name (_HID, GPIO_DEVICE_NAME) - Name (_CID, GPIO_DEVICE_NAME) - Name (_UID, 0) - Name (_DDN, GPIO_DEVICE_DESC) - - Method (_CRS, 0) { - Local0 = ResourceTemplate() { - Interrupt ( - ResourceConsumer, - Level, - ActiveLow, - Shared, , , IRQR) - { 0 } - Memory32Fixed (ReadWrite, ACPIMMIO_GPIO0_BASE, 0x400) - } - CreateDWordField (Local0, IRQR._INT, IRQN) - If (PICM) { - IRQN = IGPI - } Else { - IRQN = PGPI - } - If (IRQN == 0x1f) { - Return (ResourceTemplate() { - Memory32Fixed (ReadWrite, ACPIMMIO_GPIO0_BASE, 0x400) - }) - } Else { - Return (Local0) - } - } - - Method (_STA, 0x0, NotSerialized) - { - Return (0x0F) - } -} - -Device (MMC0) -{ - Name (_HID, "AMDI0040") - Name (_UID, 0x0) - Method (_CRS, 0) { - Local0 = ResourceTemplate() { - Interrupt ( - ResourceConsumer, - Level, - ActiveLow, - Exclusive, , , IRQR) - { 0 } - Memory32Fixed (ReadWrite, APU_EMMC_BASE, 0x1000) - } - CreateDWordField (Local0, IRQR._INT, IRQN) - If (PICM) { - IRQN = IMMC - } Else { - IRQN = PMMC - } - If (IRQN == 0x1f) { - Return (ResourceTemplate(){ - Memory32Fixed (ReadWrite, APU_EMMC_BASE, 0x1000) - }) - } Else { - Return (Local0) - } - } - - Method (_STA, 0x0, NotSerialized) - { - Return (0x0F) - } -} - -Device (FUR0) -{ - Name (_HID, "AMDI0020") - Name (_UID, 0x0) - Method (_CRS, 0) { - Local0 = ResourceTemplate() { - Interrupt ( - ResourceConsumer, - Edge, - ActiveHigh, - Exclusive, , , IRQR) - { 0 } - Memory32Fixed (ReadWrite, APU_UART0_BASE, 0x1000) - Memory32Fixed (ReadWrite, APU_DMAC0_BASE, 0x1000) - } - CreateDWordField (Local0, IRQR._INT, IRQN) - If (PICM) { - IRQN = IUA0 - } Else { - IRQN = PUA0 - } - If (IRQN == 0x1f) { - Return (ResourceTemplate() { - Memory32Fixed (ReadWrite, APU_UART0_BASE, 0x1000) - Memory32Fixed (ReadWrite, APU_DMAC0_BASE, 0x1000) - }) - } Else { - Return (Local0) - } - } - - AOAC_DEVICE(FCH_AOAC_DEV_UART0, 0) -} - -Device (FUR1) { - Name (_HID, "AMDI0020") - Name (_UID, 0x1) - Method (_CRS, 0) { - Local0 = ResourceTemplate() { - Interrupt ( - ResourceConsumer, - Edge, - ActiveHigh, - Exclusive, , , IRQR) - { 0 } - Memory32Fixed (ReadWrite, APU_UART1_BASE, 0x1000) - Memory32Fixed (ReadWrite, APU_DMAC1_BASE, 0x1000) - } - CreateDWordField (Local0, IRQR._INT, IRQN) - If (PICM) { - IRQN = IUA1 - } Else { - IRQN = PUA1 - } - If (IRQN == 0x1f) { - Return (ResourceTemplate() { - Memory32Fixed (ReadWrite, APU_UART1_BASE, 0x1000) - Memory32Fixed (ReadWrite, APU_DMAC1_BASE, 0x1000) - }) - } Else { - Return (Local0) - } - } - - AOAC_DEVICE(FCH_AOAC_DEV_UART1, 0) -} - -Device (FUR2) { - Name (_HID, "AMDI0020") - Name (_UID, 0x2) - Method (_CRS, 0) { - Local0 = ResourceTemplate() { - Interrupt ( - ResourceConsumer, - Edge, - ActiveHigh, - Exclusive, , , IRQR) - { 0 } - Memory32Fixed (ReadWrite, APU_UART2_BASE, 0x1000) - Memory32Fixed (ReadWrite, APU_DMAC2_BASE, 0x1000) - } - CreateDWordField (Local0, IRQR._INT, IRQN) - If (PICM) { - IRQN = IUA2 - } Else { - IRQN = PUA2 - } - If (IRQN == 0x1f) { - Return (ResourceTemplate() { - Memory32Fixed (ReadWrite, APU_UART2_BASE, 0x1000) - Memory32Fixed (ReadWrite, APU_DMAC2_BASE, 0x1000) - }) - } Else { - Return (Local0) - } - } - - AOAC_DEVICE(FCH_AOAC_DEV_UART2, 0) -} - -Device (FUR3) { - Name (_HID, "AMDI0020") - Name (_UID, 0x3) - Method (_CRS, 0) { - Local0 = ResourceTemplate() { - Interrupt ( - ResourceConsumer, - Edge, - ActiveHigh, - Exclusive, , , IRQR) - { 0 } - Memory32Fixed (ReadWrite, APU_UART3_BASE, 0x1000) - Memory32Fixed (ReadWrite, APU_DMAC3_BASE, 0x1000) - } - CreateDWordField (Local0, IRQR._INT, IRQN) - If (PICM) { - IRQN = IUA3 - } Else { - IRQN = PUA3 - } - If (IRQN == 0x1f) { - Return (ResourceTemplate() { - Memory32Fixed (ReadWrite, APU_UART3_BASE, 0x1000) - Memory32Fixed (ReadWrite, APU_DMAC3_BASE, 0x1000) - }) - } Else { - Return (Local0) - } - } - - AOAC_DEVICE(FCH_AOAC_DEV_UART3, 0) -} - -#if CONFIG(PSP_LOAD_MP2_FW) -Device (I2C0) { - Name (_HID, "AMDI0011") - Name (_UID, 0x0) - Method (_CRS, 0) { - Local0 = ResourceTemplate() { - Interrupt ( - ResourceConsumer, - Edge, - ActiveHigh, - Exclusive, , , IRQR) - { 0 } - Memory32Fixed (ReadWrite, APU_I2C0_BASE, 0x1000) - } - CreateDWordField (Local0, IRQR._INT, IRQN) - If (PICM) { - IRQN = II20 - } Else { - IRQN = PI20 - } - If (IRQN == 0x1f) { - Return (ResourceTemplate() { - Memory32Fixed (ReadWrite, APU_I2C0_BASE, 0x1000) - }) - } Else { - Return (Local0) - } - } - - Method (_STA, 0x0, NotSerialized) - { - Return (0x0F) - } - - AOAC_DEVICE(5, 0) -} - -Device (I2C1) { - Name (_HID, "AMDI0011") - Name (_UID, 0x1) - Method (_CRS, 0) { - Local0 = ResourceTemplate() { - Interrupt ( - ResourceConsumer, - Edge, - ActiveHigh, - Exclusive, , , IRQR) - { 0 } - Memory32Fixed (ReadWrite, APU_I2C1_BASE, 0x1000) - } - CreateDWordField (Local0, IRQR._INT, IRQN) - If (PICM) { - IRQN = II21 - } Else { - IRQN = PI21 - } - If (IRQN == 0x1f) { - Return (ResourceTemplate() { - Memory32Fixed (ReadWrite, APU_I2C1_BASE, 0x1000) - }) - } Else { - Return (Local0) - } - } - - Method (_STA, 0x0, NotSerialized) - { - Return (0x0F) - } - - AOAC_DEVICE(6, 0) -} -#endif /* CONFIG(PSP_LOAD_MP2_FW) */ - -Device (I2C2) { - Name (_HID, "AMDI0010") - Name (_UID, 0x2) - Method (_CRS, 0) { - Local0 = ResourceTemplate() { - Interrupt ( - ResourceConsumer, - Edge, - ActiveHigh, - Exclusive, , , IRQR) - { 0 } - Memory32Fixed (ReadWrite, APU_I2C2_BASE, 0x1000) - } - CreateDWordField (Local0, IRQR._INT, IRQN) - If (PICM) { - IRQN = II22 - } Else { - IRQN = PI22 - } - If (IRQN == 0x1f) { - Return (ResourceTemplate() { - Memory32Fixed (ReadWrite, APU_I2C2_BASE, 0x1000) - }) - } Else { - Return (Local0) - } - } - - Method (_STA, 0x0, NotSerialized) - { - Return (0x0F) - } - - AOAC_DEVICE(FCH_AOAC_DEV_I2C2, 0) -} - -Device (I2C3) -{ - Name (_HID, "AMDI0010") - Name (_UID, 0x3) - Method (_CRS, 0) { - Local0 = ResourceTemplate() { - Interrupt ( - ResourceConsumer, - Edge, - ActiveHigh, - Exclusive, , , IRQR) - { 0 } - Memory32Fixed (ReadWrite, APU_I2C3_BASE, 0x1000) - } - CreateDWordField (Local0, IRQR._INT, IRQN) - If (PICM) { - IRQN = II23 - } Else { - IRQN = PI23 - } - If (IRQN == 0x1f) { - Return (ResourceTemplate() { - Memory32Fixed (ReadWrite, APU_I2C3_BASE, 0x1000) - }) - } Else { - Return (Local0) - } - } - Method (_STA, 0x0, NotSerialized) - { - Return (0x0F) - } - - AOAC_DEVICE(FCH_AOAC_DEV_I2C3, 0) -} - -Device (MISC) -{ - Name (_HID, "AMD0040") - Name (_UID, 0x3) - Name (_CRS, ResourceTemplate() { - Memory32Fixed (ReadWrite, ACPIMMIO_MISC_BASE, 0x100) - }) - Name (_DSD, Package () - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () - { - Package () { "is-rv", 1 }, - }, - }) - Method (_STA, 0x0, NotSerialized) - { - Return (0x0b) - } -} diff --git a/src/soc/amd/picasso/acpi/soc.asl b/src/soc/amd/picasso/acpi/soc.asl index 0b520e42a9..a958570905 100644 --- a/src/soc/amd/picasso/acpi/soc.asl +++ b/src/soc/amd/picasso/acpi/soc.asl @@ -19,8 +19,8 @@ Scope(PCI0) { /* Describe PCI INT[A-H] for the Southbridge */ #include -/* Describe the devices in the Southbridge */ -#include "sb_fch.asl" +/* Describe the MMIO devices in the FCH */ +#include "mmio.asl" /* Add GPIO library */ #include -- cgit v1.2.3