From bf379b5211a764830f19fe3c668e1381e1b015b6 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Wed, 25 Nov 2026 08:53:37 +0000 Subject: [PATCH 1/3] platform: remove the unused interrupt headers On Zephyr, platform/drivers/interrupt.h is only included through rtos/interrupt-legacy.h, which only the AMD platforms without native drivers use, and the host build uses the library platform copy. The i.MX8, i.MX8M, i.MX8ULP and posix copies are never included. Remove them. No functional change. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Liam Girdwood --- .../imx8/include/platform/drivers/interrupt.h | 118 ---------------- .../include/platform/drivers/interrupt.h | 126 ------------------ .../include/platform/drivers/interrupt.h | 39 ------ .../include/platform/drivers/interrupt.h | 10 -- 4 files changed, 293 deletions(-) delete mode 100644 src/kernel/platform/imx8/include/platform/drivers/interrupt.h delete mode 100644 src/kernel/platform/imx8m/include/platform/drivers/interrupt.h delete mode 100644 src/kernel/platform/imx8ulp/include/platform/drivers/interrupt.h delete mode 100644 src/kernel/platform/posix/include/platform/drivers/interrupt.h diff --git a/src/kernel/platform/imx8/include/platform/drivers/interrupt.h b/src/kernel/platform/imx8/include/platform/drivers/interrupt.h deleted file mode 100644 index d18af631df26..000000000000 --- a/src/kernel/platform/imx8/include/platform/drivers/interrupt.h +++ /dev/null @@ -1,118 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2019 NXP - * - * Author: Daniel Baluta - */ - -#ifdef __SOF_DRIVERS_INTERRUPT_H__ - -#ifndef __PLATFORM_DRIVERS_INTERRUPT_H__ -#define __PLATFORM_DRIVERS_INTERRUPT_H__ - -#include - -/* IRQ numbers */ -#if CONFIG_XT_INTERRUPT_LEVEL_1 - -#define IRQ_NUM_SOFTWARE0 8 /* Level 1 */ - -#define IRQ_MASK_SOFTWARE0 BIT(IRQ_NUM_SOFTWARE0) - -#endif - -#if CONFIG_XT_INTERRUPT_LEVEL_2 - -#define IRQ_NUM_TIMER0 2 /* Level 2 */ -#define IRQ_NUM_MU 7 /* Level 2 */ -#define IRQ_NUM_SOFTWARE1 9 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP0 19 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP1 20 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP2 21 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP3 22 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP4 23 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP5 24 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP6 25 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP7 26 /* Level 2 */ - -#define IRQ_MASK_TIMER0 BIT(IRQ_NUM_TIMER0) -#define IRQ_MASK_MU BIT(IRQ_NUM_MU) -#define IRQ_MASK_SOFTWARE1 BIT(IRQ_NUM_SOFTWARE1) -#define IRQ_MASK_IRQSTR_DSP0 BIT(IRQ_NUM_IRQSTR_DSP0) -#define IRQ_MASK_IRQSTR_DSP1 BIT(IRQ_NUM_IRQSTR_DSP1) -#define IRQ_MASK_IRQSTR_DSP2 BIT(IRQ_NUM_IRQSTR_DSP2) -#define IRQ_MASK_IRQSTR_DSP3 BIT(IRQ_NUM_IRQSTR_DSP3) -#define IRQ_MASK_IRQSTR_DSP4 BIT(IRQ_NUM_IRQSTR_DSP4) -#define IRQ_MASK_IRQSTR_DSP5 BIT(IRQ_NUM_IRQSTR_DSP5) -#define IRQ_MASK_IRQSTR_DSP6 BIT(IRQ_NUM_IRQSTR_DSP6) -#define IRQ_MASK_IRQSTR_DSP7 BIT(IRQ_NUM_IRQSTR_DSP7) - -#endif - -#if CONFIG_XT_INTERRUPT_LEVEL_3 - -#define IRQ_NUM_TIMER1 3 /* Level 3 */ - -#define IRQ_MASK_TIMER1 BIT(IRQ_NUM_TIMER1) - -#endif - -/* 32 HW interrupts + 8 IRQ_STEER lines each with 64 interrupts */ -#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS -#define PLATFORM_IRQ_CHILDREN 64 /* Each cascaded struct covers 64 IRQs */ -/* IMX: Covered steer IRQs are modulo-64 aligned. */ -#define PLATFORM_IRQ_FIRST_CHILD 0 - -/* irqstr_get_sof_int() - Convert IRQ_STEER interrupt to SOF logical - * interrupt - * @irqstr_int Shared IRQ_STEER interrupt - * - * Get the SOF interrupt number for a shared IRQ_STEER interrupt number. - * The IRQ_STEER number is the one specified in the hardware description - * manuals, while the SOF interrupt number is the one usable with the - * interrupt_register and interrupt_enable functions. - * - * Return: SOF interrupt number - */ -int irqstr_get_sof_int(int irqstr_int); - -#if defined CONFIG_IMX8 -#define IRQSTR_BASE_ADDR 0x510A0000 -#elif defined CONFIG_IMX8X -#define IRQSTR_BASE_ADDR 0x51080000 -#else -#error "Unsupported i.MX8 platform detected" -#endif - -/* The MASK, SET (unused) and STATUS registers are 512-bit registers - * split into 16 32-bit registers that we can directly access. - * - * The interrupts are mapped in the registers in the following way: - * Interrupts 480-511 at offset 0 - * Interrupts 448-479 at offset 1 - * Interrupts 416-447 at offset 2 - * ... - * Interrupts 64-95 at offset 13 - * Interrupts 32-63 at offset 14 - * Interrupts 0-31 at offset 15 - */ - -#define IRQSTR_CHANCTL 0x00 -#define IRQSTR_CH_MASK(n) (0x04 + 0x04 * (15 - (n))) -#define IRQSTR_CH_SET(n) (0x44 + 0x04 * (15 - (n))) -#define IRQSTR_CH_STATUS(n) (0x84 + 0x04 * (15 - (n))) -#define IRQSTR_MASTER_DISABLE 0xC4 -#define IRQSTR_MASTER_STATUS 0xC8 - -#define IRQSTR_RESERVED_IRQS_NUM 32 -#define IRQSTR_IRQS_NUM 512 -#define IRQSTR_IRQS_REGISTERS_NUM 16 -#define IRQSTR_IRQS_PER_LINE 64 - -#endif /* __PLATFORM_DRIVERS_INTERRUPT_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/drivers/interrupt.h" - -#endif /* __SOF_DRIVERS_INTERRUPT_H__ */ diff --git a/src/kernel/platform/imx8m/include/platform/drivers/interrupt.h b/src/kernel/platform/imx8m/include/platform/drivers/interrupt.h deleted file mode 100644 index 88fbe20eacc7..000000000000 --- a/src/kernel/platform/imx8m/include/platform/drivers/interrupt.h +++ /dev/null @@ -1,126 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2020 NXP - * - * Author: Daniel Baluta - */ - -#ifdef __SOF_DRIVERS_INTERRUPT_H__ - -#ifndef __PLATFORM_DRIVERS_INTERRUPT_H__ -#define __PLATFORM_DRIVERS_INTERRUPT_H__ - -#include - - -/* IRQ numbers */ -#if CONFIG_XT_INTERRUPT_LEVEL_1 - -#define IRQ_NUM_SOFTWARE0 8 /* Level 1 */ - -#define IRQ_MASK_SOFTWARE0 BIT(IRQ_NUM_SOFTWARE0) - -#endif - -#if CONFIG_XT_INTERRUPT_LEVEL_2 - -#define IRQ_NUM_TIMER0 2 /* Level 2 */ -#define IRQ_NUM_MU 7 /* Level 2 */ -#define IRQ_NUM_SOFTWARE1 9 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP0 19 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP1 20 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP2 21 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP3 22 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP4 23 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP5 24 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP6 25 /* Level 2 */ -#define IRQ_NUM_IRQSTR_DSP7 26 /* Level 2 */ - -#define IRQ_MASK_TIMER0 BIT(IRQ_NUM_TIMER0) -#define IRQ_MASK_MU BIT(IRQ_NUM_MU) -#define IRQ_MASK_SOFTWARE1 BIT(IRQ_NUM_SOFTWARE1) -#define IRQ_MASK_IRQSTR_DSP0 BIT(IRQ_NUM_IRQSTR_DSP0) -#define IRQ_MASK_IRQSTR_DSP1 BIT(IRQ_NUM_IRQSTR_DSP1) -#define IRQ_MASK_IRQSTR_DSP2 BIT(IRQ_NUM_IRQSTR_DSP2) -#define IRQ_MASK_IRQSTR_DSP3 BIT(IRQ_NUM_IRQSTR_DSP3) -#define IRQ_MASK_IRQSTR_DSP4 BIT(IRQ_NUM_IRQSTR_DSP4) -#define IRQ_MASK_IRQSTR_DSP5 BIT(IRQ_NUM_IRQSTR_DSP5) -#define IRQ_MASK_IRQSTR_DSP6 BIT(IRQ_NUM_IRQSTR_DSP6) -#define IRQ_MASK_IRQSTR_DSP7 BIT(IRQ_NUM_IRQSTR_DSP7) - -#endif - -#if CONFIG_XT_INTERRUPT_LEVEL_3 - -#define IRQ_NUM_TIMER1 3 /* Level 3 */ - -#define IRQ_MASK_TIMER1 BIT(IRQ_NUM_TIMER1) - -#endif - -/* 32 HW interrupts + 8 IRQ_STEER lines each with 64 interrupts */ -#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS -#define PLATFORM_IRQ_CHILDREN 64 /* Each cascaded struct covers 64 IRQs */ -/* On the i.MX8MP there are no reserved interrupts in the IRQ_STEER controller, - * so we have to revert to the usual behavior of moving the IRQ_STEER interrupts - * after the hardware interrupts. - * - * On i.MX8QXP and i.MX8QM this value is 0 so as to hide the reserved initial - * 32 interrupts by overlapping them with the hardware interrupts. - * - * In practice this means that the IRQ_STEER interrupt numbers do not match the - * SOF internal interrupt numbers exactly; rather IRQ_STEER interrupt 0 will be - * known as interrupt number 32 within SOF. - */ -#define PLATFORM_IRQ_FIRST_CHILD 0 - -/* irqstr_get_sof_int() - Convert IRQ_STEER interrupt to SOF logical - * interrupt - * @irqstr_int Shared IRQ_STEER interrupt - * - * Get the SOF interrupt number for a shared IRQ_STEER interrupt number. - * The IRQ_STEER number is the one specified in the hardware description - * manuals, while the SOF interrupt number is the one usable with the - * interrupt_register and interrupt_enable functions. - * - * Return: SOF interrupt number - */ -int irqstr_get_sof_int(int irqstr_int); - -#define IRQSTR_BASE_ADDR 0x30A80000 - -/* The MASK, SET (unused) and STATUS registers are 160-bit registers - * split into 5 32-bit registers that we can directly access. - * - * The interrupts are mapped in the registers in the following way: - * Interrupts 0-31 at offset 0 - * Interrupts 32-63 at offset 1 - * Interrupts 64-95 at offset 2 - * Interrupts 96-127 at offset 3 - * Interrupts 128-159 at offset 4 - */ - -/* This register is only there for HW compatibility; on this platform it - * does nothing. - */ -#define IRQSTR_CHANCTL 0x00 - -#define IRQSTR_CH_MASK(n) (0x04 + 0x04 * (4 - (n))) -#define IRQSTR_CH_SET(n) (0x18 + 0x04 * (4 - (n))) -#define IRQSTR_CH_STATUS(n) (0x2C + 0x04 * (4 - (n))) - -#define IRQSTR_MASTER_DISABLE 0x40 -#define IRQSTR_MASTER_STATUS 0x44 - -#define IRQSTR_RESERVED_IRQS_NUM 32 -#define IRQSTR_IRQS_NUM 192 -#define IRQSTR_IRQS_REGISTERS_NUM 5 -#define IRQSTR_IRQS_PER_LINE 64 - -#endif /* __PLATFORM_DRIVERS_INTERRUPT_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/drivers/interrupt.h" - -#endif /* __SOF_DRIVERS_INTERRUPT_H__ */ diff --git a/src/kernel/platform/imx8ulp/include/platform/drivers/interrupt.h b/src/kernel/platform/imx8ulp/include/platform/drivers/interrupt.h deleted file mode 100644 index f2dfc054453f..000000000000 --- a/src/kernel/platform/imx8ulp/include/platform/drivers/interrupt.h +++ /dev/null @@ -1,39 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2021 NXP - * - * Author: Zhang Peng - */ - -#ifdef __SOF_DRIVERS_INTERRUPT_H__ - -#ifndef __PLATFORM_DRIVERS_INTERRUPT_H__ -#define __PLATFORM_DRIVERS_INTERRUPT_H__ - -#include - -/* IRQ numbers */ -#define IRQ_DSP_SYS_NMI 0 -#define IRQ_NUM_SOFTWARE0 1 -#define IRQ_NUM_TIMER0 2 -#define IRQ_NUM_TIMER1 3 -#define IRQ_NUM_MU2 14 -#define IRQ_NUM_MU3 15 -#define IRQ_SAI5_NUM 23 -#define IRQ_SAI6_NUM 24 -#define IRQ_SAI7_NUM 25 - -#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS -#define PLATFORM_IRQ_CHILDREN 0 /* Each cascaded struct covers 64 IRQs */ -/* IMX: Covered steer IRQs are modulo-64 aligned. */ -#define PLATFORM_IRQ_FIRST_CHILD 0 - -/* no irqstr in 8ulp */ -int irqstr_get_sof_int(int irqstr_int); -#endif /* __PLATFORM_DRIVERS_INTERRUPT_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/drivers/interrupt.h" - -#endif /* __SOF_DRIVERS_INTERRUPT_H__ */ diff --git a/src/kernel/platform/posix/include/platform/drivers/interrupt.h b/src/kernel/platform/posix/include/platform/drivers/interrupt.h deleted file mode 100644 index d88916847428..000000000000 --- a/src/kernel/platform/posix/include/platform/drivers/interrupt.h +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2022 Google LLC. All rights reserved. - * Author: Andy Ross - */ -#ifndef PLATFORM_POSIX_PLATFORM_DRIVERS_INTERRUPT_H -#define PLATFORM_POSIX_PLATFORM_DRIVERS_INTERRUPT_H - -#define PLATFORM_IRQ_FIRST_CHILD 0 - -#endif /* PLATFORM_POSIX_PLATFORM_DRIVERS_INTERRUPT_H */ From e017560975e4a776475c03a35e85e67965e5b834 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Wed, 25 Nov 2026 08:53:37 +0000 Subject: [PATCH 2/3] platform: remove the unused DAI headers platform/lib/dai.h is only included through sof/lib/dai-legacy.h, which the Zephyr sof/lib/dai.h only uses without CONFIG_ZEPHYR_NATIVE_DRIVERS. All the i.MX and qemu_xtensa boards use the native drivers, and SOF has no legacy DAI drivers for them, so their copies are never included. Remove them. No functional change. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Liam Girdwood --- .../platform/imx8/include/platform/lib/dai.h | 19 ------------------- .../platform/imx8m/include/platform/lib/dai.h | 19 ------------------- .../imx8ulp/include/platform/lib/dai.h | 19 ------------------- .../imx93_a55/include/platform/lib/dai.h | 19 ------------------- .../qemu_xtensa/include/platform/lib/dai.h | 11 ----------- 5 files changed, 87 deletions(-) delete mode 100644 src/kernel/platform/imx8/include/platform/lib/dai.h delete mode 100644 src/kernel/platform/imx8m/include/platform/lib/dai.h delete mode 100644 src/kernel/platform/imx8ulp/include/platform/lib/dai.h delete mode 100644 src/kernel/platform/imx93_a55/include/platform/lib/dai.h delete mode 100644 src/kernel/platform/qemu_xtensa/include/platform/lib/dai.h diff --git a/src/kernel/platform/imx8/include/platform/lib/dai.h b/src/kernel/platform/imx8/include/platform/lib/dai.h deleted file mode 100644 index 7f7ff3058d12..000000000000 --- a/src/kernel/platform/imx8/include/platform/lib/dai.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2019 NXP - * - * Author: Daniel Baluta - */ - -#ifdef __SOF_LIB_DAI_H__ - -#ifndef __PLATFORM_LIB_DAI_H__ -#define __PLATFORM_LIB_DAI_H__ - -#endif /* __PLATFORM_LIB_DAI_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dai.h" - -#endif /* __SOF_LIB_DAI_H__ */ diff --git a/src/kernel/platform/imx8m/include/platform/lib/dai.h b/src/kernel/platform/imx8m/include/platform/lib/dai.h deleted file mode 100644 index 489d79884dd6..000000000000 --- a/src/kernel/platform/imx8m/include/platform/lib/dai.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2020 NXP - * - * Author: Daniel Baluta - */ - -#ifdef __SOF_LIB_DAI_H__ - -#ifndef __PLATFORM_LIB_DAI_H__ -#define __PLATFORM_LIB_DAI_H__ - -#endif /* __PLATFORM_LIB_DAI_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dai.h" - -#endif /* __SOF_LIB_DAI_H__ */ diff --git a/src/kernel/platform/imx8ulp/include/platform/lib/dai.h b/src/kernel/platform/imx8ulp/include/platform/lib/dai.h deleted file mode 100644 index 3b77f60b88d9..000000000000 --- a/src/kernel/platform/imx8ulp/include/platform/lib/dai.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2021 NXP - * - * Author: Zhang Peng - */ - -#ifdef __SOF_LIB_DAI_H__ - -#ifndef __PLATFORM_LIB_DAI_H__ -#define __PLATFORM_LIB_DAI_H__ - -#endif /* __PLATFORM_LIB_DAI_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dai.h" - -#endif /* __SOF_LIB_DAI_H__ */ diff --git a/src/kernel/platform/imx93_a55/include/platform/lib/dai.h b/src/kernel/platform/imx93_a55/include/platform/lib/dai.h deleted file mode 100644 index 1fc983ebbeee..000000000000 --- a/src/kernel/platform/imx93_a55/include/platform/lib/dai.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2023 NXP - */ - -#ifdef __SOF_LIB_DAI_H__ - -#ifndef __PLATFORM_LIB_DAI_H__ -#define __PLATFORM_LIB_DAI_H__ - -/* TODO: remove me whenever possible */ - -#endif /* __PLATFORM_LIB_DAI_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dai.h" - -#endif /* __SOF_LIB_DAI_H__ */ diff --git a/src/kernel/platform/qemu_xtensa/include/platform/lib/dai.h b/src/kernel/platform/qemu_xtensa/include/platform/lib/dai.h deleted file mode 100644 index 418c383789a8..000000000000 --- a/src/kernel/platform/qemu_xtensa/include/platform/lib/dai.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2026 Intel Corporation. - */ - -#ifndef __PLATFORM_LIB_DAI_H__ -#define __PLATFORM_LIB_DAI_H__ - -/* Dummy dai header for qemu_xtensa */ - -#endif /* __PLATFORM_LIB_DAI_H__ */ From a093f487a8b2a8e6b3666b21794e8db856006f5f Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Wed, 25 Nov 2026 08:53:37 +0000 Subject: [PATCH 3/3] platform: remove the unused DMA headers The Zephyr sof/lib/dma.h only includes platform/lib/dma.h for the legacy DMA domain schedulers (CONFIG_SCHEDULE_DMA_SINGLE_CHANNEL and CONFIG_SCHEDULE_DMA_MULTI_CHANNEL), which only Rembrandt and MediaTek without native drivers select, and the host build uses the library platform copy. The i.MX, posix and qemu_xtensa copies are never included. Remove them. No functional change. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Liam Girdwood --- .../platform/imx8/include/platform/lib/dma.h | 31 ---------- .../platform/imx8m/include/platform/lib/dma.h | 56 ------------------- .../imx8m_cm7/include/platform/lib/dma.h | 19 ------- .../imx8ulp/include/platform/lib/dma.h | 31 ---------- .../imx93_a55/include/platform/lib/dma.h | 30 ---------- .../platform/imx95/include/platform/lib/dma.h | 19 ------- .../platform/posix/include/platform/lib/dma.h | 15 ----- .../qemu_xtensa/include/platform/lib/dma.h | 16 ------ 8 files changed, 217 deletions(-) delete mode 100644 src/kernel/platform/imx8/include/platform/lib/dma.h delete mode 100644 src/kernel/platform/imx8m/include/platform/lib/dma.h delete mode 100644 src/kernel/platform/imx8m_cm7/include/platform/lib/dma.h delete mode 100644 src/kernel/platform/imx8ulp/include/platform/lib/dma.h delete mode 100644 src/kernel/platform/imx93_a55/include/platform/lib/dma.h delete mode 100644 src/kernel/platform/imx95/include/platform/lib/dma.h delete mode 100644 src/kernel/platform/posix/include/platform/lib/dma.h delete mode 100644 src/kernel/platform/qemu_xtensa/include/platform/lib/dma.h diff --git a/src/kernel/platform/imx8/include/platform/lib/dma.h b/src/kernel/platform/imx8/include/platform/lib/dma.h deleted file mode 100644 index 2240e12780e6..000000000000 --- a/src/kernel/platform/imx8/include/platform/lib/dma.h +++ /dev/null @@ -1,31 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2019 NXP - * - * Author: Daniel Baluta - */ - -#ifdef __SOF_LIB_DMA_H__ - -#ifndef __PLATFORM_LIB_DMA_H__ -#define __PLATFORM_LIB_DMA_H__ - -#define PLATFORM_NUM_DMACS 2 - -/* max number of supported DMA channels */ -#define PLATFORM_MAX_DMA_CHAN 32 - -#define DMA_ID_EDMA0 0 -#define DMA_ID_HOST 1 - -#define dma_chan_irq(dma, chan) \ - irqstr_get_sof_int(((int *)dma->plat_data.drv_plat_data)[chan]) -#define dma_chan_irq_name(dma, chan) dma_irq_name(dma) - -#endif /* __PLATFORM_LIB_DMA_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dma.h" - -#endif /* __SOF_LIB_DMA_H__ */ diff --git a/src/kernel/platform/imx8m/include/platform/lib/dma.h b/src/kernel/platform/imx8m/include/platform/lib/dma.h deleted file mode 100644 index e5cc5a137f6e..000000000000 --- a/src/kernel/platform/imx8m/include/platform/lib/dma.h +++ /dev/null @@ -1,56 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2020 NXP - * - * Author: Daniel Baluta - */ - -#ifdef __SOF_LIB_DMA_H__ - -#ifndef __PLATFORM_LIB_DMA_H__ -#define __PLATFORM_LIB_DMA_H__ - -#define PLATFORM_NUM_DMACS 2 - -/* max number of supported DMA channels */ -#define PLATFORM_MAX_DMA_CHAN 32 - -#define DMA_ID_SDMA2 0 -#define DMA_ID_HOST 1 -#define DMA_ID_SDMA3 2 - -#define dma_chan_irq(dma, chan) dma_irq(dma) -#define dma_chan_irq_name(dma, chan) dma_irq_name(dma) - -/* SDMA2 specific data */ - -/* Interrupts must be set up interestingly -- shift them all by 32 like - * on the other platforms. - * - * We want interrupt 103 + 32. To properly get it from IRQ_STEER we have - * to divide this by 64 (gives result 2 and remainder 7) due to how the - * IRQ_STEER driver interacts with SOF. - */ -#define SDMA2_IRQ 7 -#define SDMA2_IRQ_NAME "irqsteer2" - -/* SDMA3 specific data */ - -/* Hardware interrupt at the input of irqsteer for SDMA3_IRQ is 34. In - * order to map it inside the IRQSTEER we must add 32. So inside - * irqsteer SDMA2 interrupt will be 32 + 34 = 66. Next is to map it - * to an irqsteer child 66 % 64 = 1 and reminder 2. This means the - * interrupt is mapped to irqsteer1 and has the index 2. - */ -#define SDMA3_IRQ 2 -#define SDMA3_IRQ_NAME "irqsteer1" - -#define SDMA_CORE_RATIO 1/* Enable ACR bit as it's needed for this platform */ - -#endif /* __PLATFORM_LIB_DMA_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dma.h" - -#endif /* __SOF_LIB_DMA_H__ */ diff --git a/src/kernel/platform/imx8m_cm7/include/platform/lib/dma.h b/src/kernel/platform/imx8m_cm7/include/platform/lib/dma.h deleted file mode 100644 index ad55e7f7fb89..000000000000 --- a/src/kernel/platform/imx8m_cm7/include/platform/lib/dma.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2026 NXP - */ - -#ifdef __SOF_LIB_DMA_H__ - -#ifndef __PLATFORM_LIB_DMA_H__ -#define __PLATFORM_LIB_DMA_H__ - -/* TODO: remove me whenever possible */ - -#endif /* __PLATFORM_LIB_DMA_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dma.h" - -#endif /* __SOF_LIB_DMA_H__ */ diff --git a/src/kernel/platform/imx8ulp/include/platform/lib/dma.h b/src/kernel/platform/imx8ulp/include/platform/lib/dma.h deleted file mode 100644 index 000508d0e46e..000000000000 --- a/src/kernel/platform/imx8ulp/include/platform/lib/dma.h +++ /dev/null @@ -1,31 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2021 NXP - * - * Author: Peng Zhang - */ - -#ifdef __SOF_LIB_DMA_H__ - -#ifndef __PLATFORM_LIB_DMA_H__ -#define __PLATFORM_LIB_DMA_H__ - -#define PLATFORM_NUM_DMACS 2 - -/* max number of supported DMA channels */ -#define PLATFORM_MAX_DMA_CHAN 32 - -#define DMA_ID_EDMA2 0 -#define DMA_ID_HOST 1 - -#define dma_chan_irq(dma, chan) \ - (((int *)dma->plat_data.drv_plat_data)[chan]) -#define dma_chan_irq_name(dma, chan) dma_irq_name(dma) - -#endif /* __PLATFORM_LIB_DMA_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dma.h" - -#endif /* __SOF_LIB_DMA_H__ */ diff --git a/src/kernel/platform/imx93_a55/include/platform/lib/dma.h b/src/kernel/platform/imx93_a55/include/platform/lib/dma.h deleted file mode 100644 index 93d62c2dec5d..000000000000 --- a/src/kernel/platform/imx93_a55/include/platform/lib/dma.h +++ /dev/null @@ -1,30 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2023 NXP - */ - -#ifdef __SOF_LIB_DMA_H__ - -#ifndef __PLATFORM_LIB_DMA_H__ -#define __PLATFORM_LIB_DMA_H__ - -/* i.MX93 uses dummy DMA and EDMA */ -#define PLATFORM_NUM_DMACS 2 - -#define DMA_ID_EDMA2 0 -#define DMA_ID_HOST 1 - -/* TODO: this is already defined with EDMA2_CHAN_MAX */ -#define PLATFORM_MAX_DMA_CHAN 64 - -/* TODO: required by Zephyr DMA domain to work */ -#define dma_chan_irq_name(dma, chan) dma_irq_name(dma) -#define dma_chan_irq(dma, chan) ((int *)(dma)->plat_data.drv_plat_data)[chan] - -#endif /* __PLATFORM_LIB_DMA_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dma.h" - -#endif /* __SOF_LIB_DMA_H__ */ diff --git a/src/kernel/platform/imx95/include/platform/lib/dma.h b/src/kernel/platform/imx95/include/platform/lib/dma.h deleted file mode 100644 index 5f1c725f693d..000000000000 --- a/src/kernel/platform/imx95/include/platform/lib/dma.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2024 NXP - */ - -#ifdef __SOF_LIB_DMA_H__ - -#ifndef __PLATFORM_LIB_DMA_H__ -#define __PLATFORM_LIB_DMA_H__ - -/* TODO: remove me whenever possible */ - -#endif /* __PLATFORM_LIB_DMA_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dma.h" - -#endif /* __SOF_LIB_DMA_H__ */ diff --git a/src/kernel/platform/posix/include/platform/lib/dma.h b/src/kernel/platform/posix/include/platform/lib/dma.h deleted file mode 100644 index 809ae9127af1..000000000000 --- a/src/kernel/platform/posix/include/platform/lib/dma.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2022 Google LLC. All rights reserved. - * Author: Andy Ross - */ -#ifndef PLATFORM_POSIX_LIB_DMA_H -#define PLATFORM_POSIX_LIB_DMA_H - -#define FIXME_DMA_IRQ 999 -#define dma_chan_irq(dma, chan) FIXME_DMA_IRQ -#define dma_chan_irq_name(dma, chan) "FIXME_DMA_NAME" - -#define PLATFORM_NUM_DMACS 6 -#define PLATFORM_MAX_DMA_CHAN 9 - -#endif /* PLATFORM_POSIX_LIB_DMA_H */ diff --git a/src/kernel/platform/qemu_xtensa/include/platform/lib/dma.h b/src/kernel/platform/qemu_xtensa/include/platform/lib/dma.h deleted file mode 100644 index 4c4068b99392..000000000000 --- a/src/kernel/platform/qemu_xtensa/include/platform/lib/dma.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2026 Intel Corporation. - */ - -#ifndef __PLATFORM_LIB_DMA_H__ -#define __PLATFORM_LIB_DMA_H__ - -/* Dummy dma header for qemu_xtensa */ -struct dma; - -struct sof_dma { - const struct device *z_dev; -}; - -#endif /* __PLATFORM_LIB_DMA_H__ */