Skip to contentSkip to conversation

imx: add support for i.MX7/i.MX8MQ reset controller

PATCH New Patrick Wildt 3 participants 11 messages Sep 30, 2019 – Oct 5, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imx: add support for i.MX7/i.MX8MQ reset controller

Add support for the reset controller that's used on the i.MX7D and i.MX8MQ. This will be needed to be able to assert the PCIe reset pins. Bindings taken from Linux, driver implementation mostly taken from Linux and adjusted to U-Boot infrastructure.

arch/arm/dts/fsl-imx8mq.dtsi +7 -0
index 814a1b7df4..52a76b4ba4 100644
@@ -19,6 +19,7 @@
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/pinctrl/pins-imx8mq.h>
+#include <dt-bindings/reset/imx8mq-reset.h>
 #include <dt-bindings/thermal/thermal.h>
 
 / {
@@ -269,6 +270,12 @@
 		#clock-cells = <1>;
 	};
 
+	src: reset-controller at 30390000 {
+		compatible = "fsl,imx8mq-src", "syscon";
+		reg = <0x0 0x30390000 0x0 0x10000>;
+		#reset-cells = <1>;
+	};
+
 	gpc: gpc at 303a0000 {
 		compatible = "fsl,imx8mq-gpc", "fsl,imx7d-gpc", "syscon";
 		reg = <0x0 0x303a0000 0x0 0x10000>;
configs/imx8mq_evk_defconfig +1 -0
index e45731edda..c0e5860e85 100644
@@ -38,4 +38,5 @@ CONFIG_PINCTRL_IMX8M=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_RESET=y
 CONFIG_DM_THERMAL=y
drivers/reset/Kconfig +7 -0
index 6ec6f39c85..976f3a701c 100644
@@ -127,4 +127,11 @@ config RESET_HISILICON
 	help
 	  Support for reset controller on HiSilicon SoCs.
 
+config RESET_IMX7
+	bool "i.MX7/8 Reset Driver"
+	depends on DM_RESET && (ARCH_MX7 || ARCH_IMX8M)
+	default y
+	help
+	  Support for reset controller on i.MX7/8 SoCs.
+
 endmenu
drivers/reset/Makefile +1 -0
index 7fec75bb49..f5875fce09 100644
@@ -20,3 +20,4 @@ obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_RESET_MEDIATEK) += reset-mediatek.o
 obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
 obj-$(CONFIG_RESET_HISILICON) += reset-hisilicon.o
+obj-$(CONFIG_RESET_IMX7) += reset-imx7.o
drivers/reset/reset-imx7.c new file +312 -0

312 lines not on this page · raw message

include/dt-bindings/reset/imx7-reset.h new file +52 -0

52 lines not on this page · raw message

include/dt-bindings/reset/imx8mq-reset.h new file +64 -0

64 lines not on this page · raw message

#1 lore raw

PATCH 1/1 imx: add support for i.MX7/i.MX8MQ reset controller

Add support for the reset controller that's used on the i.MX7D and i.MX8MQ. This will be needed to be able to assert the PCIe reset pins. Bindings taken from Linux, driver implementation mostly taken from Linux and adjusted to U-Boot infrastructure.

arch/arm/dts/fsl-imx8mq.dtsi +7 -0
index c35c23e293..d843b401be 100644
@@ -19,6 +19,7 @@
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/pinctrl/pins-imx8mq.h>
+#include <dt-bindings/reset/imx8mq-reset.h>
 #include <dt-bindings/thermal/thermal.h>
 
 / {
@@ -269,6 +270,12 @@
 		#clock-cells = <1>;
 	};
 
+	src: reset-controller at 30390000 {
+		compatible = "fsl,imx8mq-src", "syscon";
+		reg = <0x0 0x30390000 0x0 0x10000>;
+		#reset-cells = <1>;
+	};
+
 	gpc: gpc at 303a0000 {
 		compatible = "fsl,imx8mq-gpc", "fsl,imx7d-gpc", "syscon";
 		reg = <0x0 0x303a0000 0x0 0x10000>;
configs/imx8mq_evk_defconfig +1 -0
index e45731edda..c0e5860e85 100644
@@ -38,4 +38,5 @@ CONFIG_PINCTRL_IMX8M=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_RESET=y
 CONFIG_DM_THERMAL=y
drivers/reset/Kconfig +7 -0
index 6ec6f39c85..976f3a701c 100644
@@ -127,4 +127,11 @@ config RESET_HISILICON
 	help
 	  Support for reset controller on HiSilicon SoCs.
 
+config RESET_IMX7
+	bool "i.MX7/8 Reset Driver"
+	depends on DM_RESET && (ARCH_MX7 || ARCH_IMX8M)
+	default y
+	help
+	  Support for reset controller on i.MX7/8 SoCs.
+
 endmenu
drivers/reset/Makefile +1 -0
index 7fec75bb49..f5875fce09 100644
@@ -20,3 +20,4 @@ obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_RESET_MEDIATEK) += reset-mediatek.o
 obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
 obj-$(CONFIG_RESET_HISILICON) += reset-hisilicon.o
+obj-$(CONFIG_RESET_IMX7) += reset-imx7.o
drivers/reset/reset-imx7.c new file +312 -0

312 lines not on this page · raw message

include/dt-bindings/reset/imx7-reset.h new file +52 -0

52 lines not on this page · raw message

include/dt-bindings/reset/imx8mq-reset.h new file +64 -0

64 lines not on this page · raw message

reviewer
#2 lore raw

PATCH 1/1 imx: add support for i.MX7/i.MX8MQ reset controller

Hi Patrick,

Quoted 5 lines · Patrick Wildt

Add support for the reset controller that's used on the i.MX7D and i.MX8MQ. This will be needed to be able to assert the PCIe reset pins. Bindings taken from Linux, driver implementation mostly taken from Linux and adjusted to U-Boot infrastructure.

This looks good to me, thanks.

Only suggestion I have is to split this work in three patches:

- One that introduces the reset controller driver
- One for the dts part
- Another one for the defconfig

#3 lore raw

PATCH 1/3 imx: add support for i.MX7/i.MX8MQ reset controller

Add support for the reset controller that's used on the i.MX7D and i.MX8MQ. This will be needed to be able to assert the PCIe reset pins. Bindings taken from Linux, driver implementation mostly taken from Linux and adjusted to U-Boot infrastructure.

---
 drivers/reset/Kconfig                    |   7 +
 drivers/reset/Makefile                   |   1 +
 drivers/reset/reset-imx7.c               | 312 +++++++++++++++++++++++
 include/dt-bindings/reset/imx7-reset.h   |  52 ++++
 include/dt-bindings/reset/imx8mq-reset.h |  64 +++++
 5 files changed, 436 insertions(+)
 create mode 100644 drivers/reset/reset-imx7.c
 create mode 100644 include/dt-bindings/reset/imx7-reset.h
 create mode 100755 include/dt-bindings/reset/imx8mq-reset.h
drivers/reset/Kconfig +7 -0
index 6ec6f39c85..976f3a701c 100644
@@ -127,4 +127,11 @@ config RESET_HISILICON
 	help
 	  Support for reset controller on HiSilicon SoCs.
 
+config RESET_IMX7
+	bool "i.MX7/8 Reset Driver"
+	depends on DM_RESET && (ARCH_MX7 || ARCH_IMX8M)
+	default y
+	help
+	  Support for reset controller on i.MX7/8 SoCs.
+
 endmenu
drivers/reset/Makefile +1 -0
index 7fec75bb49..f5875fce09 100644
@@ -20,3 +20,4 @@ obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_RESET_MEDIATEK) += reset-mediatek.o
 obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
 obj-$(CONFIG_RESET_HISILICON) += reset-hisilicon.o
+obj-$(CONFIG_RESET_IMX7) += reset-imx7.o
drivers/reset/reset-imx7.c new file +312 -0

312 lines not on this page · raw message

include/dt-bindings/reset/imx7-reset.h new file +52 -0

52 lines not on this page · raw message

include/dt-bindings/reset/imx8mq-reset.h new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
2.23.0
reviewer
#4 lore raw

PATCH 1/3 imx: add support for i.MX7/i.MX8MQ reset controller

Hi Patrick,

Quoted 8 lines · Patrick Wildt

Add support for the reset controller that's used on the i.MX7D and i.MX8MQ. This will be needed to be able to assert the PCIe reset pins. Bindings taken from Linux, driver implementation mostly taken from Linux and adjusted to U-Boot infrastructure.

---

Just a suggestion for future submissions: when submitting a new version, always describe what has changed.

#5 lore raw

PATCH 2/3 imx: add the i.MX8M reset controller node

In reply to Fabio Estevam

This patch adds the reset controller node to the i.MX8MQ SoC device tree.

---
 arch/arm/dts/fsl-imx8mq.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/fsl-imx8mq.dtsi +7 -0
index c35c23e293..d843b401be 100644
@@ -19,6 +19,7 @@
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/pinctrl/pins-imx8mq.h>
+#include <dt-bindings/reset/imx8mq-reset.h>
 #include <dt-bindings/thermal/thermal.h>
 
 / {
@@ -269,6 +270,12 @@
 		#clock-cells = <1>;
 	};
 
+	src: reset-controller at 30390000 {
+		compatible = "fsl,imx8mq-src", "syscon";
+		reg = <0x0 0x30390000 0x0 0x10000>;
+		#reset-cells = <1>;
+	};
+
 	gpc: gpc at 303a0000 {
 		compatible = "fsl,imx8mq-gpc", "fsl,imx7d-gpc", "syscon";
 		reg = <0x0 0x303a0000 0x0 0x10000>;
Signature · 1 line
2.23.0
reviewer
#6 lore raw

PATCH 2/3 imx: add the i.MX8M reset controller node

Hi Patrick,

Quoted 22 lines · Patrick Wildt

This patch adds the reset controller node to the i.MX8MQ SoC device tree.

---
 arch/arm/dts/fsl-imx8mq.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/fsl-imx8mq.dtsi +1 -0
index c35c23e293..d843b401be 100644
@@ -19,6 +19,7 @@
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/pinctrl/pins-imx8mq.h>
+#include <dt-bindings/reset/imx8mq-reset.h>
 #include <dt-bindings/thermal/thermal.h>
 
 / {

arch/arm/dts/fsl-imx8mq.dtsi line 276

Quoted 7 lines
arch/arm/dts/fsl-imx8mq.dtsi +4 -0
@@ -269,6 +270,12 @@
                #clock-cells = <1>;
        };
 
+       src: reset-controller at 30390000 {
+               compatible = "fsl,imx8mq-src", "syscon";
+               reg = <0x0 0x30390000 0x0 0x10000>;
+               #reset-cells = <1>;

This reset-controller node is already part of the upstream kernel imx8mq.dtsi.

What about syncing the U-Boot version with the one from kernel 5.3.2? Also, please note the dtsi name change.

Thanks

Quoted 8 lines
arch/arm/dts/fsl-imx8mq.dtsi +2 -1
+       };
+
        gpc: gpc at 303a0000 {
                compatible = "fsl,imx8mq-gpc", "fsl,imx7d-gpc", "syscon";
                reg = <0x0 0x303a0000 0x0 0x10000>;
--

2.23.0

#7 lore raw

PATCH 2/3 imx: add the i.MX8M reset controller node

Quoted 35 lines · Fabio Estevam

Hi Patrick,

Quoted 22 lines · Patrick Wildt

This patch adds the reset controller node to the i.MX8MQ SoC device tree.

---
 arch/arm/dts/fsl-imx8mq.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/fsl-imx8mq.dtsi +1 -0
index c35c23e293..d843b401be 100644
@@ -19,6 +19,7 @@
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/pinctrl/pins-imx8mq.h>
+#include <dt-bindings/reset/imx8mq-reset.h>
 #include <dt-bindings/thermal/thermal.h>
 
 / {

arch/arm/dts/fsl-imx8mq.dtsi line 276

Quoted 7 lines
arch/arm/dts/fsl-imx8mq.dtsi +4 -0
@@ -269,6 +270,12 @@
                #clock-cells = <1>;
        };
 
+       src: reset-controller at 30390000 {
+               compatible = "fsl,imx8mq-src", "syscon";
+               reg = <0x0 0x30390000 0x0 0x10000>;
+               #reset-cells = <1>;

This reset-controller node is already part of the upstream kernel imx8mq.dtsi.

Quoted 4 lines

What about syncing the U-Boot version with the one from kernel 5.3.2? Also, please note the dtsi name change.

Thanks

Hi Fabio,

yes, that's true. It does make sense to sync the device trees and do the name change. Can the diff with the reset controller driver (patch 1/3) be merged anyway, and I'll follow up with the DTS change? Would be easier for me to handle the number of patches to submit.

Thank you for the review!

Best regards,
Patrick

Quoted 9 lines
Quoted 9 lines
arch/arm/dts/fsl-imx8mq.dtsi +2 -1
+       };
+
        gpc: gpc at 303a0000 {
                compatible = "fsl,imx8mq-gpc", "fsl,imx7d-gpc", "syscon";
                reg = <0x0 0x303a0000 0x0 0x10000>;
--

2.23.0

reviewer
#8 lore raw

PATCH 2/3 imx: add the i.MX8M reset controller node

Hi Patrick,

Quoted 4 lines · Patrick Wildt

yes, that's true. It does make sense to sync the device trees and do the name change. Can the diff with the reset controller driver (patch 1/3) be merged anyway, and I'll follow up with the DTS change? Would be easier for me to handle the number of patches to submit.

I think so.

Stefano is the one who will apply your patch if he is happy with it.

Regards,

Fabio Estevam

#9 lore raw

PATCH 2/3 imx: add the i.MX8M reset controller node

Hi Fabio, Patrick,

Quoted 4 lines · Fabio Estevam

Hi Patrick,

On Fri, Oct 4, 2019 at 12:50 PM Patrick Wildt <[email protected]> wrote:

Quoted 9 lines
Quoted 4 lines

yes, that's true. It does make sense to sync the device trees and do the name change. Can the diff with the reset controller driver (patch 1/3) be merged anyway, and I'll follow up with the DTS change? Would be easier for me to handle the number of patches to submit.

I think so.

Stefano is the one who will apply your patch if he is happy with it.

I agree with you, too. I merge patches into -next.

Regards,
Stefano Babic

Quoted 4 lines

Regards,

Fabio Estevam

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#10 lore raw

PATCH 3/3 imx: enable the reset controller on the i.MX8MQ EVK

In reply to Fabio Estevam

This patch makes sure that the reset controller driver is compiled for the i.MX8MQ EVK.

---
 configs/imx8mq_evk_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/imx8mq_evk_defconfig +1 -0
index e45731edda..c0e5860e85 100644
@@ -38,4 +38,5 @@ CONFIG_PINCTRL_IMX8M=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_RESET=y
 CONFIG_DM_THERMAL=y
Signature · 1 line
2.23.0