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

remove platform lib/dai.h from SOF Zephyr builds #9653

Merged
merged 7 commits into from
Nov 18, 2024

Conversation

kv2019i
Copy link
Collaborator

@kv2019i kv2019i commented Nov 14, 2024

A patch series the convert remaining use of platform lib/dai.h in SOF cmmon code to either device-tree (in generic code) or simple ifdefs (in vendor specific compiliation units).

In the end of series, remove the lib/dai.h definitions for all Zephyr-only SOF platforms.

Link: #5794

@kv2019i
Copy link
Collaborator Author

kv2019i commented Nov 14, 2024

Stub build is failing. I think #9651 will help with this. Current chain_dma.c require HDA drivers to be enabled in the build. Will confirm.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

Good stuff - nice to see more deletions of legacy code.

/* copier id = (group id << 4) + codec id + IPC4_ALH_DAI_INDEX_OFFSET
* dai_index = (group id << 8) + codec id;
*/
#define IPC4_ALH_DAI_INDEX(x) ((((x) & 0xF0) << DAI_NUM_ALH_BI_DIR_LINKS_GROUP) + \
#define IPC4_ALH_DAI_INDEX(x) ((((x) & 0xF0) << IPC4_DAI_NUM_ALH_BI_DIR_LINKS_GROUP) + \
Copy link
Member

Choose a reason for hiding this comment

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

Btw, should this be in Zephyr now ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lgirdwood I took a look at this, but we don't really have a good schema for ALH instances in DT, and on newer platforms (ace20 onwards), this is really replaced by the HDA link DMA. And to add to that, this bi-dir-link group is really only used to parse the blob, so it's not even strictly tied to hw interface and its use, so in the end did not seem worth the effort.

src/audio/base_fw_intel.c Show resolved Hide resolved
src/audio/base_fw_intel.c Show resolved Hide resolved
The alh.h headers have used SOF platform layer to handle
differences between different Intel ALH generations. In the end
the only difference is the encoding used for DAI index.

Move the variation to ipc4/alh.h directly as this only affects
Intel builds with ALH support.

Signed-off-by: Kai Vehmanen <[email protected]>
Stop using platform layer to query number of SSP instances
and number of HDA in/out DMA channels. The hardware specific
information is already defined in device tree data, so no need
to have same information duplicated in SOF platform layer.

Signed-off-by: Kai Vehmanen <[email protected]>
To calculate the gateway count in hardware config IPC response,
ALH bidirection link count is needed.

Instead of pulling this from the SOF platform layer, use
the ipc4/alh.h directly as it now has this information.

Signed-off-by: Kai Vehmanen <[email protected]>
Stop using the SOF platform layer and directly pull the hardware
properties from devicetree.

Signed-off-by: Kai Vehmanen <[email protected]>
Use of native Zephyr DAIs has no dependency to SOF platform
definitions anymore, so this include can be removed.

Signed-off-by: Kai Vehmanen <[email protected]>
No longer needed for Zephyr builds, can be removed as unused.

Signed-off-by: Kai Vehmanen <[email protected]>
No longer needed for Zephyr builds, can be removed as unused.

Signed-off-by: Kai Vehmanen <[email protected]>
@kv2019i kv2019i force-pushed the 202411-plat-dai-h-removal branch from b2f426e to c9fd56c Compare November 14, 2024 18:25
@kv2019i
Copy link
Collaborator Author

kv2019i commented Nov 14, 2024

V2 pushed:

@lgirdwood lgirdwood merged commit c219219 into thesofproject:main Nov 18, 2024
42 of 47 checks passed
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