-
Notifications
You must be signed in to change notification settings - Fork 322
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
Conversation
Can one of the admins verify this patch?
|
test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DINESHKUMARK1 I think this is almost ready to go, it does need proper formatting and descriptions for all commit messages though. I also assume you have some Zephyr upstream dependencies and there will be a west update to include those ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty commit "Update acp_dma.c?" Maybe file flags changed or something? As mentioned in one of the comments, please improve some of your "Update X" commit descriptions, remember that those commits will stay forever in git log
scripts/xtensa-build-zephyr.py
Outdated
@@ -168,6 +168,12 @@ class PlatformConfig: | |||
"imx", "imx95_evk/mimx9596/m7/ddr", | |||
"", "", "", "" | |||
), | |||
"acp_6_0" : PlatformConfig( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you see above, the convention is to put a line like " platforms" for each vendor, please do the same for AMD to avoid it looking like an NXP platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you have no toolchain yet, move this to extra_platform_configs =
for now, it's not ready for platform_configs_all =
yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
zephyr/CMakeLists.txt
Outdated
) | ||
|
||
# Zephyr DMA domain should only be used with zephyr_ll | ||
if (NOT(CONFIG_DMA_DOMAIN)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: maybe easier to use a positive form if (CONFIG_DMA_DOMAIN)
and swap the branches below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
static SHARED_DATA struct timer timer = { | ||
.id = TIMER0, | ||
.irq = IRQ_NUM_TIMER0, | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the brace placement was correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
sof->platform_timer = &timer; | ||
sof->cpu_timers = &timer; | ||
#endif | ||
#ifdef __ZEPHYR__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#else
and maybe swap to use a positive #ifdef __ZEPHYR__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -172,6 +172,8 @@ static inline void *platform_rfree_prepare(void *ptr) | |||
|
|||
#endif /* __PLATFORM_LIB_MEMORY_H__ */ | |||
|
|||
#endif /* __PLATFORM_LIB_MEMORY_H__ */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return 0; | ||
tr_err(&acp_dmic_dma_rmb_tr, "timed out for dma start"); | ||
return -ETIME; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 TAB fewer would make this hunk much smaller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed this one? In fact, can you use sof_cycle_get_64()
?
zephyr/include/rtos/interrupt.h
Outdated
defined(CONFIG_ZEPHYR_POSIX) || (defined(CONFIG_IMX) && !defined(CONFIG_IMX8M)) \ | ||
|| defined(CONFIG_AMD) | ||
defined(CONFIG_ZEPHYR_POSIX) || \ | ||
(defined(CONFIG_IMX) && !defined(CONFIG_IMX8M)) || defined(CONFIG_AMD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please, make commit titles and preferably bodies a bit more descriptive, at least mention AMD and Zephyr
zephyr/include/rtos/interrupt.h
Outdated
@@ -50,7 +50,7 @@ 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_AMD) | |||
(defined(CONFIG_IMX) && !defined(CONFIG_IMX8M)) || defined(CONFIG_AMD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please drop this commit
c103101
to
3b1de04
Compare
I guess this depends on zephyrproject-rtos/zephyr#79796 , but I'm ok to merge separately given this is initial enabling and not covered by any public CI yet (so merging SOF PR first will not break anything). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI: you just sent a separate Github notification every time you replied "done". You can very easily batch these notifications with the "Start Review" green button:
That page has other, unrelated but fantastic advice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments! Maybe timer code could still be simplified a bit more
return 0; | ||
tr_err(&acp_dmic_dma_rmb_tr, "timed out for dma start"); | ||
return -ETIME; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed this one? In fact, can you use sof_cycle_get_64()
?
Add config file for acp_6_0: amd_acp_6_0_adsp.conf. Signed-off-by: DineshKumar Kalva <[email protected]>
Add support to build sof for acp_6_0 platform. Signed-off-by: DineshKumar Kalva <[email protected]>
…nabling irqsteer with zephyr. For the functions platform_interrupt_clear and platform_interrupt_set, the existing definitions based on arch_interrupt_* do not compile with the xt-clang 2023 toolchain for acp_6_0. Use the Zephyr wrapper implementations for those for now. Signed-off-by: DineshKumar Kalva <[email protected]>
This commit introduces support in the CMakeLists.txt of Zephyr for building SOF for acp_6_0 platform. Signed-off-by: DineshKumar Kalva <[email protected]>
…tform There are a mapping between LOCAL and HOST on platform, then add macro local_to_host, host_to_local. DSP memory region has mapped to host memory region on acp_6_0. Then if we want access the address from host, need to convert the address. Signed-off-by: DineshKumar Kalva <[email protected]>
Replaced sof timer related functions with Zephyr alternative. Signed-off-by: DineshKumar Kalva <[email protected]>
add heap memory allocation for .heap_mem section. Signed-off-by: DineshKumar Kalva <[email protected]>
… zephyr. With Zephyr, SOF uses k_cycle_get_64() API in order to count clock cycles.this API have a 64bit counter (e.g acp_6_0 dsp integration only has xtensa timer which is limited to 32 bits). Signed-off-by: DineshKumar Kalva <[email protected]>
…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 <[email protected]>
… build. Definitions of mm_heap.h interface are not needed in Zephyr builds, added a no-op version for Zephyr. Signed-off-by: DineshKumar Kalva <[email protected]>
Add acp_6_0 toml file to support sof-acp_6_0.ri binary build. Signed-off-by: DineshKumar Kalva <[email protected]>
Integrate Zephyr support into the SOF build for AMD platforms.