All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/16] media: imx-pxp: add support for i.MX7D
@ 2023-01-13  9:54 ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

This is v2 of the series to add support for the PXP found on the i.MX7D to the
imx-pxp driver.

The PXP on the i.MX7D has a few differences compared to the one on the
i.MX6ULL. Especially, it has more processing blocks and slightly different
multiplexers to route the data between the blocks. Therefore, the driver must
configure a different data path depending on the platform.

While the PXP has a version register, the reported version is the same on the
i.MX6ULL and the i.MX7D. Therefore, we cannot use the version register to
change the driver behavior, but have to use the device tree compatible. The
driver still prints the found version to the log to help bringing up the PXP
on further platforms.

The patches are inspired by some earlier patches [0] by Laurent to add PXP
support to the i.MX7d. Compared to the earlier patches, these patches add
different behavior depending on the platform. Furthermore, the patches disable
only the LUT block, but keep the rotator block enabled, as it may now be
configured via the V4L2 rotate control.

In v2, I included Laurent's patch series [1], which was based on this series
anyway and added regmap support.

Patch 1 converts the dt-binding to yaml.

Patches 2 to 5 cleanup and refactor the driver in preparation of handling
different PXP versions.

Patches 6 and 7 add the handling of different platforms and the i.MX7d
specific configuration.

Patch 8 adds the device tree node for the PXP to the i.MX7d device tree.

Patches 9 to 15 are the cleanup and enhancement patches to add media
controller support, implement enum_framesizes, and add pxp_read/pxp_write
helpers.

Patch 16 adds regmap support to the driver.

Michael

[0] https://lore.kernel.org/linux-media/20200510223100.11641-1-laurent.pinchart@ideasonboard.com/
[1] https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com

---

Changelog

v2:

- fix device tree binding
- reduce log level of PXP version to debug
- drop fallback for missing pdata
- add cleanup and enhancement patches to series
- convert driver to regmap

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
To: linux-media@vger.kernel.org
To: devicetree@vger.kernel.org
To: Philipp Zabel <p.zabel@pengutronix.de>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: kernel@pengutronix.de
Cc: linux-imx@nxp.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: Michael Tretter <m.tretter@pengutronix.de>

---
Laurent Pinchart (7):
      media: imx-pxp: Sort headers alphabetically
      media: imx-pxp: Don't set bus_info manually in .querycap()
      media: imx-pxp: Add media controller support
      media: imx-pxp: Pass pixel format value to find_format()
      media: imx-pxp: Implement frame size enumeration
      media: imx-pxp: Introduce pxp_read() and pxp_write() wrappers
      media: imx-pxp: Use non-threaded IRQ

Michael Tretter (9):
      dt-bindings: media: fsl-pxp: convert to yaml
      media: imx-pxp: detect PXP version
      media: imx-pxp: extract helper function to setup data path
      media: imx-pxp: explicitly disable unused blocks
      media: imx-pxp: disable LUT block
      media: imx-pxp: make data_path_ctrl0 platform dependent
      media: imx-pxp: add support for i.MX7D
      ARM: dts: imx7d: add node for PXP
      media: imx-pxp: convert to regmap

 .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml |  82 +++++
 .../devicetree/bindings/media/fsl-pxp.txt          |  26 --
 arch/arm/boot/dts/imx7d.dtsi                       |   9 +
 drivers/media/platform/nxp/imx-pxp.c               | 359 +++++++++++++++------
 4 files changed, 355 insertions(+), 121 deletions(-)
---
base-commit: b7bfaa761d760e72a969d116517eaa12e404c262
change-id: 20230112-imx-pxp-073008b3c857

Best regards,
-- 
Michael Tretter <m.tretter@pengutronix.de>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

Convert the bindings of the Freescale Pixel Pipeline to YAML.

The conversion drops the previously listed compatibles for several SoCs.
It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
on the existing SoCs and would allow to reuse the already defined
compatibles. The missing compatibles should be brought back when the
support for the PXP on these SoCs is added.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog:

v2:

- add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
- restrict number of interrupts per variant
- cleanup syntax
---
 .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml | 82 ++++++++++++++++++++++
 .../devicetree/bindings/media/fsl-pxp.txt          | 26 -------
 2 files changed, 82 insertions(+), 26 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
new file mode 100644
index 000000000000..c1232689a261
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/fsl,imx6ull-pxp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale Pixel Pipeline
+
+maintainers:
+  - Philipp Zabel <p.zabel@pengutronix.de>
+  - Michael Tretter <m.tretter@pengutronix.de>
+
+description:
+  The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
+  that supports scaling, colorspace conversion, alpha blending, rotation, and
+  pixel conversion via lookup table. Different versions are present on various
+  i.MX SoCs from i.MX23 to i.MX7.
+
+properties:
+  compatible:
+    oneOf:
+      - const: fsl,imx6ul-pxp
+      - const: fsl,imx6ull-pxp
+      - const: fsl,imx7d-pxp
+      - items:
+          - enum:
+              - fsl,imx6sll-pxp
+              - fsl,imx6sx-pxp
+          - const: fsl,imx6ull-pxp
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: axi
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - fsl,imx6sx-pxp
+    then:
+      properties:
+        interrupts:
+          numItems: 1
+    else:
+      properties:
+        interrupts:
+          numItems: 2
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx6ul-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    pxp: pxp@21cc000 {
+        compatible = "fsl,imx6ull-pxp";
+        reg = <0x021cc000 0x4000>;
+        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
+        clock-names = "axi";
+        clocks = <&clks IMX6UL_CLK_PXP>;
+    };
diff --git a/Documentation/devicetree/bindings/media/fsl-pxp.txt b/Documentation/devicetree/bindings/media/fsl-pxp.txt
deleted file mode 100644
index f8090e06530d..000000000000
--- a/Documentation/devicetree/bindings/media/fsl-pxp.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Freescale Pixel Pipeline
-========================
-
-The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
-that supports scaling, colorspace conversion, alpha blending, rotation, and
-pixel conversion via lookup table. Different versions are present on various
-i.MX SoCs from i.MX23 to i.MX7.
-
-Required properties:
-- compatible: should be "fsl,<soc>-pxp", where SoC can be one of imx23, imx28,
-  imx6dl, imx6sl, imx6sll, imx6ul, imx6sx, imx6ull, or imx7d.
-- reg: the register base and size for the device registers
-- interrupts: the PXP interrupt, two interrupts for imx6ull and imx7d.
-- clock-names: should be "axi"
-- clocks: the PXP AXI clock
-
-Example:
-
-pxp@21cc000 {
-	compatible = "fsl,imx6ull-pxp";
-	reg = <0x021cc000 0x4000>;
-	interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
-		     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
-	clock-names = "axi";
-	clocks = <&clks IMX6UL_CLK_PXP>;
-};

-- 
2.30.2

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

* [PATCH v2 00/16] media: imx-pxp: add support for i.MX7D
@ 2023-01-13  9:54 ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

This is v2 of the series to add support for the PXP found on the i.MX7D to the
imx-pxp driver.

The PXP on the i.MX7D has a few differences compared to the one on the
i.MX6ULL. Especially, it has more processing blocks and slightly different
multiplexers to route the data between the blocks. Therefore, the driver must
configure a different data path depending on the platform.

While the PXP has a version register, the reported version is the same on the
i.MX6ULL and the i.MX7D. Therefore, we cannot use the version register to
change the driver behavior, but have to use the device tree compatible. The
driver still prints the found version to the log to help bringing up the PXP
on further platforms.

The patches are inspired by some earlier patches [0] by Laurent to add PXP
support to the i.MX7d. Compared to the earlier patches, these patches add
different behavior depending on the platform. Furthermore, the patches disable
only the LUT block, but keep the rotator block enabled, as it may now be
configured via the V4L2 rotate control.

In v2, I included Laurent's patch series [1], which was based on this series
anyway and added regmap support.

Patch 1 converts the dt-binding to yaml.

Patches 2 to 5 cleanup and refactor the driver in preparation of handling
different PXP versions.

Patches 6 and 7 add the handling of different platforms and the i.MX7d
specific configuration.

Patch 8 adds the device tree node for the PXP to the i.MX7d device tree.

Patches 9 to 15 are the cleanup and enhancement patches to add media
controller support, implement enum_framesizes, and add pxp_read/pxp_write
helpers.

Patch 16 adds regmap support to the driver.

Michael

[0] https://lore.kernel.org/linux-media/20200510223100.11641-1-laurent.pinchart@ideasonboard.com/
[1] https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com

---

Changelog

v2:

- fix device tree binding
- reduce log level of PXP version to debug
- drop fallback for missing pdata
- add cleanup and enhancement patches to series
- convert driver to regmap

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
To: linux-media@vger.kernel.org
To: devicetree@vger.kernel.org
To: Philipp Zabel <p.zabel@pengutronix.de>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: kernel@pengutronix.de
Cc: linux-imx@nxp.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: Michael Tretter <m.tretter@pengutronix.de>

---
Laurent Pinchart (7):
      media: imx-pxp: Sort headers alphabetically
      media: imx-pxp: Don't set bus_info manually in .querycap()
      media: imx-pxp: Add media controller support
      media: imx-pxp: Pass pixel format value to find_format()
      media: imx-pxp: Implement frame size enumeration
      media: imx-pxp: Introduce pxp_read() and pxp_write() wrappers
      media: imx-pxp: Use non-threaded IRQ

Michael Tretter (9):
      dt-bindings: media: fsl-pxp: convert to yaml
      media: imx-pxp: detect PXP version
      media: imx-pxp: extract helper function to setup data path
      media: imx-pxp: explicitly disable unused blocks
      media: imx-pxp: disable LUT block
      media: imx-pxp: make data_path_ctrl0 platform dependent
      media: imx-pxp: add support for i.MX7D
      ARM: dts: imx7d: add node for PXP
      media: imx-pxp: convert to regmap

 .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml |  82 +++++
 .../devicetree/bindings/media/fsl-pxp.txt          |  26 --
 arch/arm/boot/dts/imx7d.dtsi                       |   9 +
 drivers/media/platform/nxp/imx-pxp.c               | 359 +++++++++++++++------
 4 files changed, 355 insertions(+), 121 deletions(-)
---
base-commit: b7bfaa761d760e72a969d116517eaa12e404c262
change-id: 20230112-imx-pxp-073008b3c857

Best regards,
-- 
Michael Tretter <m.tretter@pengutronix.de>

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

* [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

Convert the bindings of the Freescale Pixel Pipeline to YAML.

The conversion drops the previously listed compatibles for several SoCs.
It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
on the existing SoCs and would allow to reuse the already defined
compatibles. The missing compatibles should be brought back when the
support for the PXP on these SoCs is added.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog:

v2:

- add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
- restrict number of interrupts per variant
- cleanup syntax
---
 .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml | 82 ++++++++++++++++++++++
 .../devicetree/bindings/media/fsl-pxp.txt          | 26 -------
 2 files changed, 82 insertions(+), 26 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
new file mode 100644
index 000000000000..c1232689a261
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/fsl,imx6ull-pxp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale Pixel Pipeline
+
+maintainers:
+  - Philipp Zabel <p.zabel@pengutronix.de>
+  - Michael Tretter <m.tretter@pengutronix.de>
+
+description:
+  The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
+  that supports scaling, colorspace conversion, alpha blending, rotation, and
+  pixel conversion via lookup table. Different versions are present on various
+  i.MX SoCs from i.MX23 to i.MX7.
+
+properties:
+  compatible:
+    oneOf:
+      - const: fsl,imx6ul-pxp
+      - const: fsl,imx6ull-pxp
+      - const: fsl,imx7d-pxp
+      - items:
+          - enum:
+              - fsl,imx6sll-pxp
+              - fsl,imx6sx-pxp
+          - const: fsl,imx6ull-pxp
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: axi
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - fsl,imx6sx-pxp
+    then:
+      properties:
+        interrupts:
+          numItems: 1
+    else:
+      properties:
+        interrupts:
+          numItems: 2
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx6ul-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    pxp: pxp@21cc000 {
+        compatible = "fsl,imx6ull-pxp";
+        reg = <0x021cc000 0x4000>;
+        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
+        clock-names = "axi";
+        clocks = <&clks IMX6UL_CLK_PXP>;
+    };
diff --git a/Documentation/devicetree/bindings/media/fsl-pxp.txt b/Documentation/devicetree/bindings/media/fsl-pxp.txt
deleted file mode 100644
index f8090e06530d..000000000000
--- a/Documentation/devicetree/bindings/media/fsl-pxp.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Freescale Pixel Pipeline
-========================
-
-The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
-that supports scaling, colorspace conversion, alpha blending, rotation, and
-pixel conversion via lookup table. Different versions are present on various
-i.MX SoCs from i.MX23 to i.MX7.
-
-Required properties:
-- compatible: should be "fsl,<soc>-pxp", where SoC can be one of imx23, imx28,
-  imx6dl, imx6sl, imx6sll, imx6ul, imx6sx, imx6ull, or imx7d.
-- reg: the register base and size for the device registers
-- interrupts: the PXP interrupt, two interrupts for imx6ull and imx7d.
-- clock-names: should be "axi"
-- clocks: the PXP AXI clock
-
-Example:
-
-pxp@21cc000 {
-	compatible = "fsl,imx6ull-pxp";
-	reg = <0x021cc000 0x4000>;
-	interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
-		     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
-	clock-names = "axi";
-	clocks = <&clks IMX6UL_CLK_PXP>;
-};

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 02/16] media: imx-pxp: detect PXP version
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

Different versions of the Pixel Pipeline have different blocks and their
routing may be different. Read the PXP_HW_VERSION register to determine
the version of the PXP and print it to the log for debugging purposes.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog:

v2:

- reduce debug level for version to dev_dbg
- drop hw_version field from struct pxp_dev
---
 drivers/media/platform/nxp/imx-pxp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 689ae5e6ac62..5b671c6e5cae 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -10,6 +10,7 @@
  * Pawel Osciak, <pawel@osciak.com>
  * Marek Szyprowski, <m.szyprowski@samsung.com>
  */
+#include <linux/bitfield.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
@@ -52,6 +53,11 @@ MODULE_PARM_DESC(debug, "activates debug info");
 #define MEM2MEM_HFLIP	(1 << 0)
 #define MEM2MEM_VFLIP	(1 << 1)
 
+#define PXP_VERSION_MAJOR(version) \
+	FIELD_GET(BM_PXP_VERSION_MAJOR, version)
+#define PXP_VERSION_MINOR(version) \
+	FIELD_GET(BM_PXP_VERSION_MINOR, version)
+
 #define dprintk(dev, fmt, arg...) \
 	v4l2_dbg(1, debug, &dev->v4l2_dev, "%s: " fmt, __func__, ## arg)
 
@@ -1665,6 +1671,7 @@ static int pxp_probe(struct platform_device *pdev)
 	struct pxp_dev *dev;
 	struct video_device *vfd;
 	int irq;
+	u32 hw_version;
 	int ret;
 
 	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
@@ -1705,6 +1712,10 @@ static int pxp_probe(struct platform_device *pdev)
 		goto err_clk;
 	}
 
+	hw_version = readl(dev->mmio + HW_PXP_VERSION);
+	dev_dbg(&pdev->dev, "PXP Version %u.%u\n",
+		PXP_VERSION_MAJOR(hw_version), PXP_VERSION_MINOR(hw_version));
+
 	ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
 	if (ret)
 		goto err_clk;

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 02/16] media: imx-pxp: detect PXP version
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

Different versions of the Pixel Pipeline have different blocks and their
routing may be different. Read the PXP_HW_VERSION register to determine
the version of the PXP and print it to the log for debugging purposes.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog:

v2:

- reduce debug level for version to dev_dbg
- drop hw_version field from struct pxp_dev
---
 drivers/media/platform/nxp/imx-pxp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 689ae5e6ac62..5b671c6e5cae 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -10,6 +10,7 @@
  * Pawel Osciak, <pawel@osciak.com>
  * Marek Szyprowski, <m.szyprowski@samsung.com>
  */
+#include <linux/bitfield.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
@@ -52,6 +53,11 @@ MODULE_PARM_DESC(debug, "activates debug info");
 #define MEM2MEM_HFLIP	(1 << 0)
 #define MEM2MEM_VFLIP	(1 << 1)
 
+#define PXP_VERSION_MAJOR(version) \
+	FIELD_GET(BM_PXP_VERSION_MAJOR, version)
+#define PXP_VERSION_MINOR(version) \
+	FIELD_GET(BM_PXP_VERSION_MINOR, version)
+
 #define dprintk(dev, fmt, arg...) \
 	v4l2_dbg(1, debug, &dev->v4l2_dev, "%s: " fmt, __func__, ## arg)
 
@@ -1665,6 +1671,7 @@ static int pxp_probe(struct platform_device *pdev)
 	struct pxp_dev *dev;
 	struct video_device *vfd;
 	int irq;
+	u32 hw_version;
 	int ret;
 
 	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
@@ -1705,6 +1712,10 @@ static int pxp_probe(struct platform_device *pdev)
 		goto err_clk;
 	}
 
+	hw_version = readl(dev->mmio + HW_PXP_VERSION);
+	dev_dbg(&pdev->dev, "PXP Version %u.%u\n",
+		PXP_VERSION_MAJOR(hw_version), PXP_VERSION_MINOR(hw_version));
+
 	ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
 	if (ret)
 		goto err_clk;

-- 
2.30.2

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

* [PATCH v2 03/16] media: imx-pxp: extract helper function to setup data path
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

The driver must configure the data path through the Pixel Pipeline.

Currently, the driver is using a fixed setup, but once there are
different pipeline configurations, it is helpful to have a dedicated
function for determining the register value for the data path.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog:

v2: none
---
 drivers/media/platform/nxp/imx-pxp.c | 62 ++++++++++++++++++++++++------------
 1 file changed, 42 insertions(+), 20 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 5b671c6e5cae..675fd00faaac 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -724,6 +724,47 @@ static void pxp_setup_csc(struct pxp_ctx *ctx)
 	}
 }
 
+static u32 pxp_data_path_ctrl0(struct pxp_ctx *ctx)
+{
+	u32 ctrl0;
+
+	ctrl0 = 0;
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(1);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(1);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX3_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(0);
+
+	return ctrl0;
+}
+
+static void pxp_set_data_path(struct pxp_ctx *ctx)
+{
+	struct pxp_dev *dev = ctx->dev;
+	u32 ctrl0;
+	u32 ctrl1;
+
+	ctrl0 = pxp_data_path_ctrl0(ctx);
+
+	ctrl1 = 0;
+	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(1);
+	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(1);
+
+	writel(ctrl0, dev->mmio + HW_PXP_DATA_PATH_CTRL0);
+	writel(ctrl1, dev->mmio + HW_PXP_DATA_PATH_CTRL1);
+}
+
 static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
 		     struct vb2_v4l2_buffer *out_vb)
 {
@@ -910,26 +951,7 @@ static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
 	/* bypass LUT */
 	writel(BM_PXP_LUT_CTRL_BYPASS, dev->mmio + HW_PXP_LUT_CTRL);
 
-	writel(BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(1)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(1)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX3_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(0),
-	       dev->mmio + HW_PXP_DATA_PATH_CTRL0);
-	writel(BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(1) |
-	       BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(1),
-	       dev->mmio + HW_PXP_DATA_PATH_CTRL1);
+	pxp_set_data_path(ctx);
 
 	writel(0xffff, dev->mmio + HW_PXP_IRQ_MASK);
 

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 03/16] media: imx-pxp: extract helper function to setup data path
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

The driver must configure the data path through the Pixel Pipeline.

Currently, the driver is using a fixed setup, but once there are
different pipeline configurations, it is helpful to have a dedicated
function for determining the register value for the data path.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog:

v2: none
---
 drivers/media/platform/nxp/imx-pxp.c | 62 ++++++++++++++++++++++++------------
 1 file changed, 42 insertions(+), 20 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 5b671c6e5cae..675fd00faaac 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -724,6 +724,47 @@ static void pxp_setup_csc(struct pxp_ctx *ctx)
 	}
 }
 
+static u32 pxp_data_path_ctrl0(struct pxp_ctx *ctx)
+{
+	u32 ctrl0;
+
+	ctrl0 = 0;
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(1);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(1);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX3_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(0);
+
+	return ctrl0;
+}
+
+static void pxp_set_data_path(struct pxp_ctx *ctx)
+{
+	struct pxp_dev *dev = ctx->dev;
+	u32 ctrl0;
+	u32 ctrl1;
+
+	ctrl0 = pxp_data_path_ctrl0(ctx);
+
+	ctrl1 = 0;
+	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(1);
+	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(1);
+
+	writel(ctrl0, dev->mmio + HW_PXP_DATA_PATH_CTRL0);
+	writel(ctrl1, dev->mmio + HW_PXP_DATA_PATH_CTRL1);
+}
+
 static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
 		     struct vb2_v4l2_buffer *out_vb)
 {
@@ -910,26 +951,7 @@ static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
 	/* bypass LUT */
 	writel(BM_PXP_LUT_CTRL_BYPASS, dev->mmio + HW_PXP_LUT_CTRL);
 
-	writel(BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(1)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(1)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX3_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(0)|
-	       BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(0),
-	       dev->mmio + HW_PXP_DATA_PATH_CTRL0);
-	writel(BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(1) |
-	       BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(1),
-	       dev->mmio + HW_PXP_DATA_PATH_CTRL1);
+	pxp_set_data_path(ctx);
 
 	writel(0xffff, dev->mmio + HW_PXP_IRQ_MASK);
 

-- 
2.30.2

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

* [PATCH v2 04/16] media: imx-pxp: explicitly disable unused blocks
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

Various multiplexers in the pipeline are not used with the currently
configured data path. Disable all unused multiplexers by selecting the
"no output" (3) option.

The datasheet doesn't explicitly require this, but the PXP has been seen
to hang after processing a few hundreds of frames otherwise.

As at it, add documentation for the multiplexers that are actually
relevant for the data path.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2: none
---
 drivers/media/platform/nxp/imx-pxp.c | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 675fd00faaac..78e778d68e64 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -729,22 +729,28 @@ static u32 pxp_data_path_ctrl0(struct pxp_ctx *ctx)
 	u32 ctrl0;
 
 	ctrl0 = 0;
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(3);
+	/* Bypass Dithering x3CH */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(1);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(3);
+	/* Select Rotation */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(0);
+	/* Select LUT */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(3);
+	/* Select MUX8 for LUT */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(1);
+	/* Select CSC 2 */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(3);
+	/* Bypass Rotation 2 */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX3_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(3);
 
 	return ctrl0;
 }
@@ -758,8 +764,8 @@ static void pxp_set_data_path(struct pxp_ctx *ctx)
 	ctrl0 = pxp_data_path_ctrl0(ctx);
 
 	ctrl1 = 0;
-	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(1);
-	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(1);
+	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(3);
+	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(3);
 
 	writel(ctrl0, dev->mmio + HW_PXP_DATA_PATH_CTRL0);
 	writel(ctrl1, dev->mmio + HW_PXP_DATA_PATH_CTRL1);

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 04/16] media: imx-pxp: explicitly disable unused blocks
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

Various multiplexers in the pipeline are not used with the currently
configured data path. Disable all unused multiplexers by selecting the
"no output" (3) option.

The datasheet doesn't explicitly require this, but the PXP has been seen
to hang after processing a few hundreds of frames otherwise.

As at it, add documentation for the multiplexers that are actually
relevant for the data path.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2: none
---
 drivers/media/platform/nxp/imx-pxp.c | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 675fd00faaac..78e778d68e64 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -729,22 +729,28 @@ static u32 pxp_data_path_ctrl0(struct pxp_ctx *ctx)
 	u32 ctrl0;
 
 	ctrl0 = 0;
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(3);
+	/* Bypass Dithering x3CH */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(1);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(3);
+	/* Select Rotation */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(0);
+	/* Select LUT */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(3);
+	/* Select MUX8 for LUT */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(1);
+	/* Select CSC 2 */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(3);
+	/* Bypass Rotation 2 */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX3_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(0);
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(3);
 
 	return ctrl0;
 }
@@ -758,8 +764,8 @@ static void pxp_set_data_path(struct pxp_ctx *ctx)
 	ctrl0 = pxp_data_path_ctrl0(ctx);
 
 	ctrl1 = 0;
-	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(1);
-	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(1);
+	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(3);
+	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(3);
 
 	writel(ctrl0, dev->mmio + HW_PXP_DATA_PATH_CTRL0);
 	writel(ctrl1, dev->mmio + HW_PXP_DATA_PATH_CTRL1);

-- 
2.30.2

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

* [PATCH v2 05/16] media: imx-pxp: disable LUT block
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

The LUT block is always configured in bypass mode.

Take it entirely out of the pipeline by disabling it and routing the
data path around the LUT.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2: none
---
 drivers/media/platform/nxp/imx-pxp.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 78e778d68e64..bf3be989a552 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -735,11 +735,10 @@ static u32 pxp_data_path_ctrl0(struct pxp_ctx *ctx)
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(3);
 	/* Select Rotation */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(0);
-	/* Select LUT */
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(0);
+	/* Bypass LUT */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(1);
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(3);
-	/* Select MUX8 for LUT */
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(1);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(3);
 	/* Select CSC 2 */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0);
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(3);
@@ -964,7 +963,7 @@ static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
 	/* ungate, enable PS/AS/OUT and PXP operation */
 	writel(BM_PXP_CTRL_IRQ_ENABLE, dev->mmio + HW_PXP_CTRL_SET);
 	writel(BM_PXP_CTRL_ENABLE | BM_PXP_CTRL_ENABLE_CSC2 |
-	       BM_PXP_CTRL_ENABLE_LUT | BM_PXP_CTRL_ENABLE_ROTATE0 |
+	       BM_PXP_CTRL_ENABLE_ROTATE0 |
 	       BM_PXP_CTRL_ENABLE_PS_AS_OUT, dev->mmio + HW_PXP_CTRL_SET);
 
 	return 0;

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 05/16] media: imx-pxp: disable LUT block
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

The LUT block is always configured in bypass mode.

Take it entirely out of the pipeline by disabling it and routing the
data path around the LUT.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2: none
---
 drivers/media/platform/nxp/imx-pxp.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 78e778d68e64..bf3be989a552 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -735,11 +735,10 @@ static u32 pxp_data_path_ctrl0(struct pxp_ctx *ctx)
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(3);
 	/* Select Rotation */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(0);
-	/* Select LUT */
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(0);
+	/* Bypass LUT */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(1);
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(3);
-	/* Select MUX8 for LUT */
-	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(1);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(3);
 	/* Select CSC 2 */
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0);
 	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(3);
@@ -964,7 +963,7 @@ static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
 	/* ungate, enable PS/AS/OUT and PXP operation */
 	writel(BM_PXP_CTRL_IRQ_ENABLE, dev->mmio + HW_PXP_CTRL_SET);
 	writel(BM_PXP_CTRL_ENABLE | BM_PXP_CTRL_ENABLE_CSC2 |
-	       BM_PXP_CTRL_ENABLE_LUT | BM_PXP_CTRL_ENABLE_ROTATE0 |
+	       BM_PXP_CTRL_ENABLE_ROTATE0 |
 	       BM_PXP_CTRL_ENABLE_PS_AS_OUT, dev->mmio + HW_PXP_CTRL_SET);
 
 	return 0;

-- 
2.30.2

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

* [PATCH v2 06/16] media: imx-pxp: make data_path_ctrl0 platform dependent
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

Unfortunately, the PXP_HW_VERSION register reports the PXP on the i.MX7D
and on the i.MX6ULL as version 3.0, although the PXP versions on these
SoCs have significant differences.

Use the compatible to configure the ctrl0 register as required dependent
on the platform.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- drop fallback for missing data_path_ctrl0
---
 drivers/media/platform/nxp/imx-pxp.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index bf3be989a552..c7f8a1808516 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -19,6 +19,7 @@
 #include <linux/iopoll.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 
@@ -191,6 +192,12 @@ static struct pxp_fmt *find_format(struct v4l2_format *f)
 	return &formats[k];
 }
 
+struct pxp_ctx;
+
+struct pxp_pdata {
+	u32 (*data_path_ctrl0)(struct pxp_ctx *ctx);
+};
+
 struct pxp_dev {
 	struct v4l2_device	v4l2_dev;
 	struct video_device	vfd;
@@ -198,6 +205,8 @@ struct pxp_dev {
 	struct clk		*clk;
 	void __iomem		*mmio;
 
+	const struct pxp_pdata	*pdata;
+
 	atomic_t		num_inst;
 	struct mutex		dev_mutex;
 	spinlock_t		irqlock;
@@ -724,7 +733,7 @@ static void pxp_setup_csc(struct pxp_ctx *ctx)
 	}
 }
 
-static u32 pxp_data_path_ctrl0(struct pxp_ctx *ctx)
+static u32 pxp_imx6ull_data_path_ctrl0(struct pxp_ctx *ctx)
 {
 	u32 ctrl0;
 
@@ -760,7 +769,7 @@ static void pxp_set_data_path(struct pxp_ctx *ctx)
 	u32 ctrl0;
 	u32 ctrl1;
 
-	ctrl0 = pxp_data_path_ctrl0(ctx);
+	ctrl0 = dev->pdata->data_path_ctrl0(ctx);
 
 	ctrl1 = 0;
 	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(3);
@@ -1705,6 +1714,8 @@ static int pxp_probe(struct platform_device *pdev)
 	if (!dev)
 		return -ENOMEM;
 
+	dev->pdata = of_device_get_match_data(&pdev->dev);
+
 	dev->clk = devm_clk_get(&pdev->dev, "axi");
 	if (IS_ERR(dev->clk)) {
 		ret = PTR_ERR(dev->clk);
@@ -1804,8 +1815,12 @@ static int pxp_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct pxp_pdata pxp_imx6ull_pdata = {
+	.data_path_ctrl0 = pxp_imx6ull_data_path_ctrl0,
+};
+
 static const struct of_device_id pxp_dt_ids[] = {
-	{ .compatible = "fsl,imx6ull-pxp", .data = NULL },
+	{ .compatible = "fsl,imx6ull-pxp", .data = &pxp_imx6ull_pdata },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, pxp_dt_ids);

-- 
2.30.2

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

* [PATCH v2 06/16] media: imx-pxp: make data_path_ctrl0 platform dependent
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

Unfortunately, the PXP_HW_VERSION register reports the PXP on the i.MX7D
and on the i.MX6ULL as version 3.0, although the PXP versions on these
SoCs have significant differences.

Use the compatible to configure the ctrl0 register as required dependent
on the platform.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- drop fallback for missing data_path_ctrl0
---
 drivers/media/platform/nxp/imx-pxp.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index bf3be989a552..c7f8a1808516 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -19,6 +19,7 @@
 #include <linux/iopoll.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 
@@ -191,6 +192,12 @@ static struct pxp_fmt *find_format(struct v4l2_format *f)
 	return &formats[k];
 }
 
+struct pxp_ctx;
+
+struct pxp_pdata {
+	u32 (*data_path_ctrl0)(struct pxp_ctx *ctx);
+};
+
 struct pxp_dev {
 	struct v4l2_device	v4l2_dev;
 	struct video_device	vfd;
@@ -198,6 +205,8 @@ struct pxp_dev {
 	struct clk		*clk;
 	void __iomem		*mmio;
 
+	const struct pxp_pdata	*pdata;
+
 	atomic_t		num_inst;
 	struct mutex		dev_mutex;
 	spinlock_t		irqlock;
@@ -724,7 +733,7 @@ static void pxp_setup_csc(struct pxp_ctx *ctx)
 	}
 }
 
-static u32 pxp_data_path_ctrl0(struct pxp_ctx *ctx)
+static u32 pxp_imx6ull_data_path_ctrl0(struct pxp_ctx *ctx)
 {
 	u32 ctrl0;
 
@@ -760,7 +769,7 @@ static void pxp_set_data_path(struct pxp_ctx *ctx)
 	u32 ctrl0;
 	u32 ctrl1;
 
-	ctrl0 = pxp_data_path_ctrl0(ctx);
+	ctrl0 = dev->pdata->data_path_ctrl0(ctx);
 
 	ctrl1 = 0;
 	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(3);
@@ -1705,6 +1714,8 @@ static int pxp_probe(struct platform_device *pdev)
 	if (!dev)
 		return -ENOMEM;
 
+	dev->pdata = of_device_get_match_data(&pdev->dev);
+
 	dev->clk = devm_clk_get(&pdev->dev, "axi");
 	if (IS_ERR(dev->clk)) {
 		ret = PTR_ERR(dev->clk);
@@ -1804,8 +1815,12 @@ static int pxp_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct pxp_pdata pxp_imx6ull_pdata = {
+	.data_path_ctrl0 = pxp_imx6ull_data_path_ctrl0,
+};
+
 static const struct of_device_id pxp_dt_ids[] = {
-	{ .compatible = "fsl,imx6ull-pxp", .data = NULL },
+	{ .compatible = "fsl,imx6ull-pxp", .data = &pxp_imx6ull_pdata },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, pxp_dt_ids);

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 07/16] media: imx-pxp: add support for i.MX7D
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

The i.MX7D needs a different data path configuration than the i.MX6ULL.
Configure the data path as close as possible to the data path on the
i.MX6ULL.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2: none
---
 drivers/media/platform/nxp/imx-pxp.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index c7f8a1808516..aabe10f21c8b 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -763,6 +763,37 @@ static u32 pxp_imx6ull_data_path_ctrl0(struct pxp_ctx *ctx)
 	return ctrl0;
 }
 
+static u32 pxp_imx7d_data_path_ctrl0(struct pxp_ctx *ctx)
+{
+	u32 ctrl0;
+
+	ctrl0 = 0;
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(3);
+	/* Select Rotation 0 */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(3);
+	/* Select MUX11 for Rotation 0 */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(1);
+	/* Bypass LUT */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(1);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(3);
+	/* Select CSC 2 */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(3);
+	/* Select Composite Alpha Blending/Color Key 0 for CSC 2 */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(1);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(3);
+	/* Bypass Rotation 1 */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX3_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(3);
+
+	return ctrl0;
+}
+
 static void pxp_set_data_path(struct pxp_ctx *ctx)
 {
 	struct pxp_dev *dev = ctx->dev;
@@ -1819,8 +1850,13 @@ static const struct pxp_pdata pxp_imx6ull_pdata = {
 	.data_path_ctrl0 = pxp_imx6ull_data_path_ctrl0,
 };
 
+static const struct pxp_pdata pxp_imx7d_pdata = {
+	.data_path_ctrl0 = pxp_imx7d_data_path_ctrl0,
+};
+
 static const struct of_device_id pxp_dt_ids[] = {
 	{ .compatible = "fsl,imx6ull-pxp", .data = &pxp_imx6ull_pdata },
+	{ .compatible = "fsl,imx7d-pxp", .data = &pxp_imx7d_pdata },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, pxp_dt_ids);

-- 
2.30.2

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

* [PATCH v2 07/16] media: imx-pxp: add support for i.MX7D
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

The i.MX7D needs a different data path configuration than the i.MX6ULL.
Configure the data path as close as possible to the data path on the
i.MX6ULL.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2: none
---
 drivers/media/platform/nxp/imx-pxp.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index c7f8a1808516..aabe10f21c8b 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -763,6 +763,37 @@ static u32 pxp_imx6ull_data_path_ctrl0(struct pxp_ctx *ctx)
 	return ctrl0;
 }
 
+static u32 pxp_imx7d_data_path_ctrl0(struct pxp_ctx *ctx)
+{
+	u32 ctrl0;
+
+	ctrl0 = 0;
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX15_SEL(3);
+	/* Select Rotation 0 */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX14_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX13_SEL(3);
+	/* Select MUX11 for Rotation 0 */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX12_SEL(1);
+	/* Bypass LUT */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX11_SEL(1);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX10_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX9_SEL(3);
+	/* Select CSC 2 */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX8_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX7_SEL(3);
+	/* Select Composite Alpha Blending/Color Key 0 for CSC 2 */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX6_SEL(1);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX5_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX4_SEL(3);
+	/* Bypass Rotation 1 */
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX3_SEL(0);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX2_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX1_SEL(3);
+	ctrl0 |= BF_PXP_DATA_PATH_CTRL0_MUX0_SEL(3);
+
+	return ctrl0;
+}
+
 static void pxp_set_data_path(struct pxp_ctx *ctx)
 {
 	struct pxp_dev *dev = ctx->dev;
@@ -1819,8 +1850,13 @@ static const struct pxp_pdata pxp_imx6ull_pdata = {
 	.data_path_ctrl0 = pxp_imx6ull_data_path_ctrl0,
 };
 
+static const struct pxp_pdata pxp_imx7d_pdata = {
+	.data_path_ctrl0 = pxp_imx7d_data_path_ctrl0,
+};
+
 static const struct of_device_id pxp_dt_ids[] = {
 	{ .compatible = "fsl,imx6ull-pxp", .data = &pxp_imx6ull_pdata },
+	{ .compatible = "fsl,imx7d-pxp", .data = &pxp_imx7d_pdata },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, pxp_dt_ids);

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
node to make it available.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- fix alignment
---
 arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
index 7ceb7c09f7ad..4b94b8afb55d 100644
--- a/arch/arm/boot/dts/imx7d.dtsi
+++ b/arch/arm/boot/dts/imx7d.dtsi
@@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
 		  reg = <0x306d0000 0x10000>;
 		  status = "disabled";
 	};
+
+	pxp: pxp@30700000 {
+		compatible = "fsl,imx7d-pxp";
+		reg = <0x30700000 0x10000>;
+		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&clks IMX7D_PXP_CLK>;
+		clock-names = "axi";
+	};
 };
 
 &aips3 {

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
node to make it available.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- fix alignment
---
 arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
index 7ceb7c09f7ad..4b94b8afb55d 100644
--- a/arch/arm/boot/dts/imx7d.dtsi
+++ b/arch/arm/boot/dts/imx7d.dtsi
@@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
 		  reg = <0x306d0000 0x10000>;
 		  status = "disabled";
 	};
+
+	pxp: pxp@30700000 {
+		compatible = "fsl,imx7d-pxp";
+		reg = <0x30700000 0x10000>;
+		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&clks IMX7D_PXP_CLK>;
+		clock-names = "axi";
+	};
 };
 
 &aips3 {

-- 
2.30.2

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

* [PATCH v2 09/16] media: imx-pxp: Sort headers alphabetically
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Sorting headers alphabetically helps locating duplicates, and make it
easier to figure out where to insert new headers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- Pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com
---
 drivers/media/platform/nxp/imx-pxp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index aabe10f21c8b..ad11ac530f96 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -20,15 +20,15 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/platform_device.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 
-#include <linux/platform_device.h>
-#include <media/v4l2-mem2mem.h>
-#include <media/v4l2-device.h>
-#include <media/v4l2-ioctl.h>
 #include <media/v4l2-ctrls.h>
+#include <media/v4l2-device.h>
 #include <media/v4l2-event.h>
+#include <media/v4l2-ioctl.h>
+#include <media/v4l2-mem2mem.h>
 #include <media/videobuf2-dma-contig.h>
 
 #include "imx-pxp.h"

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 09/16] media: imx-pxp: Sort headers alphabetically
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Sorting headers alphabetically helps locating duplicates, and make it
easier to figure out where to insert new headers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- Pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com
---
 drivers/media/platform/nxp/imx-pxp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index aabe10f21c8b..ad11ac530f96 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -20,15 +20,15 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/platform_device.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 
-#include <linux/platform_device.h>
-#include <media/v4l2-mem2mem.h>
-#include <media/v4l2-device.h>
-#include <media/v4l2-ioctl.h>
 #include <media/v4l2-ctrls.h>
+#include <media/v4l2-device.h>
 #include <media/v4l2-event.h>
+#include <media/v4l2-ioctl.h>
+#include <media/v4l2-mem2mem.h>
 #include <media/videobuf2-dma-contig.h>
 
 #include "imx-pxp.h"

-- 
2.30.2

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

* [PATCH v2 10/16] media: imx-pxp: Don't set bus_info manually in .querycap()
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

The v4l2_capability.bus_info field is set by the V4L2 core when left
empty by the .querycap() handler. This is the recommended practice, in
order to ensure bus_info coherence between drivers. Don't set it
manually.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- Pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com
---
 drivers/media/platform/nxp/imx-pxp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index ad11ac530f96..86ccc3c4aae3 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -1107,8 +1107,6 @@ static int pxp_querycap(struct file *file, void *priv,
 {
 	strscpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver));
 	strscpy(cap->card, MEM2MEM_NAME, sizeof(cap->card));
-	snprintf(cap->bus_info, sizeof(cap->bus_info),
-			"platform:%s", MEM2MEM_NAME);
 	return 0;
 }
 

-- 
2.30.2

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

* [PATCH v2 10/16] media: imx-pxp: Don't set bus_info manually in .querycap()
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

The v4l2_capability.bus_info field is set by the V4L2 core when left
empty by the .querycap() handler. This is the recommended practice, in
order to ensure bus_info coherence between drivers. Don't set it
manually.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- Pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com
---
 drivers/media/platform/nxp/imx-pxp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index ad11ac530f96..86ccc3c4aae3 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -1107,8 +1107,6 @@ static int pxp_querycap(struct file *file, void *priv,
 {
 	strscpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver));
 	strscpy(cap->card, MEM2MEM_NAME, sizeof(cap->card));
-	snprintf(cap->bus_info, sizeof(cap->bus_info),
-			"platform:%s", MEM2MEM_NAME);
 	return 0;
 }
 

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 11/16] media: imx-pxp: Add media controller support
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Register a media device for the PXP, using the v4l2-mem2mem MC
infrastructure to populate the media graph. No media device operation is
implemented, the main use of the MC API is to allow consistent discovery
of media devices for userspace.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

Changes since v1:

- Drop manual setting of bus_info
- Pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com
---
 drivers/media/platform/nxp/imx-pxp.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 86ccc3c4aae3..351e76ee32ca 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -24,6 +24,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 
+#include <media/media-device.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-event.h>
@@ -201,6 +202,9 @@ struct pxp_pdata {
 struct pxp_dev {
 	struct v4l2_device	v4l2_dev;
 	struct video_device	vfd;
+#ifdef CONFIG_MEDIA_CONTROLLER
+	struct media_device	mdev;
+#endif
 
 	struct clk		*clk;
 	void __iomem		*mmio;
@@ -1815,8 +1819,34 @@ static int pxp_probe(struct platform_device *pdev)
 		goto err_m2m;
 	}
 
+#ifdef CONFIG_MEDIA_CONTROLLER
+	dev->mdev.dev = &pdev->dev;
+	strscpy(dev->mdev.model, MEM2MEM_NAME, sizeof(dev->mdev.model));
+	media_device_init(&dev->mdev);
+	dev->v4l2_dev.mdev = &dev->mdev;
+
+	ret = v4l2_m2m_register_media_controller(dev->m2m_dev, vfd,
+						 MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER);
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to initialize media device\n");
+		goto err_vfd;
+	}
+
+	ret = media_device_register(&dev->mdev);
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to register media device\n");
+		goto err_m2m_mc;
+	}
+#endif
+
 	return 0;
 
+#ifdef CONFIG_MEDIA_CONTROLLER
+err_m2m_mc:
+	v4l2_m2m_unregister_media_controller(dev->m2m_dev);
+err_vfd:
+	video_unregister_device(vfd);
+#endif
 err_m2m:
 	v4l2_m2m_release(dev->m2m_dev);
 err_v4l2:
@@ -1837,6 +1867,11 @@ static int pxp_remove(struct platform_device *pdev)
 	clk_disable_unprepare(dev->clk);
 
 	v4l2_info(&dev->v4l2_dev, "Removing " MEM2MEM_NAME);
+
+#ifdef CONFIG_MEDIA_CONTROLLER
+	media_device_unregister(&dev->mdev);
+	v4l2_m2m_unregister_media_controller(dev->m2m_dev);
+#endif
 	video_unregister_device(&dev->vfd);
 	v4l2_m2m_release(dev->m2m_dev);
 	v4l2_device_unregister(&dev->v4l2_dev);

-- 
2.30.2

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

* [PATCH v2 11/16] media: imx-pxp: Add media controller support
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Register a media device for the PXP, using the v4l2-mem2mem MC
infrastructure to populate the media graph. No media device operation is
implemented, the main use of the MC API is to allow consistent discovery
of media devices for userspace.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

Changes since v1:

- Drop manual setting of bus_info
- Pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com
---
 drivers/media/platform/nxp/imx-pxp.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 86ccc3c4aae3..351e76ee32ca 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -24,6 +24,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 
+#include <media/media-device.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-event.h>
@@ -201,6 +202,9 @@ struct pxp_pdata {
 struct pxp_dev {
 	struct v4l2_device	v4l2_dev;
 	struct video_device	vfd;
+#ifdef CONFIG_MEDIA_CONTROLLER
+	struct media_device	mdev;
+#endif
 
 	struct clk		*clk;
 	void __iomem		*mmio;
@@ -1815,8 +1819,34 @@ static int pxp_probe(struct platform_device *pdev)
 		goto err_m2m;
 	}
 
+#ifdef CONFIG_MEDIA_CONTROLLER
+	dev->mdev.dev = &pdev->dev;
+	strscpy(dev->mdev.model, MEM2MEM_NAME, sizeof(dev->mdev.model));
+	media_device_init(&dev->mdev);
+	dev->v4l2_dev.mdev = &dev->mdev;
+
+	ret = v4l2_m2m_register_media_controller(dev->m2m_dev, vfd,
+						 MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER);
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to initialize media device\n");
+		goto err_vfd;
+	}
+
+	ret = media_device_register(&dev->mdev);
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to register media device\n");
+		goto err_m2m_mc;
+	}
+#endif
+
 	return 0;
 
+#ifdef CONFIG_MEDIA_CONTROLLER
+err_m2m_mc:
+	v4l2_m2m_unregister_media_controller(dev->m2m_dev);
+err_vfd:
+	video_unregister_device(vfd);
+#endif
 err_m2m:
 	v4l2_m2m_release(dev->m2m_dev);
 err_v4l2:
@@ -1837,6 +1867,11 @@ static int pxp_remove(struct platform_device *pdev)
 	clk_disable_unprepare(dev->clk);
 
 	v4l2_info(&dev->v4l2_dev, "Removing " MEM2MEM_NAME);
+
+#ifdef CONFIG_MEDIA_CONTROLLER
+	media_device_unregister(&dev->mdev);
+	v4l2_m2m_unregister_media_controller(dev->m2m_dev);
+#endif
 	video_unregister_device(&dev->vfd);
 	v4l2_m2m_release(dev->m2m_dev);
 	v4l2_device_unregister(&dev->v4l2_dev);

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 12/16] media: imx-pxp: Pass pixel format value to find_format()
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

The find_format() function looks up format information for a given pixel
format. It takes a v4l2_format pointer, but only uses the contained
pixel format value. To prepare it for being used by callers that don't
have v4l2_format, modify it to take the pixel format value directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- Pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com
---
 drivers/media/platform/nxp/imx-pxp.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 351e76ee32ca..9e2e522d9241 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -176,14 +176,14 @@ enum {
 	V4L2_M2M_DST = 1,
 };
 
-static struct pxp_fmt *find_format(struct v4l2_format *f)
+static struct pxp_fmt *find_format(unsigned int pixelformat)
 {
 	struct pxp_fmt *fmt;
 	unsigned int k;
 
 	for (k = 0; k < NUM_FORMATS; k++) {
 		fmt = &formats[k];
-		if (fmt->fourcc == f->fmt.pix.pixelformat)
+		if (fmt->fourcc == pixelformat)
 			break;
 	}
 
@@ -1256,10 +1256,10 @@ static int pxp_try_fmt_vid_cap(struct file *file, void *priv,
 	struct pxp_fmt *fmt;
 	struct pxp_ctx *ctx = file2ctx(file);
 
-	fmt = find_format(f);
+	fmt = find_format(f->fmt.pix.pixelformat);
 	if (!fmt) {
 		f->fmt.pix.pixelformat = formats[0].fourcc;
-		fmt = find_format(f);
+		fmt = find_format(f->fmt.pix.pixelformat);
 	}
 	if (!(fmt->types & MEM2MEM_CAPTURE)) {
 		v4l2_err(&ctx->dev->v4l2_dev,
@@ -1284,10 +1284,10 @@ static int pxp_try_fmt_vid_out(struct file *file, void *priv,
 	struct pxp_fmt *fmt;
 	struct pxp_ctx *ctx = file2ctx(file);
 
-	fmt = find_format(f);
+	fmt = find_format(f->fmt.pix.pixelformat);
 	if (!fmt) {
 		f->fmt.pix.pixelformat = formats[0].fourcc;
-		fmt = find_format(f);
+		fmt = find_format(f->fmt.pix.pixelformat);
 	}
 	if (!(fmt->types & MEM2MEM_OUTPUT)) {
 		v4l2_err(&ctx->dev->v4l2_dev,
@@ -1320,7 +1320,7 @@ static int pxp_s_fmt(struct pxp_ctx *ctx, struct v4l2_format *f)
 		return -EBUSY;
 	}
 
-	q_data->fmt		= find_format(f);
+	q_data->fmt		= find_format(f->fmt.pix.pixelformat);
 	q_data->width		= f->fmt.pix.width;
 	q_data->height		= f->fmt.pix.height;
 	q_data->bytesperline	= f->fmt.pix.bytesperline;

-- 
2.30.2

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

* [PATCH v2 12/16] media: imx-pxp: Pass pixel format value to find_format()
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

The find_format() function looks up format information for a given pixel
format. It takes a v4l2_format pointer, but only uses the contained
pixel format value. To prepare it for being used by callers that don't
have v4l2_format, modify it to take the pixel format value directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- Pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com
---
 drivers/media/platform/nxp/imx-pxp.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 351e76ee32ca..9e2e522d9241 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -176,14 +176,14 @@ enum {
 	V4L2_M2M_DST = 1,
 };
 
-static struct pxp_fmt *find_format(struct v4l2_format *f)
+static struct pxp_fmt *find_format(unsigned int pixelformat)
 {
 	struct pxp_fmt *fmt;
 	unsigned int k;
 
 	for (k = 0; k < NUM_FORMATS; k++) {
 		fmt = &formats[k];
-		if (fmt->fourcc == f->fmt.pix.pixelformat)
+		if (fmt->fourcc == pixelformat)
 			break;
 	}
 
@@ -1256,10 +1256,10 @@ static int pxp_try_fmt_vid_cap(struct file *file, void *priv,
 	struct pxp_fmt *fmt;
 	struct pxp_ctx *ctx = file2ctx(file);
 
-	fmt = find_format(f);
+	fmt = find_format(f->fmt.pix.pixelformat);
 	if (!fmt) {
 		f->fmt.pix.pixelformat = formats[0].fourcc;
-		fmt = find_format(f);
+		fmt = find_format(f->fmt.pix.pixelformat);
 	}
 	if (!(fmt->types & MEM2MEM_CAPTURE)) {
 		v4l2_err(&ctx->dev->v4l2_dev,
@@ -1284,10 +1284,10 @@ static int pxp_try_fmt_vid_out(struct file *file, void *priv,
 	struct pxp_fmt *fmt;
 	struct pxp_ctx *ctx = file2ctx(file);
 
-	fmt = find_format(f);
+	fmt = find_format(f->fmt.pix.pixelformat);
 	if (!fmt) {
 		f->fmt.pix.pixelformat = formats[0].fourcc;
-		fmt = find_format(f);
+		fmt = find_format(f->fmt.pix.pixelformat);
 	}
 	if (!(fmt->types & MEM2MEM_OUTPUT)) {
 		v4l2_err(&ctx->dev->v4l2_dev,
@@ -1320,7 +1320,7 @@ static int pxp_s_fmt(struct pxp_ctx *ctx, struct v4l2_format *f)
 		return -EBUSY;
 	}
 
-	q_data->fmt		= find_format(f);
+	q_data->fmt		= find_format(f->fmt.pix.pixelformat);
 	q_data->width		= f->fmt.pix.width;
 	q_data->height		= f->fmt.pix.height;
 	q_data->bytesperline	= f->fmt.pix.bytesperline;

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 13/16] media: imx-pxp: Implement frame size enumeration
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Implement support for the VIDIOC_ENUM_FRAMESIZES ioctl.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changes since v1:

- Use 1 << ALIGN_*
- Pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com/
---
 drivers/media/platform/nxp/imx-pxp.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 9e2e522d9241..f34eba62f7d6 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -1379,6 +1379,26 @@ static int pxp_s_fmt_vid_out(struct file *file, void *priv,
 	return 0;
 }
 
+static int pxp_enum_framesizes(struct file *file, void *fh,
+			       struct v4l2_frmsizeenum *fsize)
+{
+	if (fsize->index > 0)
+		return -EINVAL;
+
+	if (!find_format(fsize->pixel_format))
+		return -EINVAL;
+
+	fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
+	fsize->stepwise.min_width = MIN_W;
+	fsize->stepwise.max_width = MAX_W;
+	fsize->stepwise.step_width = 1 << ALIGN_W;
+	fsize->stepwise.min_height = MIN_H;
+	fsize->stepwise.max_height = MAX_H;
+	fsize->stepwise.step_height = 1 << ALIGN_H;
+
+	return 0;
+}
+
 static u8 pxp_degrees_to_rot_mode(u32 degrees)
 {
 	switch (degrees) {
@@ -1447,6 +1467,8 @@ static const struct v4l2_ioctl_ops pxp_ioctl_ops = {
 	.vidioc_try_fmt_vid_out	= pxp_try_fmt_vid_out,
 	.vidioc_s_fmt_vid_out	= pxp_s_fmt_vid_out,
 
+	.vidioc_enum_framesizes	= pxp_enum_framesizes,
+
 	.vidioc_reqbufs		= v4l2_m2m_ioctl_reqbufs,
 	.vidioc_querybuf	= v4l2_m2m_ioctl_querybuf,
 	.vidioc_qbuf		= v4l2_m2m_ioctl_qbuf,

-- 
2.30.2

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

* [PATCH v2 13/16] media: imx-pxp: Implement frame size enumeration
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Implement support for the VIDIOC_ENUM_FRAMESIZES ioctl.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changes since v1:

- Use 1 << ALIGN_*
- Pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com/
---
 drivers/media/platform/nxp/imx-pxp.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 9e2e522d9241..f34eba62f7d6 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -1379,6 +1379,26 @@ static int pxp_s_fmt_vid_out(struct file *file, void *priv,
 	return 0;
 }
 
+static int pxp_enum_framesizes(struct file *file, void *fh,
+			       struct v4l2_frmsizeenum *fsize)
+{
+	if (fsize->index > 0)
+		return -EINVAL;
+
+	if (!find_format(fsize->pixel_format))
+		return -EINVAL;
+
+	fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
+	fsize->stepwise.min_width = MIN_W;
+	fsize->stepwise.max_width = MAX_W;
+	fsize->stepwise.step_width = 1 << ALIGN_W;
+	fsize->stepwise.min_height = MIN_H;
+	fsize->stepwise.max_height = MAX_H;
+	fsize->stepwise.step_height = 1 << ALIGN_H;
+
+	return 0;
+}
+
 static u8 pxp_degrees_to_rot_mode(u32 degrees)
 {
 	switch (degrees) {
@@ -1447,6 +1467,8 @@ static const struct v4l2_ioctl_ops pxp_ioctl_ops = {
 	.vidioc_try_fmt_vid_out	= pxp_try_fmt_vid_out,
 	.vidioc_s_fmt_vid_out	= pxp_s_fmt_vid_out,
 
+	.vidioc_enum_framesizes	= pxp_enum_framesizes,
+
 	.vidioc_reqbufs		= v4l2_m2m_ioctl_reqbufs,
 	.vidioc_querybuf	= v4l2_m2m_ioctl_querybuf,
 	.vidioc_qbuf		= v4l2_m2m_ioctl_qbuf,

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 14/16] media: imx-pxp: Introduce pxp_read() and pxp_write() wrappers
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Add pxp_read() and pxp_write() functions to wrap readl() and writel()
respectively. This can be useful for debugging register accesses.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com/
- fix conflict due to removed pxp_read_version
---
 drivers/media/platform/nxp/imx-pxp.c | 118 +++++++++++++++++++----------------
 1 file changed, 64 insertions(+), 54 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index f34eba62f7d6..124d272194d1 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -253,6 +253,16 @@ static struct pxp_q_data *get_q_data(struct pxp_ctx *ctx,
 		return &ctx->q_data[V4L2_M2M_DST];
 }
 
+static inline u32 pxp_read(struct pxp_dev *dev, u32 reg)
+{
+	return readl(dev->mmio + reg);
+}
+
+static inline void pxp_write(struct pxp_dev *dev, u32 reg, u32 value)
+{
+	writel(value, dev->mmio + reg);
+}
+
 static u32 pxp_v4l2_pix_fmt_to_ps_format(u32 v4l2_pix_fmt)
 {
 	switch (v4l2_pix_fmt) {
@@ -505,11 +515,11 @@ static void pxp_setup_csc(struct pxp_ctx *ctx)
 				csc1_coef = csc1_coef_smpte240m_lim;
 		}
 
-		writel(csc1_coef[0], dev->mmio + HW_PXP_CSC1_COEF0);
-		writel(csc1_coef[1], dev->mmio + HW_PXP_CSC1_COEF1);
-		writel(csc1_coef[2], dev->mmio + HW_PXP_CSC1_COEF2);
+		pxp_write(dev, HW_PXP_CSC1_COEF0, csc1_coef[0]);
+		pxp_write(dev, HW_PXP_CSC1_COEF1, csc1_coef[1]);
+		pxp_write(dev, HW_PXP_CSC1_COEF2, csc1_coef[2]);
 	} else {
-		writel(BM_PXP_CSC1_COEF0_BYPASS, dev->mmio + HW_PXP_CSC1_COEF0);
+		pxp_write(dev, HW_PXP_CSC1_COEF0, BM_PXP_CSC1_COEF0_BYPASS);
 	}
 
 	if (!pxp_v4l2_pix_fmt_is_yuv(ctx->q_data[V4L2_M2M_SRC].fmt->fourcc) &&
@@ -725,15 +735,15 @@ static void pxp_setup_csc(struct pxp_ctx *ctx)
 				    BP_PXP_CSC2_CTRL_CSC_MODE;
 		}
 
-		writel(csc2_ctrl, dev->mmio + HW_PXP_CSC2_CTRL);
-		writel(csc2_coef[0], dev->mmio + HW_PXP_CSC2_COEF0);
-		writel(csc2_coef[1], dev->mmio + HW_PXP_CSC2_COEF1);
-		writel(csc2_coef[2], dev->mmio + HW_PXP_CSC2_COEF2);
-		writel(csc2_coef[3], dev->mmio + HW_PXP_CSC2_COEF3);
-		writel(csc2_coef[4], dev->mmio + HW_PXP_CSC2_COEF4);
-		writel(csc2_coef[5], dev->mmio + HW_PXP_CSC2_COEF5);
+		pxp_write(dev, HW_PXP_CSC2_CTRL, csc2_ctrl);
+		pxp_write(dev, HW_PXP_CSC2_COEF0, csc2_coef[0]);
+		pxp_write(dev, HW_PXP_CSC2_COEF1, csc2_coef[1]);
+		pxp_write(dev, HW_PXP_CSC2_COEF2, csc2_coef[2]);
+		pxp_write(dev, HW_PXP_CSC2_COEF3, csc2_coef[3]);
+		pxp_write(dev, HW_PXP_CSC2_COEF4, csc2_coef[4]);
+		pxp_write(dev, HW_PXP_CSC2_COEF5, csc2_coef[5]);
 	} else {
-		writel(BM_PXP_CSC2_CTRL_BYPASS, dev->mmio + HW_PXP_CSC2_CTRL);
+		pxp_write(dev, HW_PXP_CSC2_CTRL, BM_PXP_CSC2_CTRL_BYPASS);
 	}
 }
 
@@ -810,8 +820,8 @@ static void pxp_set_data_path(struct pxp_ctx *ctx)
 	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(3);
 	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(3);
 
-	writel(ctrl0, dev->mmio + HW_PXP_DATA_PATH_CTRL0);
-	writel(ctrl1, dev->mmio + HW_PXP_DATA_PATH_CTRL1);
+	pxp_write(dev, HW_PXP_DATA_PATH_CTRL0, ctrl0);
+	pxp_write(dev, HW_PXP_DATA_PATH_CTRL1, ctrl1);
 }
 
 static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
@@ -967,48 +977,48 @@ static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
 		   BF_PXP_PS_SCALE_XSCALE(xscale);
 	ps_offset = BF_PXP_PS_OFFSET_YOFFSET(0) | BF_PXP_PS_OFFSET_XOFFSET(0);
 
-	writel(ctrl, dev->mmio + HW_PXP_CTRL);
+	pxp_write(dev, HW_PXP_CTRL, ctrl);
 	/* skip STAT */
-	writel(out_ctrl, dev->mmio + HW_PXP_OUT_CTRL);
-	writel(out_buf, dev->mmio + HW_PXP_OUT_BUF);
-	writel(out_buf2, dev->mmio + HW_PXP_OUT_BUF2);
-	writel(out_pitch, dev->mmio + HW_PXP_OUT_PITCH);
-	writel(out_lrc, dev->mmio + HW_PXP_OUT_LRC);
-	writel(out_ps_ulc, dev->mmio + HW_PXP_OUT_PS_ULC);
-	writel(out_ps_lrc, dev->mmio + HW_PXP_OUT_PS_LRC);
-	writel(as_ulc, dev->mmio + HW_PXP_OUT_AS_ULC);
-	writel(as_lrc, dev->mmio + HW_PXP_OUT_AS_LRC);
-	writel(ps_ctrl, dev->mmio + HW_PXP_PS_CTRL);
-	writel(ps_buf, dev->mmio + HW_PXP_PS_BUF);
-	writel(ps_ubuf, dev->mmio + HW_PXP_PS_UBUF);
-	writel(ps_vbuf, dev->mmio + HW_PXP_PS_VBUF);
-	writel(ps_pitch, dev->mmio + HW_PXP_PS_PITCH);
-	writel(0x00ffffff, dev->mmio + HW_PXP_PS_BACKGROUND_0);
-	writel(ps_scale, dev->mmio + HW_PXP_PS_SCALE);
-	writel(ps_offset, dev->mmio + HW_PXP_PS_OFFSET);
+	pxp_write(dev, HW_PXP_OUT_CTRL, out_ctrl);
+	pxp_write(dev, HW_PXP_OUT_BUF, out_buf);
+	pxp_write(dev, HW_PXP_OUT_BUF2, out_buf2);
+	pxp_write(dev, HW_PXP_OUT_PITCH, out_pitch);
+	pxp_write(dev, HW_PXP_OUT_LRC, out_lrc);
+	pxp_write(dev, HW_PXP_OUT_PS_ULC, out_ps_ulc);
+	pxp_write(dev, HW_PXP_OUT_PS_LRC, out_ps_lrc);
+	pxp_write(dev, HW_PXP_OUT_AS_ULC, as_ulc);
+	pxp_write(dev, HW_PXP_OUT_AS_LRC, as_lrc);
+	pxp_write(dev, HW_PXP_PS_CTRL, ps_ctrl);
+	pxp_write(dev, HW_PXP_PS_BUF, ps_buf);
+	pxp_write(dev, HW_PXP_PS_UBUF, ps_ubuf);
+	pxp_write(dev, HW_PXP_PS_VBUF, ps_vbuf);
+	pxp_write(dev, HW_PXP_PS_PITCH, ps_pitch);
+	pxp_write(dev, HW_PXP_PS_BACKGROUND_0, 0x00ffffff);
+	pxp_write(dev, HW_PXP_PS_SCALE, ps_scale);
+	pxp_write(dev, HW_PXP_PS_OFFSET, ps_offset);
 	/* disable processed surface color keying */
-	writel(0x00ffffff, dev->mmio + HW_PXP_PS_CLRKEYLOW_0);
-	writel(0x00000000, dev->mmio + HW_PXP_PS_CLRKEYHIGH_0);
+	pxp_write(dev, HW_PXP_PS_CLRKEYLOW_0, 0x00ffffff);
+	pxp_write(dev, HW_PXP_PS_CLRKEYHIGH_0, 0x00000000);
 
 	/* disable alpha surface color keying */
-	writel(0x00ffffff, dev->mmio + HW_PXP_AS_CLRKEYLOW_0);
-	writel(0x00000000, dev->mmio + HW_PXP_AS_CLRKEYHIGH_0);
+	pxp_write(dev, HW_PXP_AS_CLRKEYLOW_0, 0x00ffffff);
+	pxp_write(dev, HW_PXP_AS_CLRKEYHIGH_0, 0x00000000);
 
 	/* setup CSC */
 	pxp_setup_csc(ctx);
 
 	/* bypass LUT */
-	writel(BM_PXP_LUT_CTRL_BYPASS, dev->mmio + HW_PXP_LUT_CTRL);
+	pxp_write(dev, HW_PXP_LUT_CTRL, BM_PXP_LUT_CTRL_BYPASS);
 
 	pxp_set_data_path(ctx);
 
-	writel(0xffff, dev->mmio + HW_PXP_IRQ_MASK);
+	pxp_write(dev, HW_PXP_IRQ_MASK, 0xffff);
 
 	/* ungate, enable PS/AS/OUT and PXP operation */
-	writel(BM_PXP_CTRL_IRQ_ENABLE, dev->mmio + HW_PXP_CTRL_SET);
-	writel(BM_PXP_CTRL_ENABLE | BM_PXP_CTRL_ENABLE_CSC2 |
-	       BM_PXP_CTRL_ENABLE_ROTATE0 |
-	       BM_PXP_CTRL_ENABLE_PS_AS_OUT, dev->mmio + HW_PXP_CTRL_SET);
+	pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_IRQ_ENABLE);
+	pxp_write(dev, HW_PXP_CTRL_SET,
+		  BM_PXP_CTRL_ENABLE | BM_PXP_CTRL_ENABLE_CSC2 |
+		  BM_PXP_CTRL_ENABLE_ROTATE0 | BM_PXP_CTRL_ENABLE_PS_AS_OUT);
 
 	return 0;
 }
@@ -1081,23 +1091,23 @@ static irqreturn_t pxp_irq_handler(int irq, void *dev_id)
 	struct pxp_dev *dev = dev_id;
 	u32 stat;
 
-	stat = readl(dev->mmio + HW_PXP_STAT);
+	stat = pxp_read(dev, HW_PXP_STAT);
 
 	if (stat & BM_PXP_STAT_IRQ0) {
 		/* we expect x = 0, y = height, irq0 = 1 */
 		if (stat & ~(BM_PXP_STAT_BLOCKX | BM_PXP_STAT_BLOCKY |
 			     BM_PXP_STAT_IRQ0))
 			dprintk(dev, "%s: stat = 0x%08x\n", __func__, stat);
-		writel(BM_PXP_STAT_IRQ0, dev->mmio + HW_PXP_STAT_CLR);
+		pxp_write(dev, HW_PXP_STAT_CLR, BM_PXP_STAT_IRQ0);
 
 		pxp_job_finish(dev);
 	} else {
-		u32 irq = readl(dev->mmio + HW_PXP_IRQ);
+		u32 irq = pxp_read(dev, HW_PXP_IRQ);
 
 		dprintk(dev, "%s: stat = 0x%08x\n", __func__, stat);
 		dprintk(dev, "%s: irq = 0x%08x\n", __func__, irq);
 
-		writel(irq, dev->mmio + HW_PXP_IRQ_CLR);
+		pxp_write(dev, HW_PXP_IRQ_CLR, irq);
 	}
 
 	return IRQ_HANDLED;
@@ -1741,18 +1751,18 @@ static int pxp_soft_reset(struct pxp_dev *dev)
 	int ret;
 	u32 val;
 
-	writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_CLR);
-	writel(BM_PXP_CTRL_CLKGATE, dev->mmio + HW_PXP_CTRL_CLR);
+	pxp_write(dev, HW_PXP_CTRL_CLR, BM_PXP_CTRL_SFTRST);
+	pxp_write(dev, HW_PXP_CTRL_CLR, BM_PXP_CTRL_CLKGATE);
 
-	writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_SET);
+	pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_SFTRST);
 
 	ret = readl_poll_timeout(dev->mmio + HW_PXP_CTRL, val,
 				 val & BM_PXP_CTRL_CLKGATE, 0, 100);
 	if (ret < 0)
 		return ret;
 
-	writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_CLR);
-	writel(BM_PXP_CTRL_CLKGATE, dev->mmio + HW_PXP_CTRL_CLR);
+	pxp_write(dev, HW_PXP_CTRL_CLR, BM_PXP_CTRL_SFTRST);
+	pxp_write(dev, HW_PXP_CTRL_CLR, BM_PXP_CTRL_CLKGATE);
 
 	return 0;
 }
@@ -1805,7 +1815,7 @@ static int pxp_probe(struct platform_device *pdev)
 		goto err_clk;
 	}
 
-	hw_version = readl(dev->mmio + HW_PXP_VERSION);
+	hw_version = pxp_read(dev, HW_PXP_VERSION);
 	dev_dbg(&pdev->dev, "PXP Version %u.%u\n",
 		PXP_VERSION_MAJOR(hw_version), PXP_VERSION_MINOR(hw_version));
 
@@ -1883,8 +1893,8 @@ static int pxp_remove(struct platform_device *pdev)
 {
 	struct pxp_dev *dev = platform_get_drvdata(pdev);
 
-	writel(BM_PXP_CTRL_CLKGATE, dev->mmio + HW_PXP_CTRL_SET);
-	writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_SET);
+	pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_CLKGATE);
+	pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_SFTRST);
 
 	clk_disable_unprepare(dev->clk);
 

-- 
2.30.2

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

* [PATCH v2 14/16] media: imx-pxp: Introduce pxp_read() and pxp_write() wrappers
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Add pxp_read() and pxp_write() functions to wrap readl() and writel()
respectively. This can be useful for debugging register accesses.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com/
- fix conflict due to removed pxp_read_version
---
 drivers/media/platform/nxp/imx-pxp.c | 118 +++++++++++++++++++----------------
 1 file changed, 64 insertions(+), 54 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index f34eba62f7d6..124d272194d1 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -253,6 +253,16 @@ static struct pxp_q_data *get_q_data(struct pxp_ctx *ctx,
 		return &ctx->q_data[V4L2_M2M_DST];
 }
 
+static inline u32 pxp_read(struct pxp_dev *dev, u32 reg)
+{
+	return readl(dev->mmio + reg);
+}
+
+static inline void pxp_write(struct pxp_dev *dev, u32 reg, u32 value)
+{
+	writel(value, dev->mmio + reg);
+}
+
 static u32 pxp_v4l2_pix_fmt_to_ps_format(u32 v4l2_pix_fmt)
 {
 	switch (v4l2_pix_fmt) {
@@ -505,11 +515,11 @@ static void pxp_setup_csc(struct pxp_ctx *ctx)
 				csc1_coef = csc1_coef_smpte240m_lim;
 		}
 
-		writel(csc1_coef[0], dev->mmio + HW_PXP_CSC1_COEF0);
-		writel(csc1_coef[1], dev->mmio + HW_PXP_CSC1_COEF1);
-		writel(csc1_coef[2], dev->mmio + HW_PXP_CSC1_COEF2);
+		pxp_write(dev, HW_PXP_CSC1_COEF0, csc1_coef[0]);
+		pxp_write(dev, HW_PXP_CSC1_COEF1, csc1_coef[1]);
+		pxp_write(dev, HW_PXP_CSC1_COEF2, csc1_coef[2]);
 	} else {
-		writel(BM_PXP_CSC1_COEF0_BYPASS, dev->mmio + HW_PXP_CSC1_COEF0);
+		pxp_write(dev, HW_PXP_CSC1_COEF0, BM_PXP_CSC1_COEF0_BYPASS);
 	}
 
 	if (!pxp_v4l2_pix_fmt_is_yuv(ctx->q_data[V4L2_M2M_SRC].fmt->fourcc) &&
@@ -725,15 +735,15 @@ static void pxp_setup_csc(struct pxp_ctx *ctx)
 				    BP_PXP_CSC2_CTRL_CSC_MODE;
 		}
 
-		writel(csc2_ctrl, dev->mmio + HW_PXP_CSC2_CTRL);
-		writel(csc2_coef[0], dev->mmio + HW_PXP_CSC2_COEF0);
-		writel(csc2_coef[1], dev->mmio + HW_PXP_CSC2_COEF1);
-		writel(csc2_coef[2], dev->mmio + HW_PXP_CSC2_COEF2);
-		writel(csc2_coef[3], dev->mmio + HW_PXP_CSC2_COEF3);
-		writel(csc2_coef[4], dev->mmio + HW_PXP_CSC2_COEF4);
-		writel(csc2_coef[5], dev->mmio + HW_PXP_CSC2_COEF5);
+		pxp_write(dev, HW_PXP_CSC2_CTRL, csc2_ctrl);
+		pxp_write(dev, HW_PXP_CSC2_COEF0, csc2_coef[0]);
+		pxp_write(dev, HW_PXP_CSC2_COEF1, csc2_coef[1]);
+		pxp_write(dev, HW_PXP_CSC2_COEF2, csc2_coef[2]);
+		pxp_write(dev, HW_PXP_CSC2_COEF3, csc2_coef[3]);
+		pxp_write(dev, HW_PXP_CSC2_COEF4, csc2_coef[4]);
+		pxp_write(dev, HW_PXP_CSC2_COEF5, csc2_coef[5]);
 	} else {
-		writel(BM_PXP_CSC2_CTRL_BYPASS, dev->mmio + HW_PXP_CSC2_CTRL);
+		pxp_write(dev, HW_PXP_CSC2_CTRL, BM_PXP_CSC2_CTRL_BYPASS);
 	}
 }
 
@@ -810,8 +820,8 @@ static void pxp_set_data_path(struct pxp_ctx *ctx)
 	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(3);
 	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX16_SEL(3);
 
-	writel(ctrl0, dev->mmio + HW_PXP_DATA_PATH_CTRL0);
-	writel(ctrl1, dev->mmio + HW_PXP_DATA_PATH_CTRL1);
+	pxp_write(dev, HW_PXP_DATA_PATH_CTRL0, ctrl0);
+	pxp_write(dev, HW_PXP_DATA_PATH_CTRL1, ctrl1);
 }
 
 static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
@@ -967,48 +977,48 @@ static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
 		   BF_PXP_PS_SCALE_XSCALE(xscale);
 	ps_offset = BF_PXP_PS_OFFSET_YOFFSET(0) | BF_PXP_PS_OFFSET_XOFFSET(0);
 
-	writel(ctrl, dev->mmio + HW_PXP_CTRL);
+	pxp_write(dev, HW_PXP_CTRL, ctrl);
 	/* skip STAT */
-	writel(out_ctrl, dev->mmio + HW_PXP_OUT_CTRL);
-	writel(out_buf, dev->mmio + HW_PXP_OUT_BUF);
-	writel(out_buf2, dev->mmio + HW_PXP_OUT_BUF2);
-	writel(out_pitch, dev->mmio + HW_PXP_OUT_PITCH);
-	writel(out_lrc, dev->mmio + HW_PXP_OUT_LRC);
-	writel(out_ps_ulc, dev->mmio + HW_PXP_OUT_PS_ULC);
-	writel(out_ps_lrc, dev->mmio + HW_PXP_OUT_PS_LRC);
-	writel(as_ulc, dev->mmio + HW_PXP_OUT_AS_ULC);
-	writel(as_lrc, dev->mmio + HW_PXP_OUT_AS_LRC);
-	writel(ps_ctrl, dev->mmio + HW_PXP_PS_CTRL);
-	writel(ps_buf, dev->mmio + HW_PXP_PS_BUF);
-	writel(ps_ubuf, dev->mmio + HW_PXP_PS_UBUF);
-	writel(ps_vbuf, dev->mmio + HW_PXP_PS_VBUF);
-	writel(ps_pitch, dev->mmio + HW_PXP_PS_PITCH);
-	writel(0x00ffffff, dev->mmio + HW_PXP_PS_BACKGROUND_0);
-	writel(ps_scale, dev->mmio + HW_PXP_PS_SCALE);
-	writel(ps_offset, dev->mmio + HW_PXP_PS_OFFSET);
+	pxp_write(dev, HW_PXP_OUT_CTRL, out_ctrl);
+	pxp_write(dev, HW_PXP_OUT_BUF, out_buf);
+	pxp_write(dev, HW_PXP_OUT_BUF2, out_buf2);
+	pxp_write(dev, HW_PXP_OUT_PITCH, out_pitch);
+	pxp_write(dev, HW_PXP_OUT_LRC, out_lrc);
+	pxp_write(dev, HW_PXP_OUT_PS_ULC, out_ps_ulc);
+	pxp_write(dev, HW_PXP_OUT_PS_LRC, out_ps_lrc);
+	pxp_write(dev, HW_PXP_OUT_AS_ULC, as_ulc);
+	pxp_write(dev, HW_PXP_OUT_AS_LRC, as_lrc);
+	pxp_write(dev, HW_PXP_PS_CTRL, ps_ctrl);
+	pxp_write(dev, HW_PXP_PS_BUF, ps_buf);
+	pxp_write(dev, HW_PXP_PS_UBUF, ps_ubuf);
+	pxp_write(dev, HW_PXP_PS_VBUF, ps_vbuf);
+	pxp_write(dev, HW_PXP_PS_PITCH, ps_pitch);
+	pxp_write(dev, HW_PXP_PS_BACKGROUND_0, 0x00ffffff);
+	pxp_write(dev, HW_PXP_PS_SCALE, ps_scale);
+	pxp_write(dev, HW_PXP_PS_OFFSET, ps_offset);
 	/* disable processed surface color keying */
-	writel(0x00ffffff, dev->mmio + HW_PXP_PS_CLRKEYLOW_0);
-	writel(0x00000000, dev->mmio + HW_PXP_PS_CLRKEYHIGH_0);
+	pxp_write(dev, HW_PXP_PS_CLRKEYLOW_0, 0x00ffffff);
+	pxp_write(dev, HW_PXP_PS_CLRKEYHIGH_0, 0x00000000);
 
 	/* disable alpha surface color keying */
-	writel(0x00ffffff, dev->mmio + HW_PXP_AS_CLRKEYLOW_0);
-	writel(0x00000000, dev->mmio + HW_PXP_AS_CLRKEYHIGH_0);
+	pxp_write(dev, HW_PXP_AS_CLRKEYLOW_0, 0x00ffffff);
+	pxp_write(dev, HW_PXP_AS_CLRKEYHIGH_0, 0x00000000);
 
 	/* setup CSC */
 	pxp_setup_csc(ctx);
 
 	/* bypass LUT */
-	writel(BM_PXP_LUT_CTRL_BYPASS, dev->mmio + HW_PXP_LUT_CTRL);
+	pxp_write(dev, HW_PXP_LUT_CTRL, BM_PXP_LUT_CTRL_BYPASS);
 
 	pxp_set_data_path(ctx);
 
-	writel(0xffff, dev->mmio + HW_PXP_IRQ_MASK);
+	pxp_write(dev, HW_PXP_IRQ_MASK, 0xffff);
 
 	/* ungate, enable PS/AS/OUT and PXP operation */
-	writel(BM_PXP_CTRL_IRQ_ENABLE, dev->mmio + HW_PXP_CTRL_SET);
-	writel(BM_PXP_CTRL_ENABLE | BM_PXP_CTRL_ENABLE_CSC2 |
-	       BM_PXP_CTRL_ENABLE_ROTATE0 |
-	       BM_PXP_CTRL_ENABLE_PS_AS_OUT, dev->mmio + HW_PXP_CTRL_SET);
+	pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_IRQ_ENABLE);
+	pxp_write(dev, HW_PXP_CTRL_SET,
+		  BM_PXP_CTRL_ENABLE | BM_PXP_CTRL_ENABLE_CSC2 |
+		  BM_PXP_CTRL_ENABLE_ROTATE0 | BM_PXP_CTRL_ENABLE_PS_AS_OUT);
 
 	return 0;
 }
@@ -1081,23 +1091,23 @@ static irqreturn_t pxp_irq_handler(int irq, void *dev_id)
 	struct pxp_dev *dev = dev_id;
 	u32 stat;
 
-	stat = readl(dev->mmio + HW_PXP_STAT);
+	stat = pxp_read(dev, HW_PXP_STAT);
 
 	if (stat & BM_PXP_STAT_IRQ0) {
 		/* we expect x = 0, y = height, irq0 = 1 */
 		if (stat & ~(BM_PXP_STAT_BLOCKX | BM_PXP_STAT_BLOCKY |
 			     BM_PXP_STAT_IRQ0))
 			dprintk(dev, "%s: stat = 0x%08x\n", __func__, stat);
-		writel(BM_PXP_STAT_IRQ0, dev->mmio + HW_PXP_STAT_CLR);
+		pxp_write(dev, HW_PXP_STAT_CLR, BM_PXP_STAT_IRQ0);
 
 		pxp_job_finish(dev);
 	} else {
-		u32 irq = readl(dev->mmio + HW_PXP_IRQ);
+		u32 irq = pxp_read(dev, HW_PXP_IRQ);
 
 		dprintk(dev, "%s: stat = 0x%08x\n", __func__, stat);
 		dprintk(dev, "%s: irq = 0x%08x\n", __func__, irq);
 
-		writel(irq, dev->mmio + HW_PXP_IRQ_CLR);
+		pxp_write(dev, HW_PXP_IRQ_CLR, irq);
 	}
 
 	return IRQ_HANDLED;
@@ -1741,18 +1751,18 @@ static int pxp_soft_reset(struct pxp_dev *dev)
 	int ret;
 	u32 val;
 
-	writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_CLR);
-	writel(BM_PXP_CTRL_CLKGATE, dev->mmio + HW_PXP_CTRL_CLR);
+	pxp_write(dev, HW_PXP_CTRL_CLR, BM_PXP_CTRL_SFTRST);
+	pxp_write(dev, HW_PXP_CTRL_CLR, BM_PXP_CTRL_CLKGATE);
 
-	writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_SET);
+	pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_SFTRST);
 
 	ret = readl_poll_timeout(dev->mmio + HW_PXP_CTRL, val,
 				 val & BM_PXP_CTRL_CLKGATE, 0, 100);
 	if (ret < 0)
 		return ret;
 
-	writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_CLR);
-	writel(BM_PXP_CTRL_CLKGATE, dev->mmio + HW_PXP_CTRL_CLR);
+	pxp_write(dev, HW_PXP_CTRL_CLR, BM_PXP_CTRL_SFTRST);
+	pxp_write(dev, HW_PXP_CTRL_CLR, BM_PXP_CTRL_CLKGATE);
 
 	return 0;
 }
@@ -1805,7 +1815,7 @@ static int pxp_probe(struct platform_device *pdev)
 		goto err_clk;
 	}
 
-	hw_version = readl(dev->mmio + HW_PXP_VERSION);
+	hw_version = pxp_read(dev, HW_PXP_VERSION);
 	dev_dbg(&pdev->dev, "PXP Version %u.%u\n",
 		PXP_VERSION_MAJOR(hw_version), PXP_VERSION_MINOR(hw_version));
 
@@ -1883,8 +1893,8 @@ static int pxp_remove(struct platform_device *pdev)
 {
 	struct pxp_dev *dev = platform_get_drvdata(pdev);
 
-	writel(BM_PXP_CTRL_CLKGATE, dev->mmio + HW_PXP_CTRL_SET);
-	writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_SET);
+	pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_CLKGATE);
+	pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_SFTRST);
 
 	clk_disable_unprepare(dev->clk);
 

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 15/16] media: imx-pxp: Use non-threaded IRQ
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

There's no need to use threaded IRQs with the PXP, as the interrupt
handler doesn't need to sleep and doesn't perform any time-consuming
operation. Switch to regular IRQ handler.

This fixes lockups of the PXP noticed on i.MX7, where the PXP would stop
generating interrupts after a variable number of frames (from a few
dozens to a few hundreds). The root cause is however unknown.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changes since v2:

- Drop IRQF_TRIGGER_HIGH
- pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com/
---
 drivers/media/platform/nxp/imx-pxp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 124d272194d1..b8a7e49cbc08 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -1798,8 +1798,8 @@ static int pxp_probe(struct platform_device *pdev)
 
 	spin_lock_init(&dev->irqlock);
 
-	ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, pxp_irq_handler,
-			IRQF_ONESHOT, dev_name(&pdev->dev), dev);
+	ret = devm_request_irq(&pdev->dev, irq, pxp_irq_handler, 0,
+			       dev_name(&pdev->dev), dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to request irq: %d\n", ret);
 		return ret;

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 15/16] media: imx-pxp: Use non-threaded IRQ
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

There's no need to use threaded IRQs with the PXP, as the interrupt
handler doesn't need to sleep and doesn't perform any time-consuming
operation. Switch to regular IRQ handler.

This fixes lockups of the PXP noticed on i.MX7, where the PXP would stop
generating interrupts after a variable number of frames (from a few
dozens to a few hundreds). The root cause is however unknown.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changes since v2:

- Drop IRQF_TRIGGER_HIGH
- pick from https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com/
---
 drivers/media/platform/nxp/imx-pxp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index 124d272194d1..b8a7e49cbc08 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -1798,8 +1798,8 @@ static int pxp_probe(struct platform_device *pdev)
 
 	spin_lock_init(&dev->irqlock);
 
-	ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, pxp_irq_handler,
-			IRQF_ONESHOT, dev_name(&pdev->dev), dev);
+	ret = devm_request_irq(&pdev->dev, irq, pxp_irq_handler, 0,
+			       dev_name(&pdev->dev), dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to request irq: %d\n", ret);
 		return ret;

-- 
2.30.2

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

* [PATCH v2 16/16] media: imx-pxp: convert to regmap
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-13  9:54   ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

Replace the readl and writel with regmap to ease debugging the registers
from userspace.

Suggested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- new patch
---
 drivers/media/platform/nxp/imx-pxp.c | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index b8a7e49cbc08..f2e9608a7d2d 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -21,6 +21,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/regmap.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 
@@ -176,6 +177,13 @@ enum {
 	V4L2_M2M_DST = 1,
 };
 
+static const struct regmap_config pxp_regmap_config = {
+	.reg_bits = 32,
+	.reg_stride = 4,
+	.val_bits = 32,
+	.max_register = HW_PXP_VERSION,
+};
+
 static struct pxp_fmt *find_format(unsigned int pixelformat)
 {
 	struct pxp_fmt *fmt;
@@ -207,7 +215,7 @@ struct pxp_dev {
 #endif
 
 	struct clk		*clk;
-	void __iomem		*mmio;
+	struct regmap		*regmap;
 
 	const struct pxp_pdata	*pdata;
 
@@ -255,12 +263,16 @@ static struct pxp_q_data *get_q_data(struct pxp_ctx *ctx,
 
 static inline u32 pxp_read(struct pxp_dev *dev, u32 reg)
 {
-	return readl(dev->mmio + reg);
+	u32 value;
+
+	regmap_read(dev->regmap, reg, &value);
+
+	return value;
 }
 
 static inline void pxp_write(struct pxp_dev *dev, u32 reg, u32 value)
 {
-	writel(value, dev->mmio + reg);
+	regmap_write(dev->regmap, reg, value);
 }
 
 static u32 pxp_v4l2_pix_fmt_to_ps_format(u32 v4l2_pix_fmt)
@@ -1756,8 +1768,8 @@ static int pxp_soft_reset(struct pxp_dev *dev)
 
 	pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_SFTRST);
 
-	ret = readl_poll_timeout(dev->mmio + HW_PXP_CTRL, val,
-				 val & BM_PXP_CTRL_CLKGATE, 0, 100);
+	ret = regmap_read_poll_timeout(dev->regmap, HW_PXP_CTRL, val,
+				       val & BM_PXP_CTRL_CLKGATE, 0, 100);
 	if (ret < 0)
 		return ret;
 
@@ -1774,6 +1786,7 @@ static int pxp_probe(struct platform_device *pdev)
 	int irq;
 	u32 hw_version;
 	int ret;
+	void __iomem *mmio;
 
 	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
 	if (!dev)
@@ -1788,9 +1801,11 @@ static int pxp_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	dev->mmio = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(dev->mmio))
-		return PTR_ERR(dev->mmio);
+	mmio = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(mmio))
+		return PTR_ERR(mmio);
+	dev->regmap = devm_regmap_init_mmio(&pdev->dev, mmio,
+					    &pxp_regmap_config);
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)

-- 
2.30.2

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

* [PATCH v2 16/16] media: imx-pxp: convert to regmap
@ 2023-01-13  9:54   ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13  9:54 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Michael Tretter, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

Replace the readl and writel with regmap to ease debugging the registers
from userspace.

Suggested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog

v2:

- new patch
---
 drivers/media/platform/nxp/imx-pxp.c | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index b8a7e49cbc08..f2e9608a7d2d 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -21,6 +21,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/regmap.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 
@@ -176,6 +177,13 @@ enum {
 	V4L2_M2M_DST = 1,
 };
 
+static const struct regmap_config pxp_regmap_config = {
+	.reg_bits = 32,
+	.reg_stride = 4,
+	.val_bits = 32,
+	.max_register = HW_PXP_VERSION,
+};
+
 static struct pxp_fmt *find_format(unsigned int pixelformat)
 {
 	struct pxp_fmt *fmt;
@@ -207,7 +215,7 @@ struct pxp_dev {
 #endif
 
 	struct clk		*clk;
-	void __iomem		*mmio;
+	struct regmap		*regmap;
 
 	const struct pxp_pdata	*pdata;
 
@@ -255,12 +263,16 @@ static struct pxp_q_data *get_q_data(struct pxp_ctx *ctx,
 
 static inline u32 pxp_read(struct pxp_dev *dev, u32 reg)
 {
-	return readl(dev->mmio + reg);
+	u32 value;
+
+	regmap_read(dev->regmap, reg, &value);
+
+	return value;
 }
 
 static inline void pxp_write(struct pxp_dev *dev, u32 reg, u32 value)
 {
-	writel(value, dev->mmio + reg);
+	regmap_write(dev->regmap, reg, value);
 }
 
 static u32 pxp_v4l2_pix_fmt_to_ps_format(u32 v4l2_pix_fmt)
@@ -1756,8 +1768,8 @@ static int pxp_soft_reset(struct pxp_dev *dev)
 
 	pxp_write(dev, HW_PXP_CTRL_SET, BM_PXP_CTRL_SFTRST);
 
-	ret = readl_poll_timeout(dev->mmio + HW_PXP_CTRL, val,
-				 val & BM_PXP_CTRL_CLKGATE, 0, 100);
+	ret = regmap_read_poll_timeout(dev->regmap, HW_PXP_CTRL, val,
+				       val & BM_PXP_CTRL_CLKGATE, 0, 100);
 	if (ret < 0)
 		return ret;
 
@@ -1774,6 +1786,7 @@ static int pxp_probe(struct platform_device *pdev)
 	int irq;
 	u32 hw_version;
 	int ret;
+	void __iomem *mmio;
 
 	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
 	if (!dev)
@@ -1788,9 +1801,11 @@ static int pxp_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	dev->mmio = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(dev->mmio))
-		return PTR_ERR(dev->mmio);
+	mmio = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(mmio))
+		return PTR_ERR(mmio);
+	dev->regmap = devm_regmap_init_mmio(&pdev->dev, mmio,
+					    &pxp_regmap_config);
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)

-- 
2.30.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 10:41     ` Laurent Pinchart
  -1 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-13 10:41 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel

Hi Michael,

Thank you for the patch.

On Fri, Jan 13, 2023 at 10:54:07AM +0100, Michael Tretter wrote:
> Convert the bindings of the Freescale Pixel Pipeline to YAML.
> 
> The conversion drops the previously listed compatibles for several SoCs.
> It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> on the existing SoCs and would allow to reuse the already defined
> compatibles. The missing compatibles should be brought back when the
> support for the PXP on these SoCs is added.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> Changelog:
> 
> v2:
> 
> - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> - restrict number of interrupts per variant
> - cleanup syntax
> ---
>  .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml | 82 ++++++++++++++++++++++
>  .../devicetree/bindings/media/fsl-pxp.txt          | 26 -------
>  2 files changed, 82 insertions(+), 26 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> new file mode 100644
> index 000000000000..c1232689a261
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> @@ -0,0 +1,82 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/fsl,imx6ull-pxp.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale Pixel Pipeline
> +
> +maintainers:
> +  - Philipp Zabel <p.zabel@pengutronix.de>
> +  - Michael Tretter <m.tretter@pengutronix.de>
> +
> +description:
> +  The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
> +  that supports scaling, colorspace conversion, alpha blending, rotation, and
> +  pixel conversion via lookup table. Different versions are present on various
> +  i.MX SoCs from i.MX23 to i.MX7.
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: fsl,imx6ul-pxp
> +      - const: fsl,imx6ull-pxp
> +      - const: fsl,imx7d-pxp
> +      - items:
> +          - enum:
> +              - fsl,imx6sll-pxp
> +              - fsl,imx6sx-pxp
> +          - const: fsl,imx6ull-pxp
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    minItems: 1
> +    maxItems: 2
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: axi
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - fsl,imx6sx-pxp
> +    then:
> +      properties:
> +        interrupts:
> +          numItems: 1
> +    else:
> +      properties:
> +        interrupts:
> +          numItems: 2
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/imx6ul-clock.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    pxp: pxp@21cc000 {
> +        compatible = "fsl,imx6ull-pxp";
> +        reg = <0x021cc000 0x4000>;
> +        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> +                     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
> +        clock-names = "axi";
> +        clocks = <&clks IMX6UL_CLK_PXP>;
> +    };
> diff --git a/Documentation/devicetree/bindings/media/fsl-pxp.txt b/Documentation/devicetree/bindings/media/fsl-pxp.txt
> deleted file mode 100644
> index f8090e06530d..000000000000
> --- a/Documentation/devicetree/bindings/media/fsl-pxp.txt
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -Freescale Pixel Pipeline
> -========================
> -
> -The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
> -that supports scaling, colorspace conversion, alpha blending, rotation, and
> -pixel conversion via lookup table. Different versions are present on various
> -i.MX SoCs from i.MX23 to i.MX7.
> -
> -Required properties:
> -- compatible: should be "fsl,<soc>-pxp", where SoC can be one of imx23, imx28,
> -  imx6dl, imx6sl, imx6sll, imx6ul, imx6sx, imx6ull, or imx7d.
> -- reg: the register base and size for the device registers
> -- interrupts: the PXP interrupt, two interrupts for imx6ull and imx7d.
> -- clock-names: should be "axi"
> -- clocks: the PXP AXI clock
> -
> -Example:
> -
> -pxp@21cc000 {
> -	compatible = "fsl,imx6ull-pxp";
> -	reg = <0x021cc000 0x4000>;
> -	interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> -		     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
> -	clock-names = "axi";
> -	clocks = <&clks IMX6UL_CLK_PXP>;
> -};
> 

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
@ 2023-01-13 10:41     ` Laurent Pinchart
  0 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-13 10:41 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel

Hi Michael,

Thank you for the patch.

On Fri, Jan 13, 2023 at 10:54:07AM +0100, Michael Tretter wrote:
> Convert the bindings of the Freescale Pixel Pipeline to YAML.
> 
> The conversion drops the previously listed compatibles for several SoCs.
> It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> on the existing SoCs and would allow to reuse the already defined
> compatibles. The missing compatibles should be brought back when the
> support for the PXP on these SoCs is added.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> Changelog:
> 
> v2:
> 
> - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> - restrict number of interrupts per variant
> - cleanup syntax
> ---
>  .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml | 82 ++++++++++++++++++++++
>  .../devicetree/bindings/media/fsl-pxp.txt          | 26 -------
>  2 files changed, 82 insertions(+), 26 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> new file mode 100644
> index 000000000000..c1232689a261
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> @@ -0,0 +1,82 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/fsl,imx6ull-pxp.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale Pixel Pipeline
> +
> +maintainers:
> +  - Philipp Zabel <p.zabel@pengutronix.de>
> +  - Michael Tretter <m.tretter@pengutronix.de>
> +
> +description:
> +  The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
> +  that supports scaling, colorspace conversion, alpha blending, rotation, and
> +  pixel conversion via lookup table. Different versions are present on various
> +  i.MX SoCs from i.MX23 to i.MX7.
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: fsl,imx6ul-pxp
> +      - const: fsl,imx6ull-pxp
> +      - const: fsl,imx7d-pxp
> +      - items:
> +          - enum:
> +              - fsl,imx6sll-pxp
> +              - fsl,imx6sx-pxp
> +          - const: fsl,imx6ull-pxp
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    minItems: 1
> +    maxItems: 2
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: axi
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - fsl,imx6sx-pxp
> +    then:
> +      properties:
> +        interrupts:
> +          numItems: 1
> +    else:
> +      properties:
> +        interrupts:
> +          numItems: 2
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/imx6ul-clock.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    pxp: pxp@21cc000 {
> +        compatible = "fsl,imx6ull-pxp";
> +        reg = <0x021cc000 0x4000>;
> +        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> +                     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
> +        clock-names = "axi";
> +        clocks = <&clks IMX6UL_CLK_PXP>;
> +    };
> diff --git a/Documentation/devicetree/bindings/media/fsl-pxp.txt b/Documentation/devicetree/bindings/media/fsl-pxp.txt
> deleted file mode 100644
> index f8090e06530d..000000000000
> --- a/Documentation/devicetree/bindings/media/fsl-pxp.txt
> +++ /dev/null
> @@ -1,26 +0,0 @@
> -Freescale Pixel Pipeline
> -========================
> -
> -The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
> -that supports scaling, colorspace conversion, alpha blending, rotation, and
> -pixel conversion via lookup table. Different versions are present on various
> -i.MX SoCs from i.MX23 to i.MX7.
> -
> -Required properties:
> -- compatible: should be "fsl,<soc>-pxp", where SoC can be one of imx23, imx28,
> -  imx6dl, imx6sl, imx6sll, imx6ul, imx6sx, imx6ull, or imx7d.
> -- reg: the register base and size for the device registers
> -- interrupts: the PXP interrupt, two interrupts for imx6ull and imx7d.
> -- clock-names: should be "axi"
> -- clocks: the PXP AXI clock
> -
> -Example:
> -
> -pxp@21cc000 {
> -	compatible = "fsl,imx6ull-pxp";
> -	reg = <0x021cc000 0x4000>;
> -	interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> -		     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
> -	clock-names = "axi";
> -	clocks = <&clks IMX6UL_CLK_PXP>;
> -};
> 

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 02/16] media: imx-pxp: detect PXP version
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 10:44     ` Laurent Pinchart
  -1 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-13 10:44 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel

Hi Michael,

Thank you for the patch.

On Fri, Jan 13, 2023 at 10:54:08AM +0100, Michael Tretter wrote:
> Different versions of the Pixel Pipeline have different blocks and their
> routing may be different. Read the PXP_HW_VERSION register to determine
> the version of the PXP and print it to the log for debugging purposes.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> Changelog:
> 
> v2:
> 
> - reduce debug level for version to dev_dbg
> - drop hw_version field from struct pxp_dev
> ---
>  drivers/media/platform/nxp/imx-pxp.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
> index 689ae5e6ac62..5b671c6e5cae 100644
> --- a/drivers/media/platform/nxp/imx-pxp.c
> +++ b/drivers/media/platform/nxp/imx-pxp.c
> @@ -10,6 +10,7 @@
>   * Pawel Osciak, <pawel@osciak.com>
>   * Marek Szyprowski, <m.szyprowski@samsung.com>
>   */
> +#include <linux/bitfield.h>
>  #include <linux/clk.h>
>  #include <linux/delay.h>
>  #include <linux/dma-mapping.h>
> @@ -52,6 +53,11 @@ MODULE_PARM_DESC(debug, "activates debug info");
>  #define MEM2MEM_HFLIP	(1 << 0)
>  #define MEM2MEM_VFLIP	(1 << 1)
>  
> +#define PXP_VERSION_MAJOR(version) \
> +	FIELD_GET(BM_PXP_VERSION_MAJOR, version)
> +#define PXP_VERSION_MINOR(version) \
> +	FIELD_GET(BM_PXP_VERSION_MINOR, version)
> +
>  #define dprintk(dev, fmt, arg...) \
>  	v4l2_dbg(1, debug, &dev->v4l2_dev, "%s: " fmt, __func__, ## arg)
>  
> @@ -1665,6 +1671,7 @@ static int pxp_probe(struct platform_device *pdev)
>  	struct pxp_dev *dev;
>  	struct video_device *vfd;
>  	int irq;
> +	u32 hw_version;

I'd move this one line up. Up to you, with or without that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  	int ret;
>  
>  	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> @@ -1705,6 +1712,10 @@ static int pxp_probe(struct platform_device *pdev)
>  		goto err_clk;
>  	}
>  
> +	hw_version = readl(dev->mmio + HW_PXP_VERSION);
> +	dev_dbg(&pdev->dev, "PXP Version %u.%u\n",
> +		PXP_VERSION_MAJOR(hw_version), PXP_VERSION_MINOR(hw_version));
> +
>  	ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
>  	if (ret)
>  		goto err_clk;
> 

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 02/16] media: imx-pxp: detect PXP version
@ 2023-01-13 10:44     ` Laurent Pinchart
  0 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-13 10:44 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel

Hi Michael,

Thank you for the patch.

On Fri, Jan 13, 2023 at 10:54:08AM +0100, Michael Tretter wrote:
> Different versions of the Pixel Pipeline have different blocks and their
> routing may be different. Read the PXP_HW_VERSION register to determine
> the version of the PXP and print it to the log for debugging purposes.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> Changelog:
> 
> v2:
> 
> - reduce debug level for version to dev_dbg
> - drop hw_version field from struct pxp_dev
> ---
>  drivers/media/platform/nxp/imx-pxp.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
> index 689ae5e6ac62..5b671c6e5cae 100644
> --- a/drivers/media/platform/nxp/imx-pxp.c
> +++ b/drivers/media/platform/nxp/imx-pxp.c
> @@ -10,6 +10,7 @@
>   * Pawel Osciak, <pawel@osciak.com>
>   * Marek Szyprowski, <m.szyprowski@samsung.com>
>   */
> +#include <linux/bitfield.h>
>  #include <linux/clk.h>
>  #include <linux/delay.h>
>  #include <linux/dma-mapping.h>
> @@ -52,6 +53,11 @@ MODULE_PARM_DESC(debug, "activates debug info");
>  #define MEM2MEM_HFLIP	(1 << 0)
>  #define MEM2MEM_VFLIP	(1 << 1)
>  
> +#define PXP_VERSION_MAJOR(version) \
> +	FIELD_GET(BM_PXP_VERSION_MAJOR, version)
> +#define PXP_VERSION_MINOR(version) \
> +	FIELD_GET(BM_PXP_VERSION_MINOR, version)
> +
>  #define dprintk(dev, fmt, arg...) \
>  	v4l2_dbg(1, debug, &dev->v4l2_dev, "%s: " fmt, __func__, ## arg)
>  
> @@ -1665,6 +1671,7 @@ static int pxp_probe(struct platform_device *pdev)
>  	struct pxp_dev *dev;
>  	struct video_device *vfd;
>  	int irq;
> +	u32 hw_version;

I'd move this one line up. Up to you, with or without that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  	int ret;
>  
>  	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> @@ -1705,6 +1712,10 @@ static int pxp_probe(struct platform_device *pdev)
>  		goto err_clk;
>  	}
>  
> +	hw_version = readl(dev->mmio + HW_PXP_VERSION);
> +	dev_dbg(&pdev->dev, "PXP Version %u.%u\n",
> +		PXP_VERSION_MAJOR(hw_version), PXP_VERSION_MINOR(hw_version));
> +
>  	ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
>  	if (ret)
>  		goto err_clk;
> 

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Convert the bindings of the Freescale Pixel Pipeline to YAML.
> 
> The conversion drops the previously listed compatibles for several SoCs.
> It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> on the existing SoCs and would allow to reuse the already defined
> compatibles. The missing compatibles should be brought back when the
> support for the PXP on these SoCs is added.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Convert the bindings of the Freescale Pixel Pipeline to YAML.
> 
> The conversion drops the previously listed compatibles for several SoCs.
> It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> on the existing SoCs and would allow to reuse the already defined
> compatibles. The missing compatibles should be brought back when the
> support for the PXP on these SoCs is added.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 02/16] media: imx-pxp: detect PXP version
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Different versions of the Pixel Pipeline have different blocks and their
> routing may be different. Read the PXP_HW_VERSION register to determine
> the version of the PXP and print it to the log for debugging purposes.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 02/16] media: imx-pxp: detect PXP version
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Different versions of the Pixel Pipeline have different blocks and their
> routing may be different. Read the PXP_HW_VERSION register to determine
> the version of the PXP and print it to the log for debugging purposes.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 03/16] media: imx-pxp: extract helper function to setup data path
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The driver must configure the data path through the Pixel Pipeline.
> 
> Currently, the driver is using a fixed setup, but once there are
> different pipeline configurations, it is helpful to have a dedicated
> function for determining the register value for the data path.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 03/16] media: imx-pxp: extract helper function to setup data path
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The driver must configure the data path through the Pixel Pipeline.
> 
> Currently, the driver is using a fixed setup, but once there are
> different pipeline configurations, it is helpful to have a dedicated
> function for determining the register value for the data path.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 04/16] media: imx-pxp: explicitly disable unused blocks
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Various multiplexers in the pipeline are not used with the currently
> configured data path. Disable all unused multiplexers by selecting the
> "no output" (3) option.
> 
> The datasheet doesn't explicitly require this, but the PXP has been seen
> to hang after processing a few hundreds of frames otherwise.
> 
> As at it, add documentation for the multiplexers that are actually
> relevant for the data path.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 04/16] media: imx-pxp: explicitly disable unused blocks
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Various multiplexers in the pipeline are not used with the currently
> configured data path. Disable all unused multiplexers by selecting the
> "no output" (3) option.
> 
> The datasheet doesn't explicitly require this, but the PXP has been seen
> to hang after processing a few hundreds of frames otherwise.
> 
> As at it, add documentation for the multiplexers that are actually
> relevant for the data path.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 05/16] media: imx-pxp: disable LUT block
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The LUT block is always configured in bypass mode.
> 
> Take it entirely out of the pipeline by disabling it and routing the
> data path around the LUT.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 05/16] media: imx-pxp: disable LUT block
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The LUT block is always configured in bypass mode.
> 
> Take it entirely out of the pipeline by disabling it and routing the
> data path around the LUT.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 06/16] media: imx-pxp: make data_path_ctrl0 platform dependent
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Unfortunately, the PXP_HW_VERSION register reports the PXP on the i.MX7D
> and on the i.MX6ULL as version 3.0, although the PXP versions on these
> SoCs have significant differences.
> 
> Use the compatible to configure the ctrl0 register as required dependent
> on the platform.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 06/16] media: imx-pxp: make data_path_ctrl0 platform dependent
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Unfortunately, the PXP_HW_VERSION register reports the PXP on the i.MX7D
> and on the i.MX6ULL as version 3.0, although the PXP versions on these
> SoCs have significant differences.
> 
> Use the compatible to configure the ctrl0 register as required dependent
> on the platform.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 07/16] media: imx-pxp: add support for i.MX7D
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The i.MX7D needs a different data path configuration than the i.MX6ULL.
> Configure the data path as close as possible to the data path on the
> i.MX6ULL.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 07/16] media: imx-pxp: add support for i.MX7D
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The i.MX7D needs a different data path configuration than the i.MX6ULL.
> Configure the data path as close as possible to the data path on the
> i.MX6ULL.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> node to make it available.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> node to make it available.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 09/16] media: imx-pxp: Sort headers alphabetically
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Sorting headers alphabetically helps locating duplicates, and make it
> easier to figure out where to insert new headers.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 09/16] media: imx-pxp: Sort headers alphabetically
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Sorting headers alphabetically helps locating duplicates, and make it
> easier to figure out where to insert new headers.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 10/16] media: imx-pxp: Don't set bus_info manually in .querycap()
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> The v4l2_capability.bus_info field is set by the V4L2 core when left
> empty by the .querycap() handler. This is the recommended practice, in
> order to ensure bus_info coherence between drivers. Don't set it
> manually.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 10/16] media: imx-pxp: Don't set bus_info manually in .querycap()
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> The v4l2_capability.bus_info field is set by the V4L2 core when left
> empty by the .querycap() handler. This is the recommended practice, in
> order to ensure bus_info coherence between drivers. Don't set it
> manually.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 11/16] media: imx-pxp: Add media controller support
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Register a media device for the PXP, using the v4l2-mem2mem MC
> infrastructure to populate the media graph. No media device operation is
> implemented, the main use of the MC API is to allow consistent discovery
> of media devices for userspace.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 11/16] media: imx-pxp: Add media controller support
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Register a media device for the PXP, using the v4l2-mem2mem MC
> infrastructure to populate the media graph. No media device operation is
> implemented, the main use of the MC API is to allow consistent discovery
> of media devices for userspace.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 12/16] media: imx-pxp: Pass pixel format value to find_format()
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:46     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> The find_format() function looks up format information for a given pixel
> format. It takes a v4l2_format pointer, but only uses the contained
> pixel format value. To prepare it for being used by callers that don't
> have v4l2_format, modify it to take the pixel format value directly.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 12/16] media: imx-pxp: Pass pixel format value to find_format()
@ 2023-01-13 11:46     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:46 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> The find_format() function looks up format information for a given pixel
> format. It takes a v4l2_format pointer, but only uses the contained
> pixel format value. To prepare it for being used by callers that don't
> have v4l2_format, modify it to take the pixel format value directly.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 13/16] media: imx-pxp: Implement frame size enumeration
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:49     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:49 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Implement support for the VIDIOC_ENUM_FRAMESIZES ioctl.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 13/16] media: imx-pxp: Implement frame size enumeration
@ 2023-01-13 11:49     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:49 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Implement support for the VIDIOC_ENUM_FRAMESIZES ioctl.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 14/16] media: imx-pxp: Introduce pxp_read() and pxp_write() wrappers
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:50     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:50 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Add pxp_read() and pxp_write() functions to wrap readl() and writel()
> respectively. This can be useful for debugging register accesses.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 14/16] media: imx-pxp: Introduce pxp_read() and pxp_write() wrappers
@ 2023-01-13 11:50     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:50 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Add pxp_read() and pxp_write() functions to wrap readl() and writel()
> respectively. This can be useful for debugging register accesses.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 15/16] media: imx-pxp: Use non-threaded IRQ
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:52     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:52 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> There's no need to use threaded IRQs with the PXP, as the interrupt
> handler doesn't need to sleep and doesn't perform any time-consuming
> operation. Switch to regular IRQ handler.
> 
> This fixes lockups of the PXP noticed on i.MX7, where the PXP would stop
> generating interrupts after a variable number of frames (from a few
> dozens to a few hundreds). The root cause is however unknown.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 15/16] media: imx-pxp: Use non-threaded IRQ
@ 2023-01-13 11:52     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:52 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> There's no need to use threaded IRQs with the PXP, as the interrupt
> handler doesn't need to sleep and doesn't perform any time-consuming
> operation. Switch to regular IRQ handler.
> 
> This fixes lockups of the PXP noticed on i.MX7, where the PXP would stop
> generating interrupts after a variable number of frames (from a few
> dozens to a few hundreds). The root cause is however unknown.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 16/16] media: imx-pxp: convert to regmap
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:56     ` Philipp Zabel
  -1 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:56 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Replace the readl and writel with regmap to ease debugging the registers
> from userspace.
> 
> Suggested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 16/16] media: imx-pxp: convert to regmap
@ 2023-01-13 11:56     ` Philipp Zabel
  0 siblings, 0 replies; 98+ messages in thread
From: Philipp Zabel @ 2023-01-13 11:56 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fr, 2023-01-13 at 10:54 +0100, Michael Tretter wrote:
> Replace the readl and writel with regmap to ease debugging the registers
> from userspace.
> 
> Suggested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 11:56     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 98+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-13 11:56 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Philipp Zabel,
	Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On 13/01/2023 10:54, Michael Tretter wrote:
> Convert the bindings of the Freescale Pixel Pipeline to YAML.
> 
> The conversion drops the previously listed compatibles for several SoCs.
> It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> on the existing SoCs and would allow to reuse the already defined
> compatibles. The missing compatibles should be brought back when the
> support for the PXP on these SoCs is added.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> Changelog:
> 
> v2:
> 
> - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> - restrict number of interrupts per variant
> - cleanup syntax
> ---
>  .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml | 82 ++++++++++++++++++++++
>  .../devicetree/bindings/media/fsl-pxp.txt          | 26 -------
>  2 files changed, 82 insertions(+), 26 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> new file mode 100644
> index 000000000000..c1232689a261
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> @@ -0,0 +1,82 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/fsl,imx6ull-pxp.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale Pixel Pipeline
> +
> +maintainers:
> +  - Philipp Zabel <p.zabel@pengutronix.de>
> +  - Michael Tretter <m.tretter@pengutronix.de>
> +
> +description:
> +  The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
> +  that supports scaling, colorspace conversion, alpha blending, rotation, and
> +  pixel conversion via lookup table. Different versions are present on various
> +  i.MX SoCs from i.MX23 to i.MX7.
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: fsl,imx6ul-pxp
> +      - const: fsl,imx6ull-pxp
> +      - const: fsl,imx7d-pxp

These three are an enum.

> +      - items:
> +          - enum:
> +              - fsl,imx6sll-pxp
> +              - fsl,imx6sx-pxp
> +          - const: fsl,imx6ull-pxp
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    minItems: 1
> +    maxItems: 2
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: axi
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - fsl,imx6sx-pxp
> +    then:
> +      properties:
> +        interrupts:
> +          numItems: 1

That's not correct syntax... I am surprised that it works. Did you test
the bindings?


Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
@ 2023-01-13 11:56     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 98+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-13 11:56 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Philipp Zabel,
	Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On 13/01/2023 10:54, Michael Tretter wrote:
> Convert the bindings of the Freescale Pixel Pipeline to YAML.
> 
> The conversion drops the previously listed compatibles for several SoCs.
> It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> on the existing SoCs and would allow to reuse the already defined
> compatibles. The missing compatibles should be brought back when the
> support for the PXP on these SoCs is added.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> Changelog:
> 
> v2:
> 
> - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> - restrict number of interrupts per variant
> - cleanup syntax
> ---
>  .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml | 82 ++++++++++++++++++++++
>  .../devicetree/bindings/media/fsl-pxp.txt          | 26 -------
>  2 files changed, 82 insertions(+), 26 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> new file mode 100644
> index 000000000000..c1232689a261
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> @@ -0,0 +1,82 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/fsl,imx6ull-pxp.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale Pixel Pipeline
> +
> +maintainers:
> +  - Philipp Zabel <p.zabel@pengutronix.de>
> +  - Michael Tretter <m.tretter@pengutronix.de>
> +
> +description:
> +  The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
> +  that supports scaling, colorspace conversion, alpha blending, rotation, and
> +  pixel conversion via lookup table. Different versions are present on various
> +  i.MX SoCs from i.MX23 to i.MX7.
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: fsl,imx6ul-pxp
> +      - const: fsl,imx6ull-pxp
> +      - const: fsl,imx7d-pxp

These three are an enum.

> +      - items:
> +          - enum:
> +              - fsl,imx6sll-pxp
> +              - fsl,imx6sx-pxp
> +          - const: fsl,imx6ull-pxp
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    minItems: 1
> +    maxItems: 2
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: axi
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - fsl,imx6sx-pxp
> +    then:
> +      properties:
> +        interrupts:
> +          numItems: 1

That's not correct syntax... I am surprised that it works. Did you test
the bindings?


Best regards,
Krzysztof


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

* Re: [PATCH v2 06/16] media: imx-pxp: make data_path_ctrl0 platform dependent
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 12:03     ` Laurent Pinchart
  -1 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-13 12:03 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel

Hi Michael,

Thank you for the patch.

On Fri, Jan 13, 2023 at 10:54:12AM +0100, Michael Tretter wrote:
> Unfortunately, the PXP_HW_VERSION register reports the PXP on the i.MX7D
> and on the i.MX6ULL as version 3.0, although the PXP versions on these
> SoCs have significant differences.
> 
> Use the compatible to configure the ctrl0 register as required dependent
> on the platform.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> Changelog
> 
> v2:
> 
> - drop fallback for missing data_path_ctrl0
> ---
>  drivers/media/platform/nxp/imx-pxp.c | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
> index bf3be989a552..c7f8a1808516 100644
> --- a/drivers/media/platform/nxp/imx-pxp.c
> +++ b/drivers/media/platform/nxp/imx-pxp.c
> @@ -19,6 +19,7 @@
>  #include <linux/iopoll.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> +#include <linux/of_device.h>
>  #include <linux/sched.h>
>  #include <linux/slab.h>
>  
> @@ -191,6 +192,12 @@ static struct pxp_fmt *find_format(struct v4l2_format *f)
>  	return &formats[k];
>  }
>  
> +struct pxp_ctx;
> +
> +struct pxp_pdata {
> +	u32 (*data_path_ctrl0)(struct pxp_ctx *ctx);
> +};
> +
>  struct pxp_dev {
>  	struct v4l2_device	v4l2_dev;
>  	struct video_device	vfd;
> @@ -198,6 +205,8 @@ struct pxp_dev {
>  	struct clk		*clk;
>  	void __iomem		*mmio;
>  
> +	const struct pxp_pdata	*pdata;
> +
>  	atomic_t		num_inst;
>  	struct mutex		dev_mutex;
>  	spinlock_t		irqlock;
> @@ -724,7 +733,7 @@ static void pxp_setup_csc(struct pxp_ctx *ctx)
>  	}
>  }
>  
> -static u32 pxp_data_path_ctrl0(struct pxp_ctx *ctx)
> +static u32 pxp_imx6ull_data_path_ctrl0(struct pxp_ctx *ctx)
>  {
>  	u32 ctrl0;
>  
> @@ -760,7 +769,7 @@ static void pxp_set_data_path(struct pxp_ctx *ctx)
>  	u32 ctrl0;
>  	u32 ctrl1;
>  
> -	ctrl0 = pxp_data_path_ctrl0(ctx);
> +	ctrl0 = dev->pdata->data_path_ctrl0(ctx);
>  
>  	ctrl1 = 0;
>  	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(3);
> @@ -1705,6 +1714,8 @@ static int pxp_probe(struct platform_device *pdev)
>  	if (!dev)
>  		return -ENOMEM;
>  
> +	dev->pdata = of_device_get_match_data(&pdev->dev);
> +
>  	dev->clk = devm_clk_get(&pdev->dev, "axi");
>  	if (IS_ERR(dev->clk)) {
>  		ret = PTR_ERR(dev->clk);
> @@ -1804,8 +1815,12 @@ static int pxp_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct pxp_pdata pxp_imx6ull_pdata = {
> +	.data_path_ctrl0 = pxp_imx6ull_data_path_ctrl0,
> +};
> +
>  static const struct of_device_id pxp_dt_ids[] = {
> -	{ .compatible = "fsl,imx6ull-pxp", .data = NULL },
> +	{ .compatible = "fsl,imx6ull-pxp", .data = &pxp_imx6ull_pdata },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, pxp_dt_ids);

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 06/16] media: imx-pxp: make data_path_ctrl0 platform dependent
@ 2023-01-13 12:03     ` Laurent Pinchart
  0 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-13 12:03 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel

Hi Michael,

Thank you for the patch.

On Fri, Jan 13, 2023 at 10:54:12AM +0100, Michael Tretter wrote:
> Unfortunately, the PXP_HW_VERSION register reports the PXP on the i.MX7D
> and on the i.MX6ULL as version 3.0, although the PXP versions on these
> SoCs have significant differences.
> 
> Use the compatible to configure the ctrl0 register as required dependent
> on the platform.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> Changelog
> 
> v2:
> 
> - drop fallback for missing data_path_ctrl0
> ---
>  drivers/media/platform/nxp/imx-pxp.c | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
> index bf3be989a552..c7f8a1808516 100644
> --- a/drivers/media/platform/nxp/imx-pxp.c
> +++ b/drivers/media/platform/nxp/imx-pxp.c
> @@ -19,6 +19,7 @@
>  #include <linux/iopoll.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> +#include <linux/of_device.h>
>  #include <linux/sched.h>
>  #include <linux/slab.h>
>  
> @@ -191,6 +192,12 @@ static struct pxp_fmt *find_format(struct v4l2_format *f)
>  	return &formats[k];
>  }
>  
> +struct pxp_ctx;
> +
> +struct pxp_pdata {
> +	u32 (*data_path_ctrl0)(struct pxp_ctx *ctx);
> +};
> +
>  struct pxp_dev {
>  	struct v4l2_device	v4l2_dev;
>  	struct video_device	vfd;
> @@ -198,6 +205,8 @@ struct pxp_dev {
>  	struct clk		*clk;
>  	void __iomem		*mmio;
>  
> +	const struct pxp_pdata	*pdata;
> +
>  	atomic_t		num_inst;
>  	struct mutex		dev_mutex;
>  	spinlock_t		irqlock;
> @@ -724,7 +733,7 @@ static void pxp_setup_csc(struct pxp_ctx *ctx)
>  	}
>  }
>  
> -static u32 pxp_data_path_ctrl0(struct pxp_ctx *ctx)
> +static u32 pxp_imx6ull_data_path_ctrl0(struct pxp_ctx *ctx)
>  {
>  	u32 ctrl0;
>  
> @@ -760,7 +769,7 @@ static void pxp_set_data_path(struct pxp_ctx *ctx)
>  	u32 ctrl0;
>  	u32 ctrl1;
>  
> -	ctrl0 = pxp_data_path_ctrl0(ctx);
> +	ctrl0 = dev->pdata->data_path_ctrl0(ctx);
>  
>  	ctrl1 = 0;
>  	ctrl1 |= BF_PXP_DATA_PATH_CTRL1_MUX17_SEL(3);
> @@ -1705,6 +1714,8 @@ static int pxp_probe(struct platform_device *pdev)
>  	if (!dev)
>  		return -ENOMEM;
>  
> +	dev->pdata = of_device_get_match_data(&pdev->dev);
> +
>  	dev->clk = devm_clk_get(&pdev->dev, "axi");
>  	if (IS_ERR(dev->clk)) {
>  		ret = PTR_ERR(dev->clk);
> @@ -1804,8 +1815,12 @@ static int pxp_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static const struct pxp_pdata pxp_imx6ull_pdata = {
> +	.data_path_ctrl0 = pxp_imx6ull_data_path_ctrl0,
> +};
> +
>  static const struct of_device_id pxp_dt_ids[] = {
> -	{ .compatible = "fsl,imx6ull-pxp", .data = NULL },
> +	{ .compatible = "fsl,imx6ull-pxp", .data = &pxp_imx6ull_pdata },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, pxp_dt_ids);

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
  2023-01-13 11:56     ` Krzysztof Kozlowski
@ 2023-01-13 15:09       ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13 15:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-media, devicetree, Philipp Zabel, Laurent Pinchart,
	Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fri, 13 Jan 2023 12:56:12 +0100, Krzysztof Kozlowski wrote:
> On 13/01/2023 10:54, Michael Tretter wrote:
> > Convert the bindings of the Freescale Pixel Pipeline to YAML.
> > 
> > The conversion drops the previously listed compatibles for several SoCs.
> > It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> > on the existing SoCs and would allow to reuse the already defined
> > compatibles. The missing compatibles should be brought back when the
> > support for the PXP on these SoCs is added.
> > 
> > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > ---
> > Changelog:
> > 
> > v2:
> > 
> > - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> > - restrict number of interrupts per variant
> > - cleanup syntax
> > ---
> >  .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml | 82 ++++++++++++++++++++++
> >  .../devicetree/bindings/media/fsl-pxp.txt          | 26 -------
> >  2 files changed, 82 insertions(+), 26 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> > new file mode 100644
> > index 000000000000..c1232689a261
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> > @@ -0,0 +1,82 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/media/fsl,imx6ull-pxp.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Freescale Pixel Pipeline
> > +
> > +maintainers:
> > +  - Philipp Zabel <p.zabel@pengutronix.de>
> > +  - Michael Tretter <m.tretter@pengutronix.de>
> > +
> > +description:
> > +  The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
> > +  that supports scaling, colorspace conversion, alpha blending, rotation, and
> > +  pixel conversion via lookup table. Different versions are present on various
> > +  i.MX SoCs from i.MX23 to i.MX7.
> > +
> > +properties:
> > +  compatible:
> > +    oneOf:
> > +      - const: fsl,imx6ul-pxp
> > +      - const: fsl,imx6ull-pxp
> > +      - const: fsl,imx7d-pxp
> 
> These three are an enum.

These are alternatives to the 'items:' entry below.

Are you suggesting to use the following statement?

oneOf:
  - enum:
      - fsl,imx6ul-pxp
      - fsl,imx6ull-pxp
      - fsl,imx7d-pxp
  - items:
      - enum:
          - fsl,imx6sll-pxp
          - fsl,imx6sx-pxp

Why is this better than the one that I used?

> 
> > +      - items:
> > +          - enum:
> > +              - fsl,imx6sll-pxp
> > +              - fsl,imx6sx-pxp
> > +          - const: fsl,imx6ull-pxp
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    minItems: 1
> > +    maxItems: 2
> > +
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  clock-names:
> > +    const: axi
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +  - clocks
> > +  - clock-names
> > +
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - fsl,imx6sx-pxp
> > +    then:
> > +      properties:
> > +        interrupts:
> > +          numItems: 1
> 
> That's not correct syntax... I am surprised that it works. Did you test
> the bindings?

I copied this syntax from renesas,wdt.yaml and ran

	make ARCH=arm dtbs_check DT_SCHEMA_FILES=fsl,imx6ull-pxp.yaml

with SOC_IMX7D=y, SOC_IMX6UL=y, SOC_IMX6SLL=y, and SOC_IMX6SX=y. The latter
two were not enabled in the v1, which is why it didn't catch the missing
compatibles.

On a closer look, I just saw that the checker ignored the schema due to the
incorrect syntax and didn't produce any further errors. With the syntax fixed,
the checker now produces also a few more errors about power-domains, which I
will fix in v3.

Is this syntax correct?

allOf:
  - if:
      properties:
        compatible:
          contains:
            enum:
              - fsl,imx6sx-pxp
    then:
      properties:
        interrupts:
          minItems: 1
          maxItems: 1
    else:
      properties:
        interrupts:
          minItems: 2
          maxItems: 2

Michael

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
@ 2023-01-13 15:09       ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-13 15:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-media, devicetree, Philipp Zabel, Laurent Pinchart,
	Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On Fri, 13 Jan 2023 12:56:12 +0100, Krzysztof Kozlowski wrote:
> On 13/01/2023 10:54, Michael Tretter wrote:
> > Convert the bindings of the Freescale Pixel Pipeline to YAML.
> > 
> > The conversion drops the previously listed compatibles for several SoCs.
> > It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> > on the existing SoCs and would allow to reuse the already defined
> > compatibles. The missing compatibles should be brought back when the
> > support for the PXP on these SoCs is added.
> > 
> > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > ---
> > Changelog:
> > 
> > v2:
> > 
> > - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> > - restrict number of interrupts per variant
> > - cleanup syntax
> > ---
> >  .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml | 82 ++++++++++++++++++++++
> >  .../devicetree/bindings/media/fsl-pxp.txt          | 26 -------
> >  2 files changed, 82 insertions(+), 26 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> > new file mode 100644
> > index 000000000000..c1232689a261
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
> > @@ -0,0 +1,82 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/media/fsl,imx6ull-pxp.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Freescale Pixel Pipeline
> > +
> > +maintainers:
> > +  - Philipp Zabel <p.zabel@pengutronix.de>
> > +  - Michael Tretter <m.tretter@pengutronix.de>
> > +
> > +description:
> > +  The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
> > +  that supports scaling, colorspace conversion, alpha blending, rotation, and
> > +  pixel conversion via lookup table. Different versions are present on various
> > +  i.MX SoCs from i.MX23 to i.MX7.
> > +
> > +properties:
> > +  compatible:
> > +    oneOf:
> > +      - const: fsl,imx6ul-pxp
> > +      - const: fsl,imx6ull-pxp
> > +      - const: fsl,imx7d-pxp
> 
> These three are an enum.

These are alternatives to the 'items:' entry below.

Are you suggesting to use the following statement?

oneOf:
  - enum:
      - fsl,imx6ul-pxp
      - fsl,imx6ull-pxp
      - fsl,imx7d-pxp
  - items:
      - enum:
          - fsl,imx6sll-pxp
          - fsl,imx6sx-pxp

Why is this better than the one that I used?

> 
> > +      - items:
> > +          - enum:
> > +              - fsl,imx6sll-pxp
> > +              - fsl,imx6sx-pxp
> > +          - const: fsl,imx6ull-pxp
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    minItems: 1
> > +    maxItems: 2
> > +
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  clock-names:
> > +    const: axi
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +  - clocks
> > +  - clock-names
> > +
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - fsl,imx6sx-pxp
> > +    then:
> > +      properties:
> > +        interrupts:
> > +          numItems: 1
> 
> That's not correct syntax... I am surprised that it works. Did you test
> the bindings?

I copied this syntax from renesas,wdt.yaml and ran

	make ARCH=arm dtbs_check DT_SCHEMA_FILES=fsl,imx6ull-pxp.yaml

with SOC_IMX7D=y, SOC_IMX6UL=y, SOC_IMX6SLL=y, and SOC_IMX6SX=y. The latter
two were not enabled in the v1, which is why it didn't catch the missing
compatibles.

On a closer look, I just saw that the checker ignored the schema due to the
incorrect syntax and didn't produce any further errors. With the syntax fixed,
the checker now produces also a few more errors about power-domains, which I
will fix in v3.

Is this syntax correct?

allOf:
  - if:
      properties:
        compatible:
          contains:
            enum:
              - fsl,imx6sx-pxp
    then:
      properties:
        interrupts:
          minItems: 1
          maxItems: 1
    else:
      properties:
        interrupts:
          minItems: 2
          maxItems: 2

Michael

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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-13 15:26     ` Rob Herring
  -1 siblings, 0 replies; 98+ messages in thread
From: Rob Herring @ 2023-01-13 15:26 UTC (permalink / raw)
  To: Michael Tretter
  Cc: kernel, linux-imx, Laurent Pinchart, Rob Herring, Fabio Estevam,
	Alexander Stein, linux-arm-kernel, devicetree, Philipp Zabel,
	Mauro Carvalho Chehab, linux-media, Krzysztof Kozlowski


On Fri, 13 Jan 2023 10:54:07 +0100, Michael Tretter wrote:
> Convert the bindings of the Freescale Pixel Pipeline to YAML.
> 
> The conversion drops the previously listed compatibles for several SoCs.
> It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> on the existing SoCs and would allow to reuse the already defined
> compatibles. The missing compatibles should be brought back when the
> support for the PXP on these SoCs is added.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> Changelog:
> 
> v2:
> 
> - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> - restrict number of interrupts per variant
> - cleanup syntax
> ---
>  .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml | 82 ++++++++++++++++++++++
>  .../devicetree/bindings/media/fsl-pxp.txt          | 26 -------
>  2 files changed, 82 insertions(+), 26 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml: allOf:0:else:properties:interrupts: 'anyOf' conditional failed, one must be fixed:
	'numItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
	'type' was expected
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml: allOf:0:then:properties:interrupts: 'anyOf' conditional failed, one must be fixed:
	'numItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
	'type' was expected
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230112-imx-pxp-v2-1-e2281da1db55@pengutronix.de

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
@ 2023-01-13 15:26     ` Rob Herring
  0 siblings, 0 replies; 98+ messages in thread
From: Rob Herring @ 2023-01-13 15:26 UTC (permalink / raw)
  To: Michael Tretter
  Cc: kernel, linux-imx, Laurent Pinchart, Rob Herring, Fabio Estevam,
	Alexander Stein, linux-arm-kernel, devicetree, Philipp Zabel,
	Mauro Carvalho Chehab, linux-media, Krzysztof Kozlowski


On Fri, 13 Jan 2023 10:54:07 +0100, Michael Tretter wrote:
> Convert the bindings of the Freescale Pixel Pipeline to YAML.
> 
> The conversion drops the previously listed compatibles for several SoCs.
> It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> on the existing SoCs and would allow to reuse the already defined
> compatibles. The missing compatibles should be brought back when the
> support for the PXP on these SoCs is added.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> Changelog:
> 
> v2:
> 
> - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> - restrict number of interrupts per variant
> - cleanup syntax
> ---
>  .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml | 82 ++++++++++++++++++++++
>  .../devicetree/bindings/media/fsl-pxp.txt          | 26 -------
>  2 files changed, 82 insertions(+), 26 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml: allOf:0:else:properties:interrupts: 'anyOf' conditional failed, one must be fixed:
	'numItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
	'type' was expected
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml: allOf:0:then:properties:interrupts: 'anyOf' conditional failed, one must be fixed:
	'numItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
	'type' was expected
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230112-imx-pxp-v2-1-e2281da1db55@pengutronix.de

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
  2023-01-13 15:09       ` Michael Tretter
@ 2023-01-13 16:51         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 98+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-13 16:51 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Philipp Zabel,
	Laurent Pinchart, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

On 13/01/2023 16:09, Michael Tretter wrote:
>>> +properties:
>>> +  compatible:
>>> +    oneOf:
>>> +      - const: fsl,imx6ul-pxp
>>> +      - const: fsl,imx6ull-pxp
>>> +      - const: fsl,imx7d-pxp
>>
>> These three are an enum.
> 
> These are alternatives to the 'items:' entry below.
> 
> Are you suggesting to use the following statement?
> 
> oneOf:
>   - enum:
>       - fsl,imx6ul-pxp
>       - fsl,imx6ull-pxp
>       - fsl,imx7d-pxp
>   - items:
>       - enum:
>           - fsl,imx6sll-pxp
>           - fsl,imx6sx-pxp

Yes.

> 
> Why is this better than the one that I used?

Because that's the convention - use enum for enumeration which nicely
groups all of them and is the easiest to read.

> 
>>
>>> +      - items:
>>> +          - enum:
>>> +              - fsl,imx6sll-pxp
>>> +              - fsl,imx6sx-pxp
>>> +          - const: fsl,imx6ull-pxp
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  interrupts:
>>> +    minItems: 1
>>> +    maxItems: 2
>>> +
>>> +  clocks:
>>> +    maxItems: 1
>>> +
>>> +  clock-names:
>>> +    const: axi
>>> +
>>> +required:
>>> +  - compatible
>>> +  - reg
>>> +  - interrupts
>>> +  - clocks
>>> +  - clock-names
>>> +
>>> +allOf:
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          contains:
>>> +            enum:
>>> +              - fsl,imx6sx-pxp
>>> +    then:
>>> +      properties:
>>> +        interrupts:
>>> +          numItems: 1
>>
>> That's not correct syntax... I am surprised that it works. Did you test
>> the bindings?
> 
> I copied this syntax from renesas,wdt.yaml and ran
> 
> 	make ARCH=arm dtbs_check DT_SCHEMA_FILES=fsl,imx6ull-pxp.yaml
> 
> with SOC_IMX7D=y, SOC_IMX6UL=y, SOC_IMX6SLL=y, and SOC_IMX6SX=y. The latter
> two were not enabled in the v1, which is why it didn't catch the missing
> compatibles.
> 
> On a closer look, I just saw that the checker ignored the schema due to the
> incorrect syntax and didn't produce any further errors. With the syntax fixed,
> the checker now produces also a few more errors about power-domains, which I
> will fix in v3.
> 
> Is this syntax correct?
> 
> allOf:
>   - if:
>       properties:
>         compatible:
>           contains:
>             enum:
>               - fsl,imx6sx-pxp
>     then:
>       properties:
>         interrupts:
>           minItems: 1

Drop this one


>           maxItems: 1
>     else:
>       properties:
>         interrupts:
>           minItems: 2
>           maxItems: 2
> 
> Michael

Rest is ok

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml
@ 2023-01-13 16:51         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 98+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-13 16:51 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Philipp Zabel,
	Laurent Pinchart, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

On 13/01/2023 16:09, Michael Tretter wrote:
>>> +properties:
>>> +  compatible:
>>> +    oneOf:
>>> +      - const: fsl,imx6ul-pxp
>>> +      - const: fsl,imx6ull-pxp
>>> +      - const: fsl,imx7d-pxp
>>
>> These three are an enum.
> 
> These are alternatives to the 'items:' entry below.
> 
> Are you suggesting to use the following statement?
> 
> oneOf:
>   - enum:
>       - fsl,imx6ul-pxp
>       - fsl,imx6ull-pxp
>       - fsl,imx7d-pxp
>   - items:
>       - enum:
>           - fsl,imx6sll-pxp
>           - fsl,imx6sx-pxp

Yes.

> 
> Why is this better than the one that I used?

Because that's the convention - use enum for enumeration which nicely
groups all of them and is the easiest to read.

> 
>>
>>> +      - items:
>>> +          - enum:
>>> +              - fsl,imx6sll-pxp
>>> +              - fsl,imx6sx-pxp
>>> +          - const: fsl,imx6ull-pxp
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  interrupts:
>>> +    minItems: 1
>>> +    maxItems: 2
>>> +
>>> +  clocks:
>>> +    maxItems: 1
>>> +
>>> +  clock-names:
>>> +    const: axi
>>> +
>>> +required:
>>> +  - compatible
>>> +  - reg
>>> +  - interrupts
>>> +  - clocks
>>> +  - clock-names
>>> +
>>> +allOf:
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          contains:
>>> +            enum:
>>> +              - fsl,imx6sx-pxp
>>> +    then:
>>> +      properties:
>>> +        interrupts:
>>> +          numItems: 1
>>
>> That's not correct syntax... I am surprised that it works. Did you test
>> the bindings?
> 
> I copied this syntax from renesas,wdt.yaml and ran
> 
> 	make ARCH=arm dtbs_check DT_SCHEMA_FILES=fsl,imx6ull-pxp.yaml
> 
> with SOC_IMX7D=y, SOC_IMX6UL=y, SOC_IMX6SLL=y, and SOC_IMX6SX=y. The latter
> two were not enabled in the v1, which is why it didn't catch the missing
> compatibles.
> 
> On a closer look, I just saw that the checker ignored the schema due to the
> incorrect syntax and didn't produce any further errors. With the syntax fixed,
> the checker now produces also a few more errors about power-domains, which I
> will fix in v3.
> 
> Is this syntax correct?
> 
> allOf:
>   - if:
>       properties:
>         compatible:
>           contains:
>             enum:
>               - fsl,imx6sx-pxp
>     then:
>       properties:
>         interrupts:
>           minItems: 1

Drop this one


>           maxItems: 1
>     else:
>       properties:
>         interrupts:
>           minItems: 2
>           maxItems: 2
> 
> Michael

Rest is ok

Best regards,
Krzysztof


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

* Re: [PATCH v2 00/16] media: imx-pxp: add support for i.MX7D
  2023-01-13  9:54 ` Michael Tretter
@ 2023-01-14 21:29   ` Laurent Pinchart
  -1 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-14 21:29 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel

Hi Michael,

The whole series has been reviewed, and only the DT bindings need a
small change. If you post a v2.1 of just that patch (--in-reply-to v2
and CC me, or I may not notice quickly), I can take the whole series and
get it merged in v6.3.

On Fri, Jan 13, 2023 at 10:54:07AM +0100, Michael Tretter wrote:
> This is v2 of the series to add support for the PXP found on the i.MX7D to the
> imx-pxp driver.
> 
> The PXP on the i.MX7D has a few differences compared to the one on the
> i.MX6ULL. Especially, it has more processing blocks and slightly different
> multiplexers to route the data between the blocks. Therefore, the driver must
> configure a different data path depending on the platform.
> 
> While the PXP has a version register, the reported version is the same on the
> i.MX6ULL and the i.MX7D. Therefore, we cannot use the version register to
> change the driver behavior, but have to use the device tree compatible. The
> driver still prints the found version to the log to help bringing up the PXP
> on further platforms.
> 
> The patches are inspired by some earlier patches [0] by Laurent to add PXP
> support to the i.MX7d. Compared to the earlier patches, these patches add
> different behavior depending on the platform. Furthermore, the patches disable
> only the LUT block, but keep the rotator block enabled, as it may now be
> configured via the V4L2 rotate control.
> 
> In v2, I included Laurent's patch series [1], which was based on this series
> anyway and added regmap support.
> 
> Patch 1 converts the dt-binding to yaml.
> 
> Patches 2 to 5 cleanup and refactor the driver in preparation of handling
> different PXP versions.
> 
> Patches 6 and 7 add the handling of different platforms and the i.MX7d
> specific configuration.
> 
> Patch 8 adds the device tree node for the PXP to the i.MX7d device tree.
> 
> Patches 9 to 15 are the cleanup and enhancement patches to add media
> controller support, implement enum_framesizes, and add pxp_read/pxp_write
> helpers.
> 
> Patch 16 adds regmap support to the driver.
> 
> Michael
> 
> [0] https://lore.kernel.org/linux-media/20200510223100.11641-1-laurent.pinchart@ideasonboard.com/
> [1] https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com
> 
> ---
> 
> Changelog
> 
> v2:
> 
> - fix device tree binding
> - reduce log level of PXP version to debug
> - drop fallback for missing pdata
> - add cleanup and enhancement patches to series
> - convert driver to regmap
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> To: linux-media@vger.kernel.org
> To: devicetree@vger.kernel.org
> To: Philipp Zabel <p.zabel@pengutronix.de>
> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
> Cc: kernel@pengutronix.de
> Cc: linux-imx@nxp.com
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: Michael Tretter <m.tretter@pengutronix.de>
> 
> ---
> Laurent Pinchart (7):
>       media: imx-pxp: Sort headers alphabetically
>       media: imx-pxp: Don't set bus_info manually in .querycap()
>       media: imx-pxp: Add media controller support
>       media: imx-pxp: Pass pixel format value to find_format()
>       media: imx-pxp: Implement frame size enumeration
>       media: imx-pxp: Introduce pxp_read() and pxp_write() wrappers
>       media: imx-pxp: Use non-threaded IRQ
> 
> Michael Tretter (9):
>       dt-bindings: media: fsl-pxp: convert to yaml
>       media: imx-pxp: detect PXP version
>       media: imx-pxp: extract helper function to setup data path
>       media: imx-pxp: explicitly disable unused blocks
>       media: imx-pxp: disable LUT block
>       media: imx-pxp: make data_path_ctrl0 platform dependent
>       media: imx-pxp: add support for i.MX7D
>       ARM: dts: imx7d: add node for PXP
>       media: imx-pxp: convert to regmap
> 
>  .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml |  82 +++++
>  .../devicetree/bindings/media/fsl-pxp.txt          |  26 --
>  arch/arm/boot/dts/imx7d.dtsi                       |   9 +
>  drivers/media/platform/nxp/imx-pxp.c               | 359 +++++++++++++++------
>  4 files changed, 355 insertions(+), 121 deletions(-)
> ---
> base-commit: b7bfaa761d760e72a969d116517eaa12e404c262
> change-id: 20230112-imx-pxp-073008b3c857

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 00/16] media: imx-pxp: add support for i.MX7D
@ 2023-01-14 21:29   ` Laurent Pinchart
  0 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-14 21:29 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel

Hi Michael,

The whole series has been reviewed, and only the DT bindings need a
small change. If you post a v2.1 of just that patch (--in-reply-to v2
and CC me, or I may not notice quickly), I can take the whole series and
get it merged in v6.3.

On Fri, Jan 13, 2023 at 10:54:07AM +0100, Michael Tretter wrote:
> This is v2 of the series to add support for the PXP found on the i.MX7D to the
> imx-pxp driver.
> 
> The PXP on the i.MX7D has a few differences compared to the one on the
> i.MX6ULL. Especially, it has more processing blocks and slightly different
> multiplexers to route the data between the blocks. Therefore, the driver must
> configure a different data path depending on the platform.
> 
> While the PXP has a version register, the reported version is the same on the
> i.MX6ULL and the i.MX7D. Therefore, we cannot use the version register to
> change the driver behavior, but have to use the device tree compatible. The
> driver still prints the found version to the log to help bringing up the PXP
> on further platforms.
> 
> The patches are inspired by some earlier patches [0] by Laurent to add PXP
> support to the i.MX7d. Compared to the earlier patches, these patches add
> different behavior depending on the platform. Furthermore, the patches disable
> only the LUT block, but keep the rotator block enabled, as it may now be
> configured via the V4L2 rotate control.
> 
> In v2, I included Laurent's patch series [1], which was based on this series
> anyway and added regmap support.
> 
> Patch 1 converts the dt-binding to yaml.
> 
> Patches 2 to 5 cleanup and refactor the driver in preparation of handling
> different PXP versions.
> 
> Patches 6 and 7 add the handling of different platforms and the i.MX7d
> specific configuration.
> 
> Patch 8 adds the device tree node for the PXP to the i.MX7d device tree.
> 
> Patches 9 to 15 are the cleanup and enhancement patches to add media
> controller support, implement enum_framesizes, and add pxp_read/pxp_write
> helpers.
> 
> Patch 16 adds regmap support to the driver.
> 
> Michael
> 
> [0] https://lore.kernel.org/linux-media/20200510223100.11641-1-laurent.pinchart@ideasonboard.com/
> [1] https://lore.kernel.org/linux-media/20230112172507.30579-1-laurent.pinchart@ideasonboard.com
> 
> ---
> 
> Changelog
> 
> v2:
> 
> - fix device tree binding
> - reduce log level of PXP version to debug
> - drop fallback for missing pdata
> - add cleanup and enhancement patches to series
> - convert driver to regmap
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> To: linux-media@vger.kernel.org
> To: devicetree@vger.kernel.org
> To: Philipp Zabel <p.zabel@pengutronix.de>
> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
> Cc: kernel@pengutronix.de
> Cc: linux-imx@nxp.com
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: Michael Tretter <m.tretter@pengutronix.de>
> 
> ---
> Laurent Pinchart (7):
>       media: imx-pxp: Sort headers alphabetically
>       media: imx-pxp: Don't set bus_info manually in .querycap()
>       media: imx-pxp: Add media controller support
>       media: imx-pxp: Pass pixel format value to find_format()
>       media: imx-pxp: Implement frame size enumeration
>       media: imx-pxp: Introduce pxp_read() and pxp_write() wrappers
>       media: imx-pxp: Use non-threaded IRQ
> 
> Michael Tretter (9):
>       dt-bindings: media: fsl-pxp: convert to yaml
>       media: imx-pxp: detect PXP version
>       media: imx-pxp: extract helper function to setup data path
>       media: imx-pxp: explicitly disable unused blocks
>       media: imx-pxp: disable LUT block
>       media: imx-pxp: make data_path_ctrl0 platform dependent
>       media: imx-pxp: add support for i.MX7D
>       ARM: dts: imx7d: add node for PXP
>       media: imx-pxp: convert to regmap
> 
>  .../devicetree/bindings/media/fsl,imx6ull-pxp.yaml |  82 +++++
>  .../devicetree/bindings/media/fsl-pxp.txt          |  26 --
>  arch/arm/boot/dts/imx7d.dtsi                       |   9 +
>  drivers/media/platform/nxp/imx-pxp.c               | 359 +++++++++++++++------
>  4 files changed, 355 insertions(+), 121 deletions(-)
> ---
> base-commit: b7bfaa761d760e72a969d116517eaa12e404c262
> change-id: 20230112-imx-pxp-073008b3c857

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2.1 02/17] dt-bindings: media: fsl-pxp: convert to yaml
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-16 11:38     ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-16 11:38 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel, Michael Tretter

Convert the bindings of the Freescale Pixel Pipeline to YAML.

The conversion drops the previously listed compatibles for several SoCs.
It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
on the existing SoCs and would allow to reuse the already defined
compatibles. The missing compatibles should be brought back when the
support for the PXP on these SoCs is added.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog:

v2:

- add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
- restrict number of interrupts per variant
- cleanup syntax

v2.1:

- use enum for compatibles
- add power-domains property
- fix syntax for specifying the required number of interrupts
- fix number of interrupts for fsl,imx6ul-pxp
---
 .../bindings/media/fsl,imx6ull-pxp.yaml       | 88 +++++++++++++++++++
 .../devicetree/bindings/media/fsl-pxp.txt     | 26 ------
 2 files changed, 88 insertions(+), 26 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
 delete mode 100644 Documentation/devicetree/bindings/media/fsl-pxp.txt

diff --git a/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
new file mode 100644
index 000000000000..84a5e894ace4
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
@@ -0,0 +1,88 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/fsl,imx6ull-pxp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale Pixel Pipeline
+
+maintainers:
+  - Philipp Zabel <p.zabel@pengutronix.de>
+  - Michael Tretter <m.tretter@pengutronix.de>
+
+description:
+  The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
+  that supports scaling, colorspace conversion, alpha blending, rotation, and
+  pixel conversion via lookup table. Different versions are present on various
+  i.MX SoCs from i.MX23 to i.MX7.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - fsl,imx6ul-pxp
+          - fsl,imx6ull-pxp
+          - fsl,imx7d-pxp
+      - items:
+          - enum:
+              - fsl,imx6sll-pxp
+              - fsl,imx6sx-pxp
+          - const: fsl,imx6ull-pxp
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: axi
+
+  power-domains:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - fsl,imx6sx-pxp
+              - fsl,imx6ul-pxp
+    then:
+      properties:
+        interrupts:
+          maxItems: 1
+    else:
+      properties:
+        interrupts:
+          minItems: 2
+          maxItems: 2
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx6ul-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    pxp: pxp@21cc000 {
+        compatible = "fsl,imx6ull-pxp";
+        reg = <0x021cc000 0x4000>;
+        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
+        clock-names = "axi";
+        clocks = <&clks IMX6UL_CLK_PXP>;
+    };
diff --git a/Documentation/devicetree/bindings/media/fsl-pxp.txt b/Documentation/devicetree/bindings/media/fsl-pxp.txt
deleted file mode 100644
index f8090e06530d..000000000000
--- a/Documentation/devicetree/bindings/media/fsl-pxp.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Freescale Pixel Pipeline
-========================
-
-The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
-that supports scaling, colorspace conversion, alpha blending, rotation, and
-pixel conversion via lookup table. Different versions are present on various
-i.MX SoCs from i.MX23 to i.MX7.
-
-Required properties:
-- compatible: should be "fsl,<soc>-pxp", where SoC can be one of imx23, imx28,
-  imx6dl, imx6sl, imx6sll, imx6ul, imx6sx, imx6ull, or imx7d.
-- reg: the register base and size for the device registers
-- interrupts: the PXP interrupt, two interrupts for imx6ull and imx7d.
-- clock-names: should be "axi"
-- clocks: the PXP AXI clock
-
-Example:
-
-pxp@21cc000 {
-	compatible = "fsl,imx6ull-pxp";
-	reg = <0x021cc000 0x4000>;
-	interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
-		     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
-	clock-names = "axi";
-	clocks = <&clks IMX6UL_CLK_PXP>;
-};
-- 
2.30.2


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

* [PATCH v2.1 02/17] dt-bindings: media: fsl-pxp: convert to yaml
@ 2023-01-16 11:38     ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-16 11:38 UTC (permalink / raw)
  To: linux-media, devicetree, Philipp Zabel, Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel, Michael Tretter

Convert the bindings of the Freescale Pixel Pipeline to YAML.

The conversion drops the previously listed compatibles for several SoCs.
It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
on the existing SoCs and would allow to reuse the already defined
compatibles. The missing compatibles should be brought back when the
support for the PXP on these SoCs is added.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changelog:

v2:

- add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
- restrict number of interrupts per variant
- cleanup syntax

v2.1:

- use enum for compatibles
- add power-domains property
- fix syntax for specifying the required number of interrupts
- fix number of interrupts for fsl,imx6ul-pxp
---
 .../bindings/media/fsl,imx6ull-pxp.yaml       | 88 +++++++++++++++++++
 .../devicetree/bindings/media/fsl-pxp.txt     | 26 ------
 2 files changed, 88 insertions(+), 26 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
 delete mode 100644 Documentation/devicetree/bindings/media/fsl-pxp.txt

diff --git a/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
new file mode 100644
index 000000000000..84a5e894ace4
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/fsl,imx6ull-pxp.yaml
@@ -0,0 +1,88 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/fsl,imx6ull-pxp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale Pixel Pipeline
+
+maintainers:
+  - Philipp Zabel <p.zabel@pengutronix.de>
+  - Michael Tretter <m.tretter@pengutronix.de>
+
+description:
+  The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
+  that supports scaling, colorspace conversion, alpha blending, rotation, and
+  pixel conversion via lookup table. Different versions are present on various
+  i.MX SoCs from i.MX23 to i.MX7.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - fsl,imx6ul-pxp
+          - fsl,imx6ull-pxp
+          - fsl,imx7d-pxp
+      - items:
+          - enum:
+              - fsl,imx6sll-pxp
+              - fsl,imx6sx-pxp
+          - const: fsl,imx6ull-pxp
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: axi
+
+  power-domains:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - fsl,imx6sx-pxp
+              - fsl,imx6ul-pxp
+    then:
+      properties:
+        interrupts:
+          maxItems: 1
+    else:
+      properties:
+        interrupts:
+          minItems: 2
+          maxItems: 2
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx6ul-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    pxp: pxp@21cc000 {
+        compatible = "fsl,imx6ull-pxp";
+        reg = <0x021cc000 0x4000>;
+        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
+        clock-names = "axi";
+        clocks = <&clks IMX6UL_CLK_PXP>;
+    };
diff --git a/Documentation/devicetree/bindings/media/fsl-pxp.txt b/Documentation/devicetree/bindings/media/fsl-pxp.txt
deleted file mode 100644
index f8090e06530d..000000000000
--- a/Documentation/devicetree/bindings/media/fsl-pxp.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Freescale Pixel Pipeline
-========================
-
-The Pixel Pipeline (PXP) is a memory-to-memory graphics processing engine
-that supports scaling, colorspace conversion, alpha blending, rotation, and
-pixel conversion via lookup table. Different versions are present on various
-i.MX SoCs from i.MX23 to i.MX7.
-
-Required properties:
-- compatible: should be "fsl,<soc>-pxp", where SoC can be one of imx23, imx28,
-  imx6dl, imx6sl, imx6sll, imx6ul, imx6sx, imx6ull, or imx7d.
-- reg: the register base and size for the device registers
-- interrupts: the PXP interrupt, two interrupts for imx6ull and imx7d.
-- clock-names: should be "axi"
-- clocks: the PXP AXI clock
-
-Example:
-
-pxp@21cc000 {
-	compatible = "fsl,imx6ull-pxp";
-	reg = <0x021cc000 0x4000>;
-	interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
-		     <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
-	clock-names = "axi";
-	clocks = <&clks IMX6UL_CLK_PXP>;
-};
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2.1 02/17] dt-bindings: media: fsl-pxp: convert to yaml
  2023-01-16 11:38     ` Michael Tretter
@ 2023-01-16 11:59       ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 98+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-16 11:59 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Philipp Zabel,
	Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On 16/01/2023 12:38, Michael Tretter wrote:
> Convert the bindings of the Freescale Pixel Pipeline to YAML.
> 
> The conversion drops the previously listed compatibles for several SoCs.
> It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> on the existing SoCs and would allow to reuse the already defined
> compatibles. The missing compatibles should be brought back when the
> support for the PXP on these SoCs is added.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> Changelog:
> 
> v2:
> 
> - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> - restrict number of interrupts per variant
> - cleanup syntax
> 
> v2.1:
> 
> - use enum for compatibles
> - add power-domains property
> - fix syntax for specifying the required number of interrupts
> - fix number of interrupts for fsl,imx6ul-pxp

Attaching some half-baked patch to existing thread is not the way. It
might not be supported by workflows at all (b4, patchwork), it messes
with threads. Don't do it. Send a v3 of entire patchset once you collect
proper feedback.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH v2.1 02/17] dt-bindings: media: fsl-pxp: convert to yaml
@ 2023-01-16 11:59       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 98+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-16 11:59 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Philipp Zabel,
	Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

On 16/01/2023 12:38, Michael Tretter wrote:
> Convert the bindings of the Freescale Pixel Pipeline to YAML.
> 
> The conversion drops the previously listed compatibles for several SoCs.
> It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> on the existing SoCs and would allow to reuse the already defined
> compatibles. The missing compatibles should be brought back when the
> support for the PXP on these SoCs is added.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> Changelog:
> 
> v2:
> 
> - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> - restrict number of interrupts per variant
> - cleanup syntax
> 
> v2.1:
> 
> - use enum for compatibles
> - add power-domains property
> - fix syntax for specifying the required number of interrupts
> - fix number of interrupts for fsl,imx6ul-pxp

Attaching some half-baked patch to existing thread is not the way. It
might not be supported by workflows at all (b4, patchwork), it messes
with threads. Don't do it. Send a v3 of entire patchset once you collect
proper feedback.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2.1 02/17] dt-bindings: media: fsl-pxp: convert to yaml
  2023-01-16 11:59       ` Krzysztof Kozlowski
@ 2023-01-16 16:11         ` Laurent Pinchart
  -1 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-16 16:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Michael Tretter, linux-media, devicetree, Philipp Zabel,
	Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

Hi Krzysztof,

On Mon, Jan 16, 2023 at 12:59:23PM +0100, Krzysztof Kozlowski wrote:
> On 16/01/2023 12:38, Michael Tretter wrote:
> > Convert the bindings of the Freescale Pixel Pipeline to YAML.
> > 
> > The conversion drops the previously listed compatibles for several SoCs.
> > It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> > on the existing SoCs and would allow to reuse the already defined
> > compatibles. The missing compatibles should be brought back when the
> > support for the PXP on these SoCs is added.
> > 
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
> > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > ---
> > Changelog:
> > 
> > v2:
> > 
> > - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> > - restrict number of interrupts per variant
> > - cleanup syntax
> > 
> > v2.1:
> > 
> > - use enum for compatibles
> > - add power-domains property
> > - fix syntax for specifying the required number of interrupts
> > - fix number of interrupts for fsl,imx6ul-pxp
> 
> Attaching some half-baked patch to existing thread is not the way. It
> might not be supported by workflows at all (b4, patchwork), it messes
> with threads. Don't do it. Send a v3 of entire patchset once you collect
> proper feedback.

This is the only patch in the series that required a new version, and
I've asked Michael to resubmit it alone to avoid spamming all the
recipients.

> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Thanks. I'll take the whole series in my tree and send a pull request
for v6.3.

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2.1 02/17] dt-bindings: media: fsl-pxp: convert to yaml
@ 2023-01-16 16:11         ` Laurent Pinchart
  0 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-16 16:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Michael Tretter, linux-media, devicetree, Philipp Zabel,
	Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

Hi Krzysztof,

On Mon, Jan 16, 2023 at 12:59:23PM +0100, Krzysztof Kozlowski wrote:
> On 16/01/2023 12:38, Michael Tretter wrote:
> > Convert the bindings of the Freescale Pixel Pipeline to YAML.
> > 
> > The conversion drops the previously listed compatibles for several SoCs.
> > It is unclear, if the PXP on these SoCs is compatible to any of the PXPs
> > on the existing SoCs and would allow to reuse the already defined
> > compatibles. The missing compatibles should be brought back when the
> > support for the PXP on these SoCs is added.
> > 
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
> > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > ---
> > Changelog:
> > 
> > v2:
> > 
> > - add fsl,imx6sll-pxp and fsl,imx6sx-pxp compatibles
> > - restrict number of interrupts per variant
> > - cleanup syntax
> > 
> > v2.1:
> > 
> > - use enum for compatibles
> > - add power-domains property
> > - fix syntax for specifying the required number of interrupts
> > - fix number of interrupts for fsl,imx6ul-pxp
> 
> Attaching some half-baked patch to existing thread is not the way. It
> might not be supported by workflows at all (b4, patchwork), it messes
> with threads. Don't do it. Send a v3 of entire patchset once you collect
> proper feedback.

This is the only patch in the series that required a new version, and
I've asked Michael to resubmit it alone to avoid spamming all the
recipients.

> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Thanks. I'll take the whole series in my tree and send a pull request
for v6.3.

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
  2023-01-13  9:54   ` Michael Tretter
@ 2023-01-16 16:26     ` Laurent Pinchart
  -1 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-16 16:26 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel, Shawn Guo

Hi Michael,

(CC'ing Shawn)

On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> node to make it available.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Should this go through Shawn's tree ? If so, how would you like to
handle the dependency on the DT bindings in patch 01/16 ?

> ---
> Changelog
> 
> v2:
> 
> - fix alignment
> ---
>  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> index 7ceb7c09f7ad..4b94b8afb55d 100644
> --- a/arch/arm/boot/dts/imx7d.dtsi
> +++ b/arch/arm/boot/dts/imx7d.dtsi
> @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
>  		  reg = <0x306d0000 0x10000>;
>  		  status = "disabled";
>  	};
> +
> +	pxp: pxp@30700000 {
> +		compatible = "fsl,imx7d-pxp";
> +		reg = <0x30700000 0x10000>;
> +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&clks IMX7D_PXP_CLK>;
> +		clock-names = "axi";
> +	};
>  };
>  
>  &aips3 {

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
@ 2023-01-16 16:26     ` Laurent Pinchart
  0 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-16 16:26 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel, Shawn Guo

Hi Michael,

(CC'ing Shawn)

On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> node to make it available.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>

Should this go through Shawn's tree ? If so, how would you like to
handle the dependency on the DT bindings in patch 01/16 ?

> ---
> Changelog
> 
> v2:
> 
> - fix alignment
> ---
>  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> index 7ceb7c09f7ad..4b94b8afb55d 100644
> --- a/arch/arm/boot/dts/imx7d.dtsi
> +++ b/arch/arm/boot/dts/imx7d.dtsi
> @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
>  		  reg = <0x306d0000 0x10000>;
>  		  status = "disabled";
>  	};
> +
> +	pxp: pxp@30700000 {
> +		compatible = "fsl,imx7d-pxp";
> +		reg = <0x30700000 0x10000>;
> +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&clks IMX7D_PXP_CLK>;
> +		clock-names = "axi";
> +	};
>  };
>  
>  &aips3 {

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
  2023-01-16 16:26     ` Laurent Pinchart
@ 2023-01-20  9:06       ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-20  9:06 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel, Shawn Guo

On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > node to make it available.
> > 
> > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> 
> Should this go through Shawn's tree ? If so, how would you like to
> handle the dependency on the DT bindings in patch 01/16 ?

There is no actual dependency. The binding was already specified as a txt,
just not as a yaml, and the added node matches both.

Michael

> 
> > ---
> > Changelog
> > 
> > v2:
> > 
> > - fix alignment
> > ---
> >  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> > index 7ceb7c09f7ad..4b94b8afb55d 100644
> > --- a/arch/arm/boot/dts/imx7d.dtsi
> > +++ b/arch/arm/boot/dts/imx7d.dtsi
> > @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
> >  		  reg = <0x306d0000 0x10000>;
> >  		  status = "disabled";
> >  	};
> > +
> > +	pxp: pxp@30700000 {
> > +		compatible = "fsl,imx7d-pxp";
> > +		reg = <0x30700000 0x10000>;
> > +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> > +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&clks IMX7D_PXP_CLK>;
> > +		clock-names = "axi";
> > +	};
> >  };
> >  
> >  &aips3 {

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
@ 2023-01-20  9:06       ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-01-20  9:06 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel, Shawn Guo

On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > node to make it available.
> > 
> > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> 
> Should this go through Shawn's tree ? If so, how would you like to
> handle the dependency on the DT bindings in patch 01/16 ?

There is no actual dependency. The binding was already specified as a txt,
just not as a yaml, and the added node matches both.

Michael

> 
> > ---
> > Changelog
> > 
> > v2:
> > 
> > - fix alignment
> > ---
> >  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> > index 7ceb7c09f7ad..4b94b8afb55d 100644
> > --- a/arch/arm/boot/dts/imx7d.dtsi
> > +++ b/arch/arm/boot/dts/imx7d.dtsi
> > @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
> >  		  reg = <0x306d0000 0x10000>;
> >  		  status = "disabled";
> >  	};
> > +
> > +	pxp: pxp@30700000 {
> > +		compatible = "fsl,imx7d-pxp";
> > +		reg = <0x30700000 0x10000>;
> > +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> > +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&clks IMX7D_PXP_CLK>;
> > +		clock-names = "axi";
> > +	};
> >  };
> >  
> >  &aips3 {

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
  2023-01-20  9:06       ` Michael Tretter
@ 2023-01-20  9:20         ` Laurent Pinchart
  -1 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-20  9:20 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel, Shawn Guo

On Fri, Jan 20, 2023 at 10:06:09AM +0100, Michael Tretter wrote:
> On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> > On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > > node to make it available.
> > > 
> > > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > 
> > Should this go through Shawn's tree ? If so, how would you like to
> > handle the dependency on the DT bindings in patch 01/16 ?
> 
> There is no actual dependency. The binding was already specified as a txt,
> just not as a yaml, and the added node matches both.

Good point. I'll send a pull request for the series then, without this
patch, which can be picked by Shawn separately.

> > > ---
> > > Changelog
> > > 
> > > v2:
> > > 
> > > - fix alignment
> > > ---
> > >  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
> > >  1 file changed, 9 insertions(+)
> > > 
> > > diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> > > index 7ceb7c09f7ad..4b94b8afb55d 100644
> > > --- a/arch/arm/boot/dts/imx7d.dtsi
> > > +++ b/arch/arm/boot/dts/imx7d.dtsi
> > > @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
> > >  		  reg = <0x306d0000 0x10000>;
> > >  		  status = "disabled";
> > >  	};
> > > +
> > > +	pxp: pxp@30700000 {
> > > +		compatible = "fsl,imx7d-pxp";
> > > +		reg = <0x30700000 0x10000>;
> > > +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> > > +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> > > +		clocks = <&clks IMX7D_PXP_CLK>;
> > > +		clock-names = "axi";
> > > +	};
> > >  };
> > >  
> > >  &aips3 {

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
@ 2023-01-20  9:20         ` Laurent Pinchart
  0 siblings, 0 replies; 98+ messages in thread
From: Laurent Pinchart @ 2023-01-20  9:20 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-media, devicetree, Philipp Zabel, Mauro Carvalho Chehab,
	Rob Herring, Krzysztof Kozlowski, Fabio Estevam, Alexander Stein,
	kernel, linux-imx, linux-arm-kernel, Shawn Guo

On Fri, Jan 20, 2023 at 10:06:09AM +0100, Michael Tretter wrote:
> On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> > On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > > node to make it available.
> > > 
> > > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > 
> > Should this go through Shawn's tree ? If so, how would you like to
> > handle the dependency on the DT bindings in patch 01/16 ?
> 
> There is no actual dependency. The binding was already specified as a txt,
> just not as a yaml, and the added node matches both.

Good point. I'll send a pull request for the series then, without this
patch, which can be picked by Shawn separately.

> > > ---
> > > Changelog
> > > 
> > > v2:
> > > 
> > > - fix alignment
> > > ---
> > >  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
> > >  1 file changed, 9 insertions(+)
> > > 
> > > diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> > > index 7ceb7c09f7ad..4b94b8afb55d 100644
> > > --- a/arch/arm/boot/dts/imx7d.dtsi
> > > +++ b/arch/arm/boot/dts/imx7d.dtsi
> > > @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
> > >  		  reg = <0x306d0000 0x10000>;
> > >  		  status = "disabled";
> > >  	};
> > > +
> > > +	pxp: pxp@30700000 {
> > > +		compatible = "fsl,imx7d-pxp";
> > > +		reg = <0x30700000 0x10000>;
> > > +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> > > +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> > > +		clocks = <&clks IMX7D_PXP_CLK>;
> > > +		clock-names = "axi";
> > > +	};
> > >  };
> > >  
> > >  &aips3 {

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
  2023-01-20  9:20         ` Laurent Pinchart
@ 2023-02-09 14:02           ` Michael Tretter
  -1 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-02-09 14:02 UTC (permalink / raw)
  To: Shawn Guo
  Cc: linux-media, devicetree, Laurent Pinchart, Philipp Zabel,
	Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

Hi Shawn,

On Fri, 20 Jan 2023 11:20:24 +0200, Laurent Pinchart wrote:
> On Fri, Jan 20, 2023 at 10:06:09AM +0100, Michael Tretter wrote:
> > On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> > > On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > > > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > > > node to make it available.
> > > > 
> > > > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > > 
> > > Should this go through Shawn's tree ? If so, how would you like to
> > > handle the dependency on the DT bindings in patch 01/16 ?
> > 
> > There is no actual dependency. The binding was already specified as a txt,
> > just not as a yaml, and the added node matches both.
> 
> Good point. I'll send a pull request for the series then, without this
> patch, which can be picked by Shawn separately.

Can you pick this patch or should I resend it as a separate series?

Michael

> 
> > > > ---
> > > > Changelog
> > > > 
> > > > v2:
> > > > 
> > > > - fix alignment
> > > > ---
> > > >  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
> > > >  1 file changed, 9 insertions(+)
> > > > 
> > > > diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> > > > index 7ceb7c09f7ad..4b94b8afb55d 100644
> > > > --- a/arch/arm/boot/dts/imx7d.dtsi
> > > > +++ b/arch/arm/boot/dts/imx7d.dtsi
> > > > @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
> > > >  		  reg = <0x306d0000 0x10000>;
> > > >  		  status = "disabled";
> > > >  	};
> > > > +
> > > > +	pxp: pxp@30700000 {
> > > > +		compatible = "fsl,imx7d-pxp";
> > > > +		reg = <0x30700000 0x10000>;
> > > > +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> > > > +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> > > > +		clocks = <&clks IMX7D_PXP_CLK>;
> > > > +		clock-names = "axi";
> > > > +	};
> > > >  };
> > > >  
> > > >  &aips3 {

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
@ 2023-02-09 14:02           ` Michael Tretter
  0 siblings, 0 replies; 98+ messages in thread
From: Michael Tretter @ 2023-02-09 14:02 UTC (permalink / raw)
  To: Shawn Guo
  Cc: linux-media, devicetree, Laurent Pinchart, Philipp Zabel,
	Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Fabio Estevam, Alexander Stein, kernel, linux-imx,
	linux-arm-kernel

Hi Shawn,

On Fri, 20 Jan 2023 11:20:24 +0200, Laurent Pinchart wrote:
> On Fri, Jan 20, 2023 at 10:06:09AM +0100, Michael Tretter wrote:
> > On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> > > On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > > > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > > > node to make it available.
> > > > 
> > > > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > > 
> > > Should this go through Shawn's tree ? If so, how would you like to
> > > handle the dependency on the DT bindings in patch 01/16 ?
> > 
> > There is no actual dependency. The binding was already specified as a txt,
> > just not as a yaml, and the added node matches both.
> 
> Good point. I'll send a pull request for the series then, without this
> patch, which can be picked by Shawn separately.

Can you pick this patch or should I resend it as a separate series?

Michael

> 
> > > > ---
> > > > Changelog
> > > > 
> > > > v2:
> > > > 
> > > > - fix alignment
> > > > ---
> > > >  arch/arm/boot/dts/imx7d.dtsi | 9 +++++++++
> > > >  1 file changed, 9 insertions(+)
> > > > 
> > > > diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
> > > > index 7ceb7c09f7ad..4b94b8afb55d 100644
> > > > --- a/arch/arm/boot/dts/imx7d.dtsi
> > > > +++ b/arch/arm/boot/dts/imx7d.dtsi
> > > > @@ -165,6 +165,15 @@ pcie_phy: pcie-phy@306d0000 {
> > > >  		  reg = <0x306d0000 0x10000>;
> > > >  		  status = "disabled";
> > > >  	};
> > > > +
> > > > +	pxp: pxp@30700000 {
> > > > +		compatible = "fsl,imx7d-pxp";
> > > > +		reg = <0x30700000 0x10000>;
> > > > +		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
> > > > +			     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
> > > > +		clocks = <&clks IMX7D_PXP_CLK>;
> > > > +		clock-names = "axi";
> > > > +	};
> > > >  };
> > > >  
> > > >  &aips3 {

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
  2023-02-09 14:02           ` Michael Tretter
@ 2023-03-06  1:19             ` Shawn Guo
  -1 siblings, 0 replies; 98+ messages in thread
From: Shawn Guo @ 2023-03-06  1:19 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart,
	Philipp Zabel, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

On Thu, Feb 09, 2023 at 03:02:25PM +0100, Michael Tretter wrote:
> Hi Shawn,
> 
> On Fri, 20 Jan 2023 11:20:24 +0200, Laurent Pinchart wrote:
> > On Fri, Jan 20, 2023 at 10:06:09AM +0100, Michael Tretter wrote:
> > > On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> > > > On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > > > > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > > > > node to make it available.
> > > > > 
> > > > > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > > > 
> > > > Should this go through Shawn's tree ? If so, how would you like to
> > > > handle the dependency on the DT bindings in patch 01/16 ?
> > > 
> > > There is no actual dependency. The binding was already specified as a txt,
> > > just not as a yaml, and the added node matches both.
> > 
> > Good point. I'll send a pull request for the series then, without this
> > patch, which can be picked by Shawn separately.
> 
> Can you pick this patch or should I resend it as a separate series?

Applied, thanks!

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

* Re: [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP
@ 2023-03-06  1:19             ` Shawn Guo
  0 siblings, 0 replies; 98+ messages in thread
From: Shawn Guo @ 2023-03-06  1:19 UTC (permalink / raw)
  To: Michael Tretter, linux-media, devicetree, Laurent Pinchart,
	Philipp Zabel, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Fabio Estevam, Alexander Stein, kernel,
	linux-imx, linux-arm-kernel

On Thu, Feb 09, 2023 at 03:02:25PM +0100, Michael Tretter wrote:
> Hi Shawn,
> 
> On Fri, 20 Jan 2023 11:20:24 +0200, Laurent Pinchart wrote:
> > On Fri, Jan 20, 2023 at 10:06:09AM +0100, Michael Tretter wrote:
> > > On Mon, 16 Jan 2023 18:26:49 +0200, Laurent Pinchart wrote:
> > > > On Fri, Jan 13, 2023 at 10:54:14AM +0100, Michael Tretter wrote:
> > > > > The i.MX7d contains a Pixel Pipeline in version 3.0. Add the device tree
> > > > > node to make it available.
> > > > > 
> > > > > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > > > 
> > > > Should this go through Shawn's tree ? If so, how would you like to
> > > > handle the dependency on the DT bindings in patch 01/16 ?
> > > 
> > > There is no actual dependency. The binding was already specified as a txt,
> > > just not as a yaml, and the added node matches both.
> > 
> > Good point. I'll send a pull request for the series then, without this
> > patch, which can be picked by Shawn separately.
> 
> Can you pick this patch or should I resend it as a separate series?

Applied, thanks!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-03-06  1:21 UTC | newest]

Thread overview: 98+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13  9:54 [PATCH v2 00/16] media: imx-pxp: add support for i.MX7D Michael Tretter
2023-01-13  9:54 ` Michael Tretter
2023-01-13  9:54 ` [PATCH v2 01/16] dt-bindings: media: fsl-pxp: convert to yaml Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 10:41   ` Laurent Pinchart
2023-01-13 10:41     ` Laurent Pinchart
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-13 11:56   ` Krzysztof Kozlowski
2023-01-13 11:56     ` Krzysztof Kozlowski
2023-01-13 15:09     ` Michael Tretter
2023-01-13 15:09       ` Michael Tretter
2023-01-13 16:51       ` Krzysztof Kozlowski
2023-01-13 16:51         ` Krzysztof Kozlowski
2023-01-13 15:26   ` Rob Herring
2023-01-13 15:26     ` Rob Herring
2023-01-16 11:38   ` [PATCH v2.1 02/17] " Michael Tretter
2023-01-16 11:38     ` Michael Tretter
2023-01-16 11:59     ` Krzysztof Kozlowski
2023-01-16 11:59       ` Krzysztof Kozlowski
2023-01-16 16:11       ` Laurent Pinchart
2023-01-16 16:11         ` Laurent Pinchart
2023-01-13  9:54 ` [PATCH v2 02/16] media: imx-pxp: detect PXP version Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 10:44   ` Laurent Pinchart
2023-01-13 10:44     ` Laurent Pinchart
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 03/16] media: imx-pxp: extract helper function to setup data path Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 04/16] media: imx-pxp: explicitly disable unused blocks Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 05/16] media: imx-pxp: disable LUT block Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 06/16] media: imx-pxp: make data_path_ctrl0 platform dependent Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-13 12:03   ` Laurent Pinchart
2023-01-13 12:03     ` Laurent Pinchart
2023-01-13  9:54 ` [PATCH v2 07/16] media: imx-pxp: add support for i.MX7D Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 08/16] ARM: dts: imx7d: add node for PXP Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-16 16:26   ` Laurent Pinchart
2023-01-16 16:26     ` Laurent Pinchart
2023-01-20  9:06     ` Michael Tretter
2023-01-20  9:06       ` Michael Tretter
2023-01-20  9:20       ` Laurent Pinchart
2023-01-20  9:20         ` Laurent Pinchart
2023-02-09 14:02         ` Michael Tretter
2023-02-09 14:02           ` Michael Tretter
2023-03-06  1:19           ` Shawn Guo
2023-03-06  1:19             ` Shawn Guo
2023-01-13  9:54 ` [PATCH v2 09/16] media: imx-pxp: Sort headers alphabetically Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 10/16] media: imx-pxp: Don't set bus_info manually in .querycap() Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 11/16] media: imx-pxp: Add media controller support Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 12/16] media: imx-pxp: Pass pixel format value to find_format() Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:46   ` Philipp Zabel
2023-01-13 11:46     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 13/16] media: imx-pxp: Implement frame size enumeration Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:49   ` Philipp Zabel
2023-01-13 11:49     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 14/16] media: imx-pxp: Introduce pxp_read() and pxp_write() wrappers Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:50   ` Philipp Zabel
2023-01-13 11:50     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 15/16] media: imx-pxp: Use non-threaded IRQ Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:52   ` Philipp Zabel
2023-01-13 11:52     ` Philipp Zabel
2023-01-13  9:54 ` [PATCH v2 16/16] media: imx-pxp: convert to regmap Michael Tretter
2023-01-13  9:54   ` Michael Tretter
2023-01-13 11:56   ` Philipp Zabel
2023-01-13 11:56     ` Philipp Zabel
2023-01-14 21:29 ` [PATCH v2 00/16] media: imx-pxp: add support for i.MX7D Laurent Pinchart
2023-01-14 21:29   ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.