Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build SOF with zephyr on acp_6_0 platform #9578

Merged
merged 11 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
zephyr: amd: the lack of native Zephyr driver support for acp_6_0 pla…
…tform.

In order to avoid  first level interrupt handling from
wrapper.c second level interrupt handling go through interrupt.c
define macros to rename the duplicated functions

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
  • Loading branch information
DINESHKUMARK1 committed Oct 18, 2024
commit 0ba04af2db9d17a3f0b8b047d8550207c2a3f91c
2 changes: 1 addition & 1 deletion posix/include/rtos/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static inline struct cascade_root *cascade_root_get(void)
/* For i.MX, while building SOF with Zephyr use the interrupt_*
* functions from second level interrupt handling and IRQ_STEER.
*/
#if defined(__ZEPHYR__) && defined(CONFIG_IMX)
#if defined(__ZEPHYR__) && (defined(CONFIG_IMX) || defined(CONFIG_AMD))
int mux_interrupt_get_irq(unsigned int irq, const char *cascade);
int mux_interrupt_register(uint32_t irq, void(*handler)(void *arg), void *arg);
void mux_interrupt_unregister(uint32_t irq, const void *arg);
Expand Down
4 changes: 4 additions & 0 deletions src/drivers/amd/rembrandt/acp_hs_dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
SOF_DEFINE_REG_UUID(hsdai);
DECLARE_TR_CTX(hsdai_tr, SOF_UUID(hsdai_uuid), LOG_LEVEL_INFO);

#if defined(__ZEPHYR__)
#define interrupt_get_irq mux_interrupt_get_irq
#endif

static inline int hsdai_set_config(struct dai *dai, struct ipc_config_dai *common_config,
const void *spec_config)
{
Expand Down
10 changes: 5 additions & 5 deletions src/drivers/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ DECLARE_TR_CTX(irq_tr, SOF_UUID(irq_uuid), LOG_LEVEL_INFO);
* handling go through interrupt-irqsteer.c define macros to
* rename the duplicated functions.
*/
#if defined(__ZEPHYR__) && defined(CONFIG_IMX)
#if defined(__ZEPHYR__) && (defined(CONFIG_IMX) || defined(CONFIG_AMD))
#define interrupt_get_irq mux_interrupt_get_irq
#define interrupt_register mux_interrupt_register
#define interrupt_unregister mux_interrupt_unregister
Expand Down Expand Up @@ -377,7 +377,7 @@ static int interrupt_register_internal(uint32_t irq, void (*handler)(void *arg),
/* no parent means we are registering DSP internal IRQ */
cascade = interrupt_get_parent(irq);
if (!cascade) {
#if defined(__ZEPHYR__) && defined(CONFIG_IMX)
#if defined(__ZEPHYR__) && (defined(CONFIG_IMX) || defined(CONFIG_AMD))
/* undefine the macro so that interrupt_register()
* is resolved to the one from wrapper.c
*/
Expand Down Expand Up @@ -410,7 +410,7 @@ static void interrupt_unregister_internal(uint32_t irq, const void *arg,
/* no parent means we are unregistering DSP internal IRQ */
cascade = interrupt_get_parent(irq);
if (!cascade) {
#if defined(__ZEPHYR__) && defined(CONFIG_IMX)
#if defined(__ZEPHYR__) && (defined(CONFIG_IMX) || defined(CONFIG_AMD))
/* undefine the macro so that interrupt_unregister()
* is resolved to the one from wrapper.c
*/
Expand All @@ -437,7 +437,7 @@ uint32_t interrupt_enable(uint32_t irq, void *arg)
if (cascade)
return irq_enable_child(cascade, irq, arg);

#if defined(__ZEPHYR__) && defined(CONFIG_IMX)
#if defined(__ZEPHYR__) && (defined(CONFIG_IMX) || defined(CONFIG_AMD))
/* undefine the macro so that interrupt_enable()
* is resolved to the one from wrapper.c
*/
Expand All @@ -458,7 +458,7 @@ uint32_t interrupt_disable(uint32_t irq, void *arg)
if (cascade)
return irq_disable_child(cascade, irq, arg);

#if defined(__ZEPHYR__) && defined(CONFIG_IMX)
#if defined(__ZEPHYR__) && (defined(CONFIG_IMX) || defined(CONFIG_AMD))
/* undefine the macro so that interrupt_disable()
* is resolved to the one from wrapper.c
*/
Expand Down
2 changes: 1 addition & 1 deletion src/schedule/dma_multi_chan_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ LOG_MODULE_DECLARE(ll_schedule, CONFIG_SOF_LOG_LEVEL);
* handling go through interrupt-irqsteer.c define macros to
* rename the duplicated functions.
*/
#if defined(__ZEPHYR__) && defined(CONFIG_IMX)
#if defined(__ZEPHYR__) && (defined(CONFIG_IMX) || defined(CONFIG_AMD))
#define interrupt_get_irq mux_interrupt_get_irq
#define interrupt_register mux_interrupt_register
#define interrupt_unregister mux_interrupt_unregister
Expand Down
2 changes: 1 addition & 1 deletion src/schedule/zephyr_dma_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

LOG_MODULE_DECLARE(ll_schedule, CONFIG_SOF_LOG_LEVEL);

#ifdef CONFIG_IMX
#if defined(CONFIG_IMX) || defined(CONFIG_AMD)
#define interrupt_get_irq mux_interrupt_get_irq
#define interrupt_register mux_interrupt_register
#define interrupt_unregister mux_interrupt_unregister
Expand Down
2 changes: 1 addition & 1 deletion xtos/include/rtos/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static inline struct cascade_root *cascade_root_get(void)
/* For i.MX, while building SOF with Zephyr use the interrupt_*
* functions from second level interrupt handling and IRQ_STEER.
*/
#if defined(__ZEPHYR__) && defined(CONFIG_IMX)
#if defined(__ZEPHYR__) && (defined(CONFIG_IMX) || defined(CONFIG_AMD))
int mux_interrupt_get_irq(unsigned int irq, const char *cascade);
int mux_interrupt_register(uint32_t irq, void(*handler)(void *arg), void *arg);
void mux_interrupt_unregister(uint32_t irq, const void *arg);
Expand Down
5 changes: 3 additions & 2 deletions zephyr/include/rtos/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/* TODO: to be removed completely when the following platforms are switched
* to native drivers.
*/
#if defined(CONFIG_IMX8M)
#if defined(CONFIG_IMX8M) || defined(CONFIG_AMD)
/* imx currently has no IRQ driver in Zephyr so we force to xtos IRQ */
#include "../../../xtos/include/rtos/interrupt.h"
#else
Expand Down Expand Up @@ -49,7 +49,8 @@ static inline void interrupt_unregister(uint32_t irq, const void *arg)
static inline int interrupt_get_irq(unsigned int irq, const char *cascade)
{
#if defined(CONFIG_LIBRARY) || defined(CONFIG_ACE) || defined(CONFIG_CAVS) || \
defined(CONFIG_ZEPHYR_POSIX) || (defined(CONFIG_IMX) && !defined(CONFIG_IMX8M))
defined(CONFIG_ZEPHYR_POSIX) || (defined(CONFIG_IMX) && !defined(CONFIG_IMX8M)) || \
defined(CONFIG_AMD)
return irq;
#else
if (cascade == irq_name_level2)
Expand Down
4 changes: 2 additions & 2 deletions zephyr/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const char irq_name_level2[] = "level2";
const char irq_name_level5[] = "level5";

/* imx currently has no IRQ driver in Zephyr so we force to xtos IRQ */
#if defined(CONFIG_IMX8M)
#if defined(CONFIG_IMX8M) || defined(CONFIG_AMD)
int interrupt_register(uint32_t irq, void(*handler)(void *arg), void *arg)
{
#ifdef CONFIG_DYNAMIC_INTERRUPTS
Expand Down Expand Up @@ -98,7 +98,7 @@ uint32_t interrupt_disable(uint32_t irq, void *arg)
/*
* i.MX uses the IRQ_STEER
*/
#if !CONFIG_IMX
#if !CONFIG_IMX && !CONFIG_AMD

void interrupt_mask(uint32_t irq, unsigned int cpu)
{
Expand Down