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

2020-04-10 Thread Guido Günther
Hi,
On Thu, Apr 09, 2020 at 04:01:30PM +0200, Sam Ravnborg wrote:
> Hi Guido.
> 
> On Thu, Apr 09, 2020 at 12:42:00PM +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.
> > 
> > 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 / dcss
> >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 mainline rocktech-jh057n00900 DSI panel driver on next-20200317 and 
> > on
> > the Librem5 with the a Mantix MLAF057WE51-X DSI panel driver (not yet 
> > mainline)
> > The DCSS (submitted for mainline inclusion now too) can also act as input
> > source.
> 
> Thanks for your persistence with this driver.
> I got ack from Laurent on IRC to apply it (not for the driver as he had
> no time to review it).
> So applied to drm-misc-next now.
> 
> I look forward for the update to support DRM_BRIDGE_ATTACH_NO_CONNECTOR
> in this driver and the corresponding display driver.

Thanks. I'll have a look at that (currently checking where the larger
mxsfb rework of Laurent is going so i can use that as a base
eventually).
Cheers,
 -- Guido
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


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

2020-04-09 Thread Sam Ravnborg
Hi Guido.

On Thu, Apr 09, 2020 at 12:42:00PM +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.
> 
> 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 / dcss
>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 mainline rocktech-jh057n00900 DSI panel driver on next-20200317 and on
> the Librem5 with the a Mantix MLAF057WE51-X DSI panel driver (not yet 
> mainline)
> The DCSS (submitted for mainline inclusion now too) can also act as input
> source.

Thanks for your persistence with this driver.
I got ack from Laurent on IRC to apply it (not for the driver as he had
no time to review it).
So applied to drm-misc-next now.

I look forward for the update to support DRM_BRIDGE_ATTACH_NO_CONNECTOR
in this driver and the corresponding display driver.

Sam
> 
> Changes from v10:
> - Per review comments by Sam Ravnborg
>   
> https://lore.kernel.org/linux-arm-kernel/20200408175252.gb24...@ravnborg.org/
>   - Drop unused headers
>   - Fix 'check-patch --strict' findings
>   - Print error when DRM_BRIDGE_ATTACH_NO_CONNECTOR is passed
> - Per review comment by Laurent Pinchart
>   
> https://lore.kernel.org/linux-arm-kernel/20200408173258.ga24...@ravnborg.org/
>   - There's only one endpoint allowed at a time, add a restriction for that.
> - Add Reviewed-by from Fabio Estevam
>   
> https://lore.kernel.org/linux-arm-kernel/CAOMZO5Dhy7ahcR-S=QG=pumxxa8hnqowpg0tdfyeu_levdh...@mail.gmail.com/
>   
> https://lore.kernel.org/linux-arm-kernel/caomzo5du-zp7wxm2eh8wafock_kwomgh57ayjrbb0pzhuaa...@mail.gmail.com/
> - Move to next-20200408
> 
> Changes from v9:
> - Per review comments by Sam Ravnborg
>   https://lore.kernel.org/dri-devel/20200318214639.ga...@ravnborg.org/
>   - Drop header-test-y since kernel lost support
>   - Handle drm_bridge_attach's new flags argument
>   - Add Acked-by: to binding patch, thanks!
> - Move to next-20200319
> 
> Changes from v8:
> - Per review comments by Robert Chiras
>   https://lore.kernel.org/dri-devel/1575366594.6423.61.ca...@nxp.com/
>   - don't mix DSI host and bridge initialization
>   - only select output source once
>   - defer probe when panel is not ready to fix usage as a module
>   - use correct reset sequence as described by Robert
> (and provided by NWL)
>   - use mode->clock instead of mode->crtc_clock
> - Add tested by from Martin Kepplinger, thanks!
> - Drop platform specific data (as suggested previously by Laurent Pinchart and
>   Andrzej Hajda) since imx8q* needs another set of abstractions with the new
>   reset sequence and that's easier to do when adding imx8q* support rather 
> then
>   adding wrong abstraction now.
> - Update bindings to use proper clock and irq names to make the example match
>   reality more closely.
> - Use `fallthrough;` instead of /* Fall through */ in switch statements
> - Move to next-20200226
> 
> Changes from v7:
> - Drop reset quirk. It's not needed with mxsfb and sometimes triggers a 
> shifted display.
> 
> Changes from v6:
> - Per review comments by Andrzej Hajda
>   
> https://lore.kernel.org/linux-arm-kernel/c86b7ca2-7799-eafd-c380-e4b551520...@samsung.com/
>   - Drop spare empty line
>   - handle nwl_dsi_write errors
>   - better handle read errors
>   - unwind in case of error in nwl_dsi_enable
>   - use bridge_to_dsi() instead of accessing driver_private
>   - don't log on -EPROBEDEFER when fething the reset controller
>   - use endpoint number to determine input
> - Spotted by kbuild test robot 
>   
> https://lore.kernel.org/linux-arm-kernel/201909230644.qfskbnf9%25...@intel.com/
>   Use signed return type for nwl_dsi_get_dpi_pixel_format
> - Drop connector type from drm_panel_bridge_add
> - Don't forget to set an error value on dsi reads
> 
> Changes from v5:
> - Per review comments by Andrzej Hajda
>   https://lists.freedesktop.org/archives/dri-devel/2019-September/235281.html
>   - Fix include file ordering
>   - Add a comment to nwl_dsi_platform_data that will allow to add support
> at least for the i.MX8QM
>   - Merge driver into a single file plus the register defs in a separate 
> header
> - Make more functions and structs static
> 
> Changes from v4:
> - Collect Reviewed-

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

2020-04-09 Thread Guido Günther
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.

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 / dcss
   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 mainline rocktech-jh057n00900 DSI panel driver on next-20200317 and on
the Librem5 with the a Mantix MLAF057WE51-X DSI panel driver (not yet mainline)
The DCSS (submitted for mainline inclusion now too) can also act as input
source.

Changes from v10:
- Per review comments by Sam Ravnborg
  https://lore.kernel.org/linux-arm-kernel/20200408175252.gb24...@ravnborg.org/
  - Drop unused headers
  - Fix 'check-patch --strict' findings
  - Print error when DRM_BRIDGE_ATTACH_NO_CONNECTOR is passed
- Per review comment by Laurent Pinchart
  https://lore.kernel.org/linux-arm-kernel/20200408173258.ga24...@ravnborg.org/
  - There's only one endpoint allowed at a time, add a restriction for that.
- Add Reviewed-by from Fabio Estevam
  
https://lore.kernel.org/linux-arm-kernel/CAOMZO5Dhy7ahcR-S=QG=pumxxa8hnqowpg0tdfyeu_levdh...@mail.gmail.com/
  
https://lore.kernel.org/linux-arm-kernel/caomzo5du-zp7wxm2eh8wafock_kwomgh57ayjrbb0pzhuaa...@mail.gmail.com/
- Move to next-20200408

Changes from v9:
- Per review comments by Sam Ravnborg
  https://lore.kernel.org/dri-devel/20200318214639.ga...@ravnborg.org/
  - Drop header-test-y since kernel lost support
  - Handle drm_bridge_attach's new flags argument
  - Add Acked-by: to binding patch, thanks!
- Move to next-20200319

Changes from v8:
- Per review comments by Robert Chiras
  https://lore.kernel.org/dri-devel/1575366594.6423.61.ca...@nxp.com/
  - don't mix DSI host and bridge initialization
  - only select output source once
  - defer probe when panel is not ready to fix usage as a module
  - use correct reset sequence as described by Robert
(and provided by NWL)
  - use mode->clock instead of mode->crtc_clock
- Add tested by from Martin Kepplinger, thanks!
- Drop platform specific data (as suggested previously by Laurent Pinchart and
  Andrzej Hajda) since imx8q* needs another set of abstractions with the new
  reset sequence and that's easier to do when adding imx8q* support rather then
  adding wrong abstraction now.
- Update bindings to use proper clock and irq names to make the example match
  reality more closely.
- Use `fallthrough;` instead of /* Fall through */ in switch statements
- Move to next-20200226

Changes from v7:
- Drop reset quirk. It's not needed with mxsfb and sometimes triggers a shifted 
display.

Changes from v6:
- Per review comments by Andrzej Hajda
  
https://lore.kernel.org/linux-arm-kernel/c86b7ca2-7799-eafd-c380-e4b551520...@samsung.com/
  - Drop spare empty line
  - handle nwl_dsi_write errors
  - better handle read errors
  - unwind in case of error in nwl_dsi_enable
  - use bridge_to_dsi() instead of accessing driver_private
  - don't log on -EPROBEDEFER when fething the reset controller
  - use endpoint number to determine input
- Spotted by kbuild test robot 
  
https://lore.kernel.org/linux-arm-kernel/201909230644.qfskbnf9%25...@intel.com/
  Use signed return type for nwl_dsi_get_dpi_pixel_format
- Drop connector type from drm_panel_bridge_add
- Don't forget to set an error value on dsi reads

Changes from v5:
- Per review comments by Andrzej Hajda
  https://lists.freedesktop.org/archives/dri-devel/2019-September/235281.html
  - Fix include file ordering
  - Add a comment to nwl_dsi_platform_data that will allow to add support
at least for the i.MX8QM
  - Merge driver into a single file plus the register defs in a separate header
- Make more functions and structs static

Changes from v4:
- Collect Reviewed-by: from Rob Herring, thanks!
  https://lists.freedesktop.org/archives/dri-devel/2019-September/233979.html
- Spotted by kbuild test robot 
  https://lists.freedesktop.org/archives/dri-devel/2019-September/233860.html
  https://lists.freedesktop.org/archives/dri-devel/2019-September/233863.html
  - fix format string for size_t
  - Use DIV64_U64_ROUND_UP to fix build on 32 bit architectures
We can't use simple shift sind d and n are similar in size and
we need full precision
- Fix debug cfg_t_post debug print out
- Avoid PSEC_PER_SEC
- Move timeout / overflow handling out of nwl_dsi_finish_transm