* [PATCH v4 0/3] Add support for imx8ulp's SIM
@ 2024-09-15 11:43 Laurentiu Mihalcea
2024-09-15 11:43 ` [PATCH v4 1/3] dt-bindings: reset: add schema for imx8ulp SIM reset Laurentiu Mihalcea
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Laurentiu Mihalcea @ 2024-09-15 11:43 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Philipp Zabel,
Liu Ying, Sascha Hauer, Conor Dooley
Cc: devicetree, imx, linux-arm-kernel, linux-kernel
i.MX8ULP's SIM (System Integration Module) allows
control and configuration of certain components
form the domain it's assigned to. Add DT node
and schema for it. Its child shall also be
included.
---
Changes in v4:
- Addressed Rob and Krzysztof's comments
- Link to v3: https://lore.kernel.org/all/20240715164514.8718-1-laurentiumihalcea111@gmail.com/
Changes in v3:
- Addressed Krzysztof's comments
- The "reset: add driver for imx8ulp SIM reset controller" patch might generate conflict when
applied to Rob and Shawn Guo's trees (for-next branch). Tested all patches with linux-next,
next-20240715 tag and no conflicts.
- Link to v2: https://lore.kernel.org/all/20240609125901.76274-1-laurentiumihalcea111@gmail.com/
Changes in v2:
- Reset controller is now also a syscon provider.
- Changed vendor prefix to nxp.
- Link to v1: https://lore.kernel.org/all/20240516204031.171920-1-laurentiumihalcea111@gmail.com/
---
Laurentiu Mihalcea (3):
dt-bindings: reset: add schema for imx8ulp SIM reset
reset: add driver for imx8ulp SIM reset controller
arm64: dts: imx8ulp: add AVD-SIM node
.../reset/nxp,imx8ulp-avd-sim-reset.yaml | 58 ++++++++++
arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 13 +++
drivers/reset/Kconfig | 7 ++
drivers/reset/Makefile | 1 +
drivers/reset/reset-imx8ulp-sim.c | 106 ++++++++++++++++++
5 files changed, 185 insertions(+)
create mode 100644 Documentation/devicetree/bindings/reset/nxp,imx8ulp-avd-sim-reset.yaml
create mode 100644 drivers/reset/reset-imx8ulp-sim.c
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v4 1/3] dt-bindings: reset: add schema for imx8ulp SIM reset
2024-09-15 11:43 [PATCH v4 0/3] Add support for imx8ulp's SIM Laurentiu Mihalcea
@ 2024-09-15 11:43 ` Laurentiu Mihalcea
2024-09-16 9:41 ` Krzysztof Kozlowski
2024-09-15 11:43 ` [PATCH v4 2/3] reset: add driver for imx8ulp SIM reset controller Laurentiu Mihalcea
2024-09-15 11:43 ` [PATCH v4 3/3] arm64: dts: imx8ulp: add AVD-SIM node Laurentiu Mihalcea
2 siblings, 1 reply; 8+ messages in thread
From: Laurentiu Mihalcea @ 2024-09-15 11:43 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Philipp Zabel,
Liu Ying, Sascha Hauer, Conor Dooley
Cc: devicetree, imx, linux-arm-kernel, linux-kernel
Add schema for imx8ulp's SIM reset controller.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
.../reset/nxp,imx8ulp-avd-sim-reset.yaml | 58 +++++++++++++++++++
1 file changed, 58 insertions(+)
create mode 100644 Documentation/devicetree/bindings/reset/nxp,imx8ulp-avd-sim-reset.yaml
diff --git a/Documentation/devicetree/bindings/reset/nxp,imx8ulp-avd-sim-reset.yaml b/Documentation/devicetree/bindings/reset/nxp,imx8ulp-avd-sim-reset.yaml
new file mode 100644
index 000000000000..f6797966fd35
--- /dev/null
+++ b/Documentation/devicetree/bindings/reset/nxp,imx8ulp-avd-sim-reset.yaml
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reset/nxp,imx8ulp-avd-sim-reset.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8ULP System Integration Module Reset Controller
+
+maintainers:
+ - Liu Ying <victor.liu@nxp.com>
+
+description:
+ Some instances of i.MX8ULP's SIM may offer control over the reset of some
+ components of a certain domain (example - AVD-SIM).
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - nxp,imx8ulp-avd-sim-reset
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ '#reset-cells':
+ const: 1
+
+ mux-controller:
+ $ref: /schemas/mux/reg-mux.yaml#
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - '#reset-cells'
+ - mux-controller
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/imx8ulp-clock.h>
+ syscon@2da50000 {
+ compatible = "nxp,imx8ulp-avd-sim-reset", "syscon";
+ reg = <0x2da50000 0x38>;
+ clocks = <&pcc5 IMX8ULP_CLK_AVD_SIM>;
+ #reset-cells = <1>;
+
+ mux-controller {
+ compatible = "mmio-mux";
+ #mux-control-cells = <1>;
+ mux-reg-masks = <0x8 0x00000200>;
+ };
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v4 2/3] reset: add driver for imx8ulp SIM reset controller
2024-09-15 11:43 [PATCH v4 0/3] Add support for imx8ulp's SIM Laurentiu Mihalcea
2024-09-15 11:43 ` [PATCH v4 1/3] dt-bindings: reset: add schema for imx8ulp SIM reset Laurentiu Mihalcea
@ 2024-09-15 11:43 ` Laurentiu Mihalcea
2024-09-24 11:11 ` Daniel Baluta
2024-09-24 11:16 ` Fabio Estevam
2024-09-15 11:43 ` [PATCH v4 3/3] arm64: dts: imx8ulp: add AVD-SIM node Laurentiu Mihalcea
2 siblings, 2 replies; 8+ messages in thread
From: Laurentiu Mihalcea @ 2024-09-15 11:43 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Philipp Zabel,
Liu Ying, Sascha Hauer, Conor Dooley
Cc: devicetree, imx, linux-arm-kernel, linux-kernel
Certain components can be reset via the SIM module.
Add reset controller driver for the SIM module to
allow drivers for said components to control the
reset signal(s).
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
drivers/reset/Kconfig | 7 ++
drivers/reset/Makefile | 1 +
drivers/reset/reset-imx8ulp-sim.c | 106 ++++++++++++++++++++++++++++++
3 files changed, 114 insertions(+)
create mode 100644 drivers/reset/reset-imx8ulp-sim.c
diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index 5484a65f66b9..492081354d03 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -113,6 +113,13 @@ config RESET_IMX8MP_AUDIOMIX
help
This enables the reset controller driver for i.MX8MP AudioMix
+config RESET_IMX8ULP_SIM
+ tristate "i.MX8ULP SIM Reset Driver"
+ depends on ARCH_MXC
+ help
+ This enables the SIM (System Integration Module) reset driver
+ for i.MX8ULP SoC.
+
config RESET_INTEL_GW
bool "Intel Reset Controller Driver"
depends on X86 || COMPILE_TEST
diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
index 4411a2a124d7..38354e701811 100644
--- a/drivers/reset/Makefile
+++ b/drivers/reset/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_RESET_GPIO) += reset-gpio.o
obj-$(CONFIG_RESET_HSDK) += reset-hsdk.o
obj-$(CONFIG_RESET_IMX7) += reset-imx7.o
obj-$(CONFIG_RESET_IMX8MP_AUDIOMIX) += reset-imx8mp-audiomix.o
+obj-$(CONFIG_RESET_IMX8ULP_SIM) += reset-imx8ulp-sim.o
obj-$(CONFIG_RESET_INTEL_GW) += reset-intel-gw.o
obj-$(CONFIG_RESET_K210) += reset-k210.o
obj-$(CONFIG_RESET_LANTIQ) += reset-lantiq.o
diff --git a/drivers/reset/reset-imx8ulp-sim.c b/drivers/reset/reset-imx8ulp-sim.c
new file mode 100644
index 000000000000..04ff11d41e10
--- /dev/null
+++ b/drivers/reset/reset-imx8ulp-sim.c
@@ -0,0 +1,106 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/*
+ * Copyright 2024 NXP
+ */
+
+#include <linux/mfd/syscon.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/reset-controller.h>
+#include <linux/of_platform.h>
+
+#define IMX8ULP_SIM_RESET_MIPI_DSI_RST_DPI_N 0
+#define IMX8ULP_SIM_RESET_MIPI_DSI_RST_ESC_N 1
+#define IMX8ULP_SIM_RESET_MIPI_DSI_RST_BYTE_N 2
+
+#define IMX8ULP_SIM_RESET_NUM 3
+
+#define AVD_SIM_SYSCTRL0 0x8
+
+struct imx8ulp_sim_reset {
+ struct reset_controller_dev rcdev;
+ struct regmap *regmap;
+};
+
+static const u32 imx8ulp_sim_reset_bits[IMX8ULP_SIM_RESET_NUM] = {
+ [IMX8ULP_SIM_RESET_MIPI_DSI_RST_DPI_N] = BIT(3),
+ [IMX8ULP_SIM_RESET_MIPI_DSI_RST_ESC_N] = BIT(4),
+ [IMX8ULP_SIM_RESET_MIPI_DSI_RST_BYTE_N] = BIT(5),
+};
+
+static inline struct imx8ulp_sim_reset *
+to_imx8ulp_sim_reset(struct reset_controller_dev *rcdev)
+{
+ return container_of(rcdev, struct imx8ulp_sim_reset, rcdev);
+}
+
+static int imx8ulp_sim_reset_assert(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ struct imx8ulp_sim_reset *simr = to_imx8ulp_sim_reset(rcdev);
+ const u32 bit = imx8ulp_sim_reset_bits[id];
+
+ return regmap_update_bits(simr->regmap, AVD_SIM_SYSCTRL0, bit, 0);
+}
+
+static int imx8ulp_sim_reset_deassert(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ struct imx8ulp_sim_reset *simr = to_imx8ulp_sim_reset(rcdev);
+ const u32 bit = imx8ulp_sim_reset_bits[id];
+
+ return regmap_update_bits(simr->regmap, AVD_SIM_SYSCTRL0, bit, bit);
+}
+
+static const struct reset_control_ops imx8ulp_sim_reset_ops = {
+ .assert = imx8ulp_sim_reset_assert,
+ .deassert = imx8ulp_sim_reset_deassert,
+};
+
+static const struct of_device_id imx8ulp_sim_reset_dt_ids[] = {
+ { .compatible = "nxp,imx8ulp-avd-sim-reset", },
+ { /* sentinel */ },
+};
+
+static int imx8ulp_sim_reset_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct imx8ulp_sim_reset *simr;
+ int ret;
+
+ simr = devm_kzalloc(dev, sizeof(*simr), GFP_KERNEL);
+ if (!simr)
+ return -ENOMEM;
+
+ simr->regmap = syscon_node_to_regmap(dev->of_node);
+ if (IS_ERR(simr->regmap))
+ return dev_err_probe(&pdev->dev, PTR_ERR(simr->regmap),
+ "failed to get regmap\n");
+
+ simr->rcdev.owner = THIS_MODULE;
+ simr->rcdev.nr_resets = IMX8ULP_SIM_RESET_NUM;
+ simr->rcdev.ops = &imx8ulp_sim_reset_ops;
+ simr->rcdev.of_node = dev->of_node;
+
+ ret = devm_of_platform_populate(dev);
+ if (ret)
+ return ret;
+
+ return devm_reset_controller_register(dev, &simr->rcdev);
+}
+
+static struct platform_driver imx8ulp_sim_reset_driver = {
+ .probe = imx8ulp_sim_reset_probe,
+ .driver = {
+ .name = KBUILD_MODNAME,
+ .of_match_table = imx8ulp_sim_reset_dt_ids,
+ },
+};
+module_platform_driver(imx8ulp_sim_reset_driver);
+
+MODULE_AUTHOR("Liu Ying <victor.liu@nxp.com>");
+MODULE_DESCRIPTION("NXP i.MX8ULP System Integration Module Reset driver");
+MODULE_LICENSE("GPL");
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v4 3/3] arm64: dts: imx8ulp: add AVD-SIM node
2024-09-15 11:43 [PATCH v4 0/3] Add support for imx8ulp's SIM Laurentiu Mihalcea
2024-09-15 11:43 ` [PATCH v4 1/3] dt-bindings: reset: add schema for imx8ulp SIM reset Laurentiu Mihalcea
2024-09-15 11:43 ` [PATCH v4 2/3] reset: add driver for imx8ulp SIM reset controller Laurentiu Mihalcea
@ 2024-09-15 11:43 ` Laurentiu Mihalcea
2 siblings, 0 replies; 8+ messages in thread
From: Laurentiu Mihalcea @ 2024-09-15 11:43 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Philipp Zabel,
Liu Ying, Sascha Hauer, Conor Dooley
Cc: devicetree, imx, linux-arm-kernel, linux-kernel
Add node for imx8ulp's AVD-SIM module. This also
includes its children.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
index e32d5afcf4a9..1ffa4da23042 100644
--- a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
@@ -614,6 +614,19 @@ per_bridge5: bus@2d800000 {
#size-cells = <1>;
ranges;
+ avd_sim: syscon@2da50000 {
+ compatible = "nxp,imx8ulp-avd-sim-reset", "syscon";
+ reg = <0x2da50000 0x38>;
+ clocks = <&pcc5 IMX8ULP_CLK_AVD_SIM>;
+ #reset-cells = <1>;
+
+ mux: mux-controller {
+ compatible = "mmio-mux";
+ #mux-control-cells = <1>;
+ mux-reg-masks = <0x8 0x00000200>;
+ };
+ };
+
cgc2: clock-controller@2da60000 {
compatible = "fsl,imx8ulp-cgc2";
reg = <0x2da60000 0x10000>;
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v4 1/3] dt-bindings: reset: add schema for imx8ulp SIM reset
2024-09-15 11:43 ` [PATCH v4 1/3] dt-bindings: reset: add schema for imx8ulp SIM reset Laurentiu Mihalcea
@ 2024-09-16 9:41 ` Krzysztof Kozlowski
0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2024-09-16 9:41 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Philipp Zabel,
Liu Ying, Sascha Hauer, Conor Dooley, devicetree, imx,
linux-arm-kernel, linux-kernel
On Sun, Sep 15, 2024 at 07:43:09AM -0400, Laurentiu Mihalcea wrote:
> Add schema for imx8ulp's SIM reset controller.
>
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Fix checkpatch errors. You have SoB mismatch.
This applies to all your patches.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v4 2/3] reset: add driver for imx8ulp SIM reset controller
2024-09-15 11:43 ` [PATCH v4 2/3] reset: add driver for imx8ulp SIM reset controller Laurentiu Mihalcea
@ 2024-09-24 11:11 ` Daniel Baluta
2024-09-24 11:16 ` Fabio Estevam
1 sibling, 0 replies; 8+ messages in thread
From: Daniel Baluta @ 2024-09-24 11:11 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Philipp Zabel,
Liu Ying, Sascha Hauer, Conor Dooley, devicetree, imx,
linux-arm-kernel, linux-kernel
On Sun, Sep 15, 2024 at 2:45 PM Laurentiu Mihalcea
<laurentiumihalcea111@gmail.com> wrote:
>
> Certain components can be reset via the SIM module.
> Add reset controller driver for the SIM module to
> allow drivers for said components to control the
> reset signal(s).
>
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v4 2/3] reset: add driver for imx8ulp SIM reset controller
2024-09-15 11:43 ` [PATCH v4 2/3] reset: add driver for imx8ulp SIM reset controller Laurentiu Mihalcea
2024-09-24 11:11 ` Daniel Baluta
@ 2024-09-24 11:16 ` Fabio Estevam
2024-09-24 11:18 ` Fabio Estevam
1 sibling, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2024-09-24 11:16 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Philipp Zabel,
Liu Ying, Sascha Hauer, Conor Dooley, devicetree, imx,
linux-arm-kernel, linux-kernel
On Sun, Sep 15, 2024 at 8:45 AM Laurentiu Mihalcea
<laurentiumihalcea111@gmail.com> wrote:
>
> Certain components can be reset via the SIM module.
> Add reset controller driver for the SIM module to
> allow drivers for said components to control the
> reset signal(s).
>
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Who is the original author?
In the NXP kernel, the author is Liu Ying.
If that's still the case the Author field should contain Liu Ying's name.
Please double-check.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v4 2/3] reset: add driver for imx8ulp SIM reset controller
2024-09-24 11:16 ` Fabio Estevam
@ 2024-09-24 11:18 ` Fabio Estevam
0 siblings, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2024-09-24 11:18 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Philipp Zabel,
Liu Ying, Sascha Hauer, Conor Dooley, devicetree, imx,
linux-arm-kernel, linux-kernel
On Tue, Sep 24, 2024 at 8:16 AM Fabio Estevam <festevam@gmail.com> wrote:
> Who is the original author?
>
> In the NXP kernel, the author is Liu Ying.
>
> If that's still the case the Author field should contain Liu Ying's name.
>
> Please double-check.
Also, even if you are the author, there is still something wrong
as reported by checkpatch:
WARNING: From:/Signed-off-by: email address mismatch: 'From: Laurentiu
Mihalcea <laurentiumihalcea111@gmail.com>' != 'Signed-off-by:
Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>'
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-09-24 11:18 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-15 11:43 [PATCH v4 0/3] Add support for imx8ulp's SIM Laurentiu Mihalcea
2024-09-15 11:43 ` [PATCH v4 1/3] dt-bindings: reset: add schema for imx8ulp SIM reset Laurentiu Mihalcea
2024-09-16 9:41 ` Krzysztof Kozlowski
2024-09-15 11:43 ` [PATCH v4 2/3] reset: add driver for imx8ulp SIM reset controller Laurentiu Mihalcea
2024-09-24 11:11 ` Daniel Baluta
2024-09-24 11:16 ` Fabio Estevam
2024-09-24 11:18 ` Fabio Estevam
2024-09-15 11:43 ` [PATCH v4 3/3] arm64: dts: imx8ulp: add AVD-SIM 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).