* [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API
@ 2025-03-11 8:58 Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 1/8] dt-bindings: reset: audiomix: Add reset ids for EARC and DSP Daniel Baluta
` (9 more replies)
0 siblings, 10 replies; 14+ messages in thread
From: Daniel Baluta @ 2025-03-11 8:58 UTC (permalink / raw)
To: p.zabel, robh, krzk+dt, shawnguo, mathieu.poirier, devicetree,
linux-remoteproc
Cc: conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang, Daniel Baluta
This patch series adds support to control the Run/Stall DSP bits found on
i.MX8MP via the reset controller API instead of using the syscon API.
DSP found on i.MX8MP doesn't have a direct reset line so according to hardware
design team in order to handle assert/deassert/reset functionality we
need to use a combination of control bits from two modules.
Audio block control module:
- for Run/Stall control bits of the DSP
Debug Access Port (DAP)
- for Software Reset via IMX8M_DAP_PWRCTL register
The current implementation for IMX DSP Remotproc driver and for Sound Open
Firmware driver (already upstream) uses the following approach:
- maps the Audio Block Control address via syscon API through
the fsl,dsp-ctrl property of the dsp node.
- maps the DAP address space using directly a call to ioremap
with IMX8M_DAP_DEBUG macro depicting the DAP base address.
The both approaches are problematic when comes to describing the address
spaces via the DT:
- for Audio Block Control, because it uses the syscon interface
- for DAP because it hardcodes de base address instead of using a dt node.
This patch series aims to fix the Audio Block control usage of the
syscon interface and replace it with Reset Controller interface.
Main advantages of using the Reset Controller API is that we stop
abusing the syscon interface, offer a better probe ordering, PM runtime
support. Main critique of using the Reset Controller API is that
Run/Stall bits are not reset bits (but according the hardware design
team they are part of the reset proccess since there is no real reset
line).
Initial discussion is here:
https://patchwork.kernel.org/project/imx/patch/20250212085222.107102-6-daniel.baluta@nxp.com/
Note that we can safely remove the fsl,dsp-ctrl property usage from IMX DSP
remoteproc driver because there is no Device Tree users.
Changes since v4:
https://lore.kernel.org/lkml/20250305100037.373782-3-daniel.baluta@nxp.com/T/
- picked-up R-b tags from Frank Li and Peng Fan
- reworded commit message of patch 8/8 as per Mathieu Poirier suggestion
Changes since v3:
https://lore.kernel.org/linux-arm-kernel/20250225102005.408773-5-daniel.baluta@nxp.com/T/
- renamed resets ids as per Philipp comments
- add boths resets (named them runstall and softreset) as per Philipp comments
Changes since v2:
(https://lore.kernel.org/lkml/Z7ZNngd3wtJ5MZgl@lizhi-Precision-Tower-5810/T/)
- picked R-b and A-b tags
- use run_stall instead of reset to refer to reset controller
instance
- remove 'resets' description as it is a common property
- add correct include in the yaml dts snippet example
Changes since v1:
(https://lore.kernel.org/imx/20250219030809.GD6537@nxa18884-linux/T/)
- addresed comments received on v1
- picked up R-b and A-b tags
Daniel Baluta (8):
dt-bindings: reset: audiomix: Add reset ids for EARC and DSP
dt-bindings: dsp: fsl,dsp: Add resets property
arm64: dts: imx8mp: Use resets property
reset: imx8mp-audiomix: Add prefix for internal macro
reset: imx8mp-audiomix: Prepare the code for more reset bits
reset: imx8mp-audiomix: Introduce active_low configuration option
reset: imx8mp-audiomix: Add support for DSP run/stall
imx_dsp_rproc: Use reset controller API to control the DSP
.../devicetree/bindings/dsp/fsl,dsp.yaml | 24 +++++-
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 3 +
drivers/remoteproc/imx_dsp_rproc.c | 25 ++++--
drivers/remoteproc/imx_rproc.h | 2 +
drivers/reset/reset-imx8mp-audiomix.c | 78 +++++++++++++------
.../dt-bindings/reset/imx8mp-reset-audiomix.h | 13 ++++
6 files changed, 114 insertions(+), 31 deletions(-)
create mode 100644 include/dt-bindings/reset/imx8mp-reset-audiomix.h
--
2.43.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v5 1/8] dt-bindings: reset: audiomix: Add reset ids for EARC and DSP
2025-03-11 8:58 [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Daniel Baluta
@ 2025-03-11 8:58 ` Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 2/8] dt-bindings: dsp: fsl,dsp: Add resets property Daniel Baluta
` (8 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Daniel Baluta @ 2025-03-11 8:58 UTC (permalink / raw)
To: p.zabel, robh, krzk+dt, shawnguo, mathieu.poirier, devicetree,
linux-remoteproc
Cc: conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang, Daniel Baluta
Add reset ids used for EARC and DSP on i.MX8MP platform.
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
include/dt-bindings/reset/imx8mp-reset-audiomix.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 include/dt-bindings/reset/imx8mp-reset-audiomix.h
diff --git a/include/dt-bindings/reset/imx8mp-reset-audiomix.h b/include/dt-bindings/reset/imx8mp-reset-audiomix.h
new file mode 100644
index 000000000000..746c1337ed99
--- /dev/null
+++ b/include/dt-bindings/reset/imx8mp-reset-audiomix.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
+/*
+ * Copyright 2025 NXP
+ */
+
+#ifndef DT_BINDING_RESET_IMX8MP_AUDIOMIX_H
+#define DT_BINDING_RESET_IMX8MP_AUDIOMIX_H
+
+#define IMX8MP_AUDIOMIX_EARC_RESET 0
+#define IMX8MP_AUDIOMIX_EARC_PHY_RESET 1
+#define IMX8MP_AUDIOMIX_DSP_RUNSTALL 2
+
+#endif /* DT_BINDING_RESET_IMX8MP_AUDIOMIX_H */
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 2/8] dt-bindings: dsp: fsl,dsp: Add resets property
2025-03-11 8:58 [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 1/8] dt-bindings: reset: audiomix: Add reset ids for EARC and DSP Daniel Baluta
@ 2025-03-11 8:58 ` Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 3/8] arm64: dts: imx8mp: Use " Daniel Baluta
` (7 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Daniel Baluta @ 2025-03-11 8:58 UTC (permalink / raw)
To: p.zabel, robh, krzk+dt, shawnguo, mathieu.poirier, devicetree,
linux-remoteproc
Cc: conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang, Daniel Baluta
Assert and deassert functionality of the DSP found on i.MX8MP is
realized by combining control bits from two modules: Audio Block
Control and Debug Access Port.
Audio block control bits are used to Run/Stall the DSP core
while the DAP bits are used for software reset the core.
The original plan was to use fsl,dsp-ctrl property and to refer the
audiomix bits via syscon interface. This proposal received NACK from
community we shouldn't abuse the syscon interface [1].
So remove fsl,dsp-ctrl property for i.MX8MP and use reset control
interface instead.
Example dts node only uses runstall control now, but softreset will
be added in the future when we will convert the softreset functionality
to use reset controller API.
[1] https://patchwork.kernel.org/project/imx/patch/20250212085222.107102-6-daniel.baluta@nxp.com/
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
.../devicetree/bindings/dsp/fsl,dsp.yaml | 24 ++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
index ab93ffd3d2e5..b8693e4b4b0d 100644
--- a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
+++ b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
@@ -82,6 +82,15 @@ properties:
description:
Phandle to syscon block which provide access for processor enablement
+ resets:
+ minItems: 1
+
+ reset-names:
+ minItems: 1
+ items:
+ - const: runstall
+ - const: softreset
+
required:
- compatible
- reg
@@ -164,6 +173,17 @@ allOf:
- const: txdb1
- const: rxdb0
- const: rxdb1
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - fsl,imx8mp-dsp
+ - fsl,imx8mp-hifi4
+ then:
+ required:
+ - resets
+ - reset-names
additionalProperties: false
@@ -186,6 +206,7 @@ examples:
};
- |
#include <dt-bindings/clock/imx8mp-clock.h>
+ #include <dt-bindings/reset/imx8mp-reset-audiomix.h>
dsp_reserved: dsp@92400000 {
reg = <0x92400000 0x1000000>;
no-map;
@@ -220,5 +241,6 @@ examples:
<&mu2 3 0>;
memory-region = <&dsp_vdev0buffer>, <&dsp_vdev0vring0>,
<&dsp_vdev0vring1>, <&dsp_reserved>;
- fsl,dsp-ctrl = <&audio_blk_ctrl>;
+ resets = <&audio_blk_ctrl IMX8MP_AUDIOMIX_DSP_RUNSTALL>;
+ reset-names = "runstall";
};
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 3/8] arm64: dts: imx8mp: Use resets property
2025-03-11 8:58 [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 1/8] dt-bindings: reset: audiomix: Add reset ids for EARC and DSP Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 2/8] dt-bindings: dsp: fsl,dsp: Add resets property Daniel Baluta
@ 2025-03-11 8:58 ` Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 4/8] reset: imx8mp-audiomix: Add prefix for internal macro Daniel Baluta
` (6 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Daniel Baluta @ 2025-03-11 8:58 UTC (permalink / raw)
To: p.zabel, robh, krzk+dt, shawnguo, mathieu.poirier, devicetree,
linux-remoteproc
Cc: conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang, Daniel Baluta
Add resets property to dsp node in order to be able to control the dsp
run/stall bit from audio block control.
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index e0d3b8cba221..90ecee81e465 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -6,6 +6,7 @@
#include <dt-bindings/clock/imx8mp-clock.h>
#include <dt-bindings/power/imx8mp-power.h>
#include <dt-bindings/reset/imx8mp-reset.h>
+#include <dt-bindings/reset/imx8mp-reset-audiomix.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interconnect/fsl,imx8mp.h>
@@ -2421,6 +2422,8 @@ dsp: dsp@3b6e8000 {
mboxes = <&mu2 2 0>, <&mu2 2 1>,
<&mu2 3 0>, <&mu2 3 1>;
memory-region = <&dsp_reserved>;
+ resets = <&audio_blk_ctrl IMX8MP_AUDIOMIX_DSP_RUNSTALL>;
+ reset-names = "runstall";
status = "disabled";
};
};
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 4/8] reset: imx8mp-audiomix: Add prefix for internal macro
2025-03-11 8:58 [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Daniel Baluta
` (2 preceding siblings ...)
2025-03-11 8:58 ` [PATCH v5 3/8] arm64: dts: imx8mp: Use " Daniel Baluta
@ 2025-03-11 8:58 ` Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 5/8] reset: imx8mp-audiomix: Prepare the code for more reset bits Daniel Baluta
` (5 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Daniel Baluta @ 2025-03-11 8:58 UTC (permalink / raw)
To: p.zabel, robh, krzk+dt, shawnguo, mathieu.poirier, devicetree,
linux-remoteproc
Cc: conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang, Daniel Baluta
This adds IMX8MP_AUDIOMIX_ prefix to internal macros in order to show
that specific macros are related to audiomix.
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
drivers/reset/reset-imx8mp-audiomix.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/reset/reset-imx8mp-audiomix.c b/drivers/reset/reset-imx8mp-audiomix.c
index 6e3f3069f727..c2c3e8113182 100644
--- a/drivers/reset/reset-imx8mp-audiomix.c
+++ b/drivers/reset/reset-imx8mp-audiomix.c
@@ -11,8 +11,8 @@
#include <linux/of_address.h>
#include <linux/reset-controller.h>
-#define EARC 0x200
-#define EARC_RESET_MASK 0x3
+#define IMX8MP_AUDIOMIX_EARC_RESET_OFFSET 0x200
+#define IMX8MP_AUDIOMIX_EARC_RESET_MASK 0x3
struct imx8mp_audiomix_reset {
struct reset_controller_dev rcdev;
@@ -35,8 +35,8 @@ static int imx8mp_audiomix_reset_assert(struct reset_controller_dev *rcdev,
mask = BIT(id);
spin_lock_irqsave(&priv->lock, flags);
- reg = readl(reg_addr + EARC);
- writel(reg & ~mask, reg_addr + EARC);
+ reg = readl(reg_addr + IMX8MP_AUDIOMIX_EARC_RESET_OFFSET);
+ writel(reg & ~mask, reg_addr + IMX8MP_AUDIOMIX_EARC_RESET_OFFSET);
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
@@ -52,8 +52,8 @@ static int imx8mp_audiomix_reset_deassert(struct reset_controller_dev *rcdev,
mask = BIT(id);
spin_lock_irqsave(&priv->lock, flags);
- reg = readl(reg_addr + EARC);
- writel(reg | mask, reg_addr + EARC);
+ reg = readl(reg_addr + IMX8MP_AUDIOMIX_EARC_RESET_OFFSET);
+ writel(reg | mask, reg_addr + IMX8MP_AUDIOMIX_EARC_RESET_OFFSET);
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
@@ -78,7 +78,7 @@ static int imx8mp_audiomix_reset_probe(struct auxiliary_device *adev,
spin_lock_init(&priv->lock);
priv->rcdev.owner = THIS_MODULE;
- priv->rcdev.nr_resets = fls(EARC_RESET_MASK);
+ priv->rcdev.nr_resets = fls(IMX8MP_AUDIOMIX_EARC_RESET_MASK);
priv->rcdev.ops = &imx8mp_audiomix_reset_ops;
priv->rcdev.of_node = dev->parent->of_node;
priv->rcdev.dev = dev;
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 5/8] reset: imx8mp-audiomix: Prepare the code for more reset bits
2025-03-11 8:58 [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Daniel Baluta
` (3 preceding siblings ...)
2025-03-11 8:58 ` [PATCH v5 4/8] reset: imx8mp-audiomix: Add prefix for internal macro Daniel Baluta
@ 2025-03-11 8:58 ` Daniel Baluta
2025-03-13 8:50 ` Philipp Zabel
2025-03-11 8:58 ` [PATCH v5 6/8] reset: imx8mp-audiomix: Introduce active_low configuration option Daniel Baluta
` (4 subsequent siblings)
9 siblings, 1 reply; 14+ messages in thread
From: Daniel Baluta @ 2025-03-11 8:58 UTC (permalink / raw)
To: p.zabel, robh, krzk+dt, shawnguo, mathieu.poirier, devicetree,
linux-remoteproc
Cc: conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang, Daniel Baluta
Current code supports EARC PHY Software Reset and EARC Software Reset
but it is not easily extensible to more reset bits.
So, refactor the code in order to easily allow more reset bits in the
future.
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
drivers/reset/reset-imx8mp-audiomix.c | 43 ++++++++++++++++++++-------
1 file changed, 33 insertions(+), 10 deletions(-)
diff --git a/drivers/reset/reset-imx8mp-audiomix.c b/drivers/reset/reset-imx8mp-audiomix.c
index c2c3e8113182..abef6d768e62 100644
--- a/drivers/reset/reset-imx8mp-audiomix.c
+++ b/drivers/reset/reset-imx8mp-audiomix.c
@@ -3,6 +3,8 @@
* Copyright 2024 NXP
*/
+#include <dt-bindings/reset/imx8mp-reset-audiomix.h>
+
#include <linux/auxiliary_bus.h>
#include <linux/device.h>
#include <linux/io.h>
@@ -12,7 +14,24 @@
#include <linux/reset-controller.h>
#define IMX8MP_AUDIOMIX_EARC_RESET_OFFSET 0x200
-#define IMX8MP_AUDIOMIX_EARC_RESET_MASK 0x3
+#define IMX8MP_AUDIOMIX_EARC_RESET_MASK BIT(1)
+#define IMX8MP_AUDIOMIX_EARC_PHY_RESET_MASK BIT(2)
+
+struct imx8mp_reset_map {
+ unsigned int offset;
+ unsigned int mask;
+};
+
+static const struct imx8mp_reset_map reset_map[] = {
+ [IMX8MP_AUDIOMIX_EARC_RESET] = {
+ .offset = IMX8MP_AUDIOMIX_EARC_RESET_OFFSET,
+ .mask = IMX8MP_AUDIOMIX_EARC_RESET_MASK,
+ },
+ [IMX8MP_AUDIOMIX_EARC_PHY_RESET] = {
+ .offset = IMX8MP_AUDIOMIX_EARC_RESET_OFFSET,
+ .mask = IMX8MP_AUDIOMIX_EARC_PHY_RESET_MASK,
+ },
+};
struct imx8mp_audiomix_reset {
struct reset_controller_dev rcdev;
@@ -30,13 +49,15 @@ static int imx8mp_audiomix_reset_assert(struct reset_controller_dev *rcdev,
{
struct imx8mp_audiomix_reset *priv = to_imx8mp_audiomix_reset(rcdev);
void __iomem *reg_addr = priv->base;
- unsigned int mask, reg;
+ unsigned int mask, offset, reg;
unsigned long flags;
- mask = BIT(id);
+ mask = reset_map[id].mask;
+ offset = reset_map[id].offset;
+
spin_lock_irqsave(&priv->lock, flags);
- reg = readl(reg_addr + IMX8MP_AUDIOMIX_EARC_RESET_OFFSET);
- writel(reg & ~mask, reg_addr + IMX8MP_AUDIOMIX_EARC_RESET_OFFSET);
+ reg = readl(reg_addr + offset);
+ writel(reg & ~mask, reg_addr + offset);
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
@@ -47,13 +68,15 @@ static int imx8mp_audiomix_reset_deassert(struct reset_controller_dev *rcdev,
{
struct imx8mp_audiomix_reset *priv = to_imx8mp_audiomix_reset(rcdev);
void __iomem *reg_addr = priv->base;
- unsigned int mask, reg;
+ unsigned int mask, offset, reg;
unsigned long flags;
- mask = BIT(id);
+ mask = reset_map[id].mask;
+ offset = reset_map[id].offset;
+
spin_lock_irqsave(&priv->lock, flags);
- reg = readl(reg_addr + IMX8MP_AUDIOMIX_EARC_RESET_OFFSET);
- writel(reg | mask, reg_addr + IMX8MP_AUDIOMIX_EARC_RESET_OFFSET);
+ reg = readl(reg_addr + offset);
+ writel(reg | mask, reg_addr + offset);
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
@@ -78,7 +101,7 @@ static int imx8mp_audiomix_reset_probe(struct auxiliary_device *adev,
spin_lock_init(&priv->lock);
priv->rcdev.owner = THIS_MODULE;
- priv->rcdev.nr_resets = fls(IMX8MP_AUDIOMIX_EARC_RESET_MASK);
+ priv->rcdev.nr_resets = ARRAY_SIZE(reset_map);
priv->rcdev.ops = &imx8mp_audiomix_reset_ops;
priv->rcdev.of_node = dev->parent->of_node;
priv->rcdev.dev = dev;
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 6/8] reset: imx8mp-audiomix: Introduce active_low configuration option
2025-03-11 8:58 [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Daniel Baluta
` (4 preceding siblings ...)
2025-03-11 8:58 ` [PATCH v5 5/8] reset: imx8mp-audiomix: Prepare the code for more reset bits Daniel Baluta
@ 2025-03-11 8:58 ` Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 7/8] reset: imx8mp-audiomix: Add support for DSP run/stall Daniel Baluta
` (3 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Daniel Baluta @ 2025-03-11 8:58 UTC (permalink / raw)
To: p.zabel, robh, krzk+dt, shawnguo, mathieu.poirier, devicetree,
linux-remoteproc
Cc: conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang, Daniel Baluta
For EARC and EARC PHY the reset happens when clearing the reset bits.
Refactor assert/deassert function in order to take into account the
active_low configuration option.
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
drivers/reset/reset-imx8mp-audiomix.c | 41 ++++++++++++++-------------
1 file changed, 22 insertions(+), 19 deletions(-)
diff --git a/drivers/reset/reset-imx8mp-audiomix.c b/drivers/reset/reset-imx8mp-audiomix.c
index abef6d768e62..04ad27aca806 100644
--- a/drivers/reset/reset-imx8mp-audiomix.c
+++ b/drivers/reset/reset-imx8mp-audiomix.c
@@ -20,16 +20,19 @@
struct imx8mp_reset_map {
unsigned int offset;
unsigned int mask;
+ bool active_low;
};
static const struct imx8mp_reset_map reset_map[] = {
[IMX8MP_AUDIOMIX_EARC_RESET] = {
.offset = IMX8MP_AUDIOMIX_EARC_RESET_OFFSET,
.mask = IMX8MP_AUDIOMIX_EARC_RESET_MASK,
+ .active_low = true,
},
[IMX8MP_AUDIOMIX_EARC_PHY_RESET] = {
.offset = IMX8MP_AUDIOMIX_EARC_RESET_OFFSET,
.mask = IMX8MP_AUDIOMIX_EARC_PHY_RESET_MASK,
+ .active_low = true,
},
};
@@ -44,42 +47,42 @@ static struct imx8mp_audiomix_reset *to_imx8mp_audiomix_reset(struct reset_contr
return container_of(rcdev, struct imx8mp_audiomix_reset, rcdev);
}
-static int imx8mp_audiomix_reset_assert(struct reset_controller_dev *rcdev,
- unsigned long id)
+static int imx8mp_audiomix_update(struct reset_controller_dev *rcdev,
+ unsigned long id, bool assert)
{
struct imx8mp_audiomix_reset *priv = to_imx8mp_audiomix_reset(rcdev);
void __iomem *reg_addr = priv->base;
- unsigned int mask, offset, reg;
- unsigned long flags;
+ unsigned int mask, offset, active_low;
+ unsigned long reg, flags;
mask = reset_map[id].mask;
offset = reset_map[id].offset;
+ active_low = reset_map[id].active_low;
spin_lock_irqsave(&priv->lock, flags);
+
reg = readl(reg_addr + offset);
- writel(reg & ~mask, reg_addr + offset);
+ if (active_low ^ assert)
+ reg |= mask;
+ else
+ reg &= ~mask;
+ writel(reg, reg_addr + offset);
+
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
}
+static int imx8mp_audiomix_reset_assert(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ return imx8mp_audiomix_update(rcdev, id, true);
+}
+
static int imx8mp_audiomix_reset_deassert(struct reset_controller_dev *rcdev,
unsigned long id)
{
- struct imx8mp_audiomix_reset *priv = to_imx8mp_audiomix_reset(rcdev);
- void __iomem *reg_addr = priv->base;
- unsigned int mask, offset, reg;
- unsigned long flags;
-
- mask = reset_map[id].mask;
- offset = reset_map[id].offset;
-
- spin_lock_irqsave(&priv->lock, flags);
- reg = readl(reg_addr + offset);
- writel(reg | mask, reg_addr + offset);
- spin_unlock_irqrestore(&priv->lock, flags);
-
- return 0;
+ return imx8mp_audiomix_update(rcdev, id, false);
}
static const struct reset_control_ops imx8mp_audiomix_reset_ops = {
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 7/8] reset: imx8mp-audiomix: Add support for DSP run/stall
2025-03-11 8:58 [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Daniel Baluta
` (5 preceding siblings ...)
2025-03-11 8:58 ` [PATCH v5 6/8] reset: imx8mp-audiomix: Introduce active_low configuration option Daniel Baluta
@ 2025-03-11 8:58 ` Daniel Baluta
2025-03-13 8:49 ` Philipp Zabel
2025-03-11 8:58 ` [PATCH v5 8/8] imx_dsp_rproc: Use reset controller API to control the DSP Daniel Baluta
` (2 subsequent siblings)
9 siblings, 1 reply; 14+ messages in thread
From: Daniel Baluta @ 2025-03-11 8:58 UTC (permalink / raw)
To: p.zabel, robh, krzk+dt, shawnguo, mathieu.poirier, devicetree,
linux-remoteproc
Cc: conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang, Daniel Baluta
We can Run/Stall the DSP via audio block control bits found in audiomix.
Implement this functionality using the reset controller and use assert
for Stall and deassert for Run.
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
drivers/reset/reset-imx8mp-audiomix.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/reset/reset-imx8mp-audiomix.c b/drivers/reset/reset-imx8mp-audiomix.c
index 04ad27aca806..6b357adfe646 100644
--- a/drivers/reset/reset-imx8mp-audiomix.c
+++ b/drivers/reset/reset-imx8mp-audiomix.c
@@ -17,6 +17,9 @@
#define IMX8MP_AUDIOMIX_EARC_RESET_MASK BIT(1)
#define IMX8MP_AUDIOMIX_EARC_PHY_RESET_MASK BIT(2)
+#define IMX8MP_AUDIOMIX_DSP_RUNSTALL_OFFSET 0x108
+#define IMX8MP_AUDIOMIX_DSP_RUNSTALL_MASK BIT(5)
+
struct imx8mp_reset_map {
unsigned int offset;
unsigned int mask;
@@ -34,6 +37,11 @@ static const struct imx8mp_reset_map reset_map[] = {
.mask = IMX8MP_AUDIOMIX_EARC_PHY_RESET_MASK,
.active_low = true,
},
+ [IMX8MP_AUDIOMIX_DSP_RUNSTALL] = {
+ .offset = IMX8MP_AUDIOMIX_DSP_RUNSTALL_OFFSET,
+ .mask = IMX8MP_AUDIOMIX_DSP_RUNSTALL_MASK,
+ .active_low = false,
+ },
};
struct imx8mp_audiomix_reset {
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v5 8/8] imx_dsp_rproc: Use reset controller API to control the DSP
2025-03-11 8:58 [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Daniel Baluta
` (6 preceding siblings ...)
2025-03-11 8:58 ` [PATCH v5 7/8] reset: imx8mp-audiomix: Add support for DSP run/stall Daniel Baluta
@ 2025-03-11 8:58 ` Daniel Baluta
2025-03-11 16:27 ` [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Mathieu Poirier
2025-03-13 15:46 ` Mathieu Poirier
9 siblings, 0 replies; 14+ messages in thread
From: Daniel Baluta @ 2025-03-11 8:58 UTC (permalink / raw)
To: p.zabel, robh, krzk+dt, shawnguo, mathieu.poirier, devicetree,
linux-remoteproc
Cc: conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang, Daniel Baluta
DSP on i.MX8MP doesn't have a direct reset line so according to hardware
design team in order to handle assert/deassert/reset functionality we
need to use a combination of control bits from two modules. Audio block
control module for Run/Stall control of the DSP and DAP module in order
to do software reset.
In a first step, for i.MX8MP we are switching on using the reset
controller API to handle the DSP Run/Stall bits i.MX8MP. This comes with
the advantage of offering a better probe ordering and a more natural way
of abstracting the Audio block control bits.
[1] https://patchwork.kernel.org/project/imx/patch/20250212085222.107102-6-daniel.baluta@nxp.com/
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
drivers/remoteproc/imx_dsp_rproc.c | 25 +++++++++++++++++--------
drivers/remoteproc/imx_rproc.h | 2 ++
2 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
index ea5024919c2f..bc60edcdd661 100644
--- a/drivers/remoteproc/imx_dsp_rproc.c
+++ b/drivers/remoteproc/imx_dsp_rproc.c
@@ -19,6 +19,7 @@
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/remoteproc.h>
+#include <linux/reset.h>
#include <linux/slab.h>
#include "imx_rproc.h"
@@ -111,6 +112,7 @@ enum imx_dsp_rp_mbox_messages {
*/
struct imx_dsp_rproc {
struct regmap *regmap;
+ struct reset_control *run_stall;
struct rproc *rproc;
const struct imx_dsp_rproc_dcfg *dsp_dcfg;
struct clk_bulk_data clks[DSP_RPROC_CLK_MAX];
@@ -192,9 +194,7 @@ static int imx8mp_dsp_reset(struct imx_dsp_rproc *priv)
/* Keep reset asserted for 10 cycles */
usleep_range(1, 2);
- regmap_update_bits(priv->regmap, IMX8M_AudioDSP_REG2,
- IMX8M_AudioDSP_REG2_RUNSTALL,
- IMX8M_AudioDSP_REG2_RUNSTALL);
+ reset_control_assert(priv->run_stall);
/* Take the DSP out of reset and keep stalled for FW loading */
pwrctl = readl(dap + IMX8M_DAP_PWRCTL);
@@ -231,13 +231,9 @@ static int imx8ulp_dsp_reset(struct imx_dsp_rproc *priv)
/* Specific configuration for i.MX8MP */
static const struct imx_rproc_dcfg dsp_rproc_cfg_imx8mp = {
- .src_reg = IMX8M_AudioDSP_REG2,
- .src_mask = IMX8M_AudioDSP_REG2_RUNSTALL,
- .src_start = 0,
- .src_stop = IMX8M_AudioDSP_REG2_RUNSTALL,
.att = imx_dsp_rproc_att_imx8mp,
.att_size = ARRAY_SIZE(imx_dsp_rproc_att_imx8mp),
- .method = IMX_RPROC_MMIO,
+ .method = IMX_RPROC_RESET_CONTROLLER,
};
static const struct imx_dsp_rproc_dcfg imx_dsp_rproc_cfg_imx8mp = {
@@ -329,6 +325,9 @@ static int imx_dsp_rproc_start(struct rproc *rproc)
true,
rproc->bootaddr);
break;
+ case IMX_RPROC_RESET_CONTROLLER:
+ ret = reset_control_deassert(priv->run_stall);
+ break;
default:
return -EOPNOTSUPP;
}
@@ -369,6 +368,9 @@ static int imx_dsp_rproc_stop(struct rproc *rproc)
false,
rproc->bootaddr);
break;
+ case IMX_RPROC_RESET_CONTROLLER:
+ ret = reset_control_assert(priv->run_stall);
+ break;
default:
return -EOPNOTSUPP;
}
@@ -995,6 +997,13 @@ static int imx_dsp_rproc_detect_mode(struct imx_dsp_rproc *priv)
priv->regmap = regmap;
break;
+ case IMX_RPROC_RESET_CONTROLLER:
+ priv->run_stall = devm_reset_control_get_exclusive(dev, "runstall");
+ if (IS_ERR(priv->run_stall)) {
+ dev_err(dev, "Failed to get DSP runstall reset control\n");
+ return PTR_ERR(priv->run_stall);
+ }
+ break;
default:
ret = -EOPNOTSUPP;
break;
diff --git a/drivers/remoteproc/imx_rproc.h b/drivers/remoteproc/imx_rproc.h
index 17a7d051c531..cfd38d37e146 100644
--- a/drivers/remoteproc/imx_rproc.h
+++ b/drivers/remoteproc/imx_rproc.h
@@ -24,6 +24,8 @@ enum imx_rproc_method {
IMX_RPROC_SMC,
/* Through System Control Unit API */
IMX_RPROC_SCU_API,
+ /* Through Reset Controller API */
+ IMX_RPROC_RESET_CONTROLLER,
};
/* dcfg flags */
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API
2025-03-11 8:58 [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Daniel Baluta
` (7 preceding siblings ...)
2025-03-11 8:58 ` [PATCH v5 8/8] imx_dsp_rproc: Use reset controller API to control the DSP Daniel Baluta
@ 2025-03-11 16:27 ` Mathieu Poirier
2025-03-13 8:54 ` Philipp Zabel
2025-03-13 15:46 ` Mathieu Poirier
9 siblings, 1 reply; 14+ messages in thread
From: Mathieu Poirier @ 2025-03-11 16:27 UTC (permalink / raw)
To: Daniel Baluta
Cc: p.zabel, robh, krzk+dt, shawnguo, devicetree, linux-remoteproc,
conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang
Thanks for the re-spin. I will wait for Shawn and Sascha to review their
respective bits before picking up this set.
Mathieu
On Tue, Mar 11, 2025 at 10:58:03AM +0200, Daniel Baluta wrote:
> This patch series adds support to control the Run/Stall DSP bits found on
> i.MX8MP via the reset controller API instead of using the syscon API.
>
> DSP found on i.MX8MP doesn't have a direct reset line so according to hardware
> design team in order to handle assert/deassert/reset functionality we
> need to use a combination of control bits from two modules.
>
> Audio block control module:
> - for Run/Stall control bits of the DSP
>
> Debug Access Port (DAP)
> - for Software Reset via IMX8M_DAP_PWRCTL register
>
> The current implementation for IMX DSP Remotproc driver and for Sound Open
> Firmware driver (already upstream) uses the following approach:
> - maps the Audio Block Control address via syscon API through
> the fsl,dsp-ctrl property of the dsp node.
> - maps the DAP address space using directly a call to ioremap
> with IMX8M_DAP_DEBUG macro depicting the DAP base address.
>
> The both approaches are problematic when comes to describing the address
> spaces via the DT:
> - for Audio Block Control, because it uses the syscon interface
> - for DAP because it hardcodes de base address instead of using a dt node.
>
> This patch series aims to fix the Audio Block control usage of the
> syscon interface and replace it with Reset Controller interface.
>
> Main advantages of using the Reset Controller API is that we stop
> abusing the syscon interface, offer a better probe ordering, PM runtime
> support. Main critique of using the Reset Controller API is that
> Run/Stall bits are not reset bits (but according the hardware design
> team they are part of the reset proccess since there is no real reset
> line).
>
> Initial discussion is here:
> https://patchwork.kernel.org/project/imx/patch/20250212085222.107102-6-daniel.baluta@nxp.com/
>
> Note that we can safely remove the fsl,dsp-ctrl property usage from IMX DSP
> remoteproc driver because there is no Device Tree users.
>
> Changes since v4:
> https://lore.kernel.org/lkml/20250305100037.373782-3-daniel.baluta@nxp.com/T/
> - picked-up R-b tags from Frank Li and Peng Fan
> - reworded commit message of patch 8/8 as per Mathieu Poirier suggestion
>
> Changes since v3:
> https://lore.kernel.org/linux-arm-kernel/20250225102005.408773-5-daniel.baluta@nxp.com/T/
> - renamed resets ids as per Philipp comments
> - add boths resets (named them runstall and softreset) as per Philipp comments
>
> Changes since v2:
> (https://lore.kernel.org/lkml/Z7ZNngd3wtJ5MZgl@lizhi-Precision-Tower-5810/T/)
> - picked R-b and A-b tags
> - use run_stall instead of reset to refer to reset controller
> instance
> - remove 'resets' description as it is a common property
> - add correct include in the yaml dts snippet example
> Changes since v1:
> (https://lore.kernel.org/imx/20250219030809.GD6537@nxa18884-linux/T/)
> - addresed comments received on v1
> - picked up R-b and A-b tags
>
> Daniel Baluta (8):
> dt-bindings: reset: audiomix: Add reset ids for EARC and DSP
> dt-bindings: dsp: fsl,dsp: Add resets property
> arm64: dts: imx8mp: Use resets property
> reset: imx8mp-audiomix: Add prefix for internal macro
> reset: imx8mp-audiomix: Prepare the code for more reset bits
> reset: imx8mp-audiomix: Introduce active_low configuration option
> reset: imx8mp-audiomix: Add support for DSP run/stall
> imx_dsp_rproc: Use reset controller API to control the DSP
>
> .../devicetree/bindings/dsp/fsl,dsp.yaml | 24 +++++-
> arch/arm64/boot/dts/freescale/imx8mp.dtsi | 3 +
> drivers/remoteproc/imx_dsp_rproc.c | 25 ++++--
> drivers/remoteproc/imx_rproc.h | 2 +
> drivers/reset/reset-imx8mp-audiomix.c | 78 +++++++++++++------
> .../dt-bindings/reset/imx8mp-reset-audiomix.h | 13 ++++
> 6 files changed, 114 insertions(+), 31 deletions(-)
> create mode 100644 include/dt-bindings/reset/imx8mp-reset-audiomix.h
>
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 7/8] reset: imx8mp-audiomix: Add support for DSP run/stall
2025-03-11 8:58 ` [PATCH v5 7/8] reset: imx8mp-audiomix: Add support for DSP run/stall Daniel Baluta
@ 2025-03-13 8:49 ` Philipp Zabel
0 siblings, 0 replies; 14+ messages in thread
From: Philipp Zabel @ 2025-03-13 8:49 UTC (permalink / raw)
To: Daniel Baluta, robh, krzk+dt, shawnguo, mathieu.poirier,
devicetree, linux-remoteproc
Cc: conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang
On Di, 2025-03-11 at 10:58 +0200, Daniel Baluta wrote:
> We can Run/Stall the DSP via audio block control bits found in audiomix.
> Implement this functionality using the reset controller and use assert
> for Stall and deassert for Run.
>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 5/8] reset: imx8mp-audiomix: Prepare the code for more reset bits
2025-03-11 8:58 ` [PATCH v5 5/8] reset: imx8mp-audiomix: Prepare the code for more reset bits Daniel Baluta
@ 2025-03-13 8:50 ` Philipp Zabel
0 siblings, 0 replies; 14+ messages in thread
From: Philipp Zabel @ 2025-03-13 8:50 UTC (permalink / raw)
To: Daniel Baluta, robh, krzk+dt, shawnguo, mathieu.poirier,
devicetree, linux-remoteproc
Cc: conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang
On Di, 2025-03-11 at 10:58 +0200, Daniel Baluta wrote:
> Current code supports EARC PHY Software Reset and EARC Software Reset
> but it is not easily extensible to more reset bits.
>
> So, refactor the code in order to easily allow more reset bits in the
> future.
>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API
2025-03-11 16:27 ` [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Mathieu Poirier
@ 2025-03-13 8:54 ` Philipp Zabel
0 siblings, 0 replies; 14+ messages in thread
From: Philipp Zabel @ 2025-03-13 8:54 UTC (permalink / raw)
To: Mathieu Poirier, Daniel Baluta
Cc: robh, krzk+dt, shawnguo, devicetree, linux-remoteproc, conor+dt,
s.hauer, kernel, festevam, linux-kernel, imx, linux-arm-kernel,
andersson, Frank.Li, peng.fan, laurentiu.mihalcea, iuliana.prodan,
shengjiu.wang
Hi Mathieu,
On Di, 2025-03-11 at 10:27 -0600, Mathieu Poirier wrote:
> Thanks for the re-spin. I will wait for Shawn and Sascha to review their
> respective bits before picking up this set.
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
for merging the whole series via rproc.
regards
Philipp
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API
2025-03-11 8:58 [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Daniel Baluta
` (8 preceding siblings ...)
2025-03-11 16:27 ` [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Mathieu Poirier
@ 2025-03-13 15:46 ` Mathieu Poirier
9 siblings, 0 replies; 14+ messages in thread
From: Mathieu Poirier @ 2025-03-13 15:46 UTC (permalink / raw)
To: Daniel Baluta
Cc: p.zabel, robh, krzk+dt, shawnguo, devicetree, linux-remoteproc,
conor+dt, s.hauer, kernel, festevam, linux-kernel, imx,
linux-arm-kernel, andersson, Frank.Li, peng.fan,
laurentiu.mihalcea, iuliana.prodan, shengjiu.wang
On Tue, Mar 11, 2025 at 10:58:03AM +0200, Daniel Baluta wrote:
> This patch series adds support to control the Run/Stall DSP bits found on
> i.MX8MP via the reset controller API instead of using the syscon API.
>
> DSP found on i.MX8MP doesn't have a direct reset line so according to hardware
> design team in order to handle assert/deassert/reset functionality we
> need to use a combination of control bits from two modules.
>
> Audio block control module:
> - for Run/Stall control bits of the DSP
>
> Debug Access Port (DAP)
> - for Software Reset via IMX8M_DAP_PWRCTL register
>
> The current implementation for IMX DSP Remotproc driver and for Sound Open
> Firmware driver (already upstream) uses the following approach:
> - maps the Audio Block Control address via syscon API through
> the fsl,dsp-ctrl property of the dsp node.
> - maps the DAP address space using directly a call to ioremap
> with IMX8M_DAP_DEBUG macro depicting the DAP base address.
>
> The both approaches are problematic when comes to describing the address
> spaces via the DT:
> - for Audio Block Control, because it uses the syscon interface
> - for DAP because it hardcodes de base address instead of using a dt node.
>
> This patch series aims to fix the Audio Block control usage of the
> syscon interface and replace it with Reset Controller interface.
>
> Main advantages of using the Reset Controller API is that we stop
> abusing the syscon interface, offer a better probe ordering, PM runtime
> support. Main critique of using the Reset Controller API is that
> Run/Stall bits are not reset bits (but according the hardware design
> team they are part of the reset proccess since there is no real reset
> line).
>
> Initial discussion is here:
> https://patchwork.kernel.org/project/imx/patch/20250212085222.107102-6-daniel.baluta@nxp.com/
>
> Note that we can safely remove the fsl,dsp-ctrl property usage from IMX DSP
> remoteproc driver because there is no Device Tree users.
>
> Changes since v4:
> https://lore.kernel.org/lkml/20250305100037.373782-3-daniel.baluta@nxp.com/T/
> - picked-up R-b tags from Frank Li and Peng Fan
> - reworded commit message of patch 8/8 as per Mathieu Poirier suggestion
>
> Changes since v3:
> https://lore.kernel.org/linux-arm-kernel/20250225102005.408773-5-daniel.baluta@nxp.com/T/
> - renamed resets ids as per Philipp comments
> - add boths resets (named them runstall and softreset) as per Philipp comments
>
> Changes since v2:
> (https://lore.kernel.org/lkml/Z7ZNngd3wtJ5MZgl@lizhi-Precision-Tower-5810/T/)
> - picked R-b and A-b tags
> - use run_stall instead of reset to refer to reset controller
> instance
> - remove 'resets' description as it is a common property
> - add correct include in the yaml dts snippet example
> Changes since v1:
> (https://lore.kernel.org/imx/20250219030809.GD6537@nxa18884-linux/T/)
> - addresed comments received on v1
> - picked up R-b and A-b tags
>
> Daniel Baluta (8):
> dt-bindings: reset: audiomix: Add reset ids for EARC and DSP
> dt-bindings: dsp: fsl,dsp: Add resets property
> arm64: dts: imx8mp: Use resets property
> reset: imx8mp-audiomix: Add prefix for internal macro
> reset: imx8mp-audiomix: Prepare the code for more reset bits
> reset: imx8mp-audiomix: Introduce active_low configuration option
> reset: imx8mp-audiomix: Add support for DSP run/stall
> imx_dsp_rproc: Use reset controller API to control the DSP
>
> .../devicetree/bindings/dsp/fsl,dsp.yaml | 24 +++++-
> arch/arm64/boot/dts/freescale/imx8mp.dtsi | 3 +
> drivers/remoteproc/imx_dsp_rproc.c | 25 ++++--
> drivers/remoteproc/imx_rproc.h | 2 +
> drivers/reset/reset-imx8mp-audiomix.c | 78 +++++++++++++------
> .../dt-bindings/reset/imx8mp-reset-audiomix.h | 13 ++++
> 6 files changed, 114 insertions(+), 31 deletions(-)
> create mode 100644 include/dt-bindings/reset/imx8mp-reset-audiomix.h
Other than patch 3 for which I haven't received a Reviewed-by, I have applied
this set.
Thanks,
Mathieu
>
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2025-03-13 16:02 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-11 8:58 [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 1/8] dt-bindings: reset: audiomix: Add reset ids for EARC and DSP Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 2/8] dt-bindings: dsp: fsl,dsp: Add resets property Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 3/8] arm64: dts: imx8mp: Use " Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 4/8] reset: imx8mp-audiomix: Add prefix for internal macro Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 5/8] reset: imx8mp-audiomix: Prepare the code for more reset bits Daniel Baluta
2025-03-13 8:50 ` Philipp Zabel
2025-03-11 8:58 ` [PATCH v5 6/8] reset: imx8mp-audiomix: Introduce active_low configuration option Daniel Baluta
2025-03-11 8:58 ` [PATCH v5 7/8] reset: imx8mp-audiomix: Add support for DSP run/stall Daniel Baluta
2025-03-13 8:49 ` Philipp Zabel
2025-03-11 8:58 ` [PATCH v5 8/8] imx_dsp_rproc: Use reset controller API to control the DSP Daniel Baluta
2025-03-11 16:27 ` [PATCH v5 0/8] imx8mp: Add support to Run/Stall DSP via reset API Mathieu Poirier
2025-03-13 8:54 ` Philipp Zabel
2025-03-13 15:46 ` Mathieu Poirier
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).