* Add ExynosAuto ABOX generic platform and PCM support
[not found] <CGME20250721024611epcas2p43099e043aaa6f48c05eb0237065d31c7@epcas2p4.samsung.com>
@ 2025-07-21 2:30 ` ew kim
[not found] ` <CGME20250721024611epcas2p45ddc52c1644f5779c7da822573f03246@epcas2p4.samsung.com>
` (8 more replies)
0 siblings, 9 replies; 17+ messages in thread
From: ew kim @ 2025-07-21 2:30 UTC (permalink / raw)
To: broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
This patch series adds the ABOX Generic audio management driver for
Samsung ExynosAuto SoCs, along with IPC messaging and PCM frontend
drivers, including their corresponding device tree bindings.
### ABOX Architecture Design: Fixed and Variable Structure
The ABOX audio framework is designed with a clear split between:
- **Fixed part** (common framework): reusable components across SoCs
- Generic ABOX platform driver
- IPC messaging handler
- PCM frontend with ALSA compressed audio support
- Solution manager for dynamic control
- **Variable part** (SoC-specific): defined via device tree
- IRQ numbers, stream IDs, buffer sizes, and ADSP allocation
- Defined per PCM/IPC device node in DTS
This separation allows the fixed part to be upstreamed and maintained
as a reusable framework, while only the DTS and minimal changes are
needed to adapt to each SoC generation.
### Major Components in This Series
- `abox_generic`: Root platform driver coordinating subcomponents
- `abox_ipc_generic`: Handles ADSP messaging via IRQ-based IPC
- `abox_pcm_dev`: PCM frontend with support for solution chain selection
- `abox_solution_mgr`: Manages software-based audio chains via dynamic
kcontrols
### Testing
Tested on ExynosAuto v920 board:
- Verified ALSA compressed audio playback via DSP
- Confirmed solution switching via kcontrol
- Verified DT node parsing and IRQ routing from device tree
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/9] ASoC: samsung: Add generic ABOX management driver
[not found] ` <CGME20250721024611epcas2p45ddc52c1644f5779c7da822573f03246@epcas2p4.samsung.com>
@ 2025-07-21 2:30 ` ew kim
2025-07-30 12:04 ` Mark Brown
0 siblings, 1 reply; 17+ messages in thread
From: ew kim @ 2025-07-21 2:30 UTC (permalink / raw)
To: broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
ew kim
This driver implements the *generic* (fixed) part of the ABOX management
stack for Samsung Automotive SoCs. It does not directly control hardware
but provides common interfaces and state needed by SoC-specific
(variable) drivers.
The abox generic driver manages child drivers and provides an interface
that bridges the fixed and variable parts, connecting the two modules.
Design Note:
- The abox generic driver has child drivers, but they are built into a
single kernel module.
- The generic driver and the SoC-specific (variable) driver do not have
a parent-child device relationship.
- Instead, they are independent, peer modules.
- To bridge the gap, the generic driver exposes shared state
via a global pointer and EXPORT_SYMBOL accessor.
- This allows multiple SoC-specific modules to attach to
common generic functionality without tight coupling.
- Only one instance of the generic driver is supported.
Future work will focus on integrating this driver tightly with
ALSA SoC components and improving user-space interfaces.
Code style and interface improvements will be made in subsequent patches
based on upstream review feedback.
Tested on Exynos Auto platform for basic initialization and state sharing.
Note:
The ABOX (Audio Box) is an audio DSP hardware block integrated into
Exynos Automotive SoCs. It includes components such as DMA controllers,
I2S interfaces, GIC (interrupt controller), and the ADSP (audio DSP core).
Signed-off-by: ew kim <ew.kim@samsung.com>
---
sound/soc/samsung/Kconfig | 2 +
sound/soc/samsung/Makefile | 1 +
sound/soc/samsung/auto_abox/Kconfig | 22 +
sound/soc/samsung/auto_abox/generic/Kbuild | 12 +
.../samsung/auto_abox/generic/abox_generic.c | 384 ++++++++++++++++++
.../auto_abox/generic/include/abox_generic.h | 84 ++++
6 files changed, 505 insertions(+)
create mode 100644 sound/soc/samsung/auto_abox/Kconfig
create mode 100644 sound/soc/samsung/auto_abox/generic/Kbuild
create mode 100644 sound/soc/samsung/auto_abox/generic/abox_generic.c
create mode 100644 sound/soc/samsung/auto_abox/generic/include/abox_generic.h
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig
index 60b4b7b75215..359aa67f49db 100644
--- a/sound/soc/samsung/Kconfig
+++ b/sound/soc/samsung/Kconfig
@@ -148,4 +148,6 @@ config SND_SOC_SAMSUNG_MIDAS_WM1811
help
Say Y if you want to add support for SoC audio on the Midas boards.
+source "sound/soc/samsung/auto_abox/Kconfig"
+
endif #SND_SOC_SAMSUNG
diff --git a/sound/soc/samsung/Makefile b/sound/soc/samsung/Makefile
index 8d5f09147900..5d99cfbfa71c 100644
--- a/sound/soc/samsung/Makefile
+++ b/sound/soc/samsung/Makefile
@@ -42,3 +42,4 @@ obj-$(CONFIG_SND_SOC_ARNDALE) += snd-soc-arndale.o
obj-$(CONFIG_SND_SOC_SAMSUNG_TM2_WM5110) += snd-soc-tm2-wm5110.o
obj-$(CONFIG_SND_SOC_SAMSUNG_ARIES_WM8994) += snd-soc-aries-wm8994.o
obj-$(CONFIG_SND_SOC_SAMSUNG_MIDAS_WM1811) += snd-soc-midas-wm1811.o
+obj-$(CONFIG_SND_SOC_SAMSUNG_AUTO_ABOX) += auto_abox/generic/
\ No newline at end of file
diff --git a/sound/soc/samsung/auto_abox/Kconfig b/sound/soc/samsung/auto_abox/Kconfig
new file mode 100644
index 000000000000..d22b54fb785f
--- /dev/null
+++ b/sound/soc/samsung/auto_abox/Kconfig
@@ -0,0 +1,22 @@
+#: SPDX-License-Identifier: GPL-2.0-only
+
+menu "Exynosauto Automotive Abox Modules Options"
+
+config SND_SOC_SAMSUNG_AUTO_ABOX
+ tristate "ASoC support for Samsung Exynosauto Automotive ABOX Audio"
+ select SND_SOC_COMPRESS
+ help
+ This driver provides a generic management layer for the ABOX
+ audio block on Samsung SoCs.
+
+ The design splits the ABOX support into:
+ - Fixed generic driver
+ - SoC-specific hardware drivers
+
+ These parts are independent modules without parent-child
+ binding. The generic driver therefore exposes a global
+ accessor via EXPORT_SYMBOL so that variable parts can share
+ state and callbacks safely.
+
+endmenu
+
diff --git a/sound/soc/samsung/auto_abox/generic/Kbuild b/sound/soc/samsung/auto_abox/generic/Kbuild
new file mode 100644
index 000000000000..fa6ba7091730
--- /dev/null
+++ b/sound/soc/samsung/auto_abox/generic/Kbuild
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0
+# Exynosauto Automotive Abox Driver Support
+
+snd-soc-samsung-abox-generic-$(CONFIG_SND_SOC_SAMSUNG_AUTO_ABOX) := \
+ abox_generic.o
+
+ccflags-y += -I./include
+
+obj-$(CONFIG_SND_SOC_SAMSUNG_AUTO_ABOX) += \
+ snd-soc-samsung-abox-generic.o
+
+
diff --git a/sound/soc/samsung/auto_abox/generic/abox_generic.c b/sound/soc/samsung/auto_abox/generic/abox_generic.c
new file mode 100644
index 000000000000..e1e14750ac8d
--- /dev/null
+++ b/sound/soc/samsung/auto_abox/generic/abox_generic.c
@@ -0,0 +1,384 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd.
+ * Author: Eunwoo Kim <ew.kim@samsung.com>
+ *
+ * EXYNOS Automotive Abox Generic Driver - abox_generic.c
+ */
+
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+
+#include "include/abox_generic.h"
+
+/**
+ * abox_generic_data_global - Shared state for ABOX generic driver.
+ *
+ * Architecture note:
+ * -------------------------------------------
+ * Our driver stack is split into:
+ * - Fixed part (Generic): does not directly control HW
+ * - Variable part (SoC-specific): directly controls HW
+ *
+ * The fixed part (this driver) must expose internal state to
+ * multiple independent variable drivers which are not parent-child related.
+ *
+ * Since there is no device hierarchy or explicit binding between
+ * generic and SoC-specific parts, we use this single global
+ * pointer plus EXPORT_SYMBOL accessors to share the state safely.
+ *
+ * Caution: Only one instance of the generic driver is supported.
+ * Future work may replace this with a dedicated bus or component binding.
+ */
+static struct abox_generic_data *g_abox_generic_data;
+
+struct abox_generic_data *abox_generic_get_abox_generic_data(void)
+{
+ return g_abox_generic_data;
+}
+
+static struct abox_generic_data *abox_generic_get_generic_data_from_child(struct device *child_dev)
+{
+ struct device *generic_dev = child_dev->parent;
+ struct abox_generic_data *generic_data = NULL;
+
+ if (!generic_dev)
+ return NULL;
+
+ generic_data = dev_get_drvdata(generic_dev);
+ if (!generic_data)
+ return NULL;
+
+ return generic_data;
+}
+
+int abox_generic_set_dma_buffer(struct device *pcm_dev)
+{
+ struct abox_generic_data *generic_data = abox_generic_get_generic_data_from_child(pcm_dev);
+
+ if (!generic_data)
+ return -ENODATA;
+
+ if (!generic_data->soc_ioctl)
+ return -ENODATA;
+
+ return generic_data->soc_ioctl(generic_data->soc_dev, ABOX_SOC_IOCTL_SET_DMA_BUFFER,
+ pcm_dev);
+}
+
+int abox_generic_set_pp_pointer(struct device *pcm_dev)
+{
+ struct abox_generic_data *generic_data = abox_generic_get_generic_data_from_child(pcm_dev);
+
+ if (!generic_data)
+ return 0;
+
+ if (!generic_data->soc_ioctl)
+ return 0;
+
+ return generic_data->soc_ioctl(generic_data->soc_dev, ABOX_SOC_IOCTL_SET_PP_POINTER,
+ pcm_dev);
+}
+
+int abox_generic_attach_soc_callback(struct device *soc_dev,
+ soc_ioctl_fn soc_ioctl)
+{
+ struct abox_generic_data *generic_data = abox_generic_get_abox_generic_data();
+
+ if (!generic_data)
+ return -ENODATA;
+
+ generic_data->soc_dev = soc_dev;
+ generic_data->soc_ioctl = soc_ioctl;
+
+ generic_data->num_of_rdma = generic_data->soc_ioctl(generic_data->soc_dev,
+ ABOX_SOC_IOCTL_GET_NUM_OF_RDMA, NULL);
+ generic_data->num_of_wdma = generic_data->soc_ioctl(generic_data->soc_dev,
+ ABOX_SOC_IOCTL_GET_NUM_OF_WDMA, NULL);
+ generic_data->num_of_uaif = generic_data->soc_ioctl(generic_data->soc_dev,
+ ABOX_SOC_IOCTL_GET_NUM_OF_UAIF, NULL);
+
+ return 0;
+}
+EXPORT_SYMBOL(abox_generic_attach_soc_callback);
+
+/**
+ * abox_generic_get_pcm_platform_dev - Find PCM platform device by ID
+ * @pcm_id: PCM index to find
+ * @stream_type: Stream direction (e.g. playback or capture)
+ *
+ * This API returns the registered PCM platform device that matches
+ * the given PCM ID and stream type.
+ * It is exported for SoC-specific drivers to look up a specific PCM
+ * device instance managed by the generic ABOX layer.
+ *
+ * Return: Pointer to matching platform device, or NULL if not found.
+ */
+struct platform_device *abox_generic_get_pcm_platform_dev(int pcm_id, int stream_type)
+{
+ struct abox_generic_data *generic_data = abox_generic_get_abox_generic_data();
+ struct platform_device **pdev_pcm = NULL;
+
+ if (stream_type == SNDRV_PCM_STREAM_PLAYBACK)
+ pdev_pcm = generic_data->pdev_pcm_playback;
+ else
+ pdev_pcm = generic_data->pdev_pcm_capture;
+
+ return pdev_pcm[pcm_id];
+}
+EXPORT_SYMBOL(abox_generic_get_pcm_platform_dev);
+
+/**
+ * abox_generic_get_num_of_pcm - Get number of supported PCM devices
+ * @stream_type: Stream direction (e.g. playback or capture)
+ *
+ * Returns the total number of PCM platform devices registered for
+ * the given stream direction.
+ * This API is exported for SoC-specific drivers that need to manage
+ * or iterate over all available PCM instances.
+ *
+ * Return: Number of PCM devices.
+ */
+int abox_generic_get_num_of_pcm(int stream_type)
+{
+ struct abox_generic_data *generic_data = abox_generic_get_abox_generic_data();
+
+ if (!generic_data)
+ return -ENODATA;
+
+ return (stream_type == SNDRV_PCM_STREAM_PLAYBACK) ? generic_data->num_pcm_playback :
+ generic_data->num_pcm_capture;
+}
+EXPORT_SYMBOL(abox_generic_get_num_of_pcm);
+
+int abox_generic_get_num_of_i2s_dummy(void)
+{
+ struct abox_generic_data *generic_data = abox_generic_get_abox_generic_data();
+
+ if (!generic_data)
+ return -ENODATA;
+
+ return generic_data->num_i2s_dummy;
+}
+
+int abox_generic_get_num_of_dma(struct device *pcm_dev, int stream_type)
+{
+ struct abox_generic_data *generic_data = abox_generic_get_generic_data_from_child(pcm_dev);
+
+ return (stream_type == SNDRV_PCM_STREAM_PLAYBACK) ?
+ generic_data->num_of_rdma : generic_data->num_of_wdma;
+}
+
+int abox_generic_register_pcm_dev(struct platform_device *pdev_pcm,
+ unsigned int id, int stream_type)
+{
+ struct device *pcm_dev = &pdev_pcm->dev;
+ struct abox_generic_data *generic_data = abox_generic_get_generic_data_from_child(pcm_dev);
+ int num_of_pcm_dev = 0;
+
+ num_of_pcm_dev = (stream_type == SNDRV_PCM_STREAM_PLAYBACK) ?
+ generic_data->num_pcm_playback : generic_data->num_pcm_capture;
+ if (id >= num_of_pcm_dev) {
+ dev_err(pcm_dev, "%s: invalid id(%u) : Stream Type:%d\n", __func__, id,
+ stream_type);
+ return -EINVAL;
+ }
+
+ if (stream_type == SNDRV_PCM_STREAM_PLAYBACK)
+ generic_data->pdev_pcm_playback[id] = pdev_pcm;
+ else
+ generic_data->pdev_pcm_capture[id] = pdev_pcm;
+
+ return 0;
+}
+
+/**
+ * abox_generic_attach_soc_callback - Register SoC-specific ioctl callback
+ * @soc_dev: Device pointer for the SoC-specific driver
+ * @soc_ioctl: SoC-specific ioctl handler to attach
+ *
+ * This API lets a SoC-specific driver register its ioctl handler with
+ * the generic ABOX driver.
+ * Used to connect variable drivers that directly control hardware
+ * with the generic layer that provides shared infrastructure.
+ *
+ * Return: 0 on success or a negative error code.
+ */
+struct device *abox_generic_find_fe_dev_from_rtd(struct snd_soc_pcm_runtime *be)
+{
+ struct abox_generic_data *generic_data = abox_generic_get_abox_generic_data();
+ struct snd_soc_dpcm *dpcm;
+ struct snd_soc_pcm_runtime *fe;
+ int stream_type;
+
+ if (!generic_data)
+ return NULL;
+
+ for (stream_type = 0; stream_type <= SNDRV_PCM_STREAM_LAST; stream_type++) {
+ int cmpnt_index = 0;
+ struct snd_soc_component *component = NULL;
+
+ for_each_dpcm_fe(be, stream_type, dpcm) {
+ fe = dpcm->fe;
+ if (fe)
+ break;
+ }
+ if (!fe)
+ continue;
+
+ for_each_rtd_components(fe, cmpnt_index, component) {
+ struct platform_device **pdev = NULL;
+ int num_of_pcm_dev = 0;
+ int i;
+
+ if (stream_type == SNDRV_PCM_STREAM_PLAYBACK) {
+ num_of_pcm_dev = generic_data->num_pcm_playback;
+ pdev = generic_data->pdev_pcm_playback;
+ } else {
+ num_of_pcm_dev = generic_data->num_pcm_capture;
+ pdev = generic_data->pdev_pcm_capture;
+ }
+ for (i = 0; i < num_of_pcm_dev; i++)
+ if (pdev[i] && component->dev == &pdev[i]->dev)
+ return component->dev;
+ }
+ }
+
+ return NULL;
+}
+EXPORT_SYMBOL_GPL(abox_generic_find_fe_dev_from_rtd);
+
+int abox_generic_request_soc_ioctl(struct device *generic_dev, enum abox_soc_ioctl_cmd cmd,
+ void *data)
+{
+ struct abox_generic_data *generic_data = dev_get_drvdata(generic_dev);
+ struct device *soc_dev = generic_data->soc_dev;
+
+ if (IS_ERR_OR_NULL(soc_dev)) {
+ dev_err(generic_dev, "%s SoC Device is not ready\n", __func__);
+ return -ENODATA;
+ }
+ return generic_data->soc_ioctl(soc_dev, cmd, data);
+}
+
+static struct platform_driver *abox_generic_sub_drivers[] = {
+};
+
+static int abox_generic_read_property_from_dt(struct device *dev, struct abox_generic_data *data)
+{
+ struct device_node *np = dev->of_node;
+ int ret = 0;
+
+ ret = of_property_read_u32(np, "samsung,num-of-pcm_playback", &data->num_pcm_playback);
+ if (ret < 0) {
+ dev_err(dev, "%s property reading fail\n", "samsung,num-of-pcm_playback");
+ return ret;
+ }
+ ret = of_property_read_u32(np, "samsung,num-of-pcm_capture", &data->num_pcm_capture);
+ if (ret < 0) {
+ dev_err(dev, "%s property reading fail\n", "samsung,num-of-pcm_capture");
+ return ret;
+ }
+ ret = of_property_read_u32(np, "samsung,num-of-i2s-dummy-backend", &data->num_i2s_dummy);
+ if (ret < 0) {
+ dev_err(dev, "%s property reading fail\n", "samsung,num-of-i2s-dummy-backend");
+ return ret;
+ }
+
+ return ret;
+}
+
+static int abox_generic_allocate_memory(struct device *dev, struct abox_generic_data *data)
+{
+ data->pdev_pcm_playback = devm_kcalloc(dev, data->num_pcm_playback,
+ sizeof(struct platform_device *),
+ GFP_KERNEL);
+ if (!data->pdev_pcm_playback)
+ return -ENOMEM;
+
+ data->pdev_pcm_capture = devm_kcalloc(dev, data->num_pcm_capture,
+ sizeof(struct platform_device *),
+ GFP_KERNEL);
+ if (!data->pdev_pcm_capture)
+ return -ENOMEM;
+
+ return 0;
+}
+
+static int samsung_abox_generic_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct device_node *np = dev->of_node;
+ struct abox_generic_data *data;
+ int ret = 0;
+
+ data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ data->pdev = pdev;
+ ret = abox_generic_read_property_from_dt(dev, data);
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "%s Failed to read property. ret:%d\n", __func__,
+ ret);
+
+ ret = abox_generic_allocate_memory(dev, data);
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "%s Failed to allocate memory. ret:%d\n", __func__,
+ ret);
+
+ g_abox_generic_data = data;
+ platform_set_drvdata(pdev, data);
+
+ platform_register_drivers(abox_generic_sub_drivers, ARRAY_SIZE(abox_generic_sub_drivers));
+ ret = of_platform_populate(np, NULL, NULL, dev);
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Failed to populate sub-platform_devices. ret:%d\n",
+ ret);
+
+ return ret;
+}
+
+static void samsung_abox_generic_remove(struct platform_device *pdev)
+{
+ struct abox_generic_data *data = platform_get_drvdata(pdev);
+
+ platform_unregister_drivers(abox_generic_sub_drivers,
+ ARRAY_SIZE(abox_generic_sub_drivers));
+
+ g_abox_generic_data = NULL;
+
+ return 0;
+}
+
+static void samsung_abox_generic_shutdown(struct platform_device *pdev)
+{
+}
+
+static const struct of_device_id samsung_abox_generic_match[] = {
+ {
+ .compatible = "samsung,abox_generic",
+ },
+ {}
+};
+MODULE_DEVICE_TABLE(of, samsung_abox_generic_match);
+
+struct platform_driver samsung_abox_generic_driver = {
+ .probe = samsung_abox_generic_probe,
+ .remove = samsung_abox_generic_remove,
+ .shutdown = samsung_abox_generic_shutdown,
+ .driver = {
+ .name = "samsung-abox-generic",
+ .of_match_table = of_match_ptr(samsung_abox_generic_match),
+ },
+};
+
+module_platform_driver(samsung_abox_generic_driver);
+/* Module information */
+MODULE_AUTHOR("Eunwoo Kim, <ew.kim@samsung.com>");
+MODULE_DESCRIPTION("Samsung ASoC A-Box Generic Driver");
+MODULE_LICENSE("GPL");
+
diff --git a/sound/soc/samsung/auto_abox/generic/include/abox_generic.h b/sound/soc/samsung/auto_abox/generic/include/abox_generic.h
new file mode 100644
index 000000000000..b2a3f32ac577
--- /dev/null
+++ b/sound/soc/samsung/auto_abox/generic/include/abox_generic.h
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * ALSA SoC - Samsung ABOX Share Function and Data structure
+ * for Exynos specific extensions
+ *
+ * Copyright (C) 2013-2020 Samsung Electronics Co., Ltd.
+ *
+ * EXYNOS - sound/soc/samsung/abox/include/abox_generic.h
+ */
+
+#ifndef __SND_SOC_ABOX_GENERIC_BASE_H
+#define __SND_SOC_ABOX_GENERIC_BASE_H
+
+struct snd_soc_pcm_runtime;
+
+enum abox_soc_ioctl_cmd {
+ ABOX_SOC_IOCTL_GET_NUM_OF_RDMA,
+ ABOX_SOC_IOCTL_GET_NUM_OF_WDMA,
+ ABOX_SOC_IOCTL_GET_NUM_OF_UAIF,
+ ABOX_SOC_IOCTL_GET_SOC_TIMER,
+ ABOX_SOC_IOCTL_SET_DMA_BUFFER,
+ ABOX_SOC_IOCTL_SET_PP_POINTER,
+ ABOX_SOC_IOCTL_SET_PERF_PERIOD,
+ ABOX_SOC_IOCTL_CHECK_TIME_MUTEX,
+ ABOX_SOC_IOCTL_CHECK_TIME_NO_MUTEX,
+ ABOX_SOC_IOCTL_PCM_DUMP_INTR,
+ ABOX_SOC_IOCTL_PCM_DUMP_CLOSE,
+ ABOX_SOC_IOCTL_PCM_DUMP_ADD_CONTROL,
+ ABOX_SOC_IOCTL_MAX
+};
+
+/**
+ * SOC_IOCTL - SoC-specific callback prototype
+ * @soc_dev: SoC device pointer
+ * @cmd: Command to handle (enum abox_soc_ioctl_cmd)
+ * @data: Additional argument, type depends on command
+ *
+ * This is the callback type which the SoC-specific driver must provide.
+ * The generic driver calls this to communicate with the hardware layer.
+ *
+ * Return: 0 on success or negative error code.
+ */
+typedef int (*soc_ioctl_fn)(struct device *soc_dev, enum abox_soc_ioctl_cmd cmd, void *data);
+
+struct abox_generic_data {
+ struct platform_device *pdev;
+ struct platform_device **pdev_pcm_playback;
+ struct platform_device **pdev_pcm_capture;
+ unsigned int num_pcm_playback;
+ unsigned int num_pcm_capture;
+ unsigned int num_i2s_dummy;
+ unsigned int num_of_rdma;
+ unsigned int num_of_wdma;
+ unsigned int num_of_uaif;
+ struct device *soc_dev;
+ soc_ioctl_fn soc_ioctl;
+};
+
+struct abox_generic_data *abox_generic_get_abox_generic_data(void);
+
+int abox_generic_set_dma_buffer(struct device *pcm_dev);
+
+int abox_generic_request_soc_ioctl(struct device *generic_dev, enum abox_soc_ioctl_cmd cmd,
+ void *data);
+
+int abox_generic_set_pp_pointer(struct device *pcm_dev);
+
+int abox_generic_get_num_of_dma(struct device *pcm_dev, int stream_type);
+
+int abox_generic_get_num_of_i2s_dummy(void);
+
+int abox_generic_register_pcm_dev(struct platform_device *pdev_pcm_dev,
+ unsigned int id, int stream_type);
+
+struct device *abox_generic_find_fe_dev_from_rtd(struct snd_soc_pcm_runtime *be);
+
+struct platform_device *abox_generic_get_pcm_platform_dev(int pcm_id, int stream_type);
+
+int abox_generic_get_num_of_pcm(int stream_type);
+
+int abox_generic_attach_soc_callback(struct device *soc_dev, soc_ioctl_fn soc_ioctl);
+
+#endif //__SND_SOC_ABOX_GENERIC_BASE_H
+
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/9] arm64: dts: exynosautov920: add abox_generic dt node
[not found] ` <CGME20250721024611epcas2p37ecbc204ea695d97f6477c04712a9974@epcas2p3.samsung.com>
@ 2025-07-21 2:30 ` ew kim
2025-07-21 6:41 ` Krzysztof Kozlowski
0 siblings, 1 reply; 17+ messages in thread
From: ew kim @ 2025-07-21 2:30 UTC (permalink / raw)
To: broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
ew kim
Add device tree node for the abox_generic platform driver to enable
its registration as a platform device. This node does not represent
direct hardware resources but is necessary for driver initialization
and platform device binding.
Properties added in the device tree node:
- samsung,num-pcm-playback (uint32):
Maximum number of supported PCM playback devices.
Here, PCM playback devices refer to ALSA PCM devices.
- samsung,num-pcm-capture (uint32):
Maximum number of supported PCM capture devices.
Here, PCM capture devices refer to ALSA PCM devices.
- samsung,num-i2s-dummy-backend (uint32):
Maximum number of supported I2S dummy backend devices.
The node is declared disabled by default in the main device tree source,
and enabled via board-specific DTS overlays by setting status = "okay".
This device tree binding document will be added under
Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
to describe the node properties and usage.
Signed-off-by: ew kim <ew.kim@samsung.com>
---
arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts | 4 ++++
arch/arm64/boot/dts/exynos/exynosautov920.dtsi | 10 ++++++++++
2 files changed, 14 insertions(+)
diff --git a/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts b/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
index a397f068ed53..a870c0b6847f 100644
--- a/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
+++ b/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
@@ -86,3 +86,7 @@ &usi_0 {
&xtcxo {
clock-frequency = <38400000>;
};
+
+&abox_generic {
+ status = "okay";
+};
\ No newline at end of file
diff --git a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
index 2cb8041c8a9f..4f086a7a79c8 100644
--- a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
@@ -1126,6 +1126,16 @@ timer {
<GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
<GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
};
+
+ abox_generic: abox_generic {
+ compatible = "samsung,abox_generic";
+ samsung,num-pcm-playback = <32>;
+ samsung,num-pcm-capture = <32>;
+ samsung,num-i2s-dummy-backend = <5>;
+ status = "disabled";
+ #address-cells = <2>;
+ #size-cells = <1>;
+ };
};
#include "exynosautov920-pinctrl.dtsi"
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/9] ASoC: dt-bindings: sound: Add Samsung ExynosAuto ABOX binding
[not found] ` <CGME20250721024611epcas2p47ebaf8cb494fc2bf71a83b00ba47f2b3@epcas2p4.samsung.com>
@ 2025-07-21 2:30 ` ew kim
2025-07-21 6:44 ` Krzysztof Kozlowski
0 siblings, 1 reply; 17+ messages in thread
From: ew kim @ 2025-07-21 2:30 UTC (permalink / raw)
To: broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
ew kim
Add the device tree binding documentation for the Samsung Exynos Automotive
ABOX generic audio management core. This binding describes how to configure
the maximum number of PCM playback, PCM capture, and dummy I2S backend
instances for the ABOX core. Actual hardware functionality is provided
by child audio sub-drivers.
Signed-off-by: ew kim <ew.kim@samsung.com>
---
.../bindings/sound/samsung,exynosauto.yaml | 69 +++++++++++++++++++
1 file changed, 69 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
diff --git a/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
new file mode 100644
index 000000000000..b1e49f38ffe9
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/samsung,exynosauto.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung Exynos Automotive Abox Generic
+
+maintainers:
+ - Eunwoo Kim <ew.kim@samsung.com>
+
+description: |
+ The Samsung Exynos Automotive Abox Generic node represents a
+ generic audio management platform device inside Exynos Automotive SoCs.
+ It does not directly control hardware resources itself, but acts as
+ a common interface to manage child audio sub-drivers for PCM playback,
+ PCM capture, and I2S dummy backends.
+
+ Typically, this node provides configuration for the maximum number of
+ PCM playback and capture devices (ALSA PCM) and the maximum number
+ of dummy I2S backend devices. The actual hardware control is handled
+ by child drivers attached to this generic core.
+
+ This node must exist for the platform driver to probe,
+ even though it does not map any physical hardware address.
+
+properties:
+ compatible:
+ const: samsung,abox_generic
+
+ samsung,num-pcm-playback:
+ description: Maximum number of PCM playback instances (ALSA PCM devices).
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ samsung,num-pcm-capture:
+ description: Maximum number of PCM capture instances (ALSA PCM devices).
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ samsung,num-i2s-dummy-backend:
+ description: Maximum number of dummy I2S backend instances.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ '#address-cells':
+ description: Required for child nodes that may declare address space.
+ const: 2
+
+ '#size-cells':
+ description: Required for child nodes that may declare address space.
+ const: 1
+
+required:
+ - compatible
+ - samsung,num-pcm-playback
+ - samsung,num-pcm-capture
+ - samsung,num-i2s-dummy-backend
+
+additionalProperties: false
+
+examples:
+ - |
+ abox_generic {
+ compatible = "samsung,abox_generic";
+ samsung,num-pcm-playback = <32>;
+ samsung,num-pcm-capture = <32>;
+ samsung,num-i2s-dummy-backend = <5>;
+ status = "disabled";
+ #address-cells = <2>;
+ #size-cells = <1>;
+ };
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 4/9] ASoC: samsung: abox: Add IPC generic support for message forwarding
[not found] ` <CGME20250721024611epcas2p4baca500b3b1f185dcdc35552b2abe8d9@epcas2p4.samsung.com>
@ 2025-07-21 2:30 ` ew kim
2025-07-30 12:06 ` Mark Brown
0 siblings, 1 reply; 17+ messages in thread
From: ew kim @ 2025-07-21 2:30 UTC (permalink / raw)
To: broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
ew kim
This adds the IPC generic driver as a child module of abox_generic
to handle bidirectional IPC message and IRQ routing between the
generic fixed layer and the SoC-specific audio side.
The driver:
- Registers a shared IRQ handler to allow SoC (variable part) to notify
the generic layer of IPC messages.
- Exports a registration interface to allow the generic layer to send
IPC messages to the SoC side.
- Uses a global singleton (non-DT) to coordinate state and callback
registration between the layers, due to lack of direct parent-child
linkage.
The driver is not a standalone module, and is built as part of the
snd-soc-samsung-abox-generic.ko module.
Signed-off-by: ew kim <ew.kim@samsung.com>
---
sound/soc/samsung/auto_abox/Kconfig | 19 +-
sound/soc/samsung/auto_abox/generic/Kbuild | 3 +-
.../samsung/auto_abox/generic/abox_generic.c | 13 +-
.../auto_abox/generic/abox_ipc_generic.c | 218 ++++++++++++++++++
.../auto_abox/generic/include/abox_generic.h | 2 +-
.../generic/include/abox_ipc_generic.h | 181 +++++++++++++++
6 files changed, 421 insertions(+), 15 deletions(-)
create mode 100644 sound/soc/samsung/auto_abox/generic/abox_ipc_generic.c
create mode 100644 sound/soc/samsung/auto_abox/generic/include/abox_ipc_generic.h
diff --git a/sound/soc/samsung/auto_abox/Kconfig b/sound/soc/samsung/auto_abox/Kconfig
index d22b54fb785f..55755b4166b8 100644
--- a/sound/soc/samsung/auto_abox/Kconfig
+++ b/sound/soc/samsung/auto_abox/Kconfig
@@ -10,13 +10,20 @@ config SND_SOC_SAMSUNG_AUTO_ABOX
audio block on Samsung SoCs.
The design splits the ABOX support into:
- - Fixed generic driver
- - SoC-specific hardware drivers
+ - A fixed generic control layer (ABOX Generic)
+ - SoC-specific hardware drivers (e.g., IPC, PCM, Backend)
- These parts are independent modules without parent-child
- binding. The generic driver therefore exposes a global
- accessor via EXPORT_SYMBOL so that variable parts can share
- state and callbacks safely.
+ These components are tightly coupled and share internal data
+ and callbacks. To ensure correct symbol resolution and
+ initialization ordering, all drivers are built together into
+ a single kernel object: snd-soc-samsung-abox-generic.ko
+
+ The sub-drivers are registered internally from the generic
+ driver's probe using platform_register_drivers(), rather than
+ being standalone platform drivers with independent module init.
+
+ This approach ensures integration consistency for fixed and
+ variable components across different automotive SoCs.
endmenu
diff --git a/sound/soc/samsung/auto_abox/generic/Kbuild b/sound/soc/samsung/auto_abox/generic/Kbuild
index fa6ba7091730..6a63d0609930 100644
--- a/sound/soc/samsung/auto_abox/generic/Kbuild
+++ b/sound/soc/samsung/auto_abox/generic/Kbuild
@@ -2,7 +2,8 @@
# Exynosauto Automotive Abox Driver Support
snd-soc-samsung-abox-generic-$(CONFIG_SND_SOC_SAMSUNG_AUTO_ABOX) := \
- abox_generic.o
+ abox_generic.o \
+ abox_ipc_generic.o
ccflags-y += -I./include
diff --git a/sound/soc/samsung/auto_abox/generic/abox_generic.c b/sound/soc/samsung/auto_abox/generic/abox_generic.c
index e1e14750ac8d..2c3f5ea910a2 100644
--- a/sound/soc/samsung/auto_abox/generic/abox_generic.c
+++ b/sound/soc/samsung/auto_abox/generic/abox_generic.c
@@ -13,7 +13,9 @@
#include <sound/soc-dapm.h>
#include "include/abox_generic.h"
+#include "include/abox_ipc_generic.h"
+extern struct platform_driver samsung_abox_ipc_generic_driver;
/**
* abox_generic_data_global - Shared state for ABOX generic driver.
*
@@ -264,9 +266,6 @@ int abox_generic_request_soc_ioctl(struct device *generic_dev, enum abox_soc_ioc
return generic_data->soc_ioctl(soc_dev, cmd, data);
}
-static struct platform_driver *abox_generic_sub_drivers[] = {
-};
-
static int abox_generic_read_property_from_dt(struct device *dev, struct abox_generic_data *data)
{
struct device_node *np = dev->of_node;
@@ -308,6 +307,10 @@ static int abox_generic_allocate_memory(struct device *dev, struct abox_generic_
return 0;
}
+static struct platform_driver *abox_generic_sub_drivers[] = {
+ &samsung_abox_ipc_generic_driver,
+};
+
static int samsung_abox_generic_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -344,14 +347,10 @@ static int samsung_abox_generic_probe(struct platform_device *pdev)
static void samsung_abox_generic_remove(struct platform_device *pdev)
{
- struct abox_generic_data *data = platform_get_drvdata(pdev);
-
platform_unregister_drivers(abox_generic_sub_drivers,
ARRAY_SIZE(abox_generic_sub_drivers));
g_abox_generic_data = NULL;
-
- return 0;
}
static void samsung_abox_generic_shutdown(struct platform_device *pdev)
diff --git a/sound/soc/samsung/auto_abox/generic/abox_ipc_generic.c b/sound/soc/samsung/auto_abox/generic/abox_ipc_generic.c
new file mode 100644
index 000000000000..58d765cd5bfa
--- /dev/null
+++ b/sound/soc/samsung/auto_abox/generic/abox_ipc_generic.c
@@ -0,0 +1,218 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd.
+ * Author: Eunwoo Kim <ew.kim@samsung.com>
+ *
+ * EXYNOS Automotive Abox IPC Generic Driver - abox_ipc_generic.c
+ *
+ * This driver is part of the ABOX generic audio stack and provides
+ * IPC message/IRQ handling between the fixed (generic) layer and the
+ * SoC-specific variable layer.
+ *
+ * It is a child driver managed by abox_generic, and is built as part
+ * of a single kernel module (snd-soc-samsung-abox-generic.ko) along with
+ * other related drivers.
+ *
+ * The IPC generic driver is registered independently as a platform
+ * driver and uses a global singleton to expose callback interfaces.
+ */
+
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+
+#include "include/abox_ipc_generic.h"
+
+struct abox_ipc_generic_irq_handler_t {
+ ipc_generic_irq_handler_t handler;
+ struct device *dev;
+};
+
+/*
+ * Singleton instance for ABOX IPC Generic driver.
+ *
+ * The generic layer and SoC-specific IPC driver are independent modules,
+ * not in a parent-child device relationship. A global symbol is used to
+ * expose internal state and register callbacks.
+ *
+ * Only one instance is supported. Accessed via exported helper functions.
+ */
+static struct abox_ipc_generic_data *g_abox_ipc_generic_data;
+
+static struct abox_ipc_generic_data *abox_ipc_generic_get_data(void)
+{
+ return g_abox_ipc_generic_data;
+}
+
+static irqreturn_t abox_ipc_generic_pcm_dev_irq_handler(struct device *ipc_generic_dev, int irq_id,
+ struct _abox_inter_ipc_msg *pmsg)
+{
+ struct device *pcm_dev;
+ struct abox_ipc_generic_data *data;
+ struct abox_ipc_generic_irq_handler_t *pcm_dev_irq_handler;
+
+ if (!ipc_generic_dev)
+ return IRQ_NONE;
+
+ data = dev_get_drvdata(ipc_generic_dev);
+ if (!data || irq_id >= data->num_irq)
+ return IRQ_NONE;
+
+ pcm_dev_irq_handler = &data->pcm_dev_irq_handler[irq_id];
+ if (!pcm_dev_irq_handler)
+ return IRQ_NONE;
+
+ if (!pcm_dev_irq_handler->handler)
+ return IRQ_NONE;
+
+ pcm_dev = pcm_dev_irq_handler->dev;
+ if (!pcm_dev)
+ return IRQ_NONE;
+
+ return pcm_dev_irq_handler->handler(pcm_dev, irq_id, pmsg);
+}
+
+static int abox_ipc_generic_read_property_from_dt(struct platform_device *pdev,
+ struct abox_ipc_generic_data *data)
+{
+ int ret;
+ struct device *dev = &pdev->dev;
+ struct device_node *np = dev->of_node;
+
+ ret = of_property_read_u32(np, "samsung,num-of-irq", &data->num_irq);
+ if (ret < 0) {
+ dev_err(dev, "%s property reading fail\n", "samsung,num-of-irq");
+ return ret;
+ }
+
+ return ret;
+}
+
+/**
+ * abox_ipc_generic_get_pcm_dev_handler_callback() - Register IRQ handler to receive IPCs from SoC
+ * @dev_ipc_gen: [out] pointer to the generic device
+ * @handler: [out] function pointer to be called on IPC IRQ
+ *
+ * This function is used by SoC-specific drivers to register the IRQ
+ * handler provided by the generic layer, enabling upward message passing.
+ *
+ * Return: 0 on success, -EINVAL on failure
+ */
+int abox_ipc_generic_get_pcm_dev_handler_callback(struct device **dev_ipc_gen,
+ ipc_generic_irq_handler_t *handler)
+{
+ struct abox_ipc_generic_data *data = NULL;
+
+ data = abox_ipc_generic_get_data();
+ if (!data)
+ return -EINVAL;
+
+ *dev_ipc_gen = &data->pdev->dev;
+ *handler = abox_ipc_generic_pcm_dev_irq_handler;
+
+ return 0;
+}
+EXPORT_SYMBOL(abox_ipc_generic_get_pcm_dev_handler_callback);
+
+/**
+ * abox_ipc_generic_register_xfer_callback() - Register callback to send IPC to SoC
+ * @xfer: SoC-provided IPC transmission function
+ *
+ * Used by the generic layer to send IPC messages to the hardware
+ * through the SoC-specific xfer function.
+ *
+ * Return: 0 on success, -EINVAL on failure
+ */
+int abox_ipc_generic_register_xfer_callback(ipc_gen_request_xfer_t xfer)
+{
+ struct abox_ipc_generic_data *data = NULL;
+
+ data = abox_ipc_generic_get_data();
+ if (!data)
+ return -EINVAL;
+
+ data->request_xfer = xfer;
+
+ return 0;
+}
+EXPORT_SYMBOL(abox_ipc_generic_register_xfer_callback);
+
+int abox_ipc_generic_request_xfer(enum INTER_IPC_ID ipc_id, struct _abox_inter_ipc_msg *pmsg,
+ bool sync, struct __abox_inter_ipc_ret *ipc_ret,
+ unsigned int adsp)
+{
+ struct abox_ipc_generic_data *data = NULL;
+
+ data = abox_ipc_generic_get_data();
+ if (!data || !data->request_xfer)
+ return -EINVAL;
+
+ return data->request_xfer(ipc_id, pmsg, sync, ipc_ret, adsp);
+}
+
+static int samsung_abox_ipc_generic_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct abox_ipc_generic_data *data;
+ int ret = 0;
+
+ data = devm_kzalloc(dev, sizeof(struct abox_ipc_generic_data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ data->pdev = pdev;
+ platform_set_drvdata(pdev, data);
+ g_abox_ipc_generic_data = data;
+
+ ret = abox_ipc_generic_read_property_from_dt(pdev, data);
+ if (ret < 0)
+ return dev_err_probe(dev, ret,
+ "%s Failed to read property ret:%d\n", __func__, ret);
+
+ data->pcm_dev_irq_handler = devm_kcalloc(dev, data->num_irq,
+ sizeof(struct abox_ipc_generic_irq_handler_t),
+ GFP_KERNEL);
+ if (!data->pcm_dev_irq_handler)
+ return dev_err_probe(dev, -ENOMEM,
+ "%s Failed to alloc memory for pcm_dev_irq_handler\n", __func__);
+
+ return ret;
+}
+
+static void samsung_abox_ipc_generic_remove(struct platform_device *pdev)
+{
+ struct abox_ipc_generic_data *data = platform_get_drvdata(pdev);
+ int i;
+
+ for (i = 0; i < data->num_irq; ++i) {
+ data->pcm_dev_irq_handler[i].handler = NULL;
+ data->pcm_dev_irq_handler[i].dev = NULL;
+ }
+ g_abox_ipc_generic_data = NULL;
+}
+
+static void samsung_abox_ipc_generic_shutdown(struct platform_device *pdev)
+{
+}
+
+static const struct of_device_id samsung_abox_ipc_generic_of_match[] = {
+ {
+ .compatible = "samsung,abox_ipc_generic",
+ },
+ {}
+};
+
+struct platform_driver samsung_abox_ipc_generic_driver = {
+ .probe = samsung_abox_ipc_generic_probe,
+ .remove = samsung_abox_ipc_generic_remove,
+ .shutdown = samsung_abox_ipc_generic_shutdown,
+ .driver = {
+ .name = "samsung-abox-ipc-generic",
+ .of_match_table = of_match_ptr(samsung_abox_ipc_generic_of_match),
+ },
+};
+
diff --git a/sound/soc/samsung/auto_abox/generic/include/abox_generic.h b/sound/soc/samsung/auto_abox/generic/include/abox_generic.h
index b2a3f32ac577..b1e6d9b9345d 100644
--- a/sound/soc/samsung/auto_abox/generic/include/abox_generic.h
+++ b/sound/soc/samsung/auto_abox/generic/include/abox_generic.h
@@ -30,7 +30,7 @@ enum abox_soc_ioctl_cmd {
};
/**
- * SOC_IOCTL - SoC-specific callback prototype
+ * soc_ioctl_fn - SoC-specific callback prototype
* @soc_dev: SoC device pointer
* @cmd: Command to handle (enum abox_soc_ioctl_cmd)
* @data: Additional argument, type depends on command
diff --git a/sound/soc/samsung/auto_abox/generic/include/abox_ipc_generic.h b/sound/soc/samsung/auto_abox/generic/include/abox_ipc_generic.h
new file mode 100644
index 000000000000..c28a72306340
--- /dev/null
+++ b/sound/soc/samsung/auto_abox/generic/include/abox_ipc_generic.h
@@ -0,0 +1,181 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd.
+ * Author: Eunwoo Kim <ew.kim@samsung.com>
+ *
+ * ALSA SoC - Samsung ABOX IPC Generic Interface Header
+ *
+ * This header defines IPC message types, data structures, and
+ * interfaces shared between the ABOX generic layer and
+ * SoC-specific IPC handlers.
+ */
+
+#ifndef __SND_SOC_ABOX_IPC_GENERIC_H
+#define __SND_SOC_ABOX_IPC_GENERIC_H
+
+#include <linux/interrupt.h>
+#include <linux/device.h>
+
+/************ IPC DEFINITION ***************/
+/* Categorized IPC, */
+enum INTER_IPC_ID {
+ INTER_NOT_USED0 = BIT(0),
+ INTER_NOT_USED1 = BIT(1),
+ INTER_IPC_PCMPLAYBACK = BIT(2),
+ INTER_IPC_PCMCAPTURE = BIT(3),
+ INTER_IPC_OFFLOAD = BIT(4),
+ INTER_IPC_DMA_INTR = BIT(5),
+ INTER_NOT_USED6 = BIT(6),
+ INTER_NOT_USED7 = BIT(7),
+ INTER_NOT_USED8 = BIT(8),
+ INTER_NOT_USED9 = BIT(9),
+ INTER_NOT_USED10 = BIT(10),
+ INTER_NOT_USED11 = BIT(11),
+ INTER_NOT_USED12 = BIT(12),
+ INTER_NOT_USED13 = BIT(13),
+ INTER_NOT_USED14 = BIT(14),
+ INTER_NOT_USED15 = BIT(15),
+ INTER_IPC_ID_COUNT = 16,
+ INTER_IPC_ID_COUNT_BIT = BIT(INTER_IPC_ID_COUNT),
+};
+
+struct __abox_inter_ipc_ret {
+ int param1;
+};
+
+/******** PCMTASK IPC ***********************/
+enum INTER_PCMMSG {
+ INTER_PCM_PLTDAI_OPEN = 11,
+ INTER_PCM_PLTDAI_CLOSE = 12,
+ INTER_PCM_PLTDAI_IOCTL = 13,
+ INTER_PCM_PLTDAI_HW_PARAMS = 14,
+ INTER_PCM_PLTDAI_HW_FREE = 15,
+ INTER_PCM_PLTDAI_PREPARE = 16,
+ INTER_PCM_PLTDAI_TRIGGER = 17,
+ INTER_PCM_PLTDAI_POINTER = 18,
+ INTER_PCM_SET_BUFFER = 20,
+ INTER_PCM_SET_FW_INTR_GAP_LOG = 51,
+ INTER_PCMMSG_MAX = 52,
+};
+
+struct PCMTASK_HW_PARAMS {
+ int sample_rate;
+ int bit_depth;
+ int channels;
+};
+
+struct PCMTASK_SET_BUFFER {
+ int phyaddr;
+ int size;
+ int count;
+};
+
+struct PCMTASK_DMA_TRIGGER {
+ int trigger;
+ int rbuf_offset;
+ int rbuf_cnt;
+ bool is_real_dma;
+};
+
+/* Parameter of the PCMTASK command */
+struct INTER_IPC_PCMTASK_MSG {
+ enum INTER_PCMMSG msgtype;
+ int pcm_alsa_id;
+ int pcm_device_id;
+ int hw_dma_id; // should know ??
+ int irq_id;
+ unsigned int domain_id; // SMH - should be removed
+ unsigned int adsp;
+ unsigned long start_threshold;
+ union {
+ struct PCMTASK_HW_PARAMS hw_params;
+ struct PCMTASK_SET_BUFFER setbuff;
+ struct PCMTASK_DMA_TRIGGER dma_trigger;
+ } param;
+};
+
+/* The parameter of the set_param */
+struct OFFLOAD_SET_PARAM {
+ int sample_rate;
+ int bit_depth;
+ int channels;
+ int phyaddr;
+ int chunk_size;
+};
+
+/* The parameter of the start */
+struct OFFLOAD_START {
+ int id;
+};
+
+/* The parameter of the write */
+struct OFFLOAD_WRITE {
+ int id;
+ int buff;
+ int size;
+};
+
+/******** OFFLOAD IPC ***********************/
+enum OFFLOADMSG {
+ OFFLOAD_OPEN = 1,
+ OFFLOAD_CLOSE,
+ OFFLOAD_SETPARAM,
+ OFFLOAD_START,
+ OFFLOAD_WRITE,
+ OFFLOAD_PAUSE,
+ OFFLOAD_STOP,
+};
+
+/* Parameter of the OFFLOADTASK command */
+struct INTER_IPC_OFFLOADTASK_MSG {
+ enum OFFLOADMSG msgtype;
+ int codec_id;
+ int pcm_device_id;
+ int hw_dma_id;
+ int irq_id;
+ int pcm_alsa_id;
+ int direction;
+ int domain_id;
+ union {
+ struct OFFLOAD_SET_PARAM setparam;
+ struct OFFLOAD_START start;
+ struct OFFLOAD_WRITE write;
+ struct PCMTASK_DMA_TRIGGER dma_trigger;
+ } param;
+};
+
+struct _abox_inter_ipc_msg {
+ enum INTER_IPC_ID ipcid;
+ int task_id;
+ union INTER_IPC_MSG {
+ struct INTER_IPC_PCMTASK_MSG pcmtask;
+ struct INTER_IPC_OFFLOADTASK_MSG offload_task;
+ } msg;
+};
+
+typedef irqreturn_t (*ipc_generic_irq_handler_t)(struct device *dev, int irq_id,
+ struct _abox_inter_ipc_msg *pmsg);
+
+typedef int (*ipc_gen_request_xfer_t)(enum INTER_IPC_ID ipc_id, struct _abox_inter_ipc_msg *pmsg,
+ bool sync, struct __abox_inter_ipc_ret *ipc_ret, unsigned int adsp);
+
+struct abox_ipc_generic_irq_handler_t;
+
+struct abox_ipc_generic_data {
+ struct platform_device *pdev;
+ unsigned int num_irq;
+ struct abox_ipc_generic_irq_handler_t *pcm_dev_irq_handler;
+ ipc_gen_request_xfer_t request_xfer;
+};
+
+int abox_ipc_generic_get_pcm_dev_handler_callback(struct device **dev_ipc_generic,
+ ipc_generic_irq_handler_t *handler);
+int abox_ipc_generic_register_xfer_callback(ipc_gen_request_xfer_t xfer);
+int abox_ipc_generic_register_pcm_dev_handler(struct device *dev_pcm, unsigned int irq_id,
+ ipc_generic_irq_handler_t handler);
+int abox_ipc_generic_request_xfer(enum INTER_IPC_ID ipc_id, struct _abox_inter_ipc_msg *pmsg,
+ bool sync, struct __abox_inter_ipc_ret *ipc_ret, unsigned int adsp);
+
+
+#endif /* __SND_SOC_ABOX_IPC_GENERIC_H */
+
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 5/9] arm64: dts: exynosautov920: Add ABOX IPC Generic device node
[not found] ` <CGME20250721024611epcas2p375cd5e4b53fcff3b69a39ef19c0825a4@epcas2p3.samsung.com>
@ 2025-07-21 2:30 ` ew kim
2025-07-21 6:45 ` Krzysztof Kozlowski
0 siblings, 1 reply; 17+ messages in thread
From: ew kim @ 2025-07-21 2:30 UTC (permalink / raw)
To: broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
ew kim
This patch adds a new child node `abox_ipc_generic` under the
`abox_generic` node for ExynosAuto v920. The ABOX IPC Generic
driver handles inter-processor communication (IPC) between
the ABOX DSP and host SoC using IRQs.
The node includes configuration for the number of IRQ channels
used for IPC routing. This allows SoC-specific subsystems to
send and receive messages through the ABOX generic audio stack.
Signed-off-by: ew kim <ew.kim@samsung.com>
---
arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts | 6 +++++-
arch/arm64/boot/dts/exynos/exynosautov920.dtsi | 10 ++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts b/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
index a870c0b6847f..2f4cf112675a 100644
--- a/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
+++ b/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
@@ -89,4 +89,8 @@ &xtcxo {
&abox_generic {
status = "okay";
-};
\ No newline at end of file
+};
+
+&abox_ipc_generic {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
index 4f086a7a79c8..21bcbcf7e2b6 100644
--- a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
@@ -1133,8 +1133,14 @@ abox_generic: abox_generic {
samsung,num-pcm-capture = <32>;
samsung,num-i2s-dummy-backend = <5>;
status = "disabled";
- #address-cells = <2>;
- #size-cells = <1>;
+ /* #address-cells = <2>; */
+ /* #size-cells = <1>; */
+
+ abox_ipc_generic: abox_ipc_generic {
+ compatible = "samsung,abox_ipc_generic";
+ samsung,num-irq = <64>;
+ status = "disabled";
+ };
};
};
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 6/9] ASoC : dt-bindings: sound: Add binding for ABOX IPC Generic
[not found] ` <CGME20250721024611epcas2p382f3decd51152a5c89c673f222e22da1@epcas2p3.samsung.com>
@ 2025-07-21 2:30 ` ew kim
2025-07-21 6:46 ` Krzysztof Kozlowski
0 siblings, 1 reply; 17+ messages in thread
From: ew kim @ 2025-07-21 2:30 UTC (permalink / raw)
To: broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
ew kim
This patch updates the existing samsung,exynosauto.yaml schema to
describe the ABOX IPC Generic child node. This node represents
a virtual IPC interface used by the ABOX audio subsystem to
communicate with SoC-specific hardware using shared IRQ channels.
The schema describes the `samsung,num-irq` property and allows
integration of the IPC node under `abox_generic`.
Signed-off-by: ew kim <ew.kim@samsung.com>
---
.../bindings/sound/samsung,exynosauto.yaml | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
index b1e49f38ffe9..3a7b5be627ee 100644
--- a/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
+++ b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
@@ -48,6 +48,23 @@ properties:
description: Required for child nodes that may declare address space.
const: 1
+ abox_ipc_generic:
+ type: object
+ description: ABOX IPC Generic subnode for SoC-level message routing
+ properties:
+ compatible:
+ const: samsung,abox_ipc_generic
+
+ samsung,num-irq:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Number of IRQ channels supported for IPC routing.
+
+ required:
+ - compatible
+ - samsung,num-irq
+
+ additionalProperties: false
+
required:
- compatible
- samsung,num-pcm-playback
@@ -66,4 +83,10 @@ examples:
status = "disabled";
#address-cells = <2>;
#size-cells = <1>;
+
+ abox_ipc_generic {
+ compatible = "samsung,abox_ipc_generic";
+ samsung,num-irq = <64>;
+ status = "disabled";
+ };
};
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 8/9] arm64: dts: exynosautov920: add PCM playback/capture
[not found] ` <CGME20250721024611epcas2p3da8e99d27a57cf7ad4ed46729e86602f@epcas2p3.samsung.com>
@ 2025-07-21 2:30 ` ew kim
0 siblings, 0 replies; 17+ messages in thread
From: ew kim @ 2025-07-21 2:30 UTC (permalink / raw)
To: broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
ew kim
This patch adds the PCM playback and capture device nodes as children of
the abox_generic audio controller for ExynosAuto v920.
Each PCM device is defined with a unique ID and an associated IRQ SW number
used for communication with the ADSP. These nodes include information such
as buffer size, ALSA DAI name prefix, and category type(e.g., deep_buffer).
The nodes are initially marked as "disabled" and can be enabled per board
(e.g., in the SADK .dts) as needed.
Signed-off-by: ew kim <ew.kim@samsung.com>
---
.../boot/dts/exynos/exynosautov920-sadk.dts | 8 +++++
.../arm64/boot/dts/exynos/exynosautov920.dtsi | 32 +++++++++++++++++--
2 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts b/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
index 2f4cf112675a..f9f717fa95d4 100644
--- a/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
+++ b/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
@@ -94,3 +94,11 @@ &abox_generic {
&abox_ipc_generic {
status = "okay";
};
+
+&abox_pcm_playback_0 {
+ status = "okay";
+};
+
+&abox_pcm_capture_0 {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
index 21bcbcf7e2b6..094fdec2e6f5 100644
--- a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
@@ -1133,14 +1133,42 @@ abox_generic: abox_generic {
samsung,num-pcm-capture = <32>;
samsung,num-i2s-dummy-backend = <5>;
status = "disabled";
- /* #address-cells = <2>; */
- /* #size-cells = <1>; */
+ #address-cells = <1>;
+ #size-cells = <1>;
abox_ipc_generic: abox_ipc_generic {
compatible = "samsung,abox_ipc_generic";
samsung,num-irq = <64>;
status = "disabled";
};
+
+ abox_pcm_playback_0: abox_pcm_playback@3fd0000 {
+ compatible = "samsung,abox-pcm-playback";
+ samsung,id = <0>;
+ samsung,irq_id = <0>;
+ samsung,allocate-adsp = <0>;
+ reg = <0x3fd0000 0x10>;
+ reg-names = "pp_pointer_offset";
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "ABOX";
+ samsung,category = "deep_buffer";
+ samsung,buffer_bytes_max = <0x24000>;
+ status = "disabled";
+ };
+
+ abox_pcm_capture_0: abox_pcm_capture@3fd0400 {
+ compatible = "samsung,abox-pcm-capture";
+ samsung,id = <0>;
+ samsung,irq_id = <32>;
+ samsung,allocate-adsp = <0>;
+ reg = <0x3fd0400 0x10>;
+ reg-names = "pp_pointer_offset";
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "ABOX";
+ samsung,category = "deep_buffer";
+ samsung,buffer_bytes_max = <0x24000>;
+ status = "disabled";
+ };
};
};
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 9/9] ASoC: dt-bindings: sound: exynosauto: add PCM frontend nodes for ABOX generic
[not found] ` <CGME20250721024612epcas2p122d627cfb90eac508b6ed3667acd9b9b@epcas2p1.samsung.com>
@ 2025-07-21 2:30 ` ew kim
2025-07-21 6:47 ` Krzysztof Kozlowski
0 siblings, 1 reply; 17+ messages in thread
From: ew kim @ 2025-07-21 2:30 UTC (permalink / raw)
To: broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
ew kim
This patch extends the Exynos Automotive ABOX generic device tree bindings
to support PCM playback and capture frontend nodes.
Each PCM device node describes an audio stream interface handled by the
ABOX DSP. These nodes include properties for stream ID, IRQ, ADSP core
assignment, buffer limits, and stream category (deep_buffer or compress).
The bindings use patternProperties to match playback and capture nodes
as children of the abox_generic controller.
Signed-off-by: ew kim <ew.kim@samsung.com>
---
.../bindings/sound/samsung,exynosauto.yaml | 126 +++++++++++++++++-
1 file changed, 123 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
index 3a7b5be627ee..e477550afc7c 100644
--- a/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
+++ b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
@@ -28,6 +28,14 @@ properties:
compatible:
const: samsung,abox_generic
+ status:
+ enum: [ okay, disabled ]
+ description: DTS node enablement state
+
+ $nodename:
+ pattern: "^abox_generic$"
+ description: Node name must be 'abox_generic'
+
samsung,num-pcm-playback:
description: Maximum number of PCM playback instances (ALSA PCM devices).
$ref: /schemas/types.yaml#/definitions/uint32
@@ -42,7 +50,7 @@ properties:
'#address-cells':
description: Required for child nodes that may declare address space.
- const: 2
+ const: 1
'#size-cells':
description: Required for child nodes that may declare address space.
@@ -55,6 +63,10 @@ properties:
compatible:
const: samsung,abox_ipc_generic
+ status:
+ enum: [ okay, disabled ]
+ description: DTS node enablement state
+
samsung,num-irq:
$ref: /schemas/types.yaml#/definitions/uint32
description: Number of IRQ channels supported for IPC routing.
@@ -65,13 +77,92 @@ properties:
additionalProperties: false
+patternProperties:
+ "^abox_pcm_(playback|capture)@[0-9a-f]+$":
+ type: object
+ description: |
+ ABOX PCM playback or capture frontend device node. These nodes define
+ individual PCM streams used by the audio subsystem, and are children of
+ the abox_generic controller. Each node describes a PCM stream ID, IRQ line,
+ ADSP core allocation, and stream-specific parameters.
+
+ properties:
+ compatible:
+ enum:
+ - samsung,abox-pcm-playback
+ - samsung,abox-pcm-capture
+ description: Compatible string for PCM playback or capture device.
+
+ reg:
+ maxItems: 1
+ description: Offset for pointer register (pp_pointer_offset) used for communication with ADSP.
+
+ reg-names:
+ const: pp_pointer_offset
+
+ samsung,id:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: |
+ Unique ID per PCM Device, separated by stream type (playback or capture).
+ Must be less than samsung,num-of-pcm_playback or samsung,num-of-pcm_capture
+ defined in the abox_generic node.
+
+ samsung,irq_id:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: |
+ Software IRQ ID assigned in the control domain. Represents the software interrupt
+ line used by the ADSP to communicate with this PCM device.
+
+ samsung,allocate-adsp:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: |
+ Index of the ADSP core that this PCM device is allocated to. Indicates on which core
+ the stream is handled.
+
+ sound-name-prefix:
+ $ref: /schemas/types.yaml#/definitions/string
+ description: |
+ Prefix name for ALSA DAI interface. Helps to namespace controls and routing.
+
+ samsung,category:
+ enum: [deep_buffer, compress]
+ description: |
+ Type of the PCM stream. Can be either 'deep_buffer' for normal PCM playback/capture,
+ or 'compress' for compressed offload streams.
+
+ samsung,buffer_bytes_max:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: |
+ Maximum size (in bytes) of the DMA buffer allocated for this PCM device.
+
+ '#sound-dai-cells':
+ const: 0
+ description: Must be 0. Required by ALSA SoC bindings.
+
+ status:
+ enum: [ okay, disabled ]
+ description: Device node enablement status. Set to "okay" to activate the node.
+
+ required:
+ - compatible
+ - reg
+ - reg-names
+ - samsung,id
+ - samsung,irq_id
+ - samsung,allocate-adsp
+ - samsung,category
+ - samsung,buffer_bytes_max
+ - '#sound-dai-cells'
+
+ additionalProperties: true
+
required:
- compatible
- samsung,num-pcm-playback
- samsung,num-pcm-capture
- samsung,num-i2s-dummy-backend
-additionalProperties: false
+unevaluatedProperties: false
examples:
- |
@@ -81,7 +172,7 @@ examples:
samsung,num-pcm-capture = <32>;
samsung,num-i2s-dummy-backend = <5>;
status = "disabled";
- #address-cells = <2>;
+ #address-cells = <1>;
#size-cells = <1>;
abox_ipc_generic {
@@ -89,4 +180,33 @@ examples:
samsung,num-irq = <64>;
status = "disabled";
};
+
+ abox_pcm_playback@3fd0000 {
+ compatible = "samsung,abox-pcm-playback";
+ samsung,id = <0>;
+ samsung,irq_id = <0>;
+ samsung,allocate-adsp = <0>;
+ reg = <0x3fd0000 0x10>;
+ reg-names = "pp_pointer_offset";
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "ABOX";
+ samsung,category = "deep_buffer";
+ samsung,buffer_bytes_max = <0x24000>;
+ status = "disabled";
+ };
+
+ abox_pcm_capture@3fd0400 {
+ compatible = "samsung,abox-pcm-capture";
+ samsung,id = <0>;
+ samsung,irq_id = <32>;
+ samsung,allocate-adsp = <0>;
+ reg = <0x3fd0400 0x10>;
+ reg-names = "pp_pointer_offset";
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "ABOX";
+ samsung,category = "deep_buffer";
+ samsung,buffer_bytes_max = <0x24000>;
+ status = "disabled";
+ };
};
+
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 2/9] arm64: dts: exynosautov920: add abox_generic dt node
2025-07-21 2:30 ` [PATCH 2/9] arm64: dts: exynosautov920: add abox_generic dt node ew kim
@ 2025-07-21 6:41 ` Krzysztof Kozlowski
0 siblings, 0 replies; 17+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-21 6:41 UTC (permalink / raw)
To: ew kim, broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
On 21/07/2025 04:30, ew kim wrote:
> Add device tree node for the abox_generic platform driver to enable
> its registration as a platform device. This node does not represent
> direct hardware resources but is necessary for driver initialization
> and platform device binding.
>
> Properties added in the device tree node:
>
> - samsung,num-pcm-playback (uint32):
> Maximum number of supported PCM playback devices.
> Here, PCM playback devices refer to ALSA PCM devices.
>
> - samsung,num-pcm-capture (uint32):
> Maximum number of supported PCM capture devices.
> Here, PCM capture devices refer to ALSA PCM devices.
>
> - samsung,num-i2s-dummy-backend (uint32):
> Maximum number of supported I2S dummy backend devices.
>
> The node is declared disabled by default in the main device tree source,
> and enabled via board-specific DTS overlays by setting status = "okay".
>
> This device tree binding document will be added under
> Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
>
> to describe the node properties and usage.
>
> Signed-off-by: ew kim <ew.kim@samsung.com>
> ---
> arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts | 4 ++++
> arch/arm64/boot/dts/exynos/exynosautov920.dtsi | 10 ++++++++++
Entirely wrong order of patches.
> 2 files changed, 14 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts b/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
> index a397f068ed53..a870c0b6847f 100644
> --- a/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
> +++ b/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
> @@ -86,3 +86,7 @@ &usi_0 {
> &xtcxo {
> clock-frequency = <38400000>;
> };
> +
> +&abox_generic {
> + status = "okay";
> +};
> \ No newline at end of file
?
> diff --git a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
> index 2cb8041c8a9f..4f086a7a79c8 100644
> --- a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
> +++ b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
> @@ -1126,6 +1126,16 @@ timer {
> <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
> <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
> };
> +
> + abox_generic: abox_generic {
And you did not resolve any of previous comments, just sent the same v1.
NAK.
Implement and respond to feedback. Then version properly your patches.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/9] ASoC: dt-bindings: sound: Add Samsung ExynosAuto ABOX binding
2025-07-21 2:30 ` [PATCH 3/9] ASoC: dt-bindings: sound: Add Samsung ExynosAuto ABOX binding ew kim
@ 2025-07-21 6:44 ` Krzysztof Kozlowski
0 siblings, 0 replies; 17+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-21 6:44 UTC (permalink / raw)
To: ew kim, broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
On 21/07/2025 04:30, ew kim wrote:
> Add the device tree binding documentation for the Samsung Exynos Automotive
> ABOX generic audio management core. This binding describes how to configure
> the maximum number of PCM playback, PCM capture, and dummy I2S backend
> instances for the ABOX core. Actual hardware functionality is provided
> by child audio sub-drivers.
>
> Signed-off-by: ew kim <ew.kim@samsung.com>
> ---
> .../bindings/sound/samsung,exynosauto.yaml | 69 +++++++++++++++++++
> 1 file changed, 69 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
>
> diff --git a/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
> new file mode 100644
> index 000000000000..b1e49f38ffe9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
> @@ -0,0 +1,69 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/samsung,exynosauto.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Samsung Exynos Automotive Abox Generic
> +
> +maintainers:
> + - Eunwoo Kim <ew.kim@samsung.com>
> +
> +description: |
> + The Samsung Exynos Automotive Abox Generic node represents a
> + generic audio management platform device inside Exynos Automotive SoCs.
No, we do not add bindings for "generic" stuff.
Describe the SoC.
> + It does not directly control hardware resources itself, but acts as
Does not control hardware? so not suitable for bindings and DTS.
> + a common interface to manage child audio sub-drivers for PCM playback,
> + PCM capture, and I2S dummy backends.
Not relevant.
> +
> + Typically, this node provides configuration for the maximum number of
> + PCM playback and capture devices (ALSA PCM) and the maximum number
> + of dummy I2S backend devices. The actual hardware control is handled
> + by child drivers attached to this generic core.
Not relevant. Describe the hardware.
> +
> + This node must exist for the platform driver to probe,
> + even though it does not map any physical hardware address.
Drivers are not relevant, read writing bindings.
> +
> +properties:
> + compatible:
> + const: samsung,abox_generic
You did not implement previous feedback. This does not follow DTS coding
style and writing bindings.
I already asked you to read DTS coding style and nothing improved, no
issues were resolved.
> +
> + samsung,num-pcm-playback:
> + description: Maximum number of PCM playback instances (ALSA PCM devices).
> + $ref: /schemas/types.yaml#/definitions/uint32
> +
> + samsung,num-pcm-capture:
> + description: Maximum number of PCM capture instances (ALSA PCM devices).
> + $ref: /schemas/types.yaml#/definitions/uint32
> +
> + samsung,num-i2s-dummy-backend:
> + description: Maximum number of dummy I2S backend instances.
> + $ref: /schemas/types.yaml#/definitions/uint32
Nothing above describes hardware. Bindings are not for ALSA.
> +
> + '#address-cells':
> + description: Required for child nodes that may declare address space.
> + const: 2
> +
> + '#size-cells':
> + description: Required for child nodes that may declare address space.
> + const: 1
> +
> +required:
> + - compatible
> + - samsung,num-pcm-playback
> + - samsung,num-pcm-capture
> + - samsung,num-i2s-dummy-backend
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + abox_generic {
Did you read DTS coding style?
> + compatible = "samsung,abox_generic";
> + samsung,num-pcm-playback = <32>;
> + samsung,num-pcm-capture = <32>;
> + samsung,num-i2s-dummy-backend = <5>;
> + status = "disabled";
No.
> + #address-cells = <2>;
> + #size-cells = <1>;
> + };
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 5/9] arm64: dts: exynosautov920: Add ABOX IPC Generic device node
2025-07-21 2:30 ` [PATCH 5/9] arm64: dts: exynosautov920: Add ABOX IPC Generic device node ew kim
@ 2025-07-21 6:45 ` Krzysztof Kozlowski
0 siblings, 0 replies; 17+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-21 6:45 UTC (permalink / raw)
To: ew kim, broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
On 21/07/2025 04:30, ew kim wrote:
> This patch adds a new child node `abox_ipc_generic` under the
Please read kernel submitting patches and DT bindings submitting patches.
> `abox_generic` node for ExynosAuto v920. The ABOX IPC Generic
> driver handles inter-processor communication (IPC) between
> the ABOX DSP and host SoC using IRQs.
>
> The node includes configuration for the number of IRQ channels
> used for IPC routing. This allows SoC-specific subsystems to
> send and receive messages through the ABOX generic audio stack.
>
> Signed-off-by: ew kim <ew.kim@samsung.com>
> ---
> arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts | 6 +++++-
> arch/arm64/boot/dts/exynos/exynosautov920.dtsi | 10 ++++++++--
> 2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts b/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
> index a870c0b6847f..2f4cf112675a 100644
> --- a/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
> +++ b/arch/arm64/boot/dts/exynos/exynosautov920-sadk.dts
> @@ -89,4 +89,8 @@ &xtcxo {
>
> &abox_generic {
> status = "okay";
> -};
> \ No newline at end of file
> +};
> +
> +&abox_ipc_generic {
> + status = "okay";
> +};
> diff --git a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
> index 4f086a7a79c8..21bcbcf7e2b6 100644
> --- a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
> +++ b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
> @@ -1133,8 +1133,14 @@ abox_generic: abox_generic {
> samsung,num-pcm-capture = <32>;
> samsung,num-i2s-dummy-backend = <5>;
> status = "disabled";
> - #address-cells = <2>;
> - #size-cells = <1>;
> + /* #address-cells = <2>; */
> + /* #size-cells = <1>; */
> +
> + abox_ipc_generic: abox_ipc_generic {
> + compatible = "samsung,abox_ipc_generic";
No bindings. Are you sure you follow standard patchset order?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 6/9] ASoC : dt-bindings: sound: Add binding for ABOX IPC Generic
2025-07-21 2:30 ` [PATCH 6/9] ASoC : dt-bindings: sound: Add binding for ABOX IPC Generic ew kim
@ 2025-07-21 6:46 ` Krzysztof Kozlowski
0 siblings, 0 replies; 17+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-21 6:46 UTC (permalink / raw)
To: ew kim, broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
On 21/07/2025 04:30, ew kim wrote:
> This patch updates the existing samsung,exynosauto.yaml schema to
> describe the ABOX IPC Generic child node. This node represents
> a virtual IPC interface used by the ABOX audio subsystem to
> communicate with SoC-specific hardware using shared IRQ channels.
>
> The schema describes the `samsung,num-irq` property and allows
> integration of the IPC node under `abox_generic`.
>
> Signed-off-by: ew kim <ew.kim@samsung.com>
> ---
> .../bindings/sound/samsung,exynosauto.yaml | 23 +++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
> index b1e49f38ffe9..3a7b5be627ee 100644
> --- a/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
> +++ b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
> @@ -48,6 +48,23 @@ properties:
> description: Required for child nodes that may declare address space.
> const: 1
>
> + abox_ipc_generic:
> + type: object
> + description: ABOX IPC Generic subnode for SoC-level message routing
> + properties:
> + compatible:
> + const: samsung,abox_ipc_generic
We cannot take generic IPC.
> +
> + samsung,num-irq:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Number of IRQ channels supported for IPC routing.
> +
> + required:
> + - compatible
> + - samsung,num-irq
> +
> + additionalProperties: false
> +
> required:
> - compatible
> - samsung,num-pcm-playback
> @@ -66,4 +83,10 @@ examples:
> status = "disabled";
> #address-cells = <2>;
> #size-cells = <1>;
> +
> + abox_ipc_generic {
> + compatible = "samsung,abox_ipc_generic";
> + samsung,num-irq = <64>;
> + status = "disabled";
So you never test it...
> + };
> };
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 9/9] ASoC: dt-bindings: sound: exynosauto: add PCM frontend nodes for ABOX generic
2025-07-21 2:30 ` [PATCH 9/9] ASoC: dt-bindings: sound: exynosauto: add PCM frontend nodes for ABOX generic ew kim
@ 2025-07-21 6:47 ` Krzysztof Kozlowski
0 siblings, 0 replies; 17+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-21 6:47 UTC (permalink / raw)
To: ew kim, broonie, s.nawrocki, robh, krzk+dt
Cc: lgirdwood, tiwai, perex, conor+dt, alim.akhtar, linux-sound,
devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
On 21/07/2025 04:30, ew kim wrote:
> This patch extends the Exynos Automotive ABOX generic device tree bindings
> to support PCM playback and capture frontend nodes.
>
> Each PCM device node describes an audio stream interface handled by the
> ABOX DSP. These nodes include properties for stream ID, IRQ, ADSP core
> assignment, buffer limits, and stream category (deep_buffer or compress).
>
> The bindings use patternProperties to match playback and capture nodes
> as children of the abox_generic controller.
This split of one device into three makes no sense. Adding new binding
is one commit.
>
> Signed-off-by: ew kim <ew.kim@samsung.com>
> ---
> .../bindings/sound/samsung,exynosauto.yaml | 126 +++++++++++++++++-
> 1 file changed, 123 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
> index 3a7b5be627ee..e477550afc7c 100644
> --- a/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
> +++ b/Documentation/devicetree/bindings/sound/samsung,exynosauto.yaml
> @@ -28,6 +28,14 @@ properties:
> compatible:
> const: samsung,abox_generic
>
> + status:
> + enum: [ okay, disabled ]
> + description: DTS node enablement state
Sorry, but why are you writing something entirely different than every
other binding?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/9] ASoC: samsung: Add generic ABOX management driver
2025-07-21 2:30 ` [PATCH 1/9] ASoC: samsung: Add generic ABOX management driver ew kim
@ 2025-07-30 12:04 ` Mark Brown
0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2025-07-30 12:04 UTC (permalink / raw)
To: ew kim
Cc: s.nawrocki, robh, krzk+dt, lgirdwood, tiwai, perex, conor+dt,
alim.akhtar, linux-sound, devicetree, linux-arm-kernel,
linux-samsung-soc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 690 bytes --]
On Mon, Jul 21, 2025 at 11:30:44AM +0900, ew kim wrote:
> This driver implements the *generic* (fixed) part of the ABOX management
> stack for Samsung Automotive SoCs. It does not directly control hardware
> but provides common interfaces and state needed by SoC-specific
> (variable) drivers.
> The abox generic driver manages child drivers and provides an interface
> that bridges the fixed and variable parts, connecting the two modules.
I think for such an unusual design we need a much clearer description of
what this is trying to do and why it's not following normal kernel
patterns. I can't tell what the services this generic code is providing
are, nor why it's done this way.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 4/9] ASoC: samsung: abox: Add IPC generic support for message forwarding
2025-07-21 2:30 ` [PATCH 4/9] ASoC: samsung: abox: Add IPC generic support for message forwarding ew kim
@ 2025-07-30 12:06 ` Mark Brown
0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2025-07-30 12:06 UTC (permalink / raw)
To: ew kim
Cc: s.nawrocki, robh, krzk+dt, lgirdwood, tiwai, perex, conor+dt,
alim.akhtar, linux-sound, devicetree, linux-arm-kernel,
linux-samsung-soc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 226 bytes --]
On Mon, Jul 21, 2025 at 11:30:47AM +0900, ew kim wrote:
> +EXPORT_SYMBOL(abox_ipc_generic_get_pcm_dev_handler_callback);
ASoC is all EXPORT_SYMBOL_GPL() so if you're providing access to ASoC
things you should also use that.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: Add ExynosAuto ABOX generic platform and PCM support
2025-07-21 2:30 ` Add ExynosAuto ABOX generic platform and PCM support ew kim
` (7 preceding siblings ...)
[not found] ` <CGME20250721024612epcas2p122d627cfb90eac508b6ed3667acd9b9b@epcas2p1.samsung.com>
@ 2025-07-30 12:46 ` Mark Brown
8 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2025-07-30 12:46 UTC (permalink / raw)
To: ew kim
Cc: s.nawrocki, robh, krzk+dt, lgirdwood, tiwai, perex, conor+dt,
alim.akhtar, linux-sound, devicetree, linux-arm-kernel,
linux-samsung-soc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]
On Mon, Jul 21, 2025 at 11:30:43AM +0900, ew kim wrote:
> This patch series adds the ABOX Generic audio management driver for
> Samsung ExynosAuto SoCs, along with IPC messaging and PCM frontend
> drivers, including their corresponding device tree bindings.
>
> ### ABOX Architecture Design: Fixed and Variable Structure
>
> The ABOX audio framework is designed with a clear split between:
> - **Fixed part** (common framework): reusable components across SoCs
> - Generic ABOX platform driver
> - IPC messaging handler
> - PCM frontend with ALSA compressed audio support
> - Solution manager for dynamic control
> - **Variable part** (SoC-specific): defined via device tree
> - IRQ numbers, stream IDs, buffer sizes, and ADSP allocation
> - Defined per PCM/IPC device node in DTS
This all sounds from a system integration point of view like a fairly
standard audio DSP. Usually something like that would be structured
with the generic bits of DSP support done as a library which the drivers
for specific bits of hardware link to, the SOF code is the most obvious
example of this we have upstream but there's a few other simpler ones
like the Cirrus CODECs. If there's a reason why this wouldn't work here
it's not clear to me from what you've posted thus far.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2025-07-30 12:49 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20250721024611epcas2p43099e043aaa6f48c05eb0237065d31c7@epcas2p4.samsung.com>
2025-07-21 2:30 ` Add ExynosAuto ABOX generic platform and PCM support ew kim
[not found] ` <CGME20250721024611epcas2p45ddc52c1644f5779c7da822573f03246@epcas2p4.samsung.com>
2025-07-21 2:30 ` [PATCH 1/9] ASoC: samsung: Add generic ABOX management driver ew kim
2025-07-30 12:04 ` Mark Brown
[not found] ` <CGME20250721024611epcas2p37ecbc204ea695d97f6477c04712a9974@epcas2p3.samsung.com>
2025-07-21 2:30 ` [PATCH 2/9] arm64: dts: exynosautov920: add abox_generic dt node ew kim
2025-07-21 6:41 ` Krzysztof Kozlowski
[not found] ` <CGME20250721024611epcas2p47ebaf8cb494fc2bf71a83b00ba47f2b3@epcas2p4.samsung.com>
2025-07-21 2:30 ` [PATCH 3/9] ASoC: dt-bindings: sound: Add Samsung ExynosAuto ABOX binding ew kim
2025-07-21 6:44 ` Krzysztof Kozlowski
[not found] ` <CGME20250721024611epcas2p4baca500b3b1f185dcdc35552b2abe8d9@epcas2p4.samsung.com>
2025-07-21 2:30 ` [PATCH 4/9] ASoC: samsung: abox: Add IPC generic support for message forwarding ew kim
2025-07-30 12:06 ` Mark Brown
[not found] ` <CGME20250721024611epcas2p375cd5e4b53fcff3b69a39ef19c0825a4@epcas2p3.samsung.com>
2025-07-21 2:30 ` [PATCH 5/9] arm64: dts: exynosautov920: Add ABOX IPC Generic device node ew kim
2025-07-21 6:45 ` Krzysztof Kozlowski
[not found] ` <CGME20250721024611epcas2p382f3decd51152a5c89c673f222e22da1@epcas2p3.samsung.com>
2025-07-21 2:30 ` [PATCH 6/9] ASoC : dt-bindings: sound: Add binding for ABOX IPC Generic ew kim
2025-07-21 6:46 ` Krzysztof Kozlowski
[not found] ` <CGME20250721024611epcas2p3da8e99d27a57cf7ad4ed46729e86602f@epcas2p3.samsung.com>
2025-07-21 2:30 ` [PATCH 8/9] arm64: dts: exynosautov920: add PCM playback/capture ew kim
[not found] ` <CGME20250721024612epcas2p122d627cfb90eac508b6ed3667acd9b9b@epcas2p1.samsung.com>
2025-07-21 2:30 ` [PATCH 9/9] ASoC: dt-bindings: sound: exynosauto: add PCM frontend nodes for ABOX generic ew kim
2025-07-21 6:47 ` Krzysztof Kozlowski
2025-07-30 12:46 ` Add ExynosAuto ABOX generic platform and PCM support Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).