* [PATCH 01/14] dt-bindings: phy: Add MIPI CSI PHY for i.MX8Q
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-02-03 22:02 ` Rob Herring
2025-01-31 21:33 ` [PATCH 02/14] phy: freescale: Add MIPI CSI PHY driver " Frank Li
` (12 subsequent siblings)
13 siblings, 1 reply; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li
Add MIPI CSI phy binding doc for i.MX8QXP, i.MX8QM and i.MX8ULP.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
.../bindings/phy/fsl,imx8qxp-mipi-cphy.yaml | 53 ++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/Documentation/devicetree/bindings/phy/fsl,imx8qxp-mipi-cphy.yaml b/Documentation/devicetree/bindings/phy/fsl,imx8qxp-mipi-cphy.yaml
new file mode 100644
index 0000000000000..c6cbedd9ed114
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/fsl,imx8qxp-mipi-cphy.yaml
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/fsl,imx8qxp-mipi-cphy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX8 SoC MIPI CSI PHY
+
+maintainers:
+ - Frank Li <Frank.Li@nxp.com>
+
+properties:
+ "#phy-cells":
+ const: 0
+
+ compatible:
+ enum:
+ - fsl,imx8qxp-mipi-cphy
+ - fsl,imx8ulp-mipi-cphy
+
+ reg:
+ maxItems: 1
+
+ power-domains:
+ maxItems: 1
+
+required:
+ - "#phy-cells"
+ - compatible
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - fsl,imx8qxp-mipi-cphy
+ then:
+ required:
+ - reg
+ - power-domains
+
+additionalProperties: false
+
+examples:
+ - |
+ phy@58221000 {
+ compatible = "fsl,imx8qxp-mipi-cphy";
+ reg = <0x58221000 0x10000>;
+ #phy-cells = <0>;
+ power-domains = <&pd 0>;
+ };
+
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH 01/14] dt-bindings: phy: Add MIPI CSI PHY for i.MX8Q
2025-01-31 21:33 ` [PATCH 01/14] dt-bindings: phy: Add MIPI CSI PHY for i.MX8Q Frank Li
@ 2025-02-03 22:02 ` Rob Herring
2025-02-04 15:55 ` Frank Li
0 siblings, 1 reply; 21+ messages in thread
From: Rob Herring @ 2025-02-03 22:02 UTC (permalink / raw)
To: Frank Li
Cc: Vinod Koul, Kishon Vijay Abraham I, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Philipp Zabel, Laurent Pinchart,
Mauro Carvalho Chehab, Rui Miguel Silva, Martin Kepplinger,
Purism Kernel Team, linux-phy, devicetree, imx, linux-arm-kernel,
linux-kernel, linux-media, Guoniu.zhou, Robby Cai, Robert Chiras
On Fri, Jan 31, 2025 at 04:33:46PM -0500, Frank Li wrote:
> Add MIPI CSI phy binding doc for i.MX8QXP, i.MX8QM and i.MX8ULP.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> .../bindings/phy/fsl,imx8qxp-mipi-cphy.yaml | 53 ++++++++++++++++++++++
> 1 file changed, 53 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/phy/fsl,imx8qxp-mipi-cphy.yaml b/Documentation/devicetree/bindings/phy/fsl,imx8qxp-mipi-cphy.yaml
> new file mode 100644
> index 0000000000000..c6cbedd9ed114
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/phy/fsl,imx8qxp-mipi-cphy.yaml
> @@ -0,0 +1,53 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/phy/fsl,imx8qxp-mipi-cphy.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale i.MX8 SoC MIPI CSI PHY
> +
> +maintainers:
> + - Frank Li <Frank.Li@nxp.com>
> +
> +properties:
> + "#phy-cells":
> + const: 0
> +
> + compatible:
> + enum:
> + - fsl,imx8qxp-mipi-cphy
> + - fsl,imx8ulp-mipi-cphy
Where's imx8qm?
> +
> + reg:
> + maxItems: 1
> +
> + power-domains:
> + maxItems: 1
> +
> +required:
> + - "#phy-cells"
> + - compatible
> +
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - fsl,imx8qxp-mipi-cphy
> + then:
> + required:
> + - reg
How is the device accessed with no registers?
> + - power-domains
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + phy@58221000 {
> + compatible = "fsl,imx8qxp-mipi-cphy";
> + reg = <0x58221000 0x10000>;
> + #phy-cells = <0>;
> + power-domains = <&pd 0>;
> + };
> +
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH 01/14] dt-bindings: phy: Add MIPI CSI PHY for i.MX8Q
2025-02-03 22:02 ` Rob Herring
@ 2025-02-04 15:55 ` Frank Li
0 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-02-04 15:55 UTC (permalink / raw)
To: Rob Herring
Cc: Vinod Koul, Kishon Vijay Abraham I, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Philipp Zabel, Laurent Pinchart,
Mauro Carvalho Chehab, Rui Miguel Silva, Martin Kepplinger,
Purism Kernel Team, linux-phy, devicetree, imx, linux-arm-kernel,
linux-kernel, linux-media, Guoniu.zhou, Robby Cai, Robert Chiras
On Mon, Feb 03, 2025 at 04:02:30PM -0600, Rob Herring wrote:
> On Fri, Jan 31, 2025 at 04:33:46PM -0500, Frank Li wrote:
> > Add MIPI CSI phy binding doc for i.MX8QXP, i.MX8QM and i.MX8ULP.
> >
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> > .../bindings/phy/fsl,imx8qxp-mipi-cphy.yaml | 53 ++++++++++++++++++++++
> > 1 file changed, 53 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/phy/fsl,imx8qxp-mipi-cphy.yaml b/Documentation/devicetree/bindings/phy/fsl,imx8qxp-mipi-cphy.yaml
> > new file mode 100644
> > index 0000000000000..c6cbedd9ed114
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/phy/fsl,imx8qxp-mipi-cphy.yaml
> > @@ -0,0 +1,53 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/phy/fsl,imx8qxp-mipi-cphy.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Freescale i.MX8 SoC MIPI CSI PHY
> > +
> > +maintainers:
> > + - Frank Li <Frank.Li@nxp.com>
> > +
> > +properties:
> > + "#phy-cells":
> > + const: 0
> > +
> > + compatible:
> > + enum:
> > + - fsl,imx8qxp-mipi-cphy
> > + - fsl,imx8ulp-mipi-cphy
>
> Where's imx8qm?
Sorry, missed. dts use fsl,imx8qxp-mipi-cphy at 8qm, so I have not found it
by DTB_CHECK.
>
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + power-domains:
> > + maxItems: 1
> > +
> > +required:
> > + - "#phy-cells"
> > + - compatible
> > +
> > +allOf:
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + enum:
> > + - fsl,imx8qxp-mipi-cphy
> > + then:
> > + required:
> > + - reg
>
> How is the device accessed with no registers?
8ulp boudle other function's register.
csr_regs: csr@2dad0000 {
compatible = "8upl-csr", "syscon", "simple-mfd";
reg = <0x2dad0000 0x10000>;
clocks = <&pcc5 IMX8ULP_CLK_CSI_REGS>;
csr_regs_rst: reset-controller {
compatible = "nxp,imx8ulp-csr-regs-reset";
...
};
mipi-phy {
compatible = "fsl,imx8ulp-mipi-cphy";
...
};
};
I have not 8ulp to do test now and this serial are already quite big. I
plan update later.
Just put a fsl,imx8ulp-mipi-cphy here, because it is quite similar with
fsl,imx8qxp-mipi-cphy
Frank
>
> > + - power-domains
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + phy@58221000 {
> > + compatible = "fsl,imx8qxp-mipi-cphy";
> > + reg = <0x58221000 0x10000>;
> > + #phy-cells = <0>;
> > + power-domains = <&pd 0>;
> > + };
> > +
> >
> > --
> > 2.34.1
> >
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 02/14] phy: freescale: Add MIPI CSI PHY driver for i.MX8Q
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
2025-01-31 21:33 ` [PATCH 01/14] dt-bindings: phy: Add MIPI CSI PHY for i.MX8Q Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-01-31 21:33 ` [PATCH 03/14] dt-bindings: reset: Add reset controller for i.MX8QM and i.MX8QXP Frank Li
` (11 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li
Add MIPI CSI PHY driver for i.MX8QM, i.MX8QXP and i.MX8ULP.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
drivers/phy/freescale/Kconfig | 9 +
drivers/phy/freescale/Makefile | 1 +
drivers/phy/freescale/phy-fsl-imx8q-mipi-cphy.c | 254 ++++++++++++++++++++++++
3 files changed, 264 insertions(+)
diff --git a/drivers/phy/freescale/Kconfig b/drivers/phy/freescale/Kconfig
index dcd9acff6d01a..f412fa405b9b6 100644
--- a/drivers/phy/freescale/Kconfig
+++ b/drivers/phy/freescale/Kconfig
@@ -35,6 +35,15 @@ config PHY_FSL_IMX8M_PCIE
Enable this to add support for the PCIE PHY as found on
i.MX8M family of SOCs.
+config PHY_FSL_IMX8Q_MIPI_CPHY
+ tristate "Freescale MIPI CSI PHY support"
+ depends on OF && HAS_IOMEM
+ select GENERIC_PHY
+ select REGMAP_MMIO
+ help
+ Enable this to add support for the MIPI CSI PHY as found
+ on NXP's i.MX8 family of SOCs.
+
config PHY_FSL_IMX8QM_HSIO
tristate "Freescale i.MX8QM HSIO PHY"
depends on OF && HAS_IOMEM
diff --git a/drivers/phy/freescale/Makefile b/drivers/phy/freescale/Makefile
index 658eac7d0a622..8ff72dfdcf654 100644
--- a/drivers/phy/freescale/Makefile
+++ b/drivers/phy/freescale/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_PHY_FSL_IMX8MQ_USB) += phy-fsl-imx8mq-usb.o
obj-$(CONFIG_PHY_MIXEL_LVDS_PHY) += phy-fsl-imx8qm-lvds-phy.o
obj-$(CONFIG_PHY_MIXEL_MIPI_DPHY) += phy-fsl-imx8-mipi-dphy.o
obj-$(CONFIG_PHY_FSL_IMX8M_PCIE) += phy-fsl-imx8m-pcie.o
+obj-$(CONFIG_PHY_FSL_IMX8Q_MIPI_CPHY) += phy-fsl-imx8q-mipi-cphy.o
obj-$(CONFIG_PHY_FSL_IMX8QM_HSIO) += phy-fsl-imx8qm-hsio.o
obj-$(CONFIG_PHY_FSL_LYNX_28G) += phy-fsl-lynx-28g.o
obj-$(CONFIG_PHY_FSL_SAMSUNG_HDMI_PHY) += phy-fsl-samsung-hdmi.o
diff --git a/drivers/phy/freescale/phy-fsl-imx8q-mipi-cphy.c b/drivers/phy/freescale/phy-fsl-imx8q-mipi-cphy.c
new file mode 100644
index 0000000000000..eff3c9554b95e
--- /dev/null
+++ b/drivers/phy/freescale/phy-fsl-imx8q-mipi-cphy.c
@@ -0,0 +1,254 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2025 NXP
+ */
+
+#include <linux/bitfield.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/iopoll.h>
+#include <linux/mfd/syscon.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/phy/phy.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+
+struct imx8_mipi_drvdata {
+ int offset;
+ bool bsyscon : 1;
+};
+
+struct imx8_mipi_phy {
+ struct phy *phy;
+ struct device *dev;
+ struct regmap *phy_gpr;
+ int phy_gpr_reg;
+ int speed;
+ const struct imx8_mipi_drvdata *drvdata;
+};
+
+#define CSI2SS_PL_CLK_INTERVAL_US 10000
+#define CSI2SS_PL_CLK_TIMEOUT_US 100000
+
+#define CSI2SS_BASE_OFFSET 0x0
+
+#define CSI2SS_PLM_CTRL (CSI2SS_BASE_OFFSET + 0x0)
+#define CSI2SS_PLM_CTRL_PL_CLK_RUN BIT(31)
+#define CSI2SS_PLM_CTRL_VSYNC_OVERRIDE BIT(9)
+#define CSI2SS_PLM_CTRL_HSYNC_OVERRIDE BIT(10)
+#define CSI2SS_PLM_CTRL_VALID_OVERRIDE BIT(11)
+#define CSI2SS_PLM_CTRL_POLARITY_MASK BIT(12)
+#define CSI2SS_PLM_CTRL_ENABLE_PL BIT(0)
+
+#define CSI2SS_PHY_CTRL (CSI2SS_BASE_OFFSET + 0x4)
+#define CSI2SS_PHY_CTRL_PD BIT(22)
+#define CSI2SS_PHY_CTRL_RTERM_SEL BIT(21)
+#define CSI2SS_PLM_CTRL_POLARITY BIT(12)
+#define CSI2SS_PHY_CTRL_RX_HS_SETTLE(x) FIELD_PREP(GENMASK(9, 4), (x))
+#define CSI2SS_PHY_CTRL_CONT_CLK_MODE BIT(3)
+#define CSI2SS_PHY_CTRL_DDRCLK_EN BIT(2)
+#define CSI2SS_PHY_CTRL_AUTO_PD_EN BIT(1)
+#define CSI2SS_PHY_CTRL_RX_ENABLE BIT(0)
+
+#define CSI2SS_PHY_STATUS (CSI2SS_BASE_OFFSET + 0x8)
+#define CSI2SS_PHY_TEST_STATUS (CSI2SS_BASE_OFFSET + 0x10)
+#define CSI2SS_PHY_TEST_STATUS_D0 (CSI2SS_BASE_OFFSET + 0x14)
+#define CSI2SS_PHY_TEST_STATUS_D1 (CSI2SS_BASE_OFFSET + 0x18)
+#define CSI2SS_PHY_TEST_STATUS_D2 (CSI2SS_BASE_OFFSET + 0x1C)
+#define CSI2SS_PHY_TEST_STATUS_D3 (CSI2SS_BASE_OFFSET + 0x20)
+
+#define CSI2SS_VC_INTERLACED (CSI2SS_BASE_OFFSET + 0x30)
+#define CSI2SS_VC_INTERLACED_VC3 BIT(3)
+#define CSI2SS_VC_INTERLACED_VC2 BIT(2)
+#define CSI2SS_VC_INTERLACED_VC1 BIT(1)
+#define CSI2SS_VC_INTERLACED_VC0 BIT(0)
+#define CSI2SS_VC_INTERLACED_MASK GENMASK(3, 0)
+
+#define CSI2SS_DATA_TYPE (CSI2SS_BASE_OFFSET + 0x38)
+#define CSI2SS_DATA_TYPE_LEGACY_YUV420_8BIT BIT(2)
+#define CSI2SS_DATA_TYPE_YUV422_8BIT BIT(6)
+#define CSI2SS_DATA_TYPE_YUV422_10BIT BIT(7)
+#define CSI2SS_DATA_TYPE_RGB444 BIT(8)
+#define CSI2SS_DATA_TYPE_RGB555 BIT(9)
+#define CSI2SS_DATA_TYPE_RGB565 BIT(10)
+#define CSI2SS_DATA_TYPE_RGB666 BIT(11)
+#define CSI2SS_DATA_TYPE_RGB888 BIT(12)
+#define CSI2SS_DATA_TYPE_RAW6 BIT(16)
+#define CSI2SS_DATA_TYPE_RAW8 BIT(18)
+#define CSI2SS_DATA_TYPE_RAW10 BIT(19)
+
+#define CSI2SS_YUV420_1ST_LINE_DATA_TYPE (CSI2SS_BASE_OFFSET + 0x40)
+#define CSI2SS_YUV420_1ST_LINE_DATA_TYPE_ODD 0
+#define CSI2SS_YUV420_1ST_LINE_DATA_TYPE_EVEN 1
+
+#define CSI2SS_CTRL_CLK_RESET (CSI2SS_BASE_OFFSET + 0x44)
+#define CSI2SS_CTRL_CLK_RESET_EN BIT(0)
+
+#define CSI2SS_STREAM_FENCE_CTRL (CSI2SS_BASE_OFFSET + 0x48)
+#define CSI2SS_STREAM_FENCE_VC3 BIT(3)
+#define CSI2SS_STREAM_FENCE_VC2 BIT(2)
+#define CSI2SS_STREAM_FENCE_VC1 BIT(1)
+#define CSI2SS_STREAM_FENCE_VC0 BIT(0)
+#define CSI2SS_STREAM_FENCE_CTRL_MASK GENMASK(3, 0)
+
+#define CSI2SS_STREAM_FENCE_STATUS (CSI2SS_BASE_OFFSET + 0x4C)
+
+static int imx8_mipi_phy_power_on(struct phy *phy)
+{
+ struct imx8_mipi_phy *imx8_phy = phy_get_drvdata(phy);
+ int ret;
+ u32 val;
+
+ /* clear format */
+ regmap_clear_bits(imx8_phy->phy_gpr,
+ imx8_phy->phy_gpr_reg + CSI2SS_DATA_TYPE, 0xffffff);
+
+ /* clear polarity */
+ regmap_clear_bits(imx8_phy->phy_gpr,
+ imx8_phy->phy_gpr_reg + CSI2SS_PLM_CTRL,
+ CSI2SS_PLM_CTRL_VSYNC_OVERRIDE |
+ CSI2SS_PLM_CTRL_HSYNC_OVERRIDE |
+ CSI2SS_PLM_CTRL_VALID_OVERRIDE |
+ CSI2SS_PLM_CTRL_POLARITY_MASK);
+
+ val = CSI2SS_PHY_CTRL_RX_ENABLE | CSI2SS_PHY_CTRL_DDRCLK_EN |
+ CSI2SS_PHY_CTRL_CONT_CLK_MODE |
+ CSI2SS_PHY_CTRL_RX_HS_SETTLE(imx8_phy->speed) |
+ CSI2SS_PHY_CTRL_PD | CSI2SS_PHY_CTRL_RTERM_SEL |
+ CSI2SS_PHY_CTRL_AUTO_PD_EN;
+
+ regmap_update_bits(imx8_phy->phy_gpr,
+ imx8_phy->phy_gpr_reg + CSI2SS_PHY_CTRL, 0xffffff,
+ val);
+
+ ret = regmap_read_poll_timeout(imx8_phy->phy_gpr,
+ imx8_phy->phy_gpr_reg + CSI2SS_PLM_CTRL,
+ val, !(val & CSI2SS_PLM_CTRL_PL_CLK_RUN),
+ CSI2SS_PL_CLK_INTERVAL_US,
+ CSI2SS_PL_CLK_TIMEOUT_US);
+
+ if (ret) {
+ dev_err(imx8_phy->dev, "Timeout waiting for Pixel-Link clock");
+ return ret;
+ }
+
+ /* Enable Pixel link Master*/
+ regmap_set_bits(imx8_phy->phy_gpr, imx8_phy->phy_gpr_reg + CSI2SS_PLM_CTRL,
+ CSI2SS_PLM_CTRL_ENABLE_PL | CSI2SS_PLM_CTRL_VALID_OVERRIDE);
+
+ /* PHY Enable */
+ regmap_update_bits(imx8_phy->phy_gpr, imx8_phy->phy_gpr_reg + CSI2SS_PHY_CTRL,
+ CSI2SS_PHY_CTRL_PD | CSI2SS_PLM_CTRL_POLARITY, 0x0);
+
+ /* Release Reset */
+ regmap_set_bits(imx8_phy->phy_gpr, imx8_phy->phy_gpr_reg + CSI2SS_CTRL_CLK_RESET,
+ CSI2SS_CTRL_CLK_RESET_EN);
+
+ return ret;
+}
+
+static int imx8_mipi_phy_power_off(struct phy *phy)
+{
+ struct imx8_mipi_phy *imx8_phy = phy_get_drvdata(phy);
+
+ /* Disable Pixel Link */
+ regmap_write(imx8_phy->phy_gpr, imx8_phy->phy_gpr_reg + CSI2SS_PLM_CTRL, 0x0);
+
+ /* Disable PHY */
+ regmap_write(imx8_phy->phy_gpr, imx8_phy->phy_gpr_reg + CSI2SS_PHY_CTRL, 0x0);
+
+ return 0;
+};
+
+static int imx8_mipi_phy_set_speed(struct phy *phy, int speed)
+{
+ struct imx8_mipi_phy *imx8_phy = phy_get_drvdata(phy);
+
+ imx8_phy->speed = speed;
+
+ return 0;
+}
+
+static const struct phy_ops imx8_mipi_phy_ops = {
+ .power_on = imx8_mipi_phy_power_on,
+ .power_off = imx8_mipi_phy_power_off,
+ .set_speed = imx8_mipi_phy_set_speed,
+ .owner = THIS_MODULE,
+};
+
+const struct imx8_mipi_drvdata imx8qxp_mipi_drvdata = {
+};
+
+const struct imx8_mipi_drvdata imx8ulp_mipi_drvdata = {
+ .offset = 0,
+ .bsyscon = true,
+};
+
+static const struct of_device_id imx8_mipi_phy_of_match[] = {
+ { .compatible = "fsl,imx8qxp-mipi-cphy", &imx8qxp_mipi_drvdata },
+ { .compatible = "fsl,imx8ulp-mipi-cphy", &imx8ulp_mipi_drvdata },
+ {},
+};
+MODULE_DEVICE_TABLE(of, imx8_mipi_phy_of_match);
+
+static const struct regmap_config regmap_config = {
+ .reg_bits = 32,
+ .val_bits = 32,
+ .reg_stride = 4,
+};
+
+static int imx8_mipi_phy_probe(struct platform_device *pdev)
+{
+ struct phy_provider *phy_provider;
+ struct device *dev = &pdev->dev;
+ struct imx8_mipi_phy *imx8_phy;
+ void __iomem *base;
+
+ imx8_phy = devm_kzalloc(dev, sizeof(*imx8_phy), GFP_KERNEL);
+ if (!imx8_phy)
+ return -ENOMEM;
+
+ imx8_phy->dev = dev;
+ imx8_phy->drvdata = of_device_get_match_data(dev);
+ imx8_phy->phy_gpr_reg = imx8_phy->drvdata->offset;
+
+ if (imx8_phy->drvdata->bsyscon) {
+ imx8_phy->phy_gpr = syscon_node_to_regmap(dev->of_node->parent);
+ return dev_err_probe(dev, PTR_ERR(imx8_phy->phy_gpr),
+ "failed to get regmap\n");
+ } else {
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
+ return dev_err_probe(dev, IS_ERR(base),
+ "missed phy base register\n");
+
+ imx8_phy->phy_gpr = devm_regmap_init_mmio(dev, base, ®map_config);
+ if (IS_ERR(imx8_phy->phy_gpr))
+ return dev_err_probe(dev, PTR_ERR(imx8_phy->phy_gpr),
+ "unable to find iomuxc registers\n");
+ }
+
+ imx8_phy->phy = devm_phy_create(dev, NULL, &imx8_mipi_phy_ops);
+ if (IS_ERR(imx8_phy->phy))
+ return PTR_ERR(imx8_phy->phy);
+
+ phy_set_drvdata(imx8_phy->phy, imx8_phy);
+
+ phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
+
+ return PTR_ERR_OR_ZERO(phy_provider);
+}
+
+static struct platform_driver imx8_mipi_phy_driver = {
+ .probe = imx8_mipi_phy_probe,
+ .driver = {
+ .name = "imx8-mipi-cphy",
+ .of_match_table = imx8_mipi_phy_of_match,
+ }
+};
+module_platform_driver(imx8_mipi_phy_driver);
+
+MODULE_DESCRIPTION("FSL IMX8 MIPI CSI PHY driver");
+MODULE_LICENSE("GPL");
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 03/14] dt-bindings: reset: Add reset controller for i.MX8QM and i.MX8QXP
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
2025-01-31 21:33 ` [PATCH 01/14] dt-bindings: phy: Add MIPI CSI PHY for i.MX8Q Frank Li
2025-01-31 21:33 ` [PATCH 02/14] phy: freescale: Add MIPI CSI PHY driver " Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-02-03 22:06 ` Rob Herring
2025-01-31 21:33 ` [PATCH 04/14] reset: imx: Add SCU reset driver for i.MX8QXP and i.MX8QM Frank Li
` (10 subsequent siblings)
13 siblings, 1 reply; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li
Add binding doc for reset controller of i.MX8QM and i.MX8QXP, which use
System Controller Firmware(SCU) reset some peripherals, such as CSI.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
.../devicetree/bindings/reset/fsl,imx-scu.yaml | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/Documentation/devicetree/bindings/reset/fsl,imx-scu.yaml b/Documentation/devicetree/bindings/reset/fsl,imx-scu.yaml
new file mode 100644
index 0000000000000..6046df8723262
--- /dev/null
+++ b/Documentation/devicetree/bindings/reset/fsl,imx-scu.yaml
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reset/fsl,imx-scu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX8 SCU Reset
+
+maintainers:
+ - Frank Li <Frank.Li@nxp.com>
+
+description:
+ i.MX8QM and i.MX8QXP System Controller Firmware(SCU) provide reset for
+ some peripheral.
+
+properties:
+ compatible:
+ enum:
+ - fsl,imx-scu-reset
+
+ '#reset-cells':
+ const: 1
+
+required:
+ - compatible
+ - '#reset-cells'
+
+additionalProperties: false
+
+examples:
+ - |
+ reset-controller {
+ compatible = "fsl,imx-scu-reset";
+ #reset-cells = <1>;
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH 03/14] dt-bindings: reset: Add reset controller for i.MX8QM and i.MX8QXP
2025-01-31 21:33 ` [PATCH 03/14] dt-bindings: reset: Add reset controller for i.MX8QM and i.MX8QXP Frank Li
@ 2025-02-03 22:06 ` Rob Herring
0 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2025-02-03 22:06 UTC (permalink / raw)
To: Frank Li
Cc: Vinod Koul, Kishon Vijay Abraham I, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Philipp Zabel, Laurent Pinchart,
Mauro Carvalho Chehab, Rui Miguel Silva, Martin Kepplinger,
Purism Kernel Team, linux-phy, devicetree, imx, linux-arm-kernel,
linux-kernel, linux-media, Guoniu.zhou, Robby Cai, Robert Chiras
On Fri, Jan 31, 2025 at 04:33:48PM -0500, Frank Li wrote:
> Add binding doc for reset controller of i.MX8QM and i.MX8QXP, which use
> System Controller Firmware(SCU) reset some peripherals, such as CSI.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> .../devicetree/bindings/reset/fsl,imx-scu.yaml | 35 ++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/reset/fsl,imx-scu.yaml b/Documentation/devicetree/bindings/reset/fsl,imx-scu.yaml
> new file mode 100644
> index 0000000000000..6046df8723262
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/reset/fsl,imx-scu.yaml
> @@ -0,0 +1,35 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/reset/fsl,imx-scu.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale i.MX8 SCU Reset
> +
> +maintainers:
> + - Frank Li <Frank.Li@nxp.com>
> +
> +description:
> + i.MX8QM and i.MX8QXP System Controller Firmware(SCU) provide reset for
> + some peripheral.
> +
> +properties:
> + compatible:
> + enum:
> + - fsl,imx-scu-reset
> +
> + '#reset-cells':
> + const: 1
> +
> +required:
> + - compatible
> + - '#reset-cells'
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + reset-controller {
> + compatible = "fsl,imx-scu-reset";
> + #reset-cells = <1>;
This should just be a property in the parent SCU node. You don't need a
node for every provider.
We need a binding for the SCU as a whole.
Rob
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 04/14] reset: imx: Add SCU reset driver for i.MX8QXP and i.MX8QM
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
` (2 preceding siblings ...)
2025-01-31 21:33 ` [PATCH 03/14] dt-bindings: reset: Add reset controller for i.MX8QM and i.MX8QXP Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-01-31 21:33 ` [PATCH 05/14] media: dt-bindings: nxp,imx8-isi: Add i.MX8Q ISI compatible strings Frank Li
` (9 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li
Add System Controller Firmware(SCU) reset driver for i.MX8QM and i.MX8QXP.
SCU Manage resets for peripherals such as MIPI CSI. Currently, support two
reset sources: IMX_SC_R_CSI_0 and IMX_SC_R_CSI_1.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
drivers/reset/Kconfig | 7 +++
drivers/reset/Makefile | 1 +
drivers/reset/reset-imx-scu.c | 101 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 109 insertions(+)
diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index 5b3abb6db2489..99f6f9784e686 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -96,6 +96,13 @@ config RESET_HSDK
help
This enables the reset controller driver for HSDK board.
+config RESET_IMX_SCU
+ tristate "i.MX8Q Reset Driver"
+ depends on IMX_SCU && HAVE_ARM_SMCCC
+ depends on (ARM64 && ARCH_MXC) || COMPILE_TEST
+ help
+ This enables the reset controller driver for i.MX8QM/i.MX8QXP
+
config RESET_IMX7
tristate "i.MX7/8 Reset Driver"
depends on HAS_IOMEM
diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
index 677c4d1e26320..31f9904d13f9c 100644
--- a/drivers/reset/Makefile
+++ b/drivers/reset/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o
obj-$(CONFIG_RESET_EYEQ) += reset-eyeq.o
obj-$(CONFIG_RESET_GPIO) += reset-gpio.o
obj-$(CONFIG_RESET_HSDK) += reset-hsdk.o
+obj-$(CONFIG_RESET_IMX_SCU) += reset-imx-scu.o
obj-$(CONFIG_RESET_IMX7) += reset-imx7.o
obj-$(CONFIG_RESET_IMX8MP_AUDIOMIX) += reset-imx8mp-audiomix.o
obj-$(CONFIG_RESET_INTEL_GW) += reset-intel-gw.o
diff --git a/drivers/reset/reset-imx-scu.c b/drivers/reset/reset-imx-scu.c
new file mode 100644
index 0000000000000..d3074eaad4c99
--- /dev/null
+++ b/drivers/reset/reset-imx-scu.c
@@ -0,0 +1,101 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2025 NXP
+ * Frank Li <Frank.Li@nxp.com>
+ */
+#include <linux/firmware/imx/svc/misc.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/reset-controller.h>
+
+#include <dt-bindings/firmware/imx/rsrc.h>
+
+struct imx_scu_reset {
+ struct reset_controller_dev rc;
+ struct imx_sc_ipc *ipc_handle;
+};
+
+static struct imx_scu_reset *to_imx_scu(struct reset_controller_dev *rc)
+{
+ return container_of(rc, struct imx_scu_reset, rc);
+}
+
+struct imx_scu_id_map {
+ u32 resource_id;
+ u32 command_id;
+};
+
+static const struct imx_scu_id_map imx_scu_id_map[] = {
+ { IMX_SC_R_CSI_0, IMX_SC_C_MIPI_RESET },
+ { IMX_SC_R_CSI_1, IMX_SC_C_MIPI_RESET },
+};
+
+static int imx_scu_reset_assert(struct reset_controller_dev *rc, unsigned long id)
+{
+ struct imx_scu_reset *priv = to_imx_scu(rc);
+
+ return imx_sc_misc_set_control(priv->ipc_handle, imx_scu_id_map[id].resource_id,
+ imx_scu_id_map[id].command_id, true);
+}
+
+static const struct reset_control_ops imx_scu_reset_ops = {
+ .assert = imx_scu_reset_assert,
+};
+
+static int imx_scu_xlate(struct reset_controller_dev *rc, const struct of_phandle_args *reset_spec)
+{
+ int i;
+
+ for (i = 0; i < rc->nr_resets; i++)
+ if (reset_spec->args[0] == imx_scu_id_map[i].resource_id)
+ return i;
+
+ return -EINVAL;
+}
+
+static int imx_scu_reset_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct imx_scu_reset *priv;
+ int ret;
+
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+ platform_set_drvdata(pdev, &priv->rc);
+
+ ret = imx_scu_get_handle(&priv->ipc_handle);
+ if (ret)
+ return dev_err_probe(dev, ret, "sc_misc_MIPI get ipc handle failed!\n");
+
+ priv->rc.ops = &imx_scu_reset_ops;
+ priv->rc.owner = THIS_MODULE;
+ priv->rc.of_node = dev->of_node;
+ priv->rc.of_reset_n_cells = 1;
+ priv->rc.of_xlate = imx_scu_xlate;
+ priv->rc.nr_resets = ARRAY_SIZE(imx_scu_id_map);
+
+ return devm_reset_controller_register(dev, &priv->rc);
+}
+
+static const struct of_device_id imx_scu_reset_ids[] = {
+ { .compatible = "fsl,imx-scu-reset", },
+ {}
+};
+MODULE_DEVICE_TABLE(platform, imx_scu_reset_ids);
+
+static struct platform_driver imx_scu_reset_driver = {
+ .probe = imx_scu_reset_probe,
+ .driver = {
+ .name = "scu-reset",
+ .of_match_table = imx_scu_reset_ids,
+ },
+};
+module_platform_driver(imx_scu_reset_driver);
+
+MODULE_AUTHOR("Frank Li <Frank.Li@nxp.com>");
+MODULE_DESCRIPTION("i.MX scu reset driver");
+MODULE_LICENSE("GPL");
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 05/14] media: dt-bindings: nxp,imx8-isi: Add i.MX8Q ISI compatible strings
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
` (3 preceding siblings ...)
2025-01-31 21:33 ` [PATCH 04/14] reset: imx: Add SCU reset driver for i.MX8QXP and i.MX8QM Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-02-03 22:16 ` Rob Herring
2025-01-31 21:33 ` [PATCH 06/14] media: nxp: imx8-isi: Allow num_sources to be greater than num_sink Frank Li
` (8 subsequent siblings)
13 siblings, 1 reply; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li,
Mirela Rabulea, Laurentiu Palcu
From: Robert Chiras <robert.chiras@nxp.com>
Add compatible strings for i.MX8QM and i.MX8QXP platforms.
Increase the number of max interrupts and clock to 8. i.MX8QM have 8
channels and i.MX8QXP have 5 channels. Each channel requires one clock
source and interrupt.
Remove fsl,blk-ctrl from required list because i.MX8Q needn't it.
i.MX8QM use port@2 and port@3. i.MX8QXP use port@2 and port@6.
Keep the same restriction for the other platform.
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
.../devicetree/bindings/media/nxp,imx8-isi.yaml | 87 +++++++++++++++++++---
1 file changed, 75 insertions(+), 12 deletions(-)
diff --git a/Documentation/devicetree/bindings/media/nxp,imx8-isi.yaml b/Documentation/devicetree/bindings/media/nxp,imx8-isi.yaml
index f43b91984f015..b713c8ba79e39 100644
--- a/Documentation/devicetree/bindings/media/nxp,imx8-isi.yaml
+++ b/Documentation/devicetree/bindings/media/nxp,imx8-isi.yaml
@@ -21,6 +21,8 @@ properties:
enum:
- fsl,imx8mn-isi
- fsl,imx8mp-isi
+ - fsl,imx8qm-isi
+ - fsl,imx8qxp-isi
- fsl,imx8ulp-isi
- fsl,imx93-isi
@@ -28,17 +30,12 @@ properties:
maxItems: 1
clocks:
- items:
- - description: The AXI clock
- - description: The APB clock
- # TODO: Check if the per-channel ipg_proc_clk clocks need to be specified
- # as well, in case some SoCs have the ability to control them separately.
- # This may be the case of the i.MX8[DQ]X(P)
+ minItems: 1
+ maxItems: 8
clock-names:
- items:
- - const: axi
- - const: apb
+ minItems: 1
+ maxItems: 8
fsl,blk-ctrl:
$ref: /schemas/types.yaml#/definitions/phandle
@@ -49,10 +46,11 @@ properties:
interrupts:
description: Processing pipeline interrupts, one per pipeline
minItems: 1
- maxItems: 2
+ maxItems: 8
power-domains:
- maxItems: 1
+ minItems: 1
+ maxItems: 8
ports:
$ref: /schemas/graph.yaml#/properties/ports
@@ -66,7 +64,6 @@ required:
- interrupts
- clocks
- clock-names
- - fsl,blk-ctrl
- ports
allOf:
@@ -79,9 +76,17 @@ allOf:
- fsl,imx8ulp-isi
- fsl,imx93-isi
then:
+ required:
+ - fsl,blk-ctrl
properties:
interrupts:
maxItems: 1
+ clocks:
+ maxItems: 2
+ clock-names:
+ items:
+ - const: axi
+ - const: apb
ports:
properties:
port@0:
@@ -96,9 +101,17 @@ allOf:
contains:
const: fsl,imx8mp-isi
then:
+ required:
+ - fsl,blk-ctrl
properties:
interrupts:
maxItems: 2
+ clocks:
+ maxItems: 2
+ clock-names:
+ items:
+ - const: axi
+ - const: apb
ports:
properties:
port@0:
@@ -109,6 +122,56 @@ allOf:
- port@0
- port@1
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: fsl,imx8qm-isi
+ then:
+ properties:
+ clocks:
+ minItems: 8
+ clock-names:
+ items:
+ pattern: "^per[0-7]"
+ interrupts:
+ minItems: 8
+ ports:
+ properties:
+ port@2:
+ description: MIPI CSI-2 RX 0
+ port@3:
+ description: MIPI CSI-2 RX 1
+ required:
+ - port@2
+ - port@3
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: fsl,imx8qxp-isi
+ then:
+ properties:
+ clocks:
+ minItems: 5
+ maxItems: 5
+ clock-names:
+ items:
+ pattern: "^per[0,4-7]"
+ interrupts:
+ minItems: 5
+ maxItems: 5
+ ports:
+ properties:
+ port@2:
+ description: MIPI CSI-2 RX
+ port@3: false
+ port@6:
+ description: MIPI CSI-2 Parallel RX
+ required:
+ - port@2
+
additionalProperties: false
examples:
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH 05/14] media: dt-bindings: nxp,imx8-isi: Add i.MX8Q ISI compatible strings
2025-01-31 21:33 ` [PATCH 05/14] media: dt-bindings: nxp,imx8-isi: Add i.MX8Q ISI compatible strings Frank Li
@ 2025-02-03 22:16 ` Rob Herring
0 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2025-02-03 22:16 UTC (permalink / raw)
To: Frank Li
Cc: Vinod Koul, Kishon Vijay Abraham I, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Philipp Zabel, Laurent Pinchart,
Mauro Carvalho Chehab, Rui Miguel Silva, Martin Kepplinger,
Purism Kernel Team, linux-phy, devicetree, imx, linux-arm-kernel,
linux-kernel, linux-media, Guoniu.zhou, Robby Cai, Robert Chiras,
Mirela Rabulea, Laurentiu Palcu
On Fri, Jan 31, 2025 at 04:33:50PM -0500, Frank Li wrote:
> From: Robert Chiras <robert.chiras@nxp.com>
>
> Add compatible strings for i.MX8QM and i.MX8QXP platforms.
>
> Increase the number of max interrupts and clock to 8. i.MX8QM have 8
> channels and i.MX8QXP have 5 channels. Each channel requires one clock
> source and interrupt.
>
> Remove fsl,blk-ctrl from required list because i.MX8Q needn't it.
>
> i.MX8QM use port@2 and port@3. i.MX8QXP use port@2 and port@6.
>
> Keep the same restriction for the other platform.
>
> Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
> Reviewed-by: Robby Cai <robby.cai@nxp.com>
> Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
> Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> .../devicetree/bindings/media/nxp,imx8-isi.yaml | 87 +++++++++++++++++++---
> 1 file changed, 75 insertions(+), 12 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/media/nxp,imx8-isi.yaml b/Documentation/devicetree/bindings/media/nxp,imx8-isi.yaml
> index f43b91984f015..b713c8ba79e39 100644
> --- a/Documentation/devicetree/bindings/media/nxp,imx8-isi.yaml
> +++ b/Documentation/devicetree/bindings/media/nxp,imx8-isi.yaml
> @@ -21,6 +21,8 @@ properties:
> enum:
> - fsl,imx8mn-isi
> - fsl,imx8mp-isi
> + - fsl,imx8qm-isi
> + - fsl,imx8qxp-isi
> - fsl,imx8ulp-isi
> - fsl,imx93-isi
>
> @@ -28,17 +30,12 @@ properties:
> maxItems: 1
>
> clocks:
> - items:
> - - description: The AXI clock
> - - description: The APB clock
> - # TODO: Check if the per-channel ipg_proc_clk clocks need to be specified
> - # as well, in case some SoCs have the ability to control them separately.
> - # This may be the case of the i.MX8[DQ]X(P)
> + minItems: 1
> + maxItems: 8
Isn't the minimum still 2?
>
> clock-names:
> - items:
> - - const: axi
> - - const: apb
> + minItems: 1
> + maxItems: 8
>
> fsl,blk-ctrl:
> $ref: /schemas/types.yaml#/definitions/phandle
> @@ -49,10 +46,11 @@ properties:
> interrupts:
> description: Processing pipeline interrupts, one per pipeline
> minItems: 1
> - maxItems: 2
> + maxItems: 8
>
> power-domains:
> - maxItems: 1
> + minItems: 1
> + maxItems: 8
>
> ports:
> $ref: /schemas/graph.yaml#/properties/ports
> @@ -66,7 +64,6 @@ required:
> - interrupts
> - clocks
> - clock-names
> - - fsl,blk-ctrl
> - ports
>
> allOf:
> @@ -79,9 +76,17 @@ allOf:
> - fsl,imx8ulp-isi
> - fsl,imx93-isi
> then:
> + required:
> + - fsl,blk-ctrl
> properties:
> interrupts:
> maxItems: 1
> + clocks:
> + maxItems: 2
> + clock-names:
> + items:
> + - const: axi
> + - const: apb
> ports:
> properties:
> port@0:
> @@ -96,9 +101,17 @@ allOf:
> contains:
> const: fsl,imx8mp-isi
> then:
> + required:
> + - fsl,blk-ctrl
> properties:
> interrupts:
> maxItems: 2
> + clocks:
> + maxItems: 2
> + clock-names:
> + items:
> + - const: axi
> + - const: apb
> ports:
> properties:
> port@0:
> @@ -109,6 +122,56 @@ allOf:
> - port@0
> - port@1
>
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: fsl,imx8qm-isi
> + then:
> + properties:
> + clocks:
> + minItems: 8
> + clock-names:
> + items:
> + pattern: "^per[0-7]"
> + interrupts:
> + minItems: 8
> + ports:
> + properties:
> + port@2:
> + description: MIPI CSI-2 RX 0
> + port@3:
> + description: MIPI CSI-2 RX 1
> + required:
> + - port@2
> + - port@3
This schema is completely missing proper schemas for port nodes. It
needs to reference the port schema for each port. That should be at the
top-level.
I think this addition is borderline whether it should be its own schema
doc. The if/then schemas are larger than the main part. The ports are
not even the same.
Rob
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 06/14] media: nxp: imx8-isi: Allow num_sources to be greater than num_sink
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
` (4 preceding siblings ...)
2025-01-31 21:33 ` [PATCH 05/14] media: dt-bindings: nxp,imx8-isi: Add i.MX8Q ISI compatible strings Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-01-31 21:33 ` [PATCH 07/14] media: imx8-isi: Add support for i.MX8QM and i.MX8QXP Frank Li
` (7 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li
Allow num_sources (drvdata: num_channels) to be greater than num_sink
(drvdata: num_ports + 1).
ISI support stream multiplexing, such as differentiates multiple cameras
from a single 2-lane MIPI input, or duplicates input stream into multiple
outputs. So num_channels may be greater than num_ports at some platform.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c
index 93a55c97cd173..ba5b2d3617a23 100644
--- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c
+++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c
@@ -188,11 +188,11 @@ static int mxc_isi_crossbar_init_state(struct v4l2_subdev *sd,
* Create a 1:1 mapping between pixel link inputs and outputs to
* pipelines by default.
*/
- routes = kcalloc(xbar->num_sources, sizeof(*routes), GFP_KERNEL);
+ routes = kcalloc(xbar->num_sinks - 1, sizeof(*routes), GFP_KERNEL);
if (!routes)
return -ENOMEM;
- for (i = 0; i < xbar->num_sources; ++i) {
+ for (i = 0; i < xbar->num_sinks - 1; ++i) {
struct v4l2_subdev_route *route = &routes[i];
route->sink_pad = i;
@@ -200,7 +200,7 @@ static int mxc_isi_crossbar_init_state(struct v4l2_subdev *sd,
route->flags = V4L2_SUBDEV_ROUTE_FL_ACTIVE;
}
- routing.num_routes = xbar->num_sources;
+ routing.num_routes = xbar->num_sinks - 1;
routing.routes = routes;
ret = __mxc_isi_crossbar_set_routing(sd, state, &routing);
@@ -453,7 +453,7 @@ int mxc_isi_crossbar_init(struct mxc_isi_dev *isi)
* the memory input.
*/
xbar->num_sinks = isi->pdata->num_ports + 1;
- xbar->num_sources = isi->pdata->num_ports;
+ xbar->num_sources = isi->pdata->num_channels;
num_pads = xbar->num_sinks + xbar->num_sources;
xbar->pads = kcalloc(num_pads, sizeof(*xbar->pads), GFP_KERNEL);
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 07/14] media: imx8-isi: Add support for i.MX8QM and i.MX8QXP
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
` (5 preceding siblings ...)
2025-01-31 21:33 ` [PATCH 06/14] media: nxp: imx8-isi: Allow num_sources to be greater than num_sink Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-01-31 21:33 ` [PATCH 08/14] media: dt-bindings: nxp,imx8mq-mipi-csi2: Add i.MX8QM compatible strings Frank Li
` (6 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li,
Mirela Rabulea, Laurentiu Palcu
From: Robert Chiras <robert.chiras@nxp.com>
Add compatibles and platform data for i.MX8QM and i.MX8QXP platforms.
There are 8 ISI channels on i.MX8QM while there are only 5 channels on
i.MX8QXP.
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
.../media/platform/nxp/imx8-isi/imx8-isi-core.c | 47 ++++++++++++++++++++++
.../media/platform/nxp/imx8-isi/imx8-isi-core.h | 2 +
2 files changed, 49 insertions(+)
diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
index 1e79b1211b603..a3237d76f7aa5 100644
--- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
+++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
@@ -274,6 +274,25 @@ static const struct mxc_isi_set_thd mxc_imx8_isi_thd_v1 = {
.panic_set_thd_v = { .mask = 0xf0000, .offset = 16, .threshold = 0x7 },
};
+static const struct clk_bulk_data mxc_imx8qm_clks[] = {
+ { .id = "per0" },
+ { .id = "per1" },
+ { .id = "per2" },
+ { .id = "per3" },
+ { .id = "per4" },
+ { .id = "per5" },
+ { .id = "per6" },
+ { .id = "per7" },
+};
+
+static const struct clk_bulk_data mxc_imx8qxp_clks[] = {
+ { .id = "per0" },
+ { .id = "per4" },
+ { .id = "per5" },
+ { .id = "per6" },
+ { .id = "per7" },
+};
+
static const struct clk_bulk_data mxc_imx8mn_clks[] = {
{ .id = "axi" },
{ .id = "apb" },
@@ -334,6 +353,32 @@ static const struct mxc_isi_plat_data mxc_imx93_data = {
.has_36bit_dma = false,
};
+static const struct mxc_isi_plat_data mxc_imx8qm_data = {
+ .model = MXC_ISI_IMX8QM,
+ .num_ports = 5,
+ .num_channels = 8,
+ .reg_offset = 0x10000,
+ .ier_reg = &mxc_imx8_isi_ier_v1,
+ .set_thd = &mxc_imx8_isi_thd_v1,
+ .clks = mxc_imx8qm_clks,
+ .num_clks = ARRAY_SIZE(mxc_imx8qm_clks),
+ .buf_active_reverse = true,
+ .has_36bit_dma = false,
+};
+
+static const struct mxc_isi_plat_data mxc_imx8qxp_data = {
+ .model = MXC_ISI_IMX8QXP,
+ .num_ports = 5,
+ .num_channels = 5,
+ .reg_offset = 0x10000,
+ .ier_reg = &mxc_imx8_isi_ier_v1,
+ .set_thd = &mxc_imx8_isi_thd_v1,
+ .clks = mxc_imx8qxp_clks,
+ .num_clks = ARRAY_SIZE(mxc_imx8qxp_clks),
+ .buf_active_reverse = true,
+ .has_36bit_dma = false,
+};
+
/* -----------------------------------------------------------------------------
* Power management
*/
@@ -541,6 +586,8 @@ static void mxc_isi_remove(struct platform_device *pdev)
static const struct of_device_id mxc_isi_of_match[] = {
{ .compatible = "fsl,imx8mn-isi", .data = &mxc_imx8mn_data },
{ .compatible = "fsl,imx8mp-isi", .data = &mxc_imx8mp_data },
+ { .compatible = "fsl,imx8qm-isi", .data = &mxc_imx8qm_data },
+ { .compatible = "fsl,imx8qxp-isi", .data = &mxc_imx8qxp_data },
{ .compatible = "fsl,imx8ulp-isi", .data = &mxc_imx8ulp_data },
{ .compatible = "fsl,imx93-isi", .data = &mxc_imx93_data },
{ /* sentinel */ },
diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h
index 9c7fe9e5f941f..496cad3f9423d 100644
--- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h
+++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h
@@ -158,6 +158,8 @@ struct mxc_gasket_ops {
enum model {
MXC_ISI_IMX8MN,
MXC_ISI_IMX8MP,
+ MXC_ISI_IMX8QM,
+ MXC_ISI_IMX8QXP,
MXC_ISI_IMX8ULP,
MXC_ISI_IMX93,
};
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 08/14] media: dt-bindings: nxp,imx8mq-mipi-csi2: Add i.MX8QM compatible strings
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
` (6 preceding siblings ...)
2025-01-31 21:33 ` [PATCH 07/14] media: imx8-isi: Add support for i.MX8QM and i.MX8QXP Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-02-03 22:20 ` Rob Herring
2025-01-31 21:33 ` [PATCH 09/14] media: imx8mq-mipi-csi2: Add imx8mq_plat_data for different " Frank Li
` (5 subsequent siblings)
13 siblings, 1 reply; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li,
Mirela Rabulea, Laurentiu Palcu
From: Robert Chiras <robert.chiras@nxp.com>
Add compatible strings for i.MX8QM platform. Remove fsl,mipi-phy-gpr from
required properties and add 'phys', since i.MX8QM use standard phy
interface.
Keep the same restriction for other compatible strings.
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
.../bindings/media/nxp,imx8mq-mipi-csi2.yaml | 30 ++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml b/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml
index 2a14e3b0e0040..91c4d8fbb1f8c 100644
--- a/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml
+++ b/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml
@@ -18,6 +18,8 @@ properties:
compatible:
enum:
- fsl,imx8mq-mipi-csi2
+ - fsl,imx8qm-mipi-csi2
+ - fsl,imx8ulp-mipi-csi2
reg:
maxItems: 1
@@ -39,13 +41,18 @@ properties:
- const: ui
power-domains:
- maxItems: 1
+ minItems: 1
+ maxItems: 2
resets:
items:
- description: CORE_RESET reset register bit definition
- description: PHY_REF_RESET reset register bit definition
- description: ESC_RESET reset register bit definition
+ minItems: 1
+
+ phys:
+ maxItems: 1
fsl,mipi-phy-gpr:
description: |
@@ -113,9 +120,28 @@ required:
- clock-names
- power-domains
- resets
- - fsl,mipi-phy-gpr
- ports
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - fsl,imx8qm-mipi-csi2
+ - fsl,imx8ulp-mipi-csi2
+ then:
+ required:
+ - phys
+ else:
+ properties:
+ reg:
+ maxItems: 1
+ resets:
+ minItems: 3
+ required:
+ - fsl,mipi-phy-gpr
+
additionalProperties: false
examples:
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH 08/14] media: dt-bindings: nxp,imx8mq-mipi-csi2: Add i.MX8QM compatible strings
2025-01-31 21:33 ` [PATCH 08/14] media: dt-bindings: nxp,imx8mq-mipi-csi2: Add i.MX8QM compatible strings Frank Li
@ 2025-02-03 22:20 ` Rob Herring
2025-02-04 15:47 ` Frank Li
0 siblings, 1 reply; 21+ messages in thread
From: Rob Herring @ 2025-02-03 22:20 UTC (permalink / raw)
To: Frank Li
Cc: Vinod Koul, Kishon Vijay Abraham I, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Philipp Zabel, Laurent Pinchart,
Mauro Carvalho Chehab, Rui Miguel Silva, Martin Kepplinger,
Purism Kernel Team, linux-phy, devicetree, imx, linux-arm-kernel,
linux-kernel, linux-media, Guoniu.zhou, Robby Cai, Robert Chiras,
Mirela Rabulea, Laurentiu Palcu
On Fri, Jan 31, 2025 at 04:33:53PM -0500, Frank Li wrote:
> From: Robert Chiras <robert.chiras@nxp.com>
>
> Add compatible strings for i.MX8QM platform. Remove fsl,mipi-phy-gpr from
> required properties and add 'phys', since i.MX8QM use standard phy
> interface.
>
> Keep the same restriction for other compatible strings.
>
> Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
> Reviewed-by: Robby Cai <robby.cai@nxp.com>
> Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
> Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> .../bindings/media/nxp,imx8mq-mipi-csi2.yaml | 30 ++++++++++++++++++++--
> 1 file changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml b/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml
> index 2a14e3b0e0040..91c4d8fbb1f8c 100644
> --- a/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml
> +++ b/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml
> @@ -18,6 +18,8 @@ properties:
> compatible:
> enum:
> - fsl,imx8mq-mipi-csi2
> + - fsl,imx8qm-mipi-csi2
> + - fsl,imx8ulp-mipi-csi2
>
> reg:
> maxItems: 1
> @@ -39,13 +41,18 @@ properties:
> - const: ui
>
> power-domains:
> - maxItems: 1
> + minItems: 1
> + maxItems: 2
>
> resets:
> items:
> - description: CORE_RESET reset register bit definition
> - description: PHY_REF_RESET reset register bit definition
> - description: ESC_RESET reset register bit definition
> + minItems: 1
> +
> + phys:
> + maxItems: 1
>
> fsl,mipi-phy-gpr:
> description: |
> @@ -113,9 +120,28 @@ required:
> - clock-names
> - power-domains
> - resets
> - - fsl,mipi-phy-gpr
> - ports
>
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - fsl,imx8qm-mipi-csi2
> + - fsl,imx8ulp-mipi-csi2
> + then:
> + required:
> + - phys
> + else:
> + properties:
> + reg:
> + maxItems: 1
The max is already 1.
> + resets:
> + minItems: 3
1, 2, or 3 resets is valid for imx8qm and imx8ulp?
2 power-domains are also now valid?
> + required:
> + - fsl,mipi-phy-gpr
> +
> additionalProperties: false
>
> examples:
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 08/14] media: dt-bindings: nxp,imx8mq-mipi-csi2: Add i.MX8QM compatible strings
2025-02-03 22:20 ` Rob Herring
@ 2025-02-04 15:47 ` Frank Li
0 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-02-04 15:47 UTC (permalink / raw)
To: Rob Herring
Cc: Vinod Koul, Kishon Vijay Abraham I, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Philipp Zabel, Laurent Pinchart,
Mauro Carvalho Chehab, Rui Miguel Silva, Martin Kepplinger,
Purism Kernel Team, linux-phy, devicetree, imx, linux-arm-kernel,
linux-kernel, linux-media, Guoniu.zhou, Robby Cai, Robert Chiras,
Mirela Rabulea, Laurentiu Palcu
On Mon, Feb 03, 2025 at 04:20:18PM -0600, Rob Herring wrote:
> On Fri, Jan 31, 2025 at 04:33:53PM -0500, Frank Li wrote:
> > From: Robert Chiras <robert.chiras@nxp.com>
> >
> > Add compatible strings for i.MX8QM platform. Remove fsl,mipi-phy-gpr from
> > required properties and add 'phys', since i.MX8QM use standard phy
> > interface.
> >
> > Keep the same restriction for other compatible strings.
> >
> > Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
> > Reviewed-by: Robby Cai <robby.cai@nxp.com>
> > Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
> > Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> > .../bindings/media/nxp,imx8mq-mipi-csi2.yaml | 30 ++++++++++++++++++++--
> > 1 file changed, 28 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml b/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml
> > index 2a14e3b0e0040..91c4d8fbb1f8c 100644
> > --- a/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml
> > +++ b/Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml
> > @@ -18,6 +18,8 @@ properties:
> > compatible:
> > enum:
> > - fsl,imx8mq-mipi-csi2
> > + - fsl,imx8qm-mipi-csi2
> > + - fsl,imx8ulp-mipi-csi2
> >
> > reg:
> > maxItems: 1
> > @@ -39,13 +41,18 @@ properties:
> > - const: ui
> >
> > power-domains:
> > - maxItems: 1
> > + minItems: 1
> > + maxItems: 2
> >
> > resets:
> > items:
> > - description: CORE_RESET reset register bit definition
> > - description: PHY_REF_RESET reset register bit definition
> > - description: ESC_RESET reset register bit definition
> > + minItems: 1
> > +
> > + phys:
> > + maxItems: 1
> >
> > fsl,mipi-phy-gpr:
> > description: |
> > @@ -113,9 +120,28 @@ required:
> > - clock-names
> > - power-domains
> > - resets
> > - - fsl,mipi-phy-gpr
> > - ports
> >
> > +allOf:
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + enum:
> > + - fsl,imx8qm-mipi-csi2
> > + - fsl,imx8ulp-mipi-csi2
> > + then:
> > + required:
> > + - phys
> > + else:
> > + properties:
> > + reg:
> > + maxItems: 1
>
> The max is already 1.
>
> > + resets:
> > + minItems: 3
>
> 1, 2, or 3 resets is valid for imx8qm and imx8ulp?
It should be 1 for imx8qm and imx8ulp, I will update.
>
> 2 power-domains are also now valid?
Sorry, missed it. I will update it.
Frank
>
> > + required:
> > + - fsl,mipi-phy-gpr
> > +
> > additionalProperties: false
> >
> > examples:
> >
> > --
> > 2.34.1
> >
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 09/14] media: imx8mq-mipi-csi2: Add imx8mq_plat_data for different compatible strings
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
` (7 preceding siblings ...)
2025-01-31 21:33 ` [PATCH 08/14] media: dt-bindings: nxp,imx8mq-mipi-csi2: Add i.MX8QM compatible strings Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-01-31 21:33 ` [PATCH 10/14] media: imx8mq-mipi-csi2: Add support for i.MX8QM Frank Li
` (4 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li
From: "Guoniu.zhou" <guoniu.zhou@nxp.com>
Introduce `imx8mq_plat_data` along with enable/disable callback operations
to facilitate support for new chips. No functional changes.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 60 ++++++++++++++++++++-------
1 file changed, 46 insertions(+), 14 deletions(-)
diff --git a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
index 1f2657cf6e824..b5eae56d92f49 100644
--- a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
+++ b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
@@ -62,6 +62,8 @@
#define CSI2RX_CFG_VID_P_FIFO_SEND_LEVEL 0x188
#define CSI2RX_CFG_DISABLE_PAYLOAD_1 0x130
+struct csi_state;
+
enum {
ST_POWERED = 1,
ST_STREAMING = 2,
@@ -83,11 +85,11 @@ static const char * const imx8mq_mipi_csi_clk_id[CSI2_NUM_CLKS] = {
#define CSI2_NUM_CLKS ARRAY_SIZE(imx8mq_mipi_csi_clk_id)
-#define GPR_CSI2_1_RX_ENABLE BIT(13)
-#define GPR_CSI2_1_VID_INTFC_ENB BIT(12)
-#define GPR_CSI2_1_HSEL BIT(10)
-#define GPR_CSI2_1_CONT_CLK_MODE BIT(8)
-#define GPR_CSI2_1_S_PRG_RXHS_SETTLE(x) (((x) & 0x3f) << 2)
+struct imx8mq_plat_data {
+ const char *name;
+ int (*enable)(struct csi_state *state, u32 hs_settle);
+ void (*disable)(struct csi_state *state);
+};
/*
* The send level configures the number of entries that must accumulate in
@@ -106,6 +108,7 @@ static const char * const imx8mq_mipi_csi_clk_id[CSI2_NUM_CLKS] = {
struct csi_state {
struct device *dev;
+ const struct imx8mq_plat_data *pdata;
void __iomem *regs;
struct clk_bulk_data clks[CSI2_NUM_CLKS];
struct reset_control *rst;
@@ -137,6 +140,35 @@ struct csi2_pix_format {
u8 width;
};
+/* -----------------------------------------------------------------------------
+ * i.MX8MQ GPR
+ */
+
+#define GPR_CSI2_1_RX_ENABLE BIT(13)
+#define GPR_CSI2_1_VID_INTFC_ENB BIT(12)
+#define GPR_CSI2_1_HSEL BIT(10)
+#define GPR_CSI2_1_CONT_CLK_MODE BIT(8)
+#define GPR_CSI2_1_S_PRG_RXHS_SETTLE(x) (((x) & 0x3f) << 2)
+
+static int imx8mq_gpr_enable(struct csi_state *state, u32 hs_settle)
+{
+ regmap_update_bits(state->phy_gpr,
+ state->phy_gpr_reg,
+ 0x3fff,
+ GPR_CSI2_1_RX_ENABLE |
+ GPR_CSI2_1_VID_INTFC_ENB |
+ GPR_CSI2_1_HSEL |
+ GPR_CSI2_1_CONT_CLK_MODE |
+ GPR_CSI2_1_S_PRG_RXHS_SETTLE(hs_settle));
+
+ return 0;
+}
+
+static const struct imx8mq_plat_data imx8mq_data = {
+ .name = "i.MX8MQ",
+ .enable = imx8mq_gpr_enable,
+};
+
static const struct csi2_pix_format imx8mq_mipi_csi_formats[] = {
/* RAW (Bayer and greyscale) formats. */
{
@@ -364,14 +396,9 @@ static int imx8mq_mipi_csi_start_stream(struct csi_state *state,
if (ret)
return ret;
- regmap_update_bits(state->phy_gpr,
- state->phy_gpr_reg,
- 0x3fff,
- GPR_CSI2_1_RX_ENABLE |
- GPR_CSI2_1_VID_INTFC_ENB |
- GPR_CSI2_1_HSEL |
- GPR_CSI2_1_CONT_CLK_MODE |
- GPR_CSI2_1_S_PRG_RXHS_SETTLE(hs_settle));
+ ret = state->pdata->enable(state, hs_settle);
+ if (ret)
+ return ret;
return 0;
}
@@ -379,6 +406,9 @@ static int imx8mq_mipi_csi_start_stream(struct csi_state *state,
static void imx8mq_mipi_csi_stop_stream(struct csi_state *state)
{
imx8mq_mipi_csi_write(state, CSI2RX_CFG_DISABLE_DATA_LANES, 0xf);
+
+ if (state->pdata->disable)
+ state->pdata->disable(state);
}
/* -----------------------------------------------------------------------------
@@ -869,6 +899,8 @@ static int imx8mq_mipi_csi_probe(struct platform_device *pdev)
state->dev = dev;
+ state->pdata = of_device_get_match_data(dev);
+
ret = imx8mq_mipi_csi_parse_dt(state);
if (ret < 0) {
dev_err(dev, "Failed to parse device tree: %d\n", ret);
@@ -946,7 +978,7 @@ static void imx8mq_mipi_csi_remove(struct platform_device *pdev)
}
static const struct of_device_id imx8mq_mipi_csi_of_match[] = {
- { .compatible = "fsl,imx8mq-mipi-csi2", },
+ { .compatible = "fsl,imx8mq-mipi-csi2", .data = &imx8mq_data },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, imx8mq_mipi_csi_of_match);
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 10/14] media: imx8mq-mipi-csi2: Add support for i.MX8QM
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
` (8 preceding siblings ...)
2025-01-31 21:33 ` [PATCH 09/14] media: imx8mq-mipi-csi2: Add imx8mq_plat_data for different " Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-01-31 21:33 ` [PATCH 11/14] arm64: dts: imx8: add capture controller for i.MX8's img subsystem Frank Li
` (3 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li
Add support for the common PHY interface to enable and disable the MIPI CSI
PHY. This is required for platforms like i.MX8QM, which rely on the PHY
driver for powering the MIPI CSI PHY on and off.
Add reset delay for i.MX8QM. It needs a delay after toggle reset.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 46 +++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
index b5eae56d92f49..df34caffd4a3a 100644
--- a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
+++ b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
+#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
@@ -89,6 +90,8 @@ struct imx8mq_plat_data {
const char *name;
int (*enable)(struct csi_state *state, u32 hs_settle);
void (*disable)(struct csi_state *state);
+ bool use_phydrv: 1;
+ int reset_delay;
};
/*
@@ -125,6 +128,7 @@ struct csi_state {
u32 state;
struct regmap *phy_gpr;
+ struct phy *phy;
u8 phy_gpr_reg;
struct icc_path *icc_path;
@@ -169,6 +173,37 @@ static const struct imx8mq_plat_data imx8mq_data = {
.enable = imx8mq_gpr_enable,
};
+/* -----------------------------------------------------------------------------
+ * Use common PHY interface
+ */
+static int imx8_phy_enable(struct csi_state *state, u32 hs_settle)
+{
+ int ret;
+
+ ret = phy_set_speed(state->phy, hs_settle);
+ if (ret)
+ return ret;
+
+ ret = phy_power_on(state->phy);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+static void imx8_phy_disable(struct csi_state *state)
+{
+ phy_power_off(state->phy);
+}
+
+static const struct imx8mq_plat_data imx8qm_data = {
+ .name = "i.MX8QM",
+ .enable = imx8_phy_enable,
+ .disable = imx8_phy_disable,
+ .use_phydrv = 1,
+ .reset_delay = 10000,
+};
+
static const struct csi2_pix_format imx8mq_mipi_csi_formats[] = {
/* RAW (Bayer and greyscale) formats. */
{
@@ -273,6 +308,8 @@ static int imx8mq_mipi_csi_sw_reset(struct csi_state *state)
return ret;
}
+ fsleep(state->pdata->reset_delay);
+
return 0;
}
@@ -860,6 +897,14 @@ static int imx8mq_mipi_csi_parse_dt(struct csi_state *state)
return PTR_ERR(state->rst);
}
+ if (state->pdata->use_phydrv) {
+ state->phy = devm_of_phy_get_by_index(dev, dev->of_node, 0);
+ if (IS_ERR(state->phy))
+ return dev_err_probe(dev, PTR_ERR(state->phy), "Can't get mipi phy\n");
+
+ return 0;
+ }
+
ret = of_property_read_u32_array(np, "fsl,mipi-phy-gpr", out_val,
ARRAY_SIZE(out_val));
if (ret) {
@@ -979,6 +1024,7 @@ static void imx8mq_mipi_csi_remove(struct platform_device *pdev)
static const struct of_device_id imx8mq_mipi_csi_of_match[] = {
{ .compatible = "fsl,imx8mq-mipi-csi2", .data = &imx8mq_data },
+ { .compatible = "fsl,imx8qm-mipi-csi2", .data = &imx8qm_data },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, imx8mq_mipi_csi_of_match);
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 11/14] arm64: dts: imx8: add capture controller for i.MX8's img subsystem
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
` (9 preceding siblings ...)
2025-01-31 21:33 ` [PATCH 10/14] media: imx8mq-mipi-csi2: Add support for i.MX8QM Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-01-31 21:33 ` [PATCH 12/14] arm64: dts: imx8qm: add 24MHz clock-xtal24m Frank Li
` (2 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li
Add CSI related nodes (i2c, irqsteer, csi, lpcg) for i.MX8 img subsystem.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8-ss-img.dtsi | 396 ++++++++++++++++++++++
arch/arm64/boot/dts/freescale/imx8qm-ss-img.dtsi | 37 ++
arch/arm64/boot/dts/freescale/imx8qxp-ss-img.dtsi | 60 ++++
3 files changed, 493 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8-ss-img.dtsi b/arch/arm64/boot/dts/freescale/imx8-ss-img.dtsi
index d39242c1b9f79..edcf7976892aa 100644
--- a/arch/arm64/boot/dts/freescale/imx8-ss-img.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8-ss-img.dtsi
@@ -3,6 +3,14 @@
* Copyright 2019-2021 NXP
* Zhou Guoniu <guoniu.zhou@nxp.com>
*/
+
+img_axi_clk: clock-img-axi {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <400000000>;
+ clock-output-names = "img_axi_clk";
+};
+
img_ipg_clk: clock-img-ipg {
compatible = "fixed-clock";
#clock-cells = <0>;
@@ -10,12 +18,290 @@ img_ipg_clk: clock-img-ipg {
clock-output-names = "img_ipg_clk";
};
+img_pxl_clk: clock-img-pxl {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <600000000>;
+ clock-output-names = "img_pxl_clk";
+};
+
+scu_reset: reset-controller {
+ compatible = "fsl,imx-scu-reset";
+ #reset-cells = <1>;
+};
+
img_subsys: bus@58000000 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x58000000 0x0 0x58000000 0x1000000>;
+ isi: isi@58100000 {
+ reg = <0x58100000 0x90000>;
+ interrupts = <GIC_SPI 297 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 298 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 299 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 301 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 302 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 303 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&pdma0_lpcg IMX_LPCG_CLK_0>,
+ <&pdma1_lpcg IMX_LPCG_CLK_0>,
+ <&pdma2_lpcg IMX_LPCG_CLK_0>,
+ <&pdma3_lpcg IMX_LPCG_CLK_0>,
+ <&pdma4_lpcg IMX_LPCG_CLK_0>,
+ <&pdma5_lpcg IMX_LPCG_CLK_0>,
+ <&pdma6_lpcg IMX_LPCG_CLK_0>,
+ <&pdma7_lpcg IMX_LPCG_CLK_0>;
+ clock-names = "per0",
+ "per1",
+ "per2",
+ "per3",
+ "per4",
+ "per5",
+ "per6",
+ "per7";
+ interrupt-parent = <&gic>;
+ power-domains = <&pd IMX_SC_R_ISI_CH0>,
+ <&pd IMX_SC_R_ISI_CH1>,
+ <&pd IMX_SC_R_ISI_CH2>,
+ <&pd IMX_SC_R_ISI_CH3>,
+ <&pd IMX_SC_R_ISI_CH4>,
+ <&pd IMX_SC_R_ISI_CH5>,
+ <&pd IMX_SC_R_ISI_CH6>,
+ <&pd IMX_SC_R_ISI_CH7>;
+ status = "disabled";
+ };
+
+ irqsteer_csi0: irqsteer@58220000 {
+ compatible = "fsl,imx8qm-irqsteer", "fsl,imx-irqsteer";
+ reg = <0x58220000 0x1000>;
+ #interrupt-cells = <1>;
+ interrupt-controller;
+ interrupts = <GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&img_ipg_clk>;
+ clock-names = "ipg";
+ interrupt-parent = <&gic>;
+ power-domains = <&pd IMX_SC_R_CSI_0>;
+ fsl,channel = <0>;
+ fsl,num-irqs = <32>;
+ status = "disabled";
+ };
+
+ mipi_csi_0_phy: phy@58221000 {
+ compatible = "fsl,imx8qxp-mipi-cphy";
+ reg = <0x58221000 0x1000>;
+ #phy-cells = <0>;
+ power-domains = <&pd IMX_SC_R_CSI_0>;
+ };
+
+ gpio0_mipi_csi0: gpio@58222000 {
+ compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+ reg = <0x58222000 0x1000>;
+ #interrupt-cells = <2>;
+ interrupt-controller;
+ interrupts = <0>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-parent = <&irqsteer_csi0>;
+ power-domains = <&pd IMX_SC_R_CSI_0>;
+ };
+
+ csi0_core_lpcg: clock-controller@58223018 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58223018 0x4>;
+ clocks = <&clk IMX_SC_R_CSI_0 IMX_SC_PM_CLK_PER>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_4>;
+ clock-output-names = "csi0_lpcg_core_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH0>;
+ };
+
+ csi0_esc_lpcg: clock-controller@5822301c {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x5822301c 0x4>;
+ clocks = <&clk IMX_SC_R_CSI_0 IMX_SC_PM_CLK_MISC>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_4>;
+ clock-output-names = "csi0_lpcg_esc_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH0>;
+ };
+
+ i2c_mipi_csi0: i2c@58226000 {
+ compatible = "fsl,imx8qxp-lpi2c", "fsl,imx7ulp-lpi2c";
+ reg = <0x58226000 0x1000>;
+ interrupts = <8>;
+ clocks = <&clk IMX_SC_R_CSI_0_I2C_0 IMX_SC_PM_CLK_PER>,
+ <&img_ipg_clk>;
+ clock-names = "per", "ipg";
+ assigned-clocks = <&clk IMX_SC_R_CSI_0_I2C_0 IMX_SC_PM_CLK_PER>;
+ assigned-clock-rates = <24000000>;
+ interrupt-parent = <&irqsteer_csi0>;
+ power-domains = <&pd IMX_SC_R_CSI_0_I2C_0>;
+ status = "disabled";
+ };
+
+ mipi_csi_0: csi@58227000 {
+ compatible = "fsl,imx8qm-mipi-csi2";
+ reg = <0x58227000 0x1000>;
+ clocks = <&csi0_core_lpcg IMX_LPCG_CLK_4>,
+ <&csi0_esc_lpcg IMX_LPCG_CLK_4>,
+ <&csi0_pxl_lpcg IMX_LPCG_CLK_0>;
+ clock-names = "core", "esc", "ui";
+ assigned-clocks = <&csi0_core_lpcg IMX_LPCG_CLK_4>,
+ <&csi0_esc_lpcg IMX_LPCG_CLK_4>;
+ assigned-clock-rates = <360000000>, <72000000>;
+ phys = <&mipi_csi_0_phy>;
+ power-domains = <&pd IMX_SC_R_ISI_CH0>;
+ resets = <&scu_reset IMX_SC_R_CSI_0>;
+ status = "disabled";
+ };
+
+ irqsteer_csi1: irqsteer@58240000 {
+ compatible = "fsl,imx8qm-irqsteer", "fsl,imx-irqsteer";
+ reg = <0x58240000 0x1000>;
+ #interrupt-cells = <1>;
+ interrupt-controller;
+ interrupts = <GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&img_ipg_clk>;
+ clock-names = "ipg";
+ interrupt-parent = <&gic>;
+ power-domains = <&pd IMX_SC_R_CSI_1>;
+ fsl,channel = <0>;
+ fsl,num-irqs = <32>;
+ status = "disabled";
+ };
+
+ mipi_csi_1_phy: phy@58241000 {
+ compatible ="fsl,imx8qxp-mipi-cphy";
+ reg = <0x58241000 0x1000>;
+ #phy-cells = <0>;
+ power-domains = <&pd IMX_SC_R_CSI_1>;
+ status = "disabled";
+ };
+
+ gpio0_mipi_csi1: gpio@58242000 {
+ compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+ reg = <0x58242000 0x1000>;
+ #interrupt-cells = <2>;
+ interrupt-controller;
+ interrupts = <0>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ interrupt-parent = <&irqsteer_csi1>;
+ power-domains = <&pd IMX_SC_R_CSI_1>;
+ };
+
+ csi1_core_lpcg: clock-controller@58243018 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58243018 0x4>;
+ clocks = <&clk IMX_SC_R_CSI_1 IMX_SC_PM_CLK_PER>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_4>;
+ clock-output-names = "csi1_lpcg_core_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH0>;
+ };
+
+ csi1_esc_lpcg: clock-controller@5824301c {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x5824301c 0x4>;
+ clocks = <&clk IMX_SC_R_CSI_1 IMX_SC_PM_CLK_MISC>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_4>;
+ clock-output-names = "csi1_lpcg_esc_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH0>;
+ };
+
+ i2c_mipi_csi1: i2c@58246000 {
+ compatible = "fsl,imx8qxp-lpi2c", "fsl,imx7ulp-lpi2c";
+ reg = <0x58246000 0x1000>;
+ interrupts = <8>;
+ clocks = <&clk IMX_SC_R_CSI_1_I2C_0 IMX_SC_PM_CLK_PER>,
+ <&img_ipg_clk>;
+ clock-names = "per", "ipg";
+ assigned-clocks = <&clk IMX_SC_R_CSI_1_I2C_0 IMX_SC_PM_CLK_PER>;
+ assigned-clock-rates = <24000000>;
+ interrupt-parent = <&irqsteer_csi1>;
+ power-domains = <&pd IMX_SC_R_CSI_1_I2C_0>;
+ status = "disabled";
+ };
+
+ mipi_csi_1: csi@58247000 {
+ compatible = "fsl,imx8qm-mipi-csi2";
+ reg = <0x58247000 0x1000>;
+ clocks = <&csi1_core_lpcg IMX_LPCG_CLK_4>,
+ <&csi1_esc_lpcg IMX_LPCG_CLK_4>,
+ <&csi1_pxl_lpcg IMX_LPCG_CLK_0>;
+ clock-names = "core", "esc", "ui";
+ assigned-clocks = <&csi1_core_lpcg IMX_LPCG_CLK_4>,
+ <&csi1_esc_lpcg IMX_LPCG_CLK_4>;
+ assigned-clock-rates = <360000000>, <72000000>;
+ phys = <&mipi_csi_1_phy>;
+ power-domains = <&pd IMX_SC_R_ISI_CH0>;
+ resets = <&scu_reset IMX_SC_R_CSI_1>;
+ status = "disabled";
+ };
+
+ irqsteer_parallel: irqsteer@58260000 {
+ compatible = "fsl,imx8qm-irqsteer", "fsl,imx-irqsteer";
+ reg = <0x58260000 0x1000>;
+ #interrupt-cells = <1>;
+ interrupt-controller;
+ interrupts = <GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk_dummy>;
+ clock-names = "ipg";
+ interrupt-parent = <&gic>;
+ power-domains = <&pd IMX_SC_R_PI_0>;
+ fsl,channel = <0>;
+ fsl,num-irqs = <32>;
+ status = "disabled";
+ };
+
+ pi0_ipg_lpcg: clock-controller@58263004 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58263004 0x4>;
+ clocks = <&clk IMX_SC_R_PI_0 IMX_SC_PM_CLK_PER>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_4>;
+ clock-output-names = "pi0_lpcg_ipg_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH0>;
+ };
+
+ pi0_pxl_lpcg: clock-controller@58263018 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58263018 0x4>;
+ clocks = <&clk IMX_SC_R_PI_0 IMX_SC_PM_CLK_PER>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "pi0_lpcg_pxl_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH0>;
+ };
+
+ pi0_misc_lpcg: clock-controller@5826301c {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x5826301c 0x4>;
+ clocks = <&clk IMX_SC_R_PI_0 IMX_SC_PM_CLK_MISC0>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "pi0_lpcg_misc_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH0>;
+ };
+
+ i2c0_parallel: i2c@58266000 {
+ compatible = "fsl,imx8qxp-lpi2c", "fsl,imx7ulp-lpi2c";
+ reg = <0x58266000 0x1000>;
+ interrupts = <8>;
+ clocks = <&clk IMX_SC_R_PI_0_I2C_0 IMX_SC_PM_CLK_PER>,
+ <&img_ipg_clk>;
+ clock-names = "per", "ipg";
+ assigned-clocks = <&clk IMX_SC_R_PI_0_I2C_0 IMX_SC_PM_CLK_PER>;
+ assigned-clock-rates = <24000000>;
+ interrupt-parent = <&irqsteer_parallel>;
+ power-domains = <&pd IMX_SC_R_PI_0_I2C_0>;
+ status = "disabled";
+ };
+
jpegdec: jpegdec@58400000 {
reg = <0x58400000 0x00050000>;
interrupts = <GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH>;
@@ -40,6 +326,116 @@ jpegenc: jpegenc@58450000 {
<&pd IMX_SC_R_MJPEG_ENC_S0>;
};
+ pdma0_lpcg: clock-controller@58500000 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58500000 0x10000>;
+ clocks = <&img_pxl_clk>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "pdma0_lpcg_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH0>;
+ };
+
+ pdma1_lpcg: clock-controller@58510000 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58510000 0x10000>;
+ clocks = <&img_pxl_clk>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "pdma1_lpcg_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH1>;
+ };
+
+ pdma2_lpcg: clock-controller@58520000 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58520000 0x10000>;
+ clocks = <&img_pxl_clk>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "pdma2_lpcg_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH2>;
+ };
+
+ pdma3_lpcg: clock-controller@58530000 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58530000 0x10000>;
+ clocks = <&img_pxl_clk>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "pdma3_lpcg_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH3>;
+ };
+
+ pdma4_lpcg: clock-controller@58540000 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58540000 0x10000>;
+ clocks = <&img_pxl_clk>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "pdma4_lpcg_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH4>;
+ };
+
+ pdma5_lpcg: clock-controller@58550000 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58550000 0x10000>;
+ clocks = <&img_pxl_clk>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "pdma5_lpcg_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH5>;
+ };
+
+ pdma6_lpcg: clock-controller@58560000 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58560000 0x10000>;
+ clocks = <&img_pxl_clk>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "pdma6_lpcg_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH6>;
+ };
+
+ pdma7_lpcg: clock-controller@58570000 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58570000 0x10000>;
+ clocks = <&img_pxl_clk>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "pdma7_lpcg_clk";
+ power-domains = <&pd IMX_SC_R_ISI_CH7>;
+ };
+
+ csi0_pxl_lpcg: clock-controller@58580000 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58580000 0x10000>;
+ clocks = <&img_pxl_clk>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "csi0_lpcg_pxl_clk";
+ power-domains = <&pd IMX_SC_R_CSI_0>;
+ };
+
+ csi1_pxl_lpcg: clock-controller@58590000 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x58590000 0x10000>;
+ clocks = <&img_pxl_clk>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "csi1_lpcg_pxl_clk";
+ power-domains = <&pd IMX_SC_R_CSI_1>;
+ };
+
+ hdmi_rx_pxl_link_lpcg: clock-controller@585a0000 {
+ compatible = "fsl,imx8qxp-lpcg";
+ reg = <0x585a0000 0x10000>;
+ clocks = <&img_pxl_clk>;
+ #clock-cells = <1>;
+ clock-indices = <IMX_LPCG_CLK_0>;
+ clock-output-names = "hdmi_rx_lpcg_pxl_link_clk";
+ power-domains = <&pd IMX_SC_R_HDMI_RX>;
+ };
+
img_jpeg_dec_lpcg: clock-controller@585d0000 {
compatible = "fsl,imx8qxp-lpcg";
reg = <0x585d0000 0x10000>;
diff --git a/arch/arm64/boot/dts/freescale/imx8qm-ss-img.dtsi b/arch/arm64/boot/dts/freescale/imx8qm-ss-img.dtsi
index 2bbdacb1313f9..e14a5d86853f1 100644
--- a/arch/arm64/boot/dts/freescale/imx8qm-ss-img.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8qm-ss-img.dtsi
@@ -3,6 +3,31 @@
* Copyright 2021 NXP
*/
+&isi {
+ compatible = "fsl,imx8qm-isi";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ };
+
+ port@1 {
+ reg = <1>;
+ };
+
+ port@2 {
+ reg = <2>;
+ };
+
+ port@3 {
+ reg = <3>;
+ };
+ };
+};
+
&jpegdec {
compatible = "nxp,imx8qm-jpgdec", "nxp,imx8qxp-jpgdec";
};
@@ -10,3 +35,15 @@ &jpegdec {
&jpegenc {
compatible = "nxp,imx8qm-jpgenc", "nxp,imx8qxp-jpgenc";
};
+
+&pi0_ipg_lpcg {
+ status = "disabled";
+};
+
+&pi0_misc_lpcg {
+ status = "disabled";
+};
+
+&pi0_pxl_lpcg {
+ status = "disabled";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-ss-img.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp-ss-img.dtsi
index 3a087317591d8..4c15e4569a51a 100644
--- a/arch/arm64/boot/dts/freescale/imx8qxp-ss-img.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8qxp-ss-img.dtsi
@@ -4,6 +4,62 @@
* Dong Aisheng <aisheng.dong@nxp.com>
*/
+&csi1_pxl_lpcg {
+ status = "disabled";
+};
+
+&csi1_core_lpcg {
+ status = "disabled";
+};
+
+&csi1_esc_lpcg {
+ status = "disabled";
+};
+
+&gpio0_mipi_csi1 {
+ status = "disabled";
+};
+
+&i2c_mipi_csi1 {
+ status = "disabled";
+};
+
+&irqsteer_csi1 {
+ status = "disabled";
+};
+
+&isi {
+ compatible = "fsl,imx8qxp-isi";
+ interrupts = <GIC_SPI 297 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 301 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 302 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 303 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&pdma0_lpcg IMX_LPCG_CLK_0>, <&pdma4_lpcg IMX_LPCG_CLK_0>,
+ <&pdma5_lpcg IMX_LPCG_CLK_0>, <&pdma6_lpcg IMX_LPCG_CLK_0>,
+ <&pdma7_lpcg IMX_LPCG_CLK_0>;
+ clock-names = "per0", "per4", "per5", "per6", "per7";
+ power-domains = <&pd IMX_SC_R_ISI_CH0>, <&pd IMX_SC_R_ISI_CH4>, <&pd IMX_SC_R_ISI_CH5>,
+ <&pd IMX_SC_R_ISI_CH6>, <&pd IMX_SC_R_ISI_CH7>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ };
+
+ port@1 {
+ reg = <1>;
+ };
+
+ port@2 {
+ reg = <2>;
+ };
+ };
+};
+
&jpegdec {
compatible = "nxp,imx8qxp-jpgdec";
};
@@ -11,3 +67,7 @@ &jpegdec {
&jpegenc {
compatible = "nxp,imx8qxp-jpgenc";
};
+
+&mipi_csi_1 {
+ status = "disabled";
+};
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 12/14] arm64: dts: imx8qm: add 24MHz clock-xtal24m
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
` (10 preceding siblings ...)
2025-01-31 21:33 ` [PATCH 11/14] arm64: dts: imx8: add capture controller for i.MX8's img subsystem Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-01-31 21:33 ` [PATCH 13/14] arm64: dts: imx8q: add linux,cma node for imx8qm-mek and imx8qxp-mek Frank Li
2025-01-31 21:33 ` [PATCH 14/14] arm64: dts: imx8q: add camera ov5640 support " Frank Li
13 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li
Add fixed clock node clock-xtal24m to prepare to add camera support.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8qm.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8qm.dtsi b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
index 6fa31bc9ece8f..0d562c1997c47 100644
--- a/arch/arm64/boot/dts/freescale/imx8qm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8qm.dtsi
@@ -585,6 +585,13 @@ mipi_pll_div2_clk: clock-controller-mipi-div2-pll {
clock-output-names = "mipi_pll_div2_clk";
};
+ xtal24m: clock-xtal24m {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <24000000>;
+ clock-output-names = "xtal_24MHz";
+ };
+
vpu_subsys_dsp: bus@55000000 {
compatible = "simple-bus";
#address-cells = <1>;
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 13/14] arm64: dts: imx8q: add linux,cma node for imx8qm-mek and imx8qxp-mek
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
` (11 preceding siblings ...)
2025-01-31 21:33 ` [PATCH 12/14] arm64: dts: imx8qm: add 24MHz clock-xtal24m Frank Li
@ 2025-01-31 21:33 ` Frank Li
2025-01-31 21:33 ` [PATCH 14/14] arm64: dts: imx8q: add camera ov5640 support " Frank Li
13 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li
Add linux,cma node because some devices, such as camera, need big continue
physical memory.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 9 +++++++++
arch/arm64/boot/dts/freescale/imx8qxp-mek.dts | 8 ++++++++
2 files changed, 17 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
index 50fd3370f7dce..61ef00f4259e1 100644
--- a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
+++ b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
@@ -113,6 +113,15 @@ dsp_vdev0buffer: memory@94300000 {
reg = <0 0x94300000 0 0x100000>;
no-map;
};
+
+ /* global autoconfigured region for contiguous allocations */
+ linux,cma {
+ compatible = "shared-dma-pool";
+ alloc-ranges = <0 0xc0000000 0 0x3c000000>;
+ size = <0 0x3c000000>;
+ linux,cma-default;
+ reusable;
+ };
};
lvds_backlight0: backlight-lvds0 {
diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
index be79c793213a5..89c6516c5ba90 100644
--- a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
+++ b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
@@ -56,6 +56,14 @@ dsp_vdev0buffer: memory@94300000 {
reg = <0 0x94300000 0 0x100000>;
no-map;
};
+
+ linux,cma {
+ compatible = "shared-dma-pool";
+ alloc-ranges = <0 0xc0000000 0 0x3c000000>;
+ size = <0 0x3c000000>;
+ linux,cma-default;
+ reusable;
+ };
};
reg_usdhc2_vmmc: usdhc2-vmmc {
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH 14/14] arm64: dts: imx8q: add camera ov5640 support for imx8qm-mek and imx8qxp-mek
2025-01-31 21:33 [PATCH 00/14] media: imx8: add camera support Frank Li
` (12 preceding siblings ...)
2025-01-31 21:33 ` [PATCH 13/14] arm64: dts: imx8q: add linux,cma node for imx8qm-mek and imx8qxp-mek Frank Li
@ 2025-01-31 21:33 ` Frank Li
13 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2025-01-31 21:33 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel,
Laurent Pinchart, Mauro Carvalho Chehab, Rui Miguel Silva,
Martin Kepplinger, Purism Kernel Team
Cc: linux-phy, devicetree, imx, linux-arm-kernel, linux-kernel,
linux-media, Guoniu.zhou, Robby Cai, Robert Chiras, Frank Li
Add ov5640 overlay file for imx8qm-mek and imx8qxp-mek board. Camera can
connect different CSI port. So use dts overlay file to handle these
difference connect options.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
arch/arm64/boot/dts/freescale/Makefile | 12 +++
.../boot/dts/freescale/imx8qm-mek-ov5640-csi0.dtso | 93 ++++++++++++++++++++++
.../boot/dts/freescale/imx8qm-mek-ov5640-csi1.dtso | 93 ++++++++++++++++++++++
arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 51 ++++++++++++
.../boot/dts/freescale/imx8qxp-mek-ov5640-csi.dtso | 92 +++++++++++++++++++++
arch/arm64/boot/dts/freescale/imx8qxp-mek.dts | 36 +++++++++
6 files changed, 377 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
index 839432153cc7a..d1cbc08eb3f4d 100644
--- a/arch/arm64/boot/dts/freescale/Makefile
+++ b/arch/arm64/boot/dts/freescale/Makefile
@@ -261,12 +261,24 @@ dtb-$(CONFIG_ARCH_MXC) += imx8qm-apalis-v1.1-eval-v1.2.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8qm-apalis-v1.1-ixora-v1.1.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8qm-apalis-v1.1-ixora-v1.2.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8qm-mek.dtb
+
+imx8qm-mek-ov5640-csi0-dtbs := imx8qm-mek.dtb imx8qm-mek-ov5640-csi0.dtbo
+dtb-${CONFIG_ARCH_MXC} += imx8qm-mek-ov5640-csi0.dtb
+imx8qm-mek-ov5640-csi1-dtbs := imx8qm-mek.dtb imx8qm-mek-ov5640-csi1.dtbo
+dtb-${CONFIG_ARCH_MXC} += imx8qm-mek-ov5640-csi1.dtb
+imx8qm-mek-ov5640-dual-dtbs := imx8qm-mek.dtb imx8qm-mek-ov5640-csi0.dtbo imx8qm-mek-ov5640-csi1.dtbo
+dtb-${CONFIG_ARCH_MXC} += imx8qm-mek-ov5640-dual.dtb
+
dtb-$(CONFIG_ARCH_MXC) += imx8qxp-ai_ml.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8qxp-colibri-aster.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8qxp-colibri-eval-v3.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8qxp-colibri-iris.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8qxp-colibri-iris-v2.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8qxp-mek.dtb
+
+imx8qxp-mek-ov5640-csi-dtbs := imx8qxp-mek.dtb imx8qxp-mek-ov5640-csi.dtbo
+dtb-${CONFIG_ARCH_MXC} += imx8qxp-mek-ov5640-csi.dtb
+
dtb-$(CONFIG_ARCH_MXC) += imx8qxp-tqma8xqp-mba8xx.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8ulp-evk.dtb
dtb-$(CONFIG_ARCH_MXC) += imx93-9x9-qsb.dtb
diff --git a/arch/arm64/boot/dts/freescale/imx8qm-mek-ov5640-csi0.dtso b/arch/arm64/boot/dts/freescale/imx8qm-mek-ov5640-csi0.dtso
new file mode 100644
index 0000000000000..c2bc5b839e3f7
--- /dev/null
+++ b/arch/arm64/boot/dts/freescale/imx8qm-mek-ov5640-csi0.dtso
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2025 NXP
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/media/video-interfaces.h>
+
+&i2c_mipi_csi0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clock-frequency = <100000>;
+ pinctrl-0 = <&pinctrl_i2c_mipi_csi0>;
+ pinctrl-names = "default";
+ status = "okay";
+
+ ov5640_mipi_0: camera@3c {
+ compatible = "ovti,ov5640";
+ reg = <0x3c>;
+ clocks = <&xtal24m>;
+ clock-names = "xclk";
+ pinctrl-0 = <&pinctrl_mipi_csi0>;
+ pinctrl-names = "default";
+ powerdown-gpios = <&lsio_gpio1 28 GPIO_ACTIVE_HIGH>;
+ reset-gpios = <&lsio_gpio1 27 GPIO_ACTIVE_LOW>;
+ AVDD-supply = <®_2v8>;
+ DVDD-supply = <®_1v5>;
+ DOVDD-supply = <®_1v8>;
+ status = "okay";
+
+ port {
+ ov5640_mipi_0_ep: endpoint {
+ bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>;
+ data-lanes = <1 2>;
+ remote-endpoint = <&mipi_csi0_in>;
+ };
+ };
+ };
+};
+
+&irqsteer_csi0 {
+ status = "okay";
+};
+
+&isi {
+ status = "okay";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@2 {
+ reg = <2>;
+
+ isi_in_2: endpoint {
+ remote-endpoint = <&mipi_csi0_out>;
+ };
+ };
+ };
+};
+
+&mipi_csi_0 {
+ status = "okay";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ mipi_csi0_in: endpoint {
+ data-lanes = <1 2>;
+ remote-endpoint = <&ov5640_mipi_0_ep>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ mipi_csi0_out: endpoint {
+ remote-endpoint = <&isi_in_2>;
+ };
+ };
+ };
+};
+
+&mipi_csi_0_phy {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8qm-mek-ov5640-csi1.dtso b/arch/arm64/boot/dts/freescale/imx8qm-mek-ov5640-csi1.dtso
new file mode 100644
index 0000000000000..78cc0575fb005
--- /dev/null
+++ b/arch/arm64/boot/dts/freescale/imx8qm-mek-ov5640-csi1.dtso
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2025 NXP
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/media/video-interfaces.h>
+
+&i2c_mipi_csi1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clock-frequency = <100000>;
+ pinctrl-0 = <&pinctrl_i2c_mipi_csi1>;
+ pinctrl-names = "default";
+ status = "okay";
+
+ ov5640_mipi_1: camera@3c {
+ compatible = "ovti,ov5640";
+ reg = <0x3c>;
+ clocks = <&xtal24m>;
+ clock-names = "xclk";
+ pinctrl-0 = <&pinctrl_mipi_csi1>;
+ pinctrl-names = "default";
+ powerdown-gpios = <&lsio_gpio1 31 GPIO_ACTIVE_HIGH>;
+ reset-gpios = <&lsio_gpio1 30 GPIO_ACTIVE_LOW>;
+ AVDD-supply = <®_2v8>;
+ DVDD-supply = <®_1v5>;
+ DOVDD-supply = <®_1v8>;
+ status = "okay";
+
+ port {
+ ov5640_mipi_1_ep: endpoint {
+ bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>;
+ data-lanes = <1 2>;
+ remote-endpoint = <&mipi_csi1_in>;
+ };
+ };
+ };
+};
+
+&irqsteer_csi1 {
+ status = "okay";
+};
+
+&isi {
+ status = "okay";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@3 {
+ reg = <3>;
+
+ isi_in_3: endpoint {
+ remote-endpoint = <&mipi_csi1_out>;
+ };
+ };
+ };
+};
+
+&mipi_csi_1 {
+ status = "okay";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ mipi_csi1_in: endpoint {
+ data-lanes = <1 2>;
+ remote-endpoint = <&ov5640_mipi_1_ep>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ mipi_csi1_out: endpoint {
+ remote-endpoint = <&isi_in_3>;
+ };
+ };
+ };
+};
+
+&mipi_csi_1_phy {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
index 61ef00f4259e1..3a6e25e08c26a 100644
--- a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
+++ b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
@@ -155,6 +155,27 @@ usb3_data_ss: endpoint {
};
};
+ reg_1v5: regulator-1v5 {
+ compatible = "regulator-fixed";
+ regulator-name = "1v5";
+ regulator-min-microvolt = <1500000>;
+ regulator-max-microvolt = <1500000>;
+ };
+
+ reg_1v8: regulator-1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "1v8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };
+
+ reg_2v8: regulator-2v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "2v8";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ };
+
reg_usdhc2_vmmc: usdhc2-vmmc {
compatible = "regulator-fixed";
regulator-name = "SD1_SPWR";
@@ -727,6 +748,20 @@ IMX8QM_SCU_GPIO0_03_LSIO_GPIO0_IO31 0x0600004c
>;
};
+ pinctrl_i2c_mipi_csi0: i2c-mipi-csi0grp {
+ fsl,pins = <
+ IMX8QM_MIPI_CSI0_I2C0_SCL_MIPI_CSI0_I2C0_SCL 0xc2000020
+ IMX8QM_MIPI_CSI0_I2C0_SDA_MIPI_CSI0_I2C0_SDA 0xc2000020
+ >;
+ };
+
+ pinctrl_i2c_mipi_csi1: i2c-mipi-csi1grp {
+ fsl,pins = <
+ IMX8QM_MIPI_CSI1_I2C0_SCL_MIPI_CSI1_I2C0_SCL 0xc2000020
+ IMX8QM_MIPI_CSI1_I2C0_SDA_MIPI_CSI1_I2C0_SDA 0xc2000020
+ >;
+ };
+
pinctrl_i2c0: i2c0grp {
fsl,pins = <
IMX8QM_HDMI_TX0_TS_SCL_DMA_I2C0_SCL 0x06000021
@@ -905,6 +940,22 @@ IMX8QM_LVDS1_I2C1_SDA_LVDS1_I2C1_SDA 0xc600004c
>;
};
+ pinctrl_mipi_csi0: mipi-csi0grp {
+ fsl,pins = <
+ IMX8QM_MIPI_CSI0_GPIO0_00_LSIO_GPIO1_IO27 0xC0000041
+ IMX8QM_MIPI_CSI0_GPIO0_01_LSIO_GPIO1_IO28 0xC0000041
+ IMX8QM_MIPI_CSI0_MCLK_OUT_MIPI_CSI0_ACM_MCLK_OUT 0xC0000041
+ >;
+ };
+
+ pinctrl_mipi_csi1: mipi-csi1grp {
+ fsl,pins = <
+ IMX8QM_MIPI_CSI1_GPIO0_00_LSIO_GPIO1_IO30 0xC0000041
+ IMX8QM_MIPI_CSI1_GPIO0_01_LSIO_GPIO1_IO31 0xC0000041
+ IMX8QM_MIPI_CSI1_MCLK_OUT_MIPI_CSI1_ACM_MCLK_OUT 0xC0000041
+ >;
+ };
+
pinctrl_pciea: pcieagrp {
fsl,pins = <
IMX8QM_PCIE_CTRL0_WAKE_B_LSIO_GPIO4_IO28 0x04000021
diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-mek-ov5640-csi.dtso b/arch/arm64/boot/dts/freescale/imx8qxp-mek-ov5640-csi.dtso
new file mode 100644
index 0000000000000..6d86b1f549d93
--- /dev/null
+++ b/arch/arm64/boot/dts/freescale/imx8qxp-mek-ov5640-csi.dtso
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2024 NXP
+ */
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/media/video-interfaces.h>
+
+&i2c_mipi_csi0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clock-frequency = <100000>;
+ pinctrl-0 = <&pinctrl_i2c_mipi_csi0>;
+ pinctrl-names = "default";
+ status = "okay";
+
+ ov5640_mipi: camera@3c {
+ compatible = "ovti,ov5640";
+ reg = <0x3c>;
+ clocks = <&xtal24m>;
+ clock-names = "xclk";
+ pinctrl-0 = <&pinctrl_mipi_csi0>;
+ pinctrl-names = "default";
+ powerdown-gpios = <&lsio_gpio3 7 GPIO_ACTIVE_HIGH>;
+ reset-gpios = <&lsio_gpio3 8 GPIO_ACTIVE_LOW>;
+ AVDD-supply = <®_2v8>;
+ DVDD-supply = <®_1v5>;
+ DOVDD-supply = <®_1v8>;
+ status = "okay";
+
+ port {
+ ov5640_mipi_ep: endpoint {
+ bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>;
+ data-lanes = <1 2>;
+ remote-endpoint = <&mipi_csi0_in>;
+ };
+ };
+ };
+};
+
+&irqsteer_csi0 {
+ status = "okay";
+};
+
+&isi {
+ status = "okay";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@2 {
+ reg = <2>;
+
+ isi_in_2: endpoint {
+ remote-endpoint = <&mipi_csi0_out>;
+ };
+ };
+ };
+};
+
+&mipi_csi_0 {
+ status = "okay";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ mipi_csi0_in: endpoint {
+ data-lanes = <1 2>;
+ remote-endpoint = <&ov5640_mipi_ep>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ mipi_csi0_out: endpoint {
+ remote-endpoint = <&isi_in_2>;
+ };
+ };
+ };
+};
+
+&mipi_csi_0_phy {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
index 89c6516c5ba90..a356c491375cb 100644
--- a/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
+++ b/arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
@@ -90,6 +90,27 @@ usb3_data_ss: endpoint {
};
};
+ reg_1v5: regulator-1v5 {
+ compatible = "regulator-fixed";
+ regulator-name = "1v5";
+ regulator-min-microvolt = <1500000>;
+ regulator-max-microvolt = <1500000>;
+ };
+
+ reg_1v8: regulator-1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "1v8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };
+
+ reg_2v8: regulator-2v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "2v8";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ };
+
reg_pcieb: regulator-pcie {
compatible = "regulator-fixed";
regulator-max-microvolt = <3300000>;
@@ -749,6 +770,13 @@ IMX8QXP_FLEXCAN1_RX_ADMA_FLEXCAN1_RX 0x21
>;
};
+ pinctrl_i2c_mipi_csi0: i2c-mipi-csi0grp {
+ fsl,pins = <
+ IMX8QXP_MIPI_CSI0_I2C0_SCL_MIPI_CSI0_I2C0_SCL 0xc2000020
+ IMX8QXP_MIPI_CSI0_I2C0_SDA_MIPI_CSI0_I2C0_SDA 0xc2000020
+ >;
+ };
+
pinctrl_ioexp_rst: ioexprstgrp {
fsl,pins = <
IMX8QXP_SPI2_SDO_LSIO_GPIO1_IO01 0x06000021
@@ -789,6 +817,14 @@ IMX8QXP_FLEXCAN2_RX_ADMA_UART3_RX 0x06000020
>;
};
+ pinctrl_mipi_csi0: mipi-csi0grp {
+ fsl,pins = <
+ IMX8QXP_MIPI_CSI0_GPIO0_01_LSIO_GPIO3_IO07 0xC0000041
+ IMX8QXP_MIPI_CSI0_GPIO0_00_LSIO_GPIO3_IO08 0xC0000041
+ IMX8QXP_MIPI_CSI0_MCLK_OUT_MIPI_CSI0_ACM_MCLK_OUT 0xC0000041
+ >;
+ };
+
pinctrl_pcieb: pcieagrp {
fsl,pins = <
IMX8QXP_PCIE_CTRL0_PERST_B_LSIO_GPIO4_IO00 0x06000021
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread