public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] imx8mp: Add media block control
@ 2022-03-22 19:03 Laurent Pinchart
  2022-03-22 19:03 ` [PATCH v2 1/4] dt-bindings: soc: Add i.MX8MP media block control DT bindings Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2022-03-22 19:03 UTC (permalink / raw)
  To: linux-arm-kernel, Shawn Guo, Sascha Hauer
  Cc: Pengutronix Kernel Team, NXP Linux Team, Fabio Estevam,
	Paul Elder, Lucas Stach, Marek Vasut, devicetree, Rob Herring

Hello,

This patch series adds support for the MEDIA_BLK_CTRL of the i.MX8MP to
the imx8m-blk-ctrl driver, and integrates it in the i.MX8MP device tree.

The patches depend on v2 of the series "soc: imx: gpcv2: add PGC
control register indirection" from Lucas Stach [1]. For testing
convenience, a branch that includes the dependency, based on v5.17, is
available at [2].

The series starts with DT bindings (1/4) and driver support (2/4),
followed by addition of the MEDIAMIX power domains to the GPC DT node
(3/4) and finally the new DT node for the MEDIA_BLK_CTRL.

Changes since v1 are listed in changelogs in the individual patches.

The patches have been tested with with ISI on the i.MX8MP. The ISI
driver is still under development [3], and will be posted in the not too
distant future.

[1] https://lore.kernel.org/all/20220207192547.1997549-1-l.stach@pengutronix.de/
[2] https://git.linuxtv.org/pinchartl/media.git/log/?h=nxp/next/powerdomains
[3] https://gitlab.com/ideasonboard/nxp/linux/-/tree/pinchartl/v5.17/isi

Laurent Pinchart (1):
  arm64: dts: imx8mp: Add MEDIAMIX power domains

Paul Elder (3):
  dt-bindings: soc: Add i.MX8MP media block control DT bindings
  soc: imx: imx8m-blk-ctrl: Add i.MX8MP media blk-ctrl
  arm64: dts: imx8mp: Add MEDIA_BLK_CTRL

 .../soc/imx/fsl,imx8mp-media-blk-ctrl.yaml    | 106 ++++++++++++++
 arch/arm64/boot/dts/freescale/imx8mp.dtsi     |  59 ++++++++
 drivers/soc/imx/imx8m-blk-ctrl.c              | 131 +++++++++++++++++-
 include/dt-bindings/power/imx8mp-power.h      |  11 ++
 4 files changed, 305 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml


base-commit: 256819fa3c09600675e31e9cb64a1a24574f02b2
-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/4] dt-bindings: soc: Add i.MX8MP media block control DT bindings
  2022-03-22 19:03 [PATCH v2 0/4] imx8mp: Add media block control Laurent Pinchart
@ 2022-03-22 19:03 ` Laurent Pinchart
  2022-03-22 21:29   ` Marek Vasut
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2022-03-22 19:03 UTC (permalink / raw)
  To: linux-arm-kernel, Shawn Guo, Sascha Hauer
  Cc: Pengutronix Kernel Team, NXP Linux Team, Fabio Estevam,
	Paul Elder, Lucas Stach, Marek Vasut, devicetree, Rob Herring

From: Paul Elder <paul.elder@ideasonboard.com>

The i.MX8MP Media Block Control (MEDIA BLK_CTRL) is a top-level
peripheral providing access to the NoC and ensuring proper power
sequencing of the peripherals within the MEDIAMIX domain. Add DT
bindings for it.

There is already a driver for block controls of other SoCs in the i.MX8M
family, so these bindings will expand upon that.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
Changes since v1:

- Lower reg size to 0x138
- Add ISP2 power domain and rename ISP to ISP1
---
 .../soc/imx/fsl,imx8mp-media-blk-ctrl.yaml    | 106 ++++++++++++++++++
 include/dt-bindings/power/imx8mp-power.h      |  11 ++
 2 files changed, 117 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml

diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml
new file mode 100644
index 000000000000..b6808981de2f
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml
@@ -0,0 +1,106 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8MP Media Block Control
+
+maintainers:
+  - Paul Elder <paul.elder@ideasonboard.com>
+
+description:
+  The i.MX8MP Media Block Control (MEDIA BLK_CTRL) is a top-level peripheral
+  providing access to the NoC and ensuring proper power sequencing of the
+  peripherals within the MEDIAMIX domain.
+
+properties:
+  compatible:
+    items:
+      - const: fsl,imx8mp-media-blk-ctrl
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  '#power-domain-cells':
+    const: 1
+
+  power-domains:
+    maxItems: 11
+
+  power-domain-names:
+    items:
+      - const: bus
+      - const: mipi-dsi1
+      - const: mipi-csi1
+      - const: lcdif1
+      - const: isi
+      - const: mipi-csi2
+      - const: lcdif2
+      - const: isp2
+      - const: isp1
+      - const: dwe
+      - const: mipi-dsi2
+
+  clocks:
+    items:
+      - description: The APB clock
+      - description: The AXI clock
+      - description: The pixel clock for the first CSI2 receiver (aclk)
+      - description: The pixel clock for the second CSI2 receiver (aclk)
+      - description: The pixel clock for the first LCDIF (pix_clk)
+      - description: The pixel clock for the second LCDIF (pix_clk)
+      - description: The core clock for the ISP (clk)
+      - description: The MIPI-PHY reference clock used by DSI
+
+  clock-names:
+    items:
+      - const: apb
+      - const: axi
+      - const: cam1
+      - const: cam2
+      - const: disp1
+      - const: disp2
+      - const: isp
+      - const: phy
+
+required:
+  - compatible
+  - reg
+  - '#power-domain-cells'
+  - power-domains
+  - power-domain-names
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mp-clock.h>
+    #include <dt-bindings/power/imx8mp-power.h>
+
+    media_blk_ctl: blk-ctl@32ec0000 {
+        compatible = "fsl,imx8mp-media-blk-ctrl", "syscon";
+        reg = <0x32ec0000 0x138>;
+        power-domains = <&mediamix_pd>, <&mipi_phy1_pd>, <&mipi_phy1_pd>,
+                        <&mediamix_pd>, <&mediamix_pd>, <&mipi_phy2_pd>,
+                        <&mediamix_pd>, <&ispdwp_pd>, <&ispdwp_pd>,
+                        <&ispdwp_pd>, <&mipi_phy2_pd>;
+        power-domain-names = "bus", "mipi-dsi1", "mipi-csi1", "lcdif1", "isi",
+                             "mipi-csi2", "lcdif2", "isp2", "isp1", "dwe",
+                             "mipi-dsi2";
+        clocks = <&clk IMX8MP_CLK_MEDIA_APB_ROOT>,
+                 <&clk IMX8MP_CLK_MEDIA_AXI_ROOT>,
+                 <&clk IMX8MP_CLK_MEDIA_CAM1_PIX_ROOT>,
+                 <&clk IMX8MP_CLK_MEDIA_CAM2_PIX_ROOT>,
+                 <&clk IMX8MP_CLK_MEDIA_DISP1_PIX_ROOT>,
+                 <&clk IMX8MP_CLK_MEDIA_DISP2_PIX_ROOT>,
+                 <&clk IMX8MP_CLK_MEDIA_ISP_ROOT>,
+                 <&clk IMX8MP_CLK_MEDIA_MIPI_PHY1_REF_ROOT>;
+        clock-names = "apb", "axi", "cam1", "cam2", "disp1", "disp2",
+                      "isp", "phy";
+        #power-domain-cells = <1>;
+    };
+...
diff --git a/include/dt-bindings/power/imx8mp-power.h b/include/dt-bindings/power/imx8mp-power.h
index 9f90c40a2c6c..3f72bf7818fd 100644
--- a/include/dt-bindings/power/imx8mp-power.h
+++ b/include/dt-bindings/power/imx8mp-power.h
@@ -32,4 +32,15 @@
 #define IMX8MP_HSIOBLK_PD_PCIE				3
 #define IMX8MP_HSIOBLK_PD_PCIE_PHY			4
 
+#define IMX8MP_MEDIABLK_PD_MIPI_DSI_1			0
+#define IMX8MP_MEDIABLK_PD_MIPI_CSI2_1			1
+#define IMX8MP_MEDIABLK_PD_LCDIF_1			2
+#define IMX8MP_MEDIABLK_PD_ISI				3
+#define IMX8MP_MEDIABLK_PD_MIPI_CSI2_2			4
+#define IMX8MP_MEDIABLK_PD_LCDIF_2			5
+#define IMX8MP_MEDIABLK_PD_ISP2				6
+#define IMX8MP_MEDIABLK_PD_ISP1				7
+#define IMX8MP_MEDIABLK_PD_DWE				8
+#define IMX8MP_MEDIABLK_PD_MIPI_DSI_2			9
+
 #endif
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/4] dt-bindings: soc: Add i.MX8MP media block control DT bindings
  2022-03-22 19:03 ` [PATCH v2 1/4] dt-bindings: soc: Add i.MX8MP media block control DT bindings Laurent Pinchart
@ 2022-03-22 21:29   ` Marek Vasut
  2022-03-22 21:57     ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2022-03-22 21:29 UTC (permalink / raw)
  To: Laurent Pinchart, linux-arm-kernel, Shawn Guo, Sascha Hauer
  Cc: Pengutronix Kernel Team, NXP Linux Team, Fabio Estevam,
	Paul Elder, Lucas Stach, devicetree, Rob Herring

On 3/22/22 20:03, Laurent Pinchart wrote:
> From: Paul Elder <paul.elder@ideasonboard.com>
> 
> The i.MX8MP Media Block Control (MEDIA BLK_CTRL) is a top-level
> peripheral providing access to the NoC and ensuring proper power
> sequencing of the peripherals within the MEDIAMIX domain. Add DT
> bindings for it.
> 
> There is already a driver for block controls of other SoCs in the i.MX8M
> family, so these bindings will expand upon that.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Marek Vasut <marex@denx.de>

[...]

> +        power-domain-names = "bus", "mipi-dsi1", "mipi-csi1", "lcdif1", "isi",
> +                             "mipi-csi2", "lcdif2", "isp2", "isp1", "dwe",
> +                             "mipi-dsi2";

Nit, I cannot say I'm a big fan of calling the power domain "mipi-csi1" 
and "mipi-csi2", they are both MIPI CSI2, except there are two of them 
CSI2 (#1 and #2).

Maybe mipi-csi2-1 and mipi-csi2-2 would be better ? DTTO for the LCDIF, 
where we have lcdifv3 and then mx8mp lcdifv3 and eventually we will have 
power domain for lcdif #3 instance in this SoC in hdmimix, so maybe some 
lcdif-1/lcdif-2 would be a better name ?

[...]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/4] dt-bindings: soc: Add i.MX8MP media block control DT bindings
  2022-03-22 21:29   ` Marek Vasut
@ 2022-03-22 21:57     ` Laurent Pinchart
  2022-03-22 22:01       ` Marek Vasut
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2022-03-22 21:57 UTC (permalink / raw)
  To: Marek Vasut
  Cc: linux-arm-kernel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, NXP Linux Team, Fabio Estevam,
	Paul Elder, Lucas Stach, devicetree, Rob Herring

Hi Marek,

On Tue, Mar 22, 2022 at 10:29:56PM +0100, Marek Vasut wrote:
> On 3/22/22 20:03, Laurent Pinchart wrote:
> > From: Paul Elder <paul.elder@ideasonboard.com>
> > 
> > The i.MX8MP Media Block Control (MEDIA BLK_CTRL) is a top-level
> > peripheral providing access to the NoC and ensuring proper power
> > sequencing of the peripherals within the MEDIAMIX domain. Add DT
> > bindings for it.
> > 
> > There is already a driver for block controls of other SoCs in the i.MX8M
> > family, so these bindings will expand upon that.
> > 
> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Reviewed-by: Marek Vasut <marex@denx.de>
> 
> [...]
> 
> > +        power-domain-names = "bus", "mipi-dsi1", "mipi-csi1", "lcdif1", "isi",
> > +                             "mipi-csi2", "lcdif2", "isp2", "isp1", "dwe",
> > +                             "mipi-dsi2";
> 
> Nit, I cannot say I'm a big fan of calling the power domain "mipi-csi1" 
> and "mipi-csi2", they are both MIPI CSI2, except there are two of them 
> CSI2 (#1 and #2).
> 
> Maybe mipi-csi2-1 and mipi-csi2-2 would be better ? DTTO for the LCDIF, 
> where we have lcdifv3 and then mx8mp lcdifv3 and eventually we will have 
> power domain for lcdif #3 instance in this SoC in hdmimix, so maybe some 
> lcdif-1/lcdif-2 would be a better name ?

The names come from the reference manual, at least the ones for the
second instance. We have, for instance, SFT_EN_MIPI_CSI_PCLK_RESETN and
SFT_EN_MIPI_CSI2_PCLK_RESETN. Same for DSI and LCDIF, there's DSI and
DSI2, and LCDIF and LCDIF2. The "1" suffix has been added for clarity.

This is a bit bikeshedding territory as I expect the DT node for the
media-blk-ctrl to be written once and never be touched again, so if
anyone feels strongly about using better names (whatever those better
names would be), I don't mind much.

I can submit a v3 once a consensus emerges.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/4] dt-bindings: soc: Add i.MX8MP media block control DT bindings
  2022-03-22 21:57     ` Laurent Pinchart
@ 2022-03-22 22:01       ` Marek Vasut
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2022-03-22 22:01 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-arm-kernel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, NXP Linux Team, Fabio Estevam,
	Paul Elder, Lucas Stach, devicetree, Rob Herring

On 3/22/22 22:57, Laurent Pinchart wrote:
> Hi Marek,
> 
> On Tue, Mar 22, 2022 at 10:29:56PM +0100, Marek Vasut wrote:
>> On 3/22/22 20:03, Laurent Pinchart wrote:
>>> From: Paul Elder <paul.elder@ideasonboard.com>
>>>
>>> The i.MX8MP Media Block Control (MEDIA BLK_CTRL) is a top-level
>>> peripheral providing access to the NoC and ensuring proper power
>>> sequencing of the peripherals within the MEDIAMIX domain. Add DT
>>> bindings for it.
>>>
>>> There is already a driver for block controls of other SoCs in the i.MX8M
>>> family, so these bindings will expand upon that.
>>>
>>> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
>>> Reviewed-by: Rob Herring <robh@kernel.org>
>>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>
>> Reviewed-by: Marek Vasut <marex@denx.de>
>>
>> [...]
>>
>>> +        power-domain-names = "bus", "mipi-dsi1", "mipi-csi1", "lcdif1", "isi",
>>> +                             "mipi-csi2", "lcdif2", "isp2", "isp1", "dwe",
>>> +                             "mipi-dsi2";
>>
>> Nit, I cannot say I'm a big fan of calling the power domain "mipi-csi1"
>> and "mipi-csi2", they are both MIPI CSI2, except there are two of them
>> CSI2 (#1 and #2).
>>
>> Maybe mipi-csi2-1 and mipi-csi2-2 would be better ? DTTO for the LCDIF,
>> where we have lcdifv3 and then mx8mp lcdifv3 and eventually we will have
>> power domain for lcdif #3 instance in this SoC in hdmimix, so maybe some
>> lcdif-1/lcdif-2 would be a better name ?
> 
> The names come from the reference manual, at least the ones for the
> second instance. We have, for instance, SFT_EN_MIPI_CSI_PCLK_RESETN and
> SFT_EN_MIPI_CSI2_PCLK_RESETN. Same for DSI and LCDIF, there's DSI and
> DSI2, and LCDIF and LCDIF2. The "1" suffix has been added for clarity.
> 
> This is a bit bikeshedding territory as I expect the DT node for the
> media-blk-ctrl to be written once and never be touched again, so if
> anyone feels strongly about using better names (whatever those better
> names would be), I don't mind much.
> 
> I can submit a v3 once a consensus emerges.

I don't feel strongly about it, I just wanted to point it out.
Let's wait for the others' opinions.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-22 22:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-22 19:03 [PATCH v2 0/4] imx8mp: Add media block control Laurent Pinchart
2022-03-22 19:03 ` [PATCH v2 1/4] dt-bindings: soc: Add i.MX8MP media block control DT bindings Laurent Pinchart
2022-03-22 21:29   ` Marek Vasut
2022-03-22 21:57     ` Laurent Pinchart
2022-03-22 22:01       ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox