mbox series

[RFC,0/9] arm64: imx8mm: Add MIPI DSI support

Message ID 20210621072424.111733-1-jagan@amarulasolutions.com
Headers show
Series arm64: imx8mm: Add MIPI DSI support | expand

Message

Jagan Teki June 21, 2021, 7:24 a.m. UTC
This series support MIPI DSI on i.MX8MM.

It worked directly with existing mxsfb driver but the SEC DSIM
timings has to be validate and tested through all platforms, 
ie reason I'm sending it as RFC.

Tested on Engicam i.Core MX8M Mini SoM.

patch 1: dt-bindings for SEC MIPI DSIM

patch 2: SEC MIPI DSIM bridge driver

patch 3: dt-bindings for SEC DSIM DPHY

patch 4: SEC DSIM DPHY driver

patch 5: MIPI DPHY reset enable in blk-ctl

patch 6: display mix blk ctl node

patch 7: eLCDIF node

patch 8: MIPI DSI pipeline nodes

patch 9: Enable LVDS panel on EDIMM2.2

Note:
- all these patches on top of Peng Fan's blk-ctl driver.
- anyone interest, please have a look on this repo
  https://github.com/openedev/linux/commits/imx8mm

Any inputs?
Jagan.

Jagan Teki (9):
  dt-bindings: display: bridge: Add Samsung SEC MIPI DSIM bindings
  drm: bridge: Add Samsung SEC MIPI DSIM bridge driver
  dt-bindings: phy: Add SEC DSIM DPHY bindings
  phy: samsung: Add SEC DSIM DPHY driver
  soc: imx8mm: blk-ctl: Add MIPI DPHY reset enable
  arm64: dts: imx8mm: Add display mix blk ctl
  arm64: dts: imx8mm: Add eLCDIF node support
  arm64: dts: imx8mm: Add MIPI DSI pipeline
  arm64: dts: imx8mm-icore: Enable LVDS panel for EDIMM2.2

 .../display/bridge/samsung,sec-dsim.yaml      |  184 ++
 .../bindings/phy/samsung,sec-dsim-dphy.yaml   |   56 +
 .../freescale/imx8mm-icore-mx8mm-edimm2.2.dts |   90 +
 arch/arm64/boot/dts/freescale/imx8mm.dtsi     |  104 ++
 drivers/gpu/drm/bridge/Kconfig                |   15 +
 drivers/gpu/drm/bridge/Makefile               |    1 +
 drivers/gpu/drm/bridge/sec-dsim.c             | 1535 +++++++++++++++++
 drivers/phy/samsung/Kconfig                   |    9 +
 drivers/phy/samsung/Makefile                  |    1 +
 drivers/phy/samsung/phy-sec-dsim-dphy.c       |  236 +++
 drivers/soc/imx/blk-ctl-imx8mm.c              |    4 +
 include/dt-bindings/power/imx8mm-power.h      |    5 +-
 12 files changed, 2238 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/samsung,sec-dsim.yaml
 create mode 100644 Documentation/devicetree/bindings/phy/samsung,sec-dsim-dphy.yaml
 create mode 100644 drivers/gpu/drm/bridge/sec-dsim.c
 create mode 100644 drivers/phy/samsung/phy-sec-dsim-dphy.c

Comments

Rob Herring (Arm) June 21, 2021, 5:40 p.m. UTC | #1
On Mon, 21 Jun 2021 12:54:18 +0530, Jagan Teki wrote:
> Samsung SEC MIPI DSIM DPHY controller is part of registers
> available in SEC MIPI DSIM bridge for NXP's i.MX8M Mini and
> Nano Processors.
> 
> Add dt-bingings for it.
> 
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Cc: Vinod Koul <vkoul@kernel.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>  .../bindings/phy/samsung,sec-dsim-dphy.yaml   | 56 +++++++++++++++++++
>  1 file changed, 56 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/phy/samsung,sec-dsim-dphy.yaml
> 

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

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/phy/samsung,sec-dsim-dphy.example.dts:20:18: fatal error: dt-bindings/power/imx8mm-power.h: No such file or directory
   20 |         #include <dt-bindings/power/imx8mm-power.h>
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.lib:380: Documentation/devicetree/bindings/phy/samsung,sec-dsim-dphy.example.dt.yaml] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1416: dt_binding_check] Error 2
\ndoc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1494925

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

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

pip3 install dtschema --upgrade

Please check and re-submit.
Adam Ford June 22, 2021, 3:09 a.m. UTC | #2
On Mon, Jun 21, 2021 at 2:25 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> Add eLCDIF controller node for i.MX8MM.
>
> Cc: Rob Herring <robh+dt@kernel.org>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8mm.dtsi | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> index fe5485ee9419..5f68182ed3a6 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> @@ -1030,6 +1030,25 @@ aips4: bus@32c00000 {
>                         #size-cells = <1>;
>                         ranges = <0x32c00000 0x32c00000 0x400000>;
>
> +                       lcdif: lcdif@32e00000 {
> +                               compatible = "fsl,imx8mm-lcdif", "fsl,imx6sx-lcdif";

Based on a comment I read from Marek [1] from this patch series for
the driver, I think fallback compatible should be fsl,imx28-lcdif.

"The iMX8MM and iMX8MN do not support the overlay plane, so they are MXSFB V4"

[1] - https://patchwork.kernel.org/project/dri-devel/patch/20210620224834.189411-1-marex@denx.de/

adam

> +                               reg = <0x32e00000 0x10000>;
> +                               clocks = <&clk IMX8MM_CLK_LCDIF_PIXEL>,
> +                                        <&clk IMX8MM_CLK_DISP_AXI_ROOT>,
> +                                        <&clk IMX8MM_CLK_DISP_APB_ROOT>;
> +                               clock-names = "pix", "disp_axi", "axi";
> +                               assigned-clocks = <&clk IMX8MM_CLK_LCDIF_PIXEL>,
> +                                                 <&clk IMX8MM_CLK_DISP_AXI>,
> +                                                 <&clk IMX8MM_CLK_DISP_APB>;
> +                               assigned-clock-parents = <&clk IMX8MM_VIDEO_PLL1_OUT>,
> +                                                        <&clk IMX8MM_SYS_PLL2_1000M>,
> +                                                        <&clk IMX8MM_SYS_PLL1_800M>;
> +                               assigned-clock-rate = <594000000>, <500000000>, <200000000>;
> +                               interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
> +                               power-domains = <&dispmix_blk_ctl IMX8MM_BLK_CTL_PD_DISPMIX_LCDIF>;
> +                               status = "disabled";
> +                       };
> +
>                         dispmix_blk_ctl: blk-ctl@32e28000 {
>                                 compatible = "fsl,imx8mm-dispmix-blk-ctl", "syscon";
>                                 reg = <0x32e28000 0x100>;
> --
> 2.25.1
>
Jagan Teki June 22, 2021, 1:59 p.m. UTC | #3
On Tue, Jun 22, 2021 at 8:39 AM Adam Ford <aford173@gmail.com> wrote:
>

> On Mon, Jun 21, 2021 at 2:25 AM Jagan Teki <jagan@amarulasolutions.com> wrote:

> >

> > Add eLCDIF controller node for i.MX8MM.

> >

> > Cc: Rob Herring <robh+dt@kernel.org>

> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

> > ---

> >  arch/arm64/boot/dts/freescale/imx8mm.dtsi | 19 +++++++++++++++++++

> >  1 file changed, 19 insertions(+)

> >

> > diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi

> > index fe5485ee9419..5f68182ed3a6 100644

> > --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi

> > +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi

> > @@ -1030,6 +1030,25 @@ aips4: bus@32c00000 {

> >                         #size-cells = <1>;

> >                         ranges = <0x32c00000 0x32c00000 0x400000>;

> >

> > +                       lcdif: lcdif@32e00000 {

> > +                               compatible = "fsl,imx8mm-lcdif", "fsl,imx6sx-lcdif";

>

> Based on a comment I read from Marek [1] from this patch series for

> the driver, I think fallback compatible should be fsl,imx28-lcdif.

>

> "The iMX8MM and iMX8MN do not support the overlay plane, so they are MXSFB V4"

>

> [1] - https://patchwork.kernel.org/project/dri-devel/patch/20210620224834.189411-1-marex@denx.de/


Yes, I saw that, look like some conversation is going on that thread.
will update accordingly in next version.

Jagan.
Jagan Teki June 23, 2021, 3:44 p.m. UTC | #4
Hi Laurent,

On Mon, Jun 21, 2021 at 11:26 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Jagan,
>
> Thank you for the patch.
>
> On Mon, Jun 21, 2021 at 12:54:16PM +0530, Jagan Teki wrote:
> > Samsung SEC MIPI DSIM Bridge controller is MIPI DSI bridge
> > available in NXP's i.MX8M Mini and Nano Processors.
> >
> > Add dt-bingings for it.
> >
> > Cc: Andrzej Hajda <a.hajda@samsung.com>
> > Cc: Neil Armstrong <narmstrong@baylibre.com>
> > Cc: Robert Foss <robert.foss@linaro.org>
> > Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> > Cc: Rob Herring <robh+dt@kernel.org>
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > ---
> >  .../display/bridge/samsung,sec-dsim.yaml      | 184 ++++++++++++++++++
> >  1 file changed, 184 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/display/bridge/samsung,sec-dsim.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/display/bridge/samsung,sec-dsim.yaml b/Documentation/devicetree/bindings/display/bridge/samsung,sec-dsim.yaml
> > new file mode 100644
> > index 000000000000..32f67f313dfd
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/display/bridge/samsung,sec-dsim.yaml
> > @@ -0,0 +1,184 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/display/bridge/samsung,sec-dsim.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Samsung SEC MIPI DSIM Bridge controller on i.MX8M Mini and Nano SoCs
> > +
> > +maintainers:
> > +  - Jagan Teki <jagan@amarulasolutions.com>
> > +
> > +description: |
> > +  NWL MIPI-DSI host controller found on i.MX8 platforms. This is a dsi bridge for
> > +  the SOCs NWL MIPI-DSI host controller.
> > +
> > +allOf:
> > +  - $ref: ../dsi-controller.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - fsl,imx8mm-sec-dsim
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  '#address-cells':
> > +    const: 1
> > +
> > +  '#size-cells':
> > +    const: 0
> > +
> > +  assigned-clock-parents: true
> > +  assigned-clock-rates: true
> > +  assigned-clocks: true
> > +
> > +  clocks:
> > +    items:
> > +      - description: DSI bus clock
> > +      - description: PHY_REF clock
> > +
> > +  clock-names:
> > +    items:
> > +      - const: bus
> > +      - const: phy_ref
> > +
> > +  phys:
> > +    maxItems: 1
> > +    description: phandle to the phy module representing the DPHY
> > +
> > +  phy-names:
> > +    items:
> > +      - const: dphy
> > +
> > +  power-domains:
> > +    maxItems: 1
> > +    description: phandle to the associated power domain
> > +
> > +  samsung,burst-clock-frequency:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description:
> > +      DSIM high speed burst mode frequency.
> > +
> > +  samsung,esc-clock-frequency:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description:
> > +      DSIM escape mode frequency.
> > +
> > +  samsung,pll-clock-frequency:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description:
> > +      DSIM oscillator clock frequency.
>
> Why do you need those three properties ? They look like configuration
> information to me, not system description. If they are needed, their
> description needs to explain how to set them. Looking at the three
> descriptions above I have no idea what to select for those frequencies.

DSIM PLLOutput PMS values are computed based on these clock values as
per exynos dsi code is concern. Look like there is other way to
compute PMS in SEC DSIM(at least on i.MX8MM) unlike exynos. Let me
come back with new changes, thanks!

Jagan.
Peng Fan (OSS) June 29, 2021, 7:10 a.m. UTC | #5
Hi Jagan,

> Subject: [RFC PATCH 0/9] arm64: imx8mm: Add MIPI DSI support

> 

> This series support MIPI DSI on i.MX8MM.

> 

> It worked directly with existing mxsfb driver but the SEC DSIM timings has to

> be validate and tested through all platforms, ie reason I'm sending it as RFC.

> 

> Tested on Engicam i.Core MX8M Mini SoM.


Thanks for the work.

> 

> patch 1: dt-bindings for SEC MIPI DSIM

> 

> patch 2: SEC MIPI DSIM bridge driver

> 

> patch 3: dt-bindings for SEC DSIM DPHY

> 

> patch 4: SEC DSIM DPHY driver

> 

> patch 5: MIPI DPHY reset enable in blk-ctl

> 

> patch 6: display mix blk ctl node

> 

> patch 7: eLCDIF node

> 

> patch 8: MIPI DSI pipeline nodes

> 

> patch 9: Enable LVDS panel on EDIMM2.2

> 

> Note:

> - all these patches on top of Peng Fan's blk-ctl driver.


Would you please update to use V8 patchset?

And the dtb:
https://patchwork.kernel.org/project/linux-arm-kernel/
patch/20210604111005.6804-1-peng.fan@oss.nxp.com/

Thanks,
Peng.

> - anyone interest, please have a look on this repo

> 

> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.

> com%2Fopenedev%2Flinux%2Fcommits%2Fimx8mm&amp;data=04%7C01%7

> Cpeng.fan%40nxp.com%7C8185c94655404000316208d93485a285%7C686ea

> 1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637598570833578734%7CU

> nknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI

> 6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=HKAHBv4YM0G6mVV3bq

> oPOyNb2mQTH03YSBU8RnrJmlE%3D&amp;reserved=0

> 

> Any inputs?

> Jagan.

> 

> Jagan Teki (9):

>   dt-bindings: display: bridge: Add Samsung SEC MIPI DSIM bindings

>   drm: bridge: Add Samsung SEC MIPI DSIM bridge driver

>   dt-bindings: phy: Add SEC DSIM DPHY bindings

>   phy: samsung: Add SEC DSIM DPHY driver

>   soc: imx8mm: blk-ctl: Add MIPI DPHY reset enable

>   arm64: dts: imx8mm: Add display mix blk ctl

>   arm64: dts: imx8mm: Add eLCDIF node support

>   arm64: dts: imx8mm: Add MIPI DSI pipeline

>   arm64: dts: imx8mm-icore: Enable LVDS panel for EDIMM2.2

> 

>  .../display/bridge/samsung,sec-dsim.yaml      |  184 ++

>  .../bindings/phy/samsung,sec-dsim-dphy.yaml   |   56 +

>  .../freescale/imx8mm-icore-mx8mm-edimm2.2.dts |   90 +

>  arch/arm64/boot/dts/freescale/imx8mm.dtsi     |  104 ++

>  drivers/gpu/drm/bridge/Kconfig                |   15 +

>  drivers/gpu/drm/bridge/Makefile               |    1 +

>  drivers/gpu/drm/bridge/sec-dsim.c             | 1535

> +++++++++++++++++

>  drivers/phy/samsung/Kconfig                   |    9 +

>  drivers/phy/samsung/Makefile                  |    1 +

>  drivers/phy/samsung/phy-sec-dsim-dphy.c       |  236 +++

>  drivers/soc/imx/blk-ctl-imx8mm.c              |    4 +

>  include/dt-bindings/power/imx8mm-power.h      |    5 +-

>  12 files changed, 2238 insertions(+), 2 deletions(-)  create mode 100644

> Documentation/devicetree/bindings/display/bridge/samsung,sec-dsim.yaml

>  create mode 100644

> Documentation/devicetree/bindings/phy/samsung,sec-dsim-dphy.yaml

>  create mode 100644 drivers/gpu/drm/bridge/sec-dsim.c  create mode

> 100644 drivers/phy/samsung/phy-sec-dsim-dphy.c

> 

> --

> 2.25.1
Jagan Teki June 30, 2021, 12:24 p.m. UTC | #6
Hi Peng,

On Tue, Jun 29, 2021 at 12:40 PM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> Hi Jagan,
>
> > Subject: [RFC PATCH 0/9] arm64: imx8mm: Add MIPI DSI support
> >
> > This series support MIPI DSI on i.MX8MM.
> >
> > It worked directly with existing mxsfb driver but the SEC DSIM timings has to
> > be validate and tested through all platforms, ie reason I'm sending it as RFC.
> >
> > Tested on Engicam i.Core MX8M Mini SoM.
>
> Thanks for the work.
>
> >
> > patch 1: dt-bindings for SEC MIPI DSIM
> >
> > patch 2: SEC MIPI DSIM bridge driver
> >
> > patch 3: dt-bindings for SEC DSIM DPHY
> >
> > patch 4: SEC DSIM DPHY driver
> >
> > patch 5: MIPI DPHY reset enable in blk-ctl
> >
> > patch 6: display mix blk ctl node
> >
> > patch 7: eLCDIF node
> >
> > patch 8: MIPI DSI pipeline nodes
> >
> > patch 9: Enable LVDS panel on EDIMM2.2
> >
> > Note:
> > - all these patches on top of Peng Fan's blk-ctl driver.
>
> Would you please update to use V8 patchset?
>
> And the dtb:
> https://patchwork.kernel.org/project/linux-arm-kernel/
> patch/20210604111005.6804-1-peng.fan@oss.nxp.com/

Thanks for the details.

I will rebase to use this series and test. Will update on blk-ctl patches.

Thanks,
Jagan.