Skip to content

Commit 572ccd5

Browse files
teburdnashif
authored andcommitted
intel_adsp: Use device tree to enable/disable each HDA driver
Uses the dt_compat_enabled Kconfig preprocessor to set defaults for each HDA driver. Each direction is uniquely selectable which can be useful when building with SOF where only some directions may wish to be enabled at any given time. By default, given the device tree (intel_cavs.dtsi) only the host directions are enabled but an overlay may adjust that as needed. Signed-off-by: Tom Burdick <[email protected]>
1 parent 2a8e3fe commit 572ccd5

File tree

5 files changed

+47
-10
lines changed

5 files changed

+47
-10
lines changed

drivers/dma/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@ zephyr_library_sources_ifdef(CONFIG_DMA_PL330 dma_pl330.c)
1717
zephyr_library_sources_ifdef(CONFIG_DMA_IPROC_PAX dma_iproc_pax_v1.c)
1818
zephyr_library_sources_ifdef(CONFIG_DMA_IPROC_PAX_V2 dma_iproc_pax_v2.c)
1919
zephyr_library_sources_ifdef(CONFIG_DMA_CAVS_GPDMA dma_cavs_gpdma.c dma_dw_common.c)
20-
zephyr_library_sources_ifdef(CONFIG_DMA_CAVS_HDA dma_cavs_hda.c dma_cavs_hda_host_in.c dma_cavs_hda_host_out.c
21-
dma_cavs_hda_link_in.c dma_cavs_hda_link_out.c)
20+
zephyr_library_sources_ifdef(CONFIG_DMA_CAVS_HDA dma_cavs_hda.c)
21+
zephyr_library_sources_ifdef(CONFIG_DMA_CAVS_HDA_HOST_IN dma_cavs_hda_host_in.c)
22+
zephyr_library_sources_ifdef(CONFIG_DMA_CAVS_HDA_HOST_OUT dma_cavs_hda_host_out.c)
23+
zephyr_library_sources_ifdef(CONFIG_DMA_CAVS_HDA_LINK_IN dma_cavs_hda_link_in.c)
24+
zephyr_library_sources_ifdef(CONFIG_DMA_CAVS_HDA_LINK_OUT dma_cavs_hda_link_out.c)

drivers/dma/Kconfig.cavs_hda

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,45 @@
33
# Copyright (c) 2022 Intel Corporation
44
# SPDX-License-Identifier: Apache-2.0
55

6+
DT_COMPAT_INTEL_CAVS_HDA_HOST_IN := intel,cavs-hda-host-in
7+
DT_COMPAT_INTEL_CAVS_HDA_HOST_OUT := intel,cavs-hda-host-out
8+
DT_COMPAT_INTEL_CAVS_HDA_LINK_IN := intel,cavs-hda-link-in
9+
DT_COMPAT_INTEL_CAVS_HDA_LINK_OUT := intel,cavs-hda-link-out
10+
11+
config DMA_CAVS_HDA_HOST_IN
12+
bool "Intel cAVS HDA Host In DMA drivers"
13+
default $(dt_compat_enabled,$(DT_COMPAT_INTEL_CAVS_HDA_HOST_IN))
14+
depends on DMA
15+
select DMA_CAVS_HDA
16+
help
17+
Intel cAVS Host HDA DMA driver.
18+
19+
config DMA_CAVS_HDA_HOST_OUT
20+
bool "Intel cAVS HDA Host Out DMA drivers"
21+
default $(dt_compat_enabled,$(DT_COMPAT_INTEL_CAVS_HDA_HOST_OUT))
22+
depends on DMA
23+
select DMA_CAVS_HDA
24+
help
25+
Intel cAVS Host HDA DMA driver.
26+
27+
config DMA_CAVS_HDA_LINK_IN
28+
bool "Intel cAVS HDA Link In DMA drivers"
29+
default $(dt_compat_enabled,$(DT_COMPAT_INTEL_CAVS_HDA_LINK_IN))
30+
depends on DMA
31+
select DMA_CAVS_HDA
32+
help
33+
Intel cAVS Link In HDA DMA driver.
34+
35+
config DMA_CAVS_HDA_LINK_OUT
36+
bool "Intel cAVS HDA Link Out DMA drivers"
37+
default $(dt_compat_enabled,$(DT_COMPAT_INTEL_CAVS_HDA_LINK_OUT))
38+
depends on DMA
39+
select DMA_CAVS_HDA
40+
help
41+
Intel cAVS Link Out HDA DMA driver.
42+
643
config DMA_CAVS_HDA
7-
bool "Intel cAVS HDA DMA driver"
44+
bool
45+
depends on DMA_CAVS_HDA_LINK_OUT || DMA_CAVS_HDA_LINK_IN || DMA_CAVS_HDA_HOST_OUT || DMA_CAVS_HDA_HOST_IN
846
help
947
Intel cAVS HDA DMA driver.

dts/xtensa/intel/intel_cavs.dtsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
dma-buf-alignment = <128>;
4141
label = "HDA_LINK_OUT";
4242

43-
status = "okay";
43+
status = "disabled";
4444
};
4545

4646
hda_link_in: dma@72600 {
@@ -51,7 +51,7 @@
5151
dma-buf-alignment = <128>;
5252
label = "HDA_LINK_IN";
5353

54-
status = "okay";
54+
status = "disabled";
5555
};
5656

5757
hda_host_out: dma@72800 {

soc/xtensa/intel_adsp/Kconfig.defconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ config DMA_CAVS_GPDMA
1919
default y
2020
depends on DMA
2121

22-
config DMA_CAVS_HDA
23-
default y
24-
depends on DMA
25-
2622
config XTENSA_CCOUNT_HZ
2723
default 400000000 if SOC_SERIES_INTEL_CAVS_V25
2824
default 200000000

subsys/logging/Kconfig.backends

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ endif # LOG_BACKEND_ADSP
335335

336336
config LOG_BACKEND_CAVS_HDA
337337
bool "cAVS HDA backend"
338-
depends on SOC_FAMILY_INTEL_ADSP && DMA && DMA_CAVS_HDA
338+
depends on SOC_FAMILY_INTEL_ADSP && DMA && DMA_CAVS_HDA_HOST_OUT
339339
select LOG_OUTPUT
340340
help
341341
Provide a logging backend which writes to a buffer and

0 commit comments

Comments
 (0)