Skip to content

Commit 206ce15

Browse files
nxp: imx8/imx8x: switch to native Zephyr drivers and timer domain
This commit includes all necessary changes for switching to timer domain and Zephyr native drivers on imx8 and imx8x. This consists of: 1) Switching all imx8 topologies to timer domain. 2) Disabling Zephyr DMA domain 3) Various interrupt-related fixes via Kconfig-related ifdef logic. This commit includes all necessary changes for switching to native Zephyr drivers on imx8/imx8x. Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
1 parent 32d6d63 commit 206ce15

24 files changed

Lines changed: 43 additions & 60 deletions

app/boards/imx8qm_mek_mimx8qm6_adsp.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ CONFIG_TRACE=n
77
CONFIG_DMA=y
88
CONFIG_DMA_NXP_EDMA_ENABLE_HALFMAJOR_IRQ=y
99
CONFIG_SHARED_INTERRUPTS=y
10+
CONFIG_ZEPHYR_NATIVE_DRIVERS=y

app/boards/imx8qxp_mek_mimx8qx6_adsp.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ CONFIG_TRACE=n
77
CONFIG_DMA=y
88
CONFIG_DMA_NXP_EDMA_ENABLE_HALFMAJOR_IRQ=y
99
CONFIG_SHARED_INTERRUPTS=y
10+
CONFIG_ZEPHYR_NATIVE_DRIVERS=y

src/drivers/imx/ipc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
LOG_MODULE_REGISTER(ipc_task, CONFIG_SOF_LOG_LEVEL);
3535

36-
#ifdef CONFIG_ARM64
36+
#if defined(CONFIG_ARM64) || defined(CONFIG_IMX8) || defined(CONFIG_IMX8X)
3737
/* thanks to the fact that ARM's GIC is supported
3838
* by Zephyr there's no need to clear interrupts
3939
* explicitly. This should already be done by Zephyr

src/platform/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ config IMX8
6767
select IMX
6868
select IMX_EDMA
6969
select IMX_ESAI
70-
select SCHEDULE_DMA_MULTI_CHANNEL
7170
select IMX_INTERRUPT_IRQSTEER
7271
help
7372
Select if your target platform is imx8-compatible
@@ -84,7 +83,6 @@ config IMX8X
8483
select IMX
8584
select IMX_EDMA
8685
select IMX_ESAI
87-
select SCHEDULE_DMA_MULTI_CHANNEL
8886
select IMX_INTERRUPT_IRQSTEER
8987
help
9088
Select if your target platform is imx8x-compatible

src/platform/imx8/include/platform/platform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct timer;
2424
#define LPSRAM_SIZE 16384
2525

2626
/* IPC Interrupt */
27-
#define PLATFORM_IPC_INTERRUPT IRQ_NUM_MU
27+
#define PLATFORM_IPC_INTERRUPT 7
2828
#define PLATFORM_IPC_INTERRUPT_NAME NULL
2929

3030
/* Host page size */

src/platform/imx8/platform.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,6 @@ int platform_init(struct sof *sof)
160160
sof->cpu_timers = sof->platform_timer;
161161
#endif
162162

163-
#ifdef __ZEPHYR__
164-
/* initialize cascade interrupts before any usage */
165-
interrupt_init(sof);
166-
#endif
167-
168163
platform_interrupt_init();
169164
platform_clock_init(sof);
170165
scheduler_init_edf();
@@ -187,15 +182,6 @@ int platform_init(struct sof *sof)
187182
if (ret < 0)
188183
return -ENODEV;
189184

190-
/* Init EDMA platform domain */
191-
sof->platform_dma_domain = dma_multi_chan_domain_init
192-
(&sof->dma_info->dma_array[0], 1,
193-
PLATFORM_DEFAULT_CLOCK, false);
194-
195-
/* i.MX platform DMA domain will be full synchronous, no time dependent */
196-
sof->platform_dma_domain->full_sync = true;
197-
scheduler_init_ll(sof->platform_dma_domain);
198-
199185
/* initialize the host IPC mechanims */
200186
ipc_init(sof);
201187

tools/topology/topology1/development/sof-imx8-compr-pcm-cap-wm8960.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ dnl period, priority, core, time_domain)
7575
DAI_ADD(sof/pipe-dai-capture.m4,
7676
1, SAI, 1, sai1-wm8960-hifi,
7777
PIPELINE_SINK_1, 2, s32le,
78-
1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA)
78+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
7979

8080
# PCM Low Latency, id 0
8181

tools/topology/topology1/development/sof-imx8-compr-pcm-wm8960.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ dnl period, priority, core, time_domain)
7575
DAI_ADD(sof/pipe-dai-playback.m4,
7676
1, SAI, 1, sai1-wm8960-hifi,
7777
PIPELINE_SOURCE_1, 2, s32le,
78-
1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA)
78+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
7979

8080
# PCM Low Latency, id 0
8181

tools/topology/topology1/development/sof-imx8-compr-wm8960.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ dnl period, priority, core, time_domain)
9090
DAI_ADD(sof/pipe-dai-playback.m4,
9191
1, SAI, 1, DAI_BE_NAME,
9292
PIPELINE_SOURCE_1, 2, s32le,
93-
1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA)
93+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
9494

9595

9696
# PCM Low Latency, id 0

tools/topology/topology1/development/sof-imx8-src-cs42888.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ dnl period, priority, core, time_domain)
5959
DAI_ADD(sof/pipe-dai-playback.m4,
6060
1, ESAI, 0, esai0-cs42888,
6161
PIPELINE_SOURCE_1, 2, s24le,
62-
1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA)
62+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
6363

6464
# capture DAI is ESAI0 using 2 periods
6565
# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0
6666
DAI_ADD(sof/pipe-dai-capture.m4,
6767
2, ESAI, 0, esai0-cs42888,
6868
PIPELINE_SINK_2, 2, s24le,
69-
1000, 0, 0)
69+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
7070

7171
# PCM Low Latency, id 0
7272

0 commit comments

Comments
 (0)