Skip to content

ASoC: SOF: amd: add SOF support for ACP7.B/7.F platforms#5813

Open
vijendarmukunda wants to merge 16 commits into
thesofproject:topic/sof-devfrom
vijendarmukunda:topic/sof-dev
Open

ASoC: SOF: amd: add SOF support for ACP7.B/7.F platforms#5813
vijendarmukunda wants to merge 16 commits into
thesofproject:topic/sof-devfrom
vijendarmukunda:topic/sof-dev

Conversation

@vijendarmukunda

@vijendarmukunda vijendarmukunda commented Jun 12, 2026

Copy link
Copy Markdown

This series adds Sound Open Firmware (SOF) support for AMD Audio Co-Processor revisions ACP7.B (PCI rev 0x7B) and ACP7.F (PCI rev 0x7F). It builds on the existing ACP6x/ACP70 SOF PCI path with ACP7x-specific probe/remove, IRQ, signed firmware handling (including SRAM data load), power management, and IPC3 topology/DAI extensions for I2S/TDM.

What this PR does
Platform / PCI — Kconfig, build wiring, register offsets, PGFSM power-on, ACP7x PCI driver and DSP ops, SW interrupt trigger offset selection for ACP7.B/7.F.
Power — PGFSM tile status polling restricted to P0–P4; system and runtime suspend/resume for ACP7x; optional post–firmware-run delay when the ACPI property is present (same idea as existing platforms such as Van Gogh).
Firmware — ACPI-driven signed image path: configure_and_run_sha_dma honors ACPI signed firmware as well as quirks; SizeFWSigned from the ACP header with buffer and header length checks before SHA DMA length; signed data blocks routed to SRAM for 0x7B+.
IRQ — ACP7x IRQ handler for DSP IPC, using chip descriptor DSP / extended / error status fields; SW1 I2S error reason clearing refactored behind an explicit switch on PCI revision.
Topology / DAI — New SOF_DAI_AMD_I2S DAI type for ACP7x I2S/TDM; topology uses the ACPTDM DAI name for these links. IPC3 still fills sof_ipc_dai_acp_params through the existing SOF_ACPI2S_TOKENS / acpi2s_tokens[] tuple, extended with SOF_TKN_AMD_ACPI2S_FORMAT for the new format field (this is not a separate parallel “ACPTDM token group”).
Machines (if in this PR) — ACPI machine table entries for ACP7.B/7.F SOF platforms and declaration in mach-config.h so the SOF PCI driver can select firmware/topology.

Add snd_soc_acpi_amd_acp7x_sof_machines[] ACPI machine table for ACP7.B
and ACP7.F PCI revision based platforms. Add the extern declaration to
mach-config.h so that it can be referenced from the SOF PCI driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Sound Open Firmware (SOF) enablement for AMD ACP7.B/ACP7.F platforms by introducing a dedicated ACP7x PCI driver/ops layer built on the existing ACP SOF infrastructure, plus required IPC3 topology/token extensions for ACP7x I2S/TDM.

Changes:

  • Add new ACP7x PCI driver + DSP ops, including suspend/resume and IRQ handling paths.
  • Extend AMD ACP firmware loading logic for signed images and SRAM-based data loading on ACP7x.
  • Introduce a new SOF DAI type for AMD I2S/TDM and extend IPC3 topology tokens to carry an ACP TDM/I2S format field.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
sound/soc/sof/topology.c Map new ACP TDM/I2S DAI name to the new AMD I2S DAI type and include it in token selection.
sound/soc/sof/ipc3-topology.c Add ACP format token and a new ACP I2S/TDM link loader for IPC3.
sound/soc/sof/ipc3-pcm.c Add hw-params fixup for the new AMD I2S/TDM DAI type.
sound/soc/sof/amd/pci-acp7x.c New ACP7x PCI driver description/probe/remove wiring for SOF.
sound/soc/sof/amd/Makefile Build integration for the new ACP7x objects/module.
sound/soc/sof/amd/Kconfig New Kconfig option to enable ACP7x SOF support.
sound/soc/sof/amd/acp7x.c New ACP7x-specific SOF DAI list and ops init (ACPI property-driven behavior).
sound/soc/sof/amd/acp.h Add ACP7x revision IDs, masks, image header constants, and per-device flags.
sound/soc/sof/amd/acp.c Extend generic ACP code for ACP7x init/power-on/masks, add ACP7x probe/remove/PM hooks and IRQ handler.
sound/soc/sof/amd/acp-loader.c Update pre-run sizing logic for signed firmware and load signed data to SRAM on ACP7x.
sound/soc/sof/amd/acp-ipc.c Adjust host->DSP SW interrupt trigger register offset selection for ACP7x.
sound/soc/sof/amd/acp-dsp-offset.h Add ACP7x register offsets needed for IRQ/status/error handling and PM.
sound/soc/amd/mach-config.h Export declaration for ACP7x SOF machine table.
sound/soc/amd/acp-config.c Add ACP7x SOF machine table entry (ACPI ID → driver/topology/firmware).
include/uapi/sound/sof/tokens.h Add a new UAPI token for ACP I2S/TDM format.
include/sound/sof/dai.h Add new SOF DAI type for AMD I2S/TDM and union storage for ACP I2S params.
include/sound/sof/dai-amd.h Extend ACP DAI params with a format field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sound/soc/sof/amd/acp7x.c
Comment thread sound/soc/sof/amd/acp7x.c
Comment thread sound/soc/sof/amd/acp.c
Comment thread sound/soc/sof/amd/acp-loader.c
Comment thread sound/soc/sof/amd/acp-loader.c
Comment thread sound/soc/sof/amd/pci-acp7x.c

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

sound/soc/sof/ipc3-topology.c:1

  • The PR description mentions a new "ACPTDM topology token group", but the implementation extends and reuses the existing SOF_ACPI2S_TOKENS group via SOF_TKN_AMD_ACPI2S_FORMAT. Please align either the description (if ACPI2S token reuse is intended) or the code (if a distinct ACPTDM token group was intended) to avoid confusion for integrators authoring topology files.
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)

Comment thread sound/soc/sof/ipc3-topology.c
Comment thread sound/soc/sof/amd/acp7x.c Outdated
Comment thread sound/soc/sof/amd/acp.c Outdated
Comment thread sound/soc/sof/amd/acp-loader.c
Comment thread sound/soc/sof/amd/acp-dsp-offset.h Outdated
Add SOF support for ACP7.B and ACP7.F PCI revision based platforms.
This covers Kconfig/Makefile entries, register offset definitions,
DMA descriptor/channel/status paths, PGFSM power-on handling,
PCI device driver, I2S/DMIC DAI definitions, and IPC SW interrupt
trigger offset selection for ACP7.B/7.F.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
For ACP7.B/7.F, poll only the PGFSM tile status bits (P0-P4) and
consider the tiles powered on when the masked status becomes 0.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Replace the open-coded pci_rev comparison with a switch statement for
clearing ACP_SW1_I2S_ERROR_REASON. This makes the per-platform control
explicit and easier to extend.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Add amd_sof_acp7x_probe() and amd_sof_acp7x_remove() for ACP7.B/7.F.
Wire probe and remove into sof_acp7x_ops_init().

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Add acp7x_irq_handler() and register it from amd_sof_acp7x_probe() for
DSP doorbell IPC interrupts on ACP7.B/7.F.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Parse SizeFWSigned from the ACP image header when loading signed
firmware on ACP7.B/7.F platforms. Keep the legacy
ACP_FIRMWARE_SIGNATURE subtraction for pre-7B platforms using quirks.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
ACP7.B/7.F signed images read SizeFWSigned from a fixed offset inside
the ACP header. Reject firmware buffers shorter than the header so we
never read past the end of the supplied image.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
The ACP7.B/7.F ACPI signed path already reads SizeFWSigned from the image
header into size_fw. Before adding ACP_IMAGE_HEADER_SIZE for SHA DMA,
reject payload size zero or any size_fw with size_fw > fw_bin_size -
ACP_IMAGE_HEADER_SIZE, so size_fw + ACP_IMAGE_HEADER_SIZE cannot exceed the
supplied firmware buffer.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Add sof_acp7x_post_fw_run_delay() to introduce a small delay after
firmware boot completion on resume to avoid DSP entering an
unrecoverable state.

Register it as post_fw_run callback only when the ACPI property
acp-sof-post_fw_run_delay is set, following the same pattern used
by the Vangogh platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Check adata->acp_sof_signed_firmware_image alongside the existing quirk
flag so that ACP7.B/7.F platforms configured through ACPI also get the
SHA DMA header included during signed firmware loading.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Read ACPI property acp-sof-signed-firmware-image in sof_acp7x_ops_init()
and register acp_sof_load_signed_firmware as the load_firmware callback
only when the property is set.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
ACP7.B and ACP7.F signed firmware data blocks must be written to SRAM
instead of DRAM. Select SOF_FW_BLK_TYPE_SRAM for PCI revision 0x7B and
above in acp_sof_load_signed_firmware().

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Add format field to sof_ipc_dai_acp_params for ACP I2S format selection.
Add SOF_TKN_AMD_ACPI2S_FORMAT (1703) to the existing SOF_ACPI2S_TOKENS
tuple and wire it into acpi2s_tokens[] so integrators continue using the
same ACPI2S token group as earlier ACP I2S topologies, not a separate
ACPTDM-specific token set.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Add SOF_DAI_AMD_I2S DAI type for ACP7.B/7.F I2S/TDM interfaces.
Register the ACPTDM topology DAI name and map it to SOF_DAI_AMD_I2S;
IPC3 continues to parse ACP I2S link parameters through SOF_ACPI2S_TOKENS
(including the format token from the prior commit), not a new token
group named after ACPTDM. Add sof_link_acp_i2s_load() and the
SOF_DAI_AMD_I2S PCM dai link fixup path.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Add amd_sof_acp7x_suspend() and amd_sof_acp7x_resume() for ACP7.B/7.F
platforms power management.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
@vijendarmukunda

Copy link
Copy Markdown
Author

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)

sound/soc/sof/ipc3-topology.c:1

* The PR description mentions a new "ACPTDM topology token group", but the implementation extends and reuses the existing `SOF_ACPI2S_TOKENS` group via `SOF_TKN_AMD_ACPI2S_FORMAT`. Please align either the description (if ACPI2S token reuse is intended) or the code (if a distinct ACPTDM token group was intended) to avoid confusion for integrators authoring topology files.
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)

This is to separate it out from older DAI type defined new dai type as ACPTDM for ACP7x varaints.

bardliao
bardliao previously approved these changes Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Comment thread sound/soc/sof/amd/pci-acp7x.c
Comment thread sound/soc/sof/amd/pci-acp7x.c
Comment thread include/sound/sof/dai-amd.h
Comment thread sound/soc/sof/amd/acp.c Outdated
Comment thread sound/soc/sof/amd/Kconfig
Comment thread sound/soc/sof/amd/pci-acp7x.c

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Comment thread sound/soc/sof/amd/acp-loader.c
Comment thread sound/soc/sof/amd/acp.h

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Comment thread sound/soc/sof/ipc3-topology.c
@bardliao

Copy link
Copy Markdown
Collaborator

@vijendarmukunda Would you like to send the patches to the mailing list directly? And we will pick up the upstream version. Feel free to take my Reviewed-by tag.

@vijendarmukunda

vijendarmukunda commented Jun 15, 2026

Copy link
Copy Markdown
Author

@vijendarmukunda Would you like to send the patches to the mailing list directly? And we will pick up the upstream version. Feel free to take my Reviewed-by tag.

@bardliao : will send patches to the mailing list. will add reviewed-by tag . Thanks

@vijendarmukunda

Copy link
Copy Markdown
Author

@bardliao : I can't upstream patches until SOF_DAI_INTEL_UAOL type changes land in to Mark Brown's ASoC for-next branch? Could you please help to comment whether DAI type change patch has been sent to mailing list?

@bardliao

Copy link
Copy Markdown
Collaborator

@bardliao : I can't upstream patches until SOF_DAI_INTEL_UAOL type changes land in to Mark Brown's ASoC for-next branch? Could you please help to comment whether DAI type change patch has been sent to mailing list?

@vijendarmukunda Sure, I just sent the SOF_DAI_INTEL_UAOL patch to the mailing list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants