* [PATCH 0/7] Add support for i.MX8ULP's SIM LPAV
@ 2025-08-04 15:54 Laurentiu Mihalcea
2025-08-04 15:54 ` [PATCH 1/7] dt-bindings: reset: imx8ulp: add SIM LPAV reset ID definitions Laurentiu Mihalcea
` (6 more replies)
0 siblings, 7 replies; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-04 15:54 UTC (permalink / raw)
To: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel
Cc: linux-clk, imx, devicetree, linux-arm-kernel, linux-kernel,
Pengutronix Kernel Team
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The LPAV System Integration Module (SIM) is an IP found inside i.MX8ULP's
LPAV subsystem, which offers clock gating, reset line
assertion/de-assertion, and various other misc. options.
This series adds support for the IP by introducing a new clock HW provider
driver and by modifying i.MX8MP's AUDIOMIX block control reset driver to
allow it to be used for i.MX8ULP's SIM LPAV as well. Since the IP also has
MUX-ing capabilities, the DT node is marked as a syscon, therefore
allowing the usage of the MMIO MUX driver.
This series is a spin-off from [1].
[1]: https://lore.kernel.org/lkml/20240922174225.75948-1-laurentiumihalcea111@gmail.com/
Laurentiu Mihalcea (7):
dt-bindings: reset: imx8ulp: add SIM LPAV reset ID definitions
dt-bindings: clock: imx8ulp: add SIM LPAV clock gate ID definitions
dt-bindings: clock: document 8ULP's SIM LPAV
clk: imx: add driver for imx8ulp's sim lpav
reset: imx8mp-audiomix: Extend the driver usage
reset: imx8mp-audiomix: Support i.MX8ULP SIM LPAV
arm64: dts: imx8ulp: add sim lpav node
.../bindings/clock/fsl,imx8ulp-sim-lpav.yaml | 69 ++++++++
arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 11 ++
drivers/clk/imx/Makefile | 1 +
drivers/clk/imx/clk-imx8ulp-sim-lpav.c | 162 ++++++++++++++++++
drivers/reset/reset-imx8mp-audiomix.c | 63 ++++++-
include/dt-bindings/clock/imx8ulp-clock.h | 7 +
.../reset/imx8ulp-reset-sim-lpav.h | 16 ++
7 files changed, 327 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/clock/fsl,imx8ulp-sim-lpav.yaml
create mode 100644 drivers/clk/imx/clk-imx8ulp-sim-lpav.c
create mode 100644 include/dt-bindings/reset/imx8ulp-reset-sim-lpav.h
--
2.34.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/7] dt-bindings: reset: imx8ulp: add SIM LPAV reset ID definitions
2025-08-04 15:54 [PATCH 0/7] Add support for i.MX8ULP's SIM LPAV Laurentiu Mihalcea
@ 2025-08-04 15:54 ` Laurentiu Mihalcea
2025-08-05 7:01 ` Krzysztof Kozlowski
2025-08-04 15:54 ` [PATCH 2/7] dt-bindings: clock: imx8ulp: add SIM LPAV clock gate " Laurentiu Mihalcea
` (5 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-04 15:54 UTC (permalink / raw)
To: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel
Cc: linux-clk, imx, devicetree, linux-arm-kernel, linux-kernel,
Pengutronix Kernel Team
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add ID definitions for i.MX8ULP's SIM LPAV reset lines.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
.../dt-bindings/reset/imx8ulp-reset-sim-lpav.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 include/dt-bindings/reset/imx8ulp-reset-sim-lpav.h
diff --git a/include/dt-bindings/reset/imx8ulp-reset-sim-lpav.h b/include/dt-bindings/reset/imx8ulp-reset-sim-lpav.h
new file mode 100644
index 000000000000..adf95bb26d21
--- /dev/null
+++ b/include/dt-bindings/reset/imx8ulp-reset-sim-lpav.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright 2025 NXP
+ */
+
+#ifndef DT_BINDING_RESET_IMX8ULP_SIM_LPAV_H
+#define DT_BINDING_RESET_IMX8ULP_SIM_LPAV_H
+
+#define IMX8ULP_SIM_LPAV_HIFI4_DSP_DBG_RST 0
+#define IMX8ULP_SIM_LPAV_HIFI4_DSP_RST 1
+#define IMX8ULP_SIM_LPAV_HIFI4_DSP_STALL 2
+#define IMX8ULP_SIM_LPAV_DSI_RST_BYTE_N 3
+#define IMX8ULP_SIM_LPAV_DSI_RST_ESC_N 4
+#define IMX8ULP_SIM_LPAV_DSI_RST_DPI_N 5
+
+#endif /* DT_BINDING_RESET_IMX8ULP_SIM_LPAV_H */
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/7] dt-bindings: clock: imx8ulp: add SIM LPAV clock gate ID definitions
2025-08-04 15:54 [PATCH 0/7] Add support for i.MX8ULP's SIM LPAV Laurentiu Mihalcea
2025-08-04 15:54 ` [PATCH 1/7] dt-bindings: reset: imx8ulp: add SIM LPAV reset ID definitions Laurentiu Mihalcea
@ 2025-08-04 15:54 ` Laurentiu Mihalcea
2025-08-05 7:02 ` Krzysztof Kozlowski
2025-08-04 15:54 ` [PATCH 3/7] dt-bindings: clock: document 8ULP's SIM LPAV Laurentiu Mihalcea
` (4 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-04 15:54 UTC (permalink / raw)
To: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel
Cc: linux-clk, imx, devicetree, linux-arm-kernel, linux-kernel,
Pengutronix Kernel Team
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add ID definitions for the clock gates managed by the SIM LPAV module.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
include/dt-bindings/clock/imx8ulp-clock.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/dt-bindings/clock/imx8ulp-clock.h b/include/dt-bindings/clock/imx8ulp-clock.h
index 827404fadf5c..ebebb4831761 100644
--- a/include/dt-bindings/clock/imx8ulp-clock.h
+++ b/include/dt-bindings/clock/imx8ulp-clock.h
@@ -255,4 +255,11 @@
#define IMX8ULP_CLK_PCC5_END 56
+/* LPAV SIM */
+#define IMX8ULP_CLK_SIM_LPAV_HIFI_CORE 0
+#define IMX8ULP_CLK_SIM_LPAV_HIFI_PBCLK 1
+#define IMX8ULP_CLK_SIM_LPAV_HIFI_PLAT 2
+
+#define IMX8ULP_CLK_SIM_LPAV_END 3
+
#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/7] dt-bindings: clock: document 8ULP's SIM LPAV
2025-08-04 15:54 [PATCH 0/7] Add support for i.MX8ULP's SIM LPAV Laurentiu Mihalcea
2025-08-04 15:54 ` [PATCH 1/7] dt-bindings: reset: imx8ulp: add SIM LPAV reset ID definitions Laurentiu Mihalcea
2025-08-04 15:54 ` [PATCH 2/7] dt-bindings: clock: imx8ulp: add SIM LPAV clock gate " Laurentiu Mihalcea
@ 2025-08-04 15:54 ` Laurentiu Mihalcea
2025-08-05 7:03 ` Krzysztof Kozlowski
2025-08-04 15:54 ` [PATCH 4/7] clk: imx: add driver for imx8ulp's sim lpav Laurentiu Mihalcea
` (3 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-04 15:54 UTC (permalink / raw)
To: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel
Cc: linux-clk, imx, devicetree, linux-arm-kernel, linux-kernel,
Pengutronix Kernel Team
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add documentation for i.MX8ULP's SIM LPAV module.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
.../bindings/clock/fsl,imx8ulp-sim-lpav.yaml | 69 +++++++++++++++++++
1 file changed, 69 insertions(+)
create mode 100644 Documentation/devicetree/bindings/clock/fsl,imx8ulp-sim-lpav.yaml
diff --git a/Documentation/devicetree/bindings/clock/fsl,imx8ulp-sim-lpav.yaml b/Documentation/devicetree/bindings/clock/fsl,imx8ulp-sim-lpav.yaml
new file mode 100644
index 000000000000..ef44f50921f8
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/fsl,imx8ulp-sim-lpav.yaml
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/fsl,imx8ulp-sim-lpav.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8ULP LPAV System Integration Module (SIM)
+
+maintainers:
+ - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
+
+description:
+ The i.MX8ULP LPAV subsystem contains a block control module known as
+ SIM LPAV, which offers functionalities such as clock gating or reset
+ line assertion/de-assertion.
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - fsl,imx8ulp-sim-lpav
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ maxItems: 3
+
+ clock-names:
+ items:
+ - const: lpav_bus
+ - const: hifi_core
+ - const: hifi_plat
+
+ '#clock-cells':
+ const: 1
+ description: clock ID
+
+ '#reset-cells':
+ const: 1
+ description: reset ID
+
+ mux-controller:
+ $ref: /schemas/mux/reg-mux.yaml#
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+ - '#clock-cells'
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/imx8ulp-clock.h>
+
+ clock-controller@2da50000 {
+ compatible = "fsl,imx8ulp-sim-lpav", "syscon";
+ reg = <0x2da50000 0x10000>;
+ clocks = <&cgc2 IMX8ULP_CLK_LPAV_BUS_DIV>,
+ <&cgc2 IMX8ULP_CLK_HIFI_DIVCORE>,
+ <&cgc2 IMX8ULP_CLK_HIFI_DIVPLAT>;
+ clock-names = "lpav_bus", "hifi_core", "hifi_plat";
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 4/7] clk: imx: add driver for imx8ulp's sim lpav
2025-08-04 15:54 [PATCH 0/7] Add support for i.MX8ULP's SIM LPAV Laurentiu Mihalcea
` (2 preceding siblings ...)
2025-08-04 15:54 ` [PATCH 3/7] dt-bindings: clock: document 8ULP's SIM LPAV Laurentiu Mihalcea
@ 2025-08-04 15:54 ` Laurentiu Mihalcea
2025-08-04 15:54 ` [PATCH 5/7] reset: imx8mp-audiomix: Extend the driver usage Laurentiu Mihalcea
` (2 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-04 15:54 UTC (permalink / raw)
To: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel
Cc: linux-clk, imx, devicetree, linux-arm-kernel, linux-kernel,
Pengutronix Kernel Team
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The i.MX8ULP System Integration Module (SIM) LPAV module is a block
control module found inside the LPAV subsystem, which offers some clock
gating options and reset line assertion/de-assertion capabilities.
Therefore, the clock gate management is supported by registering the
module's driver as a clock provider, while the reset capabilities are
managed via the auxiliary device API to allow the DT node to act as a
reset and clock provider.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
drivers/clk/imx/Makefile | 1 +
drivers/clk/imx/clk-imx8ulp-sim-lpav.c | 162 +++++++++++++++++++++++++
2 files changed, 163 insertions(+)
create mode 100644 drivers/clk/imx/clk-imx8ulp-sim-lpav.c
diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile
index 03f2b2a1ab63..208b46873a18 100644
--- a/drivers/clk/imx/Makefile
+++ b/drivers/clk/imx/Makefile
@@ -41,6 +41,7 @@ clk-imx-lpcg-scu-$(CONFIG_CLK_IMX8QXP) += clk-lpcg-scu.o clk-imx8qxp-lpcg.o
clk-imx-acm-$(CONFIG_CLK_IMX8QXP) = clk-imx8-acm.o
obj-$(CONFIG_CLK_IMX8ULP) += clk-imx8ulp.o
+obj-$(CONFIG_CLK_IMX8ULP) += clk-imx8ulp-sim-lpav.o
obj-$(CONFIG_CLK_IMX1) += clk-imx1.o
obj-$(CONFIG_CLK_IMX25) += clk-imx25.o
diff --git a/drivers/clk/imx/clk-imx8ulp-sim-lpav.c b/drivers/clk/imx/clk-imx8ulp-sim-lpav.c
new file mode 100644
index 000000000000..2019e0a61216
--- /dev/null
+++ b/drivers/clk/imx/clk-imx8ulp-sim-lpav.c
@@ -0,0 +1,162 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2025 NXP
+ */
+
+#include <dt-bindings/clock/imx8ulp-clock.h>
+
+#include <linux/auxiliary_bus.h>
+#include <linux/clk-provider.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+
+#define SYSCTRL0 0x8
+
+#define IMX8ULP_HIFI_CLK_GATE(gname, cname, pname, bidx) \
+ { \
+ .name = gname"_cg", \
+ .id = IMX8ULP_CLK_SIM_LPAV_HIFI_##cname, \
+ .parent = { .fw_name = pname, .name = pname }, \
+ .bit = bidx, \
+ }
+
+struct clk_imx8ulp_sim_lpav_data {
+ void __iomem *base;
+ struct clk_hw_onecell_data clk_data;
+};
+
+struct clk_imx8ulp_sim_lpav_gate {
+ const char *name;
+ int id;
+ const struct clk_parent_data parent;
+ u8 bit;
+} gates[] = {
+ IMX8ULP_HIFI_CLK_GATE("hifi_core", CORE, "hifi_core", 17),
+ IMX8ULP_HIFI_CLK_GATE("hifi_pbclk", PBCLK, "lpav_bus", 18),
+ IMX8ULP_HIFI_CLK_GATE("hifi_plat", PLAT, "hifi_plat", 19)
+};
+
+#ifdef CONFIG_RESET_CONTROLLER
+static void clk_imx8ulp_sim_lpav_aux_reset_release(struct device *dev)
+{
+ struct auxiliary_device *adev = to_auxiliary_dev(dev);
+
+ kfree(adev);
+}
+
+static void clk_imx8ulp_sim_lpav_unregister_aux_reset(void *data)
+{
+ struct auxiliary_device *adev = data;
+
+ auxiliary_device_delete(adev);
+ auxiliary_device_uninit(adev);
+}
+
+static int clk_imx8ulp_sim_lpav_register_aux_reset(struct platform_device *pdev)
+{
+ struct auxiliary_device *adev __free(kfree) = NULL;
+ int ret;
+
+ adev = kzalloc(sizeof(*adev), GFP_KERNEL);
+ if (!adev)
+ return -ENOMEM;
+
+ adev->name = "reset";
+ adev->dev.parent = &pdev->dev;
+ adev->dev.release = clk_imx8ulp_sim_lpav_aux_reset_release;
+
+ ret = auxiliary_device_init(adev);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to initialize aux dev\n");
+ return ret;
+ }
+
+ ret = auxiliary_device_add(adev);
+ if (ret) {
+ auxiliary_device_uninit(adev);
+ dev_err(&pdev->dev, "failed to add aux dev\n");
+ return ret;
+ }
+
+ return devm_add_action_or_reset(&pdev->dev,
+ clk_imx8ulp_sim_lpav_unregister_aux_reset,
+ no_free_ptr(adev));
+}
+#else
+static int clk_imx8ulp_sim_lpav_register_aux_reset(struct platform_device *pdev)
+{
+ return 0;
+}
+#endif /* CONFIG_RESET_CONTROLLER */
+
+static int clk_imx8ulp_sim_lpav_probe(struct platform_device *pdev)
+{
+ struct clk_imx8ulp_sim_lpav_data *data;
+ struct clk_hw *hw;
+ int i, ret;
+
+ data = devm_kzalloc(&pdev->dev,
+ struct_size(data, clk_data.hws, IMX8ULP_CLK_SIM_LPAV_END),
+ GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ data->base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(data->base))
+ return dev_err_probe(&pdev->dev, PTR_ERR(data->base),
+ "failed to ioremap base\n");
+
+ data->clk_data.num = IMX8ULP_CLK_SIM_LPAV_END;
+
+ for (i = 0; i < ARRAY_SIZE(gates); i++) {
+ hw = devm_clk_hw_register_gate_parent_data(&pdev->dev,
+ gates[i].name,
+ &gates[i].parent,
+ CLK_SET_RATE_PARENT,
+ data->base + SYSCTRL0,
+ gates[i].bit,
+ 0x0, NULL);
+ if (IS_ERR(hw))
+ return dev_err_probe(&pdev->dev, PTR_ERR(hw),
+ "failed to register %s gate\n",
+ gates[i].name);
+
+ data->clk_data.hws[i] = hw;
+ }
+
+ ret = clk_imx8ulp_sim_lpav_register_aux_reset(pdev);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret,
+ "failed to register aux reset\n");
+
+ ret = devm_of_clk_add_hw_provider(&pdev->dev,
+ of_clk_hw_onecell_get,
+ &data->clk_data);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret,
+ "failed to register clk hw provider\n");
+
+ /* used to probe MUX child device */
+ return devm_of_platform_populate(&pdev->dev);
+}
+
+static const struct of_device_id clk_imx8ulp_sim_lpav_of_match[] = {
+ { .compatible = "fsl,imx8ulp-sim-lpav" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, clk_imx8ulp_sim_lpav_of_match);
+
+static struct platform_driver clk_imx8ulp_sim_lpav_driver = {
+ .probe = clk_imx8ulp_sim_lpav_probe,
+ .driver = {
+ .name = "clk-imx8ulp-sim-lpav",
+ .of_match_table = clk_imx8ulp_sim_lpav_of_match,
+ },
+};
+module_platform_driver(clk_imx8ulp_sim_lpav_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("i.MX8ULP LPAV System Integration Module (SIM) clock driver");
+MODULE_AUTHOR("Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>");
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 5/7] reset: imx8mp-audiomix: Extend the driver usage
2025-08-04 15:54 [PATCH 0/7] Add support for i.MX8ULP's SIM LPAV Laurentiu Mihalcea
` (3 preceding siblings ...)
2025-08-04 15:54 ` [PATCH 4/7] clk: imx: add driver for imx8ulp's sim lpav Laurentiu Mihalcea
@ 2025-08-04 15:54 ` Laurentiu Mihalcea
2025-08-05 7:51 ` Daniel Baluta
2025-08-04 15:54 ` [PATCH 6/7] reset: imx8mp-audiomix: Support i.MX8ULP SIM LPAV Laurentiu Mihalcea
2025-08-04 15:54 ` [PATCH 7/7] arm64: dts: imx8ulp: add sim lpav node Laurentiu Mihalcea
6 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-04 15:54 UTC (permalink / raw)
To: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel
Cc: linux-clk, imx, devicetree, linux-arm-kernel, linux-kernel,
Pengutronix Kernel Team
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Some NXP SoCs integrate one or more, per-subsystem, block control IPs,
which allow users to control the assertion and de-assertion of the
reset lines tied to some peripherals present in said subsystems. Some
examples of such SoCs include i.MX8MP with AUDIOMIX block control and
i.MX8ULP with SIM LPAV.
Some of the aformentioned block control IPs exhibit a common pattern with
respect to the assertion and de-assertion of the reset lines. Namely, the
user is able to control the state of the reset line by toggling a bit from
one of the IP's registers.
Linux can take advantage of this pattern and, instead of having one driver
for each block control IP, a single, more generic driver could be used.
To allow this to happen, the previous approach, in which a single reset
map is used, is replaced by a per-driver approach, in which each auxiliary
device driver holds a reference to a certain reset map.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
drivers/reset/reset-imx8mp-audiomix.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/reset/reset-imx8mp-audiomix.c b/drivers/reset/reset-imx8mp-audiomix.c
index 6b357adfe646..a3d0bd823272 100644
--- a/drivers/reset/reset-imx8mp-audiomix.c
+++ b/drivers/reset/reset-imx8mp-audiomix.c
@@ -26,7 +26,12 @@ struct imx8mp_reset_map {
bool active_low;
};
-static const struct imx8mp_reset_map reset_map[] = {
+struct imx8mp_reset_info {
+ const struct imx8mp_reset_map *map;
+ int num_lines;
+};
+
+static const struct imx8mp_reset_map imx8mp_reset_map[] = {
[IMX8MP_AUDIOMIX_EARC_RESET] = {
.offset = IMX8MP_AUDIOMIX_EARC_RESET_OFFSET,
.mask = IMX8MP_AUDIOMIX_EARC_RESET_MASK,
@@ -44,10 +49,16 @@ static const struct imx8mp_reset_map reset_map[] = {
},
};
+static const struct imx8mp_reset_info imx8mp_reset_info = {
+ .map = imx8mp_reset_map,
+ .num_lines = ARRAY_SIZE(imx8mp_reset_map),
+};
+
struct imx8mp_audiomix_reset {
struct reset_controller_dev rcdev;
spinlock_t lock; /* protect register read-modify-write cycle */
void __iomem *base;
+ const struct imx8mp_reset_info *rinfo;
};
static struct imx8mp_audiomix_reset *to_imx8mp_audiomix_reset(struct reset_controller_dev *rcdev)
@@ -59,6 +70,7 @@ 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);
+ const struct imx8mp_reset_map *reset_map = priv->rinfo->map;
void __iomem *reg_addr = priv->base;
unsigned int mask, offset, active_low;
unsigned long reg, flags;
@@ -112,7 +124,8 @@ static int imx8mp_audiomix_reset_probe(struct auxiliary_device *adev,
spin_lock_init(&priv->lock);
priv->rcdev.owner = THIS_MODULE;
- priv->rcdev.nr_resets = ARRAY_SIZE(reset_map);
+ priv->rinfo = (const struct imx8mp_reset_info *)id->driver_data;
+ priv->rcdev.nr_resets = priv->rinfo->num_lines;
priv->rcdev.ops = &imx8mp_audiomix_reset_ops;
priv->rcdev.of_node = dev->parent->of_node;
priv->rcdev.dev = dev;
@@ -144,6 +157,7 @@ static void imx8mp_audiomix_reset_remove(struct auxiliary_device *adev)
static const struct auxiliary_device_id imx8mp_audiomix_reset_ids[] = {
{
.name = "clk_imx8mp_audiomix.reset",
+ .driver_data = (kernel_ulong_t)&imx8mp_reset_info,
},
{ }
};
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 6/7] reset: imx8mp-audiomix: Support i.MX8ULP SIM LPAV
2025-08-04 15:54 [PATCH 0/7] Add support for i.MX8ULP's SIM LPAV Laurentiu Mihalcea
` (4 preceding siblings ...)
2025-08-04 15:54 ` [PATCH 5/7] reset: imx8mp-audiomix: Extend the driver usage Laurentiu Mihalcea
@ 2025-08-04 15:54 ` Laurentiu Mihalcea
2025-08-05 7:53 ` Daniel Baluta
2025-08-04 15:54 ` [PATCH 7/7] arm64: dts: imx8ulp: add sim lpav node Laurentiu Mihalcea
6 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-04 15:54 UTC (permalink / raw)
To: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel
Cc: linux-clk, imx, devicetree, linux-arm-kernel, linux-kernel,
Pengutronix Kernel Team
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Support i.MX8ULP's SIM LPAV by adding its reset map definition.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
drivers/reset/reset-imx8mp-audiomix.c | 45 +++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/drivers/reset/reset-imx8mp-audiomix.c b/drivers/reset/reset-imx8mp-audiomix.c
index a3d0bd823272..2ab701ef1c30 100644
--- a/drivers/reset/reset-imx8mp-audiomix.c
+++ b/drivers/reset/reset-imx8mp-audiomix.c
@@ -4,6 +4,7 @@
*/
#include <dt-bindings/reset/imx8mp-reset-audiomix.h>
+#include <dt-bindings/reset/imx8ulp-reset-sim-lpav.h>
#include <linux/auxiliary_bus.h>
#include <linux/device.h>
@@ -20,6 +21,8 @@
#define IMX8MP_AUDIOMIX_DSP_RUNSTALL_OFFSET 0x108
#define IMX8MP_AUDIOMIX_DSP_RUNSTALL_MASK BIT(5)
+#define IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET 0x8
+
struct imx8mp_reset_map {
unsigned int offset;
unsigned int mask;
@@ -54,6 +57,44 @@ static const struct imx8mp_reset_info imx8mp_reset_info = {
.num_lines = ARRAY_SIZE(imx8mp_reset_map),
};
+static const struct imx8mp_reset_map imx8ulp_reset_map[] = {
+ [IMX8ULP_SIM_LPAV_HIFI4_DSP_DBG_RST] = {
+ .offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
+ .mask = BIT(25),
+ .active_low = false,
+ },
+ [IMX8ULP_SIM_LPAV_HIFI4_DSP_RST] = {
+ .offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
+ .mask = BIT(16),
+ .active_low = false,
+ },
+ [IMX8ULP_SIM_LPAV_HIFI4_DSP_STALL] = {
+ .offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
+ .mask = BIT(13),
+ .active_low = false,
+ },
+ [IMX8ULP_SIM_LPAV_DSI_RST_BYTE_N] = {
+ .offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
+ .mask = BIT(5),
+ .active_low = true,
+ },
+ [IMX8ULP_SIM_LPAV_DSI_RST_ESC_N] = {
+ .offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
+ .mask = BIT(4),
+ .active_low = true,
+ },
+ [IMX8ULP_SIM_LPAV_DSI_RST_DPI_N] = {
+ .offset = IMX8ULP_SIM_LPAV_SYSCTRL0_OFFSET,
+ .mask = BIT(3),
+ .active_low = true,
+ },
+};
+
+static const struct imx8mp_reset_info imx8ulp_reset_info = {
+ .map = imx8ulp_reset_map,
+ .num_lines = ARRAY_SIZE(imx8ulp_reset_map),
+};
+
struct imx8mp_audiomix_reset {
struct reset_controller_dev rcdev;
spinlock_t lock; /* protect register read-modify-write cycle */
@@ -159,6 +200,10 @@ static const struct auxiliary_device_id imx8mp_audiomix_reset_ids[] = {
.name = "clk_imx8mp_audiomix.reset",
.driver_data = (kernel_ulong_t)&imx8mp_reset_info,
},
+ {
+ .name = "clk_imx8ulp_sim_lpav.reset",
+ .driver_data = (kernel_ulong_t)&imx8ulp_reset_info,
+ },
{ }
};
MODULE_DEVICE_TABLE(auxiliary, imx8mp_audiomix_reset_ids);
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 7/7] arm64: dts: imx8ulp: add sim lpav node
2025-08-04 15:54 [PATCH 0/7] Add support for i.MX8ULP's SIM LPAV Laurentiu Mihalcea
` (5 preceding siblings ...)
2025-08-04 15:54 ` [PATCH 6/7] reset: imx8mp-audiomix: Support i.MX8ULP SIM LPAV Laurentiu Mihalcea
@ 2025-08-04 15:54 ` Laurentiu Mihalcea
6 siblings, 0 replies; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-08-04 15:54 UTC (permalink / raw)
To: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel
Cc: linux-clk, imx, devicetree, linux-arm-kernel, linux-kernel,
Pengutronix Kernel Team
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add DT node for the SIM LPAV module.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
index 13b01f3aa2a4..d84f50d8ecc0 100644
--- a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
@@ -776,6 +776,17 @@ edma2: dma-controller@2d800000 {
"ch28", "ch29", "ch30", "ch31";
};
+ sim_lpav: clock-controller@2da50000 {
+ compatible = "fsl,imx8ulp-sim-lpav", "syscon";
+ reg = <0x2da50000 0x10000>;
+ clocks = <&cgc2 IMX8ULP_CLK_LPAV_BUS_DIV>,
+ <&cgc2 IMX8ULP_CLK_HIFI_DIVCORE>,
+ <&cgc2 IMX8ULP_CLK_HIFI_DIVPLAT>;
+ clock-names = "lpav_bus", "hifi_core", "hifi_plat";
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
+
cgc2: clock-controller@2da60000 {
compatible = "fsl,imx8ulp-cgc2";
reg = <0x2da60000 0x10000>;
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/7] dt-bindings: reset: imx8ulp: add SIM LPAV reset ID definitions
2025-08-04 15:54 ` [PATCH 1/7] dt-bindings: reset: imx8ulp: add SIM LPAV reset ID definitions Laurentiu Mihalcea
@ 2025-08-05 7:01 ` Krzysztof Kozlowski
0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-05 7:01 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel, linux-clk, imx, devicetree, linux-arm-kernel,
linux-kernel, Pengutronix Kernel Team
On Mon, Aug 04, 2025 at 11:54:01AM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Add ID definitions for i.MX8ULP's SIM LPAV reset lines.
>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
> .../dt-bindings/reset/imx8ulp-reset-sim-lpav.h | 16 ++++++++++++++++
This belongs to the bindings patch.
Also, use proper filename - compatible.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/7] dt-bindings: clock: imx8ulp: add SIM LPAV clock gate ID definitions
2025-08-04 15:54 ` [PATCH 2/7] dt-bindings: clock: imx8ulp: add SIM LPAV clock gate " Laurentiu Mihalcea
@ 2025-08-05 7:02 ` Krzysztof Kozlowski
0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-05 7:02 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel, linux-clk, imx, devicetree, linux-arm-kernel,
linux-kernel, Pengutronix Kernel Team
On Mon, Aug 04, 2025 at 11:54:02AM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Add ID definitions for the clock gates managed by the SIM LPAV module.
>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
> include/dt-bindings/clock/imx8ulp-clock.h | 7 +++++++
> 1 file changed, 7 insertions(+)
This is part of bindings patch.
>
> diff --git a/include/dt-bindings/clock/imx8ulp-clock.h b/include/dt-bindings/clock/imx8ulp-clock.h
> index 827404fadf5c..ebebb4831761 100644
> --- a/include/dt-bindings/clock/imx8ulp-clock.h
> +++ b/include/dt-bindings/clock/imx8ulp-clock.h
> @@ -255,4 +255,11 @@
>
> #define IMX8ULP_CLK_PCC5_END 56
>
> +/* LPAV SIM */
> +#define IMX8ULP_CLK_SIM_LPAV_HIFI_CORE 0
> +#define IMX8ULP_CLK_SIM_LPAV_HIFI_PBCLK 1
> +#define IMX8ULP_CLK_SIM_LPAV_HIFI_PLAT 2
> +
> +#define IMX8ULP_CLK_SIM_LPAV_END 3
Drop. Not a binding (see other discussions for many SoCs why).
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/7] dt-bindings: clock: document 8ULP's SIM LPAV
2025-08-04 15:54 ` [PATCH 3/7] dt-bindings: clock: document 8ULP's SIM LPAV Laurentiu Mihalcea
@ 2025-08-05 7:03 ` Krzysztof Kozlowski
0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-05 7:03 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel, linux-clk, imx, devicetree, linux-arm-kernel,
linux-kernel, Pengutronix Kernel Team
On Mon, Aug 04, 2025 at 11:54:03AM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Add documentation for i.MX8ULP's SIM LPAV module.
>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
> .../bindings/clock/fsl,imx8ulp-sim-lpav.yaml | 69 +++++++++++++++++++
> 1 file changed, 69 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/clock/fsl,imx8ulp-sim-lpav.yaml
>
> diff --git a/Documentation/devicetree/bindings/clock/fsl,imx8ulp-sim-lpav.yaml b/Documentation/devicetree/bindings/clock/fsl,imx8ulp-sim-lpav.yaml
> new file mode 100644
> index 000000000000..ef44f50921f8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/fsl,imx8ulp-sim-lpav.yaml
> @@ -0,0 +1,69 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/clock/fsl,imx8ulp-sim-lpav.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP i.MX8ULP LPAV System Integration Module (SIM)
> +
> +maintainers:
> + - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> +
> +description:
> + The i.MX8ULP LPAV subsystem contains a block control module known as
> + SIM LPAV, which offers functionalities such as clock gating or reset
> + line assertion/de-assertion.
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - fsl,imx8ulp-sim-lpav
> + - const: syscon
Why is this syscon?
> +
> + reg:
> + maxItems: 1
> +
> + clocks:
> + maxItems: 3
> +
> + clock-names:
> + items:
> + - const: lpav_bus
> + - const: hifi_core
> + - const: hifi_plat
> +
> + '#clock-cells':
> + const: 1
> + description: clock ID
Drop description, redundant. Look how other bindings write this.
> +
> + '#reset-cells':
> + const: 1
> + description: reset ID
Ditto
> +
> + mux-controller:
> + $ref: /schemas/mux/reg-mux.yaml#
> +
> +required:
> + - compatible
> + - reg
> + - clocks
> + - clock-names
> + - '#clock-cells'
reset cells and mux controller.
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/imx8ulp-clock.h>
> +
> + clock-controller@2da50000 {
> + compatible = "fsl,imx8ulp-sim-lpav", "syscon";
> + reg = <0x2da50000 0x10000>;
> + clocks = <&cgc2 IMX8ULP_CLK_LPAV_BUS_DIV>,
> + <&cgc2 IMX8ULP_CLK_HIFI_DIVCORE>,
> + <&cgc2 IMX8ULP_CLK_HIFI_DIVPLAT>;
> + clock-names = "lpav_bus", "hifi_core", "hifi_plat";
> + #clock-cells = <1>;
> + #reset-cells = <1>;
Incomplete node - missing properties/child. Post complete binding and
complete example.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 5/7] reset: imx8mp-audiomix: Extend the driver usage
2025-08-04 15:54 ` [PATCH 5/7] reset: imx8mp-audiomix: Extend the driver usage Laurentiu Mihalcea
@ 2025-08-05 7:51 ` Daniel Baluta
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Baluta @ 2025-08-05 7:51 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel, linux-clk, imx, devicetree, linux-arm-kernel,
linux-kernel, Pengutronix Kernel Team
On Mon, Aug 4, 2025 at 6:57 PM Laurentiu Mihalcea
<laurentiumihalcea111@gmail.com> wrote:
>
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Some NXP SoCs integrate one or more, per-subsystem, block control IPs,
> which allow users to control the assertion and de-assertion of the
> reset lines tied to some peripherals present in said subsystems. Some
> examples of such SoCs include i.MX8MP with AUDIOMIX block control and
> i.MX8ULP with SIM LPAV.
>
> Some of the aformentioned block control IPs exhibit a common pattern with
> respect to the assertion and de-assertion of the reset lines. Namely, the
> user is able to control the state of the reset line by toggling a bit from
> one of the IP's registers.
>
> Linux can take advantage of this pattern and, instead of having one driver
> for each block control IP, a single, more generic driver could be used.
>
> To allow this to happen, the previous approach, in which a single reset
> map is used, is replaced by a per-driver approach, in which each auxiliary
> device driver holds a reference to a certain reset map.
>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 6/7] reset: imx8mp-audiomix: Support i.MX8ULP SIM LPAV
2025-08-04 15:54 ` [PATCH 6/7] reset: imx8mp-audiomix: Support i.MX8ULP SIM LPAV Laurentiu Mihalcea
@ 2025-08-05 7:53 ` Daniel Baluta
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Baluta @ 2025-08-05 7:53 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Fabio Estevam,
Philipp Zabel, linux-clk, imx, devicetree, linux-arm-kernel,
linux-kernel, Pengutronix Kernel Team
On Mon, Aug 4, 2025 at 6:59 PM Laurentiu Mihalcea
<laurentiumihalcea111@gmail.com> wrote:
>
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Support i.MX8ULP's SIM LPAV by adding its reset map definition.
>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-08-05 7:51 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-04 15:54 [PATCH 0/7] Add support for i.MX8ULP's SIM LPAV Laurentiu Mihalcea
2025-08-04 15:54 ` [PATCH 1/7] dt-bindings: reset: imx8ulp: add SIM LPAV reset ID definitions Laurentiu Mihalcea
2025-08-05 7:01 ` Krzysztof Kozlowski
2025-08-04 15:54 ` [PATCH 2/7] dt-bindings: clock: imx8ulp: add SIM LPAV clock gate " Laurentiu Mihalcea
2025-08-05 7:02 ` Krzysztof Kozlowski
2025-08-04 15:54 ` [PATCH 3/7] dt-bindings: clock: document 8ULP's SIM LPAV Laurentiu Mihalcea
2025-08-05 7:03 ` Krzysztof Kozlowski
2025-08-04 15:54 ` [PATCH 4/7] clk: imx: add driver for imx8ulp's sim lpav Laurentiu Mihalcea
2025-08-04 15:54 ` [PATCH 5/7] reset: imx8mp-audiomix: Extend the driver usage Laurentiu Mihalcea
2025-08-05 7:51 ` Daniel Baluta
2025-08-04 15:54 ` [PATCH 6/7] reset: imx8mp-audiomix: Support i.MX8ULP SIM LPAV Laurentiu Mihalcea
2025-08-05 7:53 ` Daniel Baluta
2025-08-04 15:54 ` [PATCH 7/7] arm64: dts: imx8ulp: add sim lpav node Laurentiu Mihalcea
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).