Skip to content

acp: add native Zephyr drivers for AMD ACP 7.0 (includes Zephyr west.yml update)#10571

Open
Sivasubramanian678 wants to merge 7 commits intothesofproject:mainfrom
Sivasubramanian678:main
Open

acp: add native Zephyr drivers for AMD ACP 7.0 (includes Zephyr west.yml update)#10571
Sivasubramanian678 wants to merge 7 commits intothesofproject:mainfrom
Sivasubramanian678:main

Conversation

@Sivasubramanian678
Copy link
Copy Markdown

This PR adds native Zephyr support for AMD Audio Co-Processor (ACP) version 7.0 for handling Sound Wire IO.

@sofci
Copy link
Copy Markdown
Collaborator

sofci commented Feb 24, 2026

Can one of the admins verify this patch?

reply test this please to run this test once

@Sivasubramanian678
Copy link
Copy Markdown
Author

Dependency: This PR depends on zephyrproject-rtos/zephyr#104450 for native Zephyr ACP 7.0 driver enablement.

@lgirdwood
Copy link
Copy Markdown
Member

test this please

@lgirdwood
Copy link
Copy Markdown
Member

@Sivasubramanian678 can you check the CI, looks like we have some build errors...

@Sivasubramanian678
Copy link
Copy Markdown
Author

@Sivasubramanian678 can you check the CI, looks like we have some build errors...

The error that is happening in CI test is because of the dependency of Zephyr PR - zephyrproject-rtos/zephyr#104450 .In that PR we have included the required macro. I think till that PR gets merged CI test won't pass. Is there anyway to avoid this CI test failure?

@lgirdwood
Copy link
Copy Markdown
Member

@Sivasubramanian678 can you check the CI, looks like we have some build errors...

The error that is happening in CI test is because of the dependency of Zephyr PR - zephyrproject-rtos/zephyr#104450 .In that PR we have included the required macro. I think till that PR gets merged CI test won't pass. Is there anyway to avoid this CI test failure?

No, probably best we get the Zephyr PR merged 1st and then we can rerun CI to make sure all is good.

Copy link
Copy Markdown
Collaborator

@lyakh lyakh left a comment

Choose a reason for hiding this comment

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

some parts of this PR also affect non-AMD platforms, just need to be aware and check potential side-effects

Comment thread zephyr/wrapper.c Outdated

/* imx currently has no IRQ driver in Zephyr so we force to xtos IRQ */
#if defined(CONFIG_AMD)
#ifndef CONFIG_ZEPHYR_NATIVE_DRIVERS
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

so this now will be enabled for all builds that don't set CONFIG_ZEPHYR_NATIVE_DRIVERS

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same alternative as above to limit to just AMD variants

Comment thread zephyr/include/rtos/interrupt.h Outdated
* to native drivers.
*/
#if defined(CONFIG_AMD)
#ifndef CONFIG_ZEPHYR_NATIVE_DRIVERS
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this potentially affects other platforms too

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this potentially affects other platforms too

...although currently apparently only AMD has CONFIG_ZEPHYR_NATIVE_DRIVERS=n

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This change was done to maintain backward compatibility for previous generation AMD platform. We will check whether we can update the previous generation platform to native zephyr to avoid this change.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems ok, can @thesofproject/nxp check?

One alternative is to have check: "#if defined(CONFIG_AMD) && !defined(CONFIG_ZEPHYR_NATIVE_DRIVERS)""

@lgirdwood
Copy link
Copy Markdown
Member

@Sivasubramanian678 will you rebase when the Zephyr PR is merged and include the west update as a patch in this PR, this should kickstart all the CI too. Thanks !

@lgirdwood
Copy link
Copy Markdown
Member

@Sivasubramanian678 will you rebase when the Zephyr PR is merged and include the west update as a patch in this PR, this should kickstart all the CI too. Thanks !

@Sivasubramanian678 any update from Zephyr side ?

@lgirdwood
Copy link
Copy Markdown
Member

@Sivasubramanian678 will you rebase when the Zephyr PR is merged and include the west update as a patch in this PR, this should kickstart all the CI too. Thanks !

@Sivasubramanian678 any update from Zephyr side ?

Ping ?

@Sivasubramanian678
Copy link
Copy Markdown
Author

@Sivasubramanian678 will you rebase when the Zephyr PR is merged and include the west update as a patch in this PR, this should kickstart all the CI too. Thanks !

@Sivasubramanian678 any update from Zephyr side ?

Ping ?

We have received one approval from Zephyr and are currently waiting for one more. Once that approval is received, the code will be merged. After the Zephyr merge, I will rebase this PR and include the west update as a patch.

@kv2019i kv2019i changed the title acp: add native Zephyr drivers for AMD ACP 7.0 acp: add native Zephyr drivers for AMD ACP 7.0 (includes Zephyr west.yml update) Apr 29, 2026
Copy link
Copy Markdown
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Looks good, only minor comments below. Let's either have NXP folks ack the ifdef logic (or you change the logic to only apply to AMD configurations).

Comment thread zephyr/include/rtos/interrupt.h Outdated
* to native drivers.
*/
#if defined(CONFIG_AMD)
#ifndef CONFIG_ZEPHYR_NATIVE_DRIVERS
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems ok, can @thesofproject/nxp check?

One alternative is to have check: "#if defined(CONFIG_AMD) && !defined(CONFIG_ZEPHYR_NATIVE_DRIVERS)""

Comment thread zephyr/wrapper.c Outdated

/* imx currently has no IRQ driver in Zephyr so we force to xtos IRQ */
#if defined(CONFIG_AMD)
#ifndef CONFIG_ZEPHYR_NATIVE_DRIVERS
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same alternative as above to limit to just AMD variants

Comment thread src/ipc/ipc3/dai.c
This commit adds support for ACP 7.0 native zephyr and also adds acp_7_0
in zephyr build script.

Changes include:
    - Add changes in platform-specific files for ACP 7.0 for
    native zephyr support
    - Add ACP 7.0 in cmakelist under zephyr
    - Remove DMA based scheduling from kconfig for
    ACP 7.0
    - Add acp_7_0 support in zephyr build script
    - Add xtensa files idma.h,xtensa-types.h and
    xt_externalregisters.h
    -  Add UINT32_C macro fallback for stdint.h
    compatibility in tie.h
    - Replace addi.a with addi in tie-asm.h for Xtensa
    assembler compatibility.

This enables native Zephyr-based SOF support for AMD ACP 7.0
hardware platform.

Co-developed-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: Sivasubramanian <sravisar@amd.com>
Remove legacy chip_offset_byte.h and chip_register.h header
files as they are no longer needed with native Zephyr driver
support for the 7_0 platform.

Co-developed-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: Sivasubramanian <sravisar@amd.com>
Disable COMP_MUX and PROBE and remove AMD_BINARY_BUILD.

Co-developed-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: Sivasubramanian <sravisar@amd.com>
This adds SoundWire DAI support for ACP 7.0
native zephyr.

Co-developed-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: Sivasubramanian <sravisar@amd.com>
This adds changes for ACP 6.0 non native zephyr support.

Co-developed-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: Sivasubramanian <sravisar@amd.com>
This updates the Zephyr revision to include native Zephyr ACP 7.0
drivers (zephyrproject-rtos/zephyr#104450) required for SOF ACP 7.0
platform support.

Co-developed-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: Sivasubramanian <sravisar@amd.com>
@Sivasubramanian678
Copy link
Copy Markdown
Author

@kv2019i The requested changes have been completed. Please let me know if any further updates are needed.

Copy link
Copy Markdown
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Thanks @Sivasubramanian678 , looks good now!

idma_hw_error_t err_type; /* ErrorCodes field of the Status reg */
uint32_t currDesc; /* Descriptor causing error */
uint32_t srcAddr; /* PIF source address causing error */
uint32_t dstAddr; /* PIF dest. address causing error */
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

indentation - also below in structures and functions

* @retval None
*/
IDMA_API void
idma_hw_wait_all(int32_t ch);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we put all of these on single lines? Makes grepping more informative

* @retval !IDMA_OK Error type
*/
IDMA_API idma_status_t
idma_init( int32_t ch,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

there was one more case of a space after an opening bracket above

* NOTE: Pointer is valid only if idma task/buffer is in error.
*/
IDMA_API idma_error_details_t* idma_error_details(int32_t ch);
IDMA_API idma_error_details_t* idma_buffer_error_details(int32_t ch);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the usual format in SOF is type *function(arguments) i.e. * after a space and no space between it and function

#endif
IDMA_ENABLE_INTS();
return IDMA_OK;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

oh... ok, it isn't the first time that I see an actual implementation fully in headers, but... SOF doesn't do this usually... @kv2019i @lgirdwood what do you think? Can we put these in a .c file?

unsigned int RO_CLK1_DFS_STATE_IDLE : 1;
unsigned int CLK1_CURRENT_DFS_DID : 7;
unsigned int : 5;
} bitfields, bits;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

those bitfields add up to 32 bits, so I'd use uint32_t here explicitly. Same in other similar bit-field cases

Signed-off-by: Sivasubramanian678 <sravisar@amd.com>
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.

6 participants