dai: uaol: add support for Intel UAOL (includes west.yml Zephyr update)#10567
dai: uaol: add support for Intel UAOL (includes west.yml Zephyr update)#10567serhiy-katsyuba-intel wants to merge 4 commits intothesofproject:mainfrom
Conversation
c736e45 to
a2901a1
Compare
|
SOFCI TEST |
a2901a1 to
31cfd45
Compare
There was a problem hiding this comment.
Pull request overview
Adds Intel USB Audio Offload Link (UAOL) DAI support across the SOF/Zephyr integration and IPC4 paths, including capability reporting and node-id mapping.
Changes:
- Update West manifest to a Zephyr revision that includes UAOL-related support.
- Introduce the
SOF_DAI_INTEL_UAOLtype and wire it through DAI selection/config paths. - Add UAOL capability advertisement and UAOL stream-id → HDA link stream-id mapping for IPC4 DMA control.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| west.yml | Bumps Zephyr revision required for UAOL enablement. |
| src/lib/dai.c | Registers UAOL devices and maps UAOL to the Zephyr DAI type / DMA caps. |
| src/ipc/ipc4/dai.c | Adds UAOL handling for link config and DMA channel selection. |
| src/include/ipc/dai.h | Introduces SOF_DAI_INTEL_UAOL enum value. |
| src/audio/dai-zephyr.c | Adds UAOL case to Zephyr DAI configuration. |
| src/audio/copier/copier_dai.c | Adds UAOL stream link classes to DAI creation path. |
| src/audio/copier/copier.c | Routes UAOL stream link classes to copier_dai_create(). |
| src/audio/base_fw_intel.c | Advertises UAOL support/caps and maps UAOL node indices for DMA control. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| const size_t dev_count = ARRAY_SIZE(uaol_devs); | ||
| struct uaol_capabilities dev_cap; | ||
| struct ipc4_uaol_capabilities *caps = (struct ipc4_uaol_capabilities *)tuple->value; | ||
| size_t caps_size = offsetof(struct ipc4_uaol_capabilities, link_caps[dev_count]); |
There was a problem hiding this comment.
offsetof(struct ..., link_caps[dev_count]) uses a non-constant array index; this is not valid with standard offsetof/__builtin_offsetof and can fail to compile. Compute the size as sizeof(*caps) + dev_count * sizeof(caps->link_caps[0]) (or the equivalent using the element type) instead.
| size_t caps_size = offsetof(struct ipc4_uaol_capabilities, link_caps[dev_count]); | |
| size_t caps_size = sizeof(*caps) + dev_count * sizeof(caps->link_caps[0]); |
| case SOF_DAI_INTEL_UAOL: | ||
| link_cfg.full = 0; | ||
| link_cfg.part.hchan = gtw_fmt->channels_count - 1; | ||
| link_cfg.part.dir = common_config->direction; | ||
| link_cfg.part.stream = common_config->host_dma_config[0]->stream_id; | ||
| break; |
There was a problem hiding this comment.
hchan is derived as channels_count - 1. If channels_count is 0, this underflows and encodes an invalid hchan value. Clamp or validate the channel count before subtracting (e.g., ensure the minimum encoded value is 0 and only subtract when channels_count > 0).
|
@serhiy-katsyuba-intel I assuming CI will test this now ? |
Currently, CI does not have any UAOL tests enabled. Therefore, it can only test for potential regressions to existing functionality but cannot test the UAOL feature itself. Unfortunately, the Zephyr folks want to revert the Zephyr UAOL PR because it introduced a new driver type apparently without proper architectural discussion: zephyrproject-rtos/zephyr#104976. As a result, I'll change this PR to draft status for now. :-( |
Updates Zephyr to bring in UAOL support. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
31cfd45 to
1dad327
Compare
Fixes minor typo error. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Adds support for Intel USB Audio Offload Link (UAOL) DAI. Signed-off-by: Tomasz Lissowski <tomasz.lissowski@intel.com> Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Enables UAOL (USB Audio Offload Link) feature on Intel ADSP platforms ACE2, ACE3 and ACE4. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
1dad327 to
c27dd1c
Compare
It seems that everything is now resolved with Zephyr's UAOL driver future. I am changing this PR from draft status to ready for review. |
kv2019i
left a comment
There was a problem hiding this comment.
Looks good, only one change to the last patch.
| caps->link_caps[i].max_rx_fifo_size = dev_cap.max_rx_fifo_size; | ||
| } | ||
|
|
||
| tlv_value_set(tuple, type, caps_size, caps); |
There was a problem hiding this comment.
Not related to this PR, but reminds me we'd to add better protections against overrunning the IPC mailbox size. The overall length of the TLV is not known in these functions now, and it will be difficult to debug if we excedeed the space. Most of these are by definition ok as the structure is fixed and defined in FW.
| CONFIG_MM_DRV_INTEL_VIRTUAL_REGION_COUNT=2 | ||
| CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=38400000 | ||
| CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000 | ||
| CONFIG_UAOL=y |
There was a problem hiding this comment.
@serhiy-katsyuba-intel Given this is for all ACE platforms, please add this to sof/app/boards/intel_adsp/Kconfig.defconfig as:
config UAOL
» default y if ACE
Adds support for Intel USB Audio Offload Link (UAOL) DAI.
This is a revival of the old closed UAOL PR #9227.
Zephyr PR zephyrproject-rtos/zephyr#104137 is now merged.