soc/amd/common: Add ACP device to common block graphics driver

Supports a brand new ACP driver for STONEY / Grunt chromebooks.
AMD's Audio CoProcessor handles i2s/tdm audio, and is located on the
GPU.

On Windows the PCIe device for the GPU is owned by the AMD proprietary
driver, hence a separate device has to be added for the ACP driver.

Fortunately since IOMMU is disabled on STONEY, the driver itself can
pull BAR5 from the GPU and use that to initialize, so no special
configuration is required in ACPI other than the ID.

Change-Id: I0e31c3b31fa9fb99578c04b79fce2d8c1d695561
Signed-off-by: CoolStar <coolstarorganization@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78430
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
CoolStar 2023-10-17 10:53:20 -07:00 committed by Felix Held
parent 05a50d7e13
commit 970a62fcf9
2 changed files with 22 additions and 0 deletions

View File

@ -26,3 +26,10 @@ config USE_SELECTIVE_GOP_INIT
Select this option to only run the FSP GOP driver when needed for pre-OS display init Select this option to only run the FSP GOP driver when needed for pre-OS display init
(eg, Recovery and Developer Modes). Otherwise, use cached VBIOS/ATOMBIOS tables. (eg, Recovery and Developer Modes). Otherwise, use cached VBIOS/ATOMBIOS tables.
Selecting this option will save approx. 130ms boot time on the normal boot path. Selecting this option will save approx. 130ms boot time on the normal boot path.
config SOC_AMD_COMMON_BLOCK_GRAPHICS_ACP
bool
depends on SOC_AMD_COMMON_BLOCK_GRAPHICS
help
Select this option to provide Audio CoProcessor ACPI device for pre-Ryzen APUs for
use by custom Windows drivers.

View File

@ -114,6 +114,18 @@ static void generate_atif(const struct device *dev)
acpigen_pop_len(); /* Scope */ acpigen_pop_len(); /* Scope */
} }
static void generate_acp(const struct device *dev)
{
/* Scope (\_SB.PCI0.IGFX) */
acpigen_write_scope(acpi_device_path(dev));
acpigen_write_device("ACP");
acpigen_write_name_string("_HID", "BOOT0003");
acpigen_pop_len(); /* Device */
acpigen_pop_len(); /* Scope */
}
static void graphics_fill_ssdt(const struct device *dev) static void graphics_fill_ssdt(const struct device *dev)
{ {
acpi_device_write_pci_dev(dev); acpi_device_write_pci_dev(dev);
@ -124,6 +136,9 @@ static void graphics_fill_ssdt(const struct device *dev)
if (CONFIG(SOC_AMD_COMMON_BLOCK_GRAPHICS_ATIF)) if (CONFIG(SOC_AMD_COMMON_BLOCK_GRAPHICS_ATIF))
generate_atif(dev); generate_atif(dev);
if (CONFIG(SOC_AMD_COMMON_BLOCK_GRAPHICS_ACP))
generate_acp(dev);
} }
static const char *graphics_acpi_name(const struct device *dev) static const char *graphics_acpi_name(const struct device *dev)