Re: [EXT] [PATCH v3 0/2] drm: bridge: Add NWL MIPI DSI host controller support

From: Robert Chiras
Date: Wed Aug 28 2019 - 10:30:04 EST


Hi Guido,

I tested this on my setup and it works. My DSI panel is a little bit
different and it doesn't work with this as-is, but I added some
improvements on top of this, in order to be able to setup the clocks.
The changes I made can arrive on top of this as improvements, of
course, since it will allow this driver to dinamically set the
video_pll clock for any kind of mode.

So, for the whole patch-set, you can add:
Tested-by: Robert Chiras <robert.chiras@xxxxxxx>
Signed-off-by: Robert Chiras <robert.chiras@xxxxxxx>

Best regards,
Robert

On Jo, 2019-08-22 at 12:44 +0200, Guido GÃnther wrote:
> This adds initial support for the NWL MIPI DSI Host controller found
> on i.MX8
> SoCs.
>
> It adds support for the i.MX8MQ but the same IP core can also be
> found on e.g.
> i.MX8QXP. I added the necessary hooks to support other imx8 variants
> but since
> I only have imx8mq boards to test I omitted the platform data for
> other SoCs.
>
> The code is based on NXPs BSP so I added Robert Chiras as
> Co-authored-by. Robert, if this looks sane could you add your
> Signed-off-by:?
>
> The most notable changes over the BSP driver are
> Â- Calculate HS mode timing from phy_configure_opts_mipi_dphy
> Â- Perform all clock setup via DT
> Â- Merge nwl-imx and nwl drivers
> Â- Add B0 silion revision quirk
> Â- become a bridge driver to hook into mxsfb (from what I read[0]
> DCSS, which
> ÂÂÂalso can drive the nwl on the imx8mq will likely not become part
> of
> ÂÂÂimx-display-subsystem so it makes sense to make it drive a bridge
> for dsi as
> ÂÂÂwell).
> Â- Use panel_bridge to attach the panel
> Â- Use multiplex framework instead of accessing syscon directly
>
> This has been tested on a Librem 5 devkit using mxsfb with Robert's
> patches[1]
> and the rocktech-jh057n00900 panel driver on next-20190821. The DCSS
> can later
> on also act as input source too.
>
> Changes from v2:
> - Per review comments by Rob Herring
> Â https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fl
> ists.freedesktop.org%2Farchives%2Fdri-devel%2F2019-
> August%2F230448.html&amp;data=02%7C01%7Crobert.chiras%40nxp.com%7C757
> 201f9aaa54653580e08d726edb290%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%
> 7C0%7C637020674654566414&amp;sdata=JdvAdCPGq2CTsW%2BgXgnAVltWMIfdCDQn
> dXSLYpnjEH8%3D&amp;reserved=0
> Â - bindings:
> ÂÂÂÂ- Simplify by restricting to fsl,imx8mq-nwl-dsi
> ÂÂÂÂ- document reset lines
> ÂÂÂÂ- add port@{0,1}
> ÂÂÂÂ- use a real compatible string for the panel
> ÂÂÂÂ- resets are required
> - Per review comments by Arnd Bergmann
> Â https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fl
> ists.freedesktop.org%2Farchives%2Fdri-devel%2F2019-
> August%2F230868.html&amp;data=02%7C01%7Crobert.chiras%40nxp.com%7C757
> 201f9aaa54653580e08d726edb290%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%
> 7C0%7C637020674654566414&amp;sdata=LyJpZjQjMCe5zUdvK8CD8ETucLPxx621gW
> xtpAr8DM4%3D&amp;reserved=0
> Â - Don't access iomuxc_gpr regs directly. This allows us to drop the
> ÂÂÂÂfirst patch in the series with the iomuxc_gpr field defines.
> - Per review comments by Laurent Pinchart
> ÂÂÂÂ- Fix wording in bindings
> - Add mux-controls to bindings
> - Don't print error message on dphy probe deferal
>
> Changes from v1:
> - Per review comments by Sam Ravnborg
> Â https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fl
> ists.freedesktop.org%2Farchives%2Fdri-devel%2F2019-
> July%2F228130.html&amp;data=02%7C01%7Crobert.chiras%40nxp.com%7C75720
> 1f9aaa54653580e08d726edb290%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C
> 0%7C637020674654566414&amp;sdata=AU2gzIwrbCdIBZenPWWYYX%2BgdX53zc2%2B
> SQhZbuN%2FWpU%3D&amp;reserved=0
> Â - Change binding docs to YAML
> Â - build: Don't always visit imx-nwl/
> Â - build: Add header-test-y
> Â - Sort headers according to DRM convention
> Â - Use drm_display_mode instead of videmode
> - Per review comments by Fabio Estevam
> Â https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fl
> ists.freedesktop.org%2Farchives%2Fdri-devel%2F2019-
> July%2F228299.html&amp;data=02%7C01%7Crobert.chiras%40nxp.com%7C75720
> 1f9aaa54653580e08d726edb290%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C
> 0%7C637020674654566414&amp;sdata=6kpIZ6iNAQ13fMXU6sqENLwy%2FdIWL6ef8j
> gyas7I0CQ%3D&amp;reserved=0
> Â - Don't restrict build to ARCH_MXC
> Â - Drop unused includes
> Â - Drop unreachable code in imx_nwl_dsi_bridge_mode_fixup()
> Â - Drop remaining calls of dev_err() and use DRM_DEV_ERR()
> ÂÂÂÂconsistently.
> Â - Use devm_platform_ioremap_resource()
> Â - Drop devm_free_irq() in probe() error path
> Â - Use single line comments where sufficient
> Â - Use <linux/time64.h> instead of defining USEC_PER_SEC
> Â - Make input source select imx8 specific
> Â - Drop <asm/unaligned.h> inclusion (after removal of
> get_unaligned_le32)
> Â - Drop all EXPORT_SYMBOL_GPL() for functions used in the same
> module
> ÂÂÂÂbut different source files.
> Â - Drop nwl_dsi_enable_{rx,tx}_clock() by invoking
> clk_prepare_enable()
> ÂÂÂÂdirectly
> Â - Remove pointless comment
> - Laurent Pinchart
> Â https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fl
> ists.freedesktop.org%2Farchives%2Fdri-devel%2F2019-
> July%2F228313.html&amp;data=02%7C01%7Crobert.chiras%40nxp.com%7C75720
> 1f9aaa54653580e08d726edb290%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C
> 0%7C637020674654566414&amp;sdata=tDlVGeET1CPMH9W%2FqmnePNR51vNaTKD%2F
> iFOoR9%2FmESc%3D&amp;reserved=0
> Â https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fl
> ists.freedesktop.org%2Farchives%2Fdri-devel%2F2019-
> July%2F228308.html&amp;data=02%7C01%7Crobert.chiras%40nxp.com%7C75720
> 1f9aaa54653580e08d726edb290%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C
> 0%7C637020674654566414&amp;sdata=NsLGAL8%2BcOC0ZZxxeoGe7VxQCgqSBEN4G3
> WVGOeZpCo%3D&amp;reserved=0
> Â - Drop (on iMX8MQ) unused csr regmap
> Â - Use NWL_MAX_PLATFORM_CLOCKS everywhere
> Â - Drop get_unaligned_le32() usage
> Â - remove duplicate 'for the' in binding docs
> Â - Don't include unused <linux/clk-provider.h>
> Â - Don't include unused <linux/component.h>
> Â - Drop dpms_mode for tracking state, trust the drm layer on that
> Â - Use pm_runtime_put() instead of pm_runtime_put_sync()
> Â - Don't overwrite encoder type
> Â - Make imx_nwl_platform_data const
> Â - Use the reset controller API instead of open coding that platform
> specific
> ÂÂÂÂpart
> Â - Use <linux/bitfield.h> intead of making up our own defines
> Â - name mipi_dsi_transfer less generic: nwl_dsi_transfer
> Â - ensure clean in .remove by calling mipi_dsi_host_unregister.
> Â - prefix constants by NWL_DSI_
> Â - properly format transfer_direction enum
> Â - simplify platform clock handling
> Â - Don't modify state in mode_fixup() and use mode_set() instead
> Â - Drop bridge detach(), already handle by nwl_dsi_host_detach()
> Â - Drop USE_*_QUIRK() macros
> - Drop (for now) unused clock defnitions. 'pixel' and 'bypass' clock
> will be
> Â used for i.MX8 SoCs but since they're unused atm drop the
> definitions - but
> Â keep the logic to enable/disable several clocks in place since we
> know we'll
> Â need it in the future.
>
> Changes from v0:
> - Add quirk for IMQ8MQ silicon B0 revision to not mess with the
> Â system reset controller on power down since enable() won't work
> Â otherwise.
> - Drop devm_free_irq() handled by the device driver core
> - Disable tx esc clock after the phy power down to unbreak
> Â disable/enable (unblank/blank)
> - Add ports to dt binding docs
> - Select GENERIC_PHY_MIPI_DPHY instead of GENERIC_PHY for
> Â phy_mipi_dphy_get_default_config
> - Select DRM_MIPI_DSI
> - Include drm_print.h to fix build on next-20190408
> - Drop some debugging messages
> - Newline terminate all DRM_ printouts
> - Turn component driver into a drm bridge
>
> [0]: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%
> 2Flists.freedesktop.org%2Farchives%2Fdri-devel%2F2019-
> May%2F219484.html&amp;data=02%7C01%7Crobert.chiras%40nxp.com%7C757201
> f9aaa54653580e08d726edb290%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0
> %7C637020674654566414&amp;sdata=4IVjhLy3a2XxZ4jYwDFD23D%2BvwAVAEj44hY
> fvvp8OpQ%3D&amp;reserved=0
> [1]: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%
> 2Fpatchwork.freedesktop.org%2Fseries%2F62822%2F&amp;data=02%7C01%7Cro
> bert.chiras%40nxp.com%7C757201f9aaa54653580e08d726edb290%7C686ea1d3bc
> 2b4c6fa92cd99c5c301635%7C0%7C0%7C637020674654566414&amp;sdata=GueUBOc
> baGjWtWcMYBplL6ki2UbgaFPkQHg%2F6eReiYg%3D&amp;reserved=0
>
> To: David Airlie <airlied@xxxxxxxx>, Daniel Vetter <daniel@xxxxxxxx>,
> Rob Herring <robh+dt@xxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>
> , Shawn Guo <shawnguo@xxxxxxxxxx>, Sascha Hauer <s.hauer@pengutronix.
> de>, Pengutronix Kernel Team <kernel@xxxxxxxxxxxxxx>, Fabio Estevam <
> festevam@xxxxxxxxx>, NXP Linux Team <linux-imx@xxxxxxx>, Andrzej
> Hajda <a.hajda@xxxxxxxxxxx>, Neil Armstrong <narmstrong@xxxxxxxxxxxx>
> , Laurent Pinchart <Laurent.pinchart@xxxxxxxxxxxxxxxx>, Jonas Karlman
> <jonas@xxxxxxxxx>, Jernej Skrabec <jernej.skrabec@xxxxxxxx>, Lee
> Jones <lee.jones@xxxxxxxxxx>, Guido GÃnther <agx@xxxxxxxxxxx>, dri-de
> vel@xxxxxxxxxxxxxxxxxxxxx, devicetree@xxxxxxxxxxxxxxx, linux-arm-kern
> el@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Robert Chiras <
> robert.chiras@xxxxxxx>, Sam Ravnborg <sam@xxxxxxxxxxxx>, Fabio
> Estevam <festevam@xxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>
>
>
> Guido GÃnther (2):
> Â dt-bindings: display/bridge: Add binding for NWL mipi dsi host
> ÂÂÂÂcontroller
> Â drm/bridge: Add NWL MIPI DSI host controller support
>
> Â.../bindings/display/bridge/nwl-dsi.yamlÂÂÂÂÂÂ| 155 ++++
> Âdrivers/gpu/drm/bridge/KconfigÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ2 +
> Âdrivers/gpu/drm/bridge/MakefileÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ1 +
> Âdrivers/gpu/drm/bridge/nwl-dsi/KconfigÂÂÂÂÂÂÂÂ|ÂÂ16 +
> Âdrivers/gpu/drm/bridge/nwl-dsi/MakefileÂÂÂÂÂÂÂ|ÂÂÂ4 +
> Âdrivers/gpu/drm/bridge/nwl-dsi/nwl-drv.cÂÂÂÂÂÂ| 501 +++++++++++++
> Âdrivers/gpu/drm/bridge/nwl-dsi/nwl-drv.hÂÂÂÂÂÂ|ÂÂ65 ++
> Âdrivers/gpu/drm/bridge/nwl-dsi/nwl-dsi.cÂÂÂÂÂÂ| 700
> ++++++++++++++++++
> Âdrivers/gpu/drm/bridge/nwl-dsi/nwl-dsi.hÂÂÂÂÂÂ| 112 +++
> Â9 files changed, 1556 insertions(+)
> Âcreate mode 100644
> Documentation/devicetree/bindings/display/bridge/nwl-dsi.yaml
> Âcreate mode 100644 drivers/gpu/drm/bridge/nwl-dsi/Kconfig
> Âcreate mode 100644 drivers/gpu/drm/bridge/nwl-dsi/Makefile
> Âcreate mode 100644 drivers/gpu/drm/bridge/nwl-dsi/nwl-drv.c
> Âcreate mode 100644 drivers/gpu/drm/bridge/nwl-dsi/nwl-drv.h
> Âcreate mode 100644 drivers/gpu/drm/bridge/nwl-dsi/nwl-dsi.c
> Âcreate mode 100644 drivers/gpu/drm/bridge/nwl-dsi/nwl-dsi.h
>
> --
> 2.20.1
>