mbox series

[v4,00/10] Initial support for Cadence MHDP(HDMI/DP) for i.MX8MQ

Message ID cover.1669013346.git.Sandor.yu@nxp.com
Headers show
Series Initial support for Cadence MHDP(HDMI/DP) for i.MX8MQ | expand

Message

Sandor Yu Nov. 21, 2022, 7:23 a.m. UTC
The patch set initial support for Cadence MHDP(HDMI/DP) DRM bridge
drivers and Cadence HDP-TX PHY(HDMI/DP) drivers for iMX8MQ.

The patch set compose of DRM bridge drivers and PHY drivers.
Both of them need the followed two patches to pass build.
  drm: bridge: cadence: convert mailbox functions to macro functions
  phy: Add HDMI configuration options

DRM bridges driver patches:
  dts-bingings: display: bridge: Add MHDP HDMI bindings for i.MX8MQ
  drm: bridge: cadence: Add MHDP DP driver for i.MX8MQ
  dts-bindings: display: bridge: Add MHDP DP bindings for i.MX8MQ
  drm: bridge: cadence: Add MHDP HDMI driver for i.MX8MQ

PHY driver patches:
  dts-bindings: phy: Add Cadence HDP-TX DP PHY bindings
  phy: cadence: Add driver for HDP-TX DisplyPort PHY
  dts-bindings: phy: Add Cadence HDP-TX HDMI PHY bindings
  phy: cadence: Add driver for HDP-TX HDMI PHY

v3->v4:
dt-bindings:
- Correct dt-bindings coding style and address review comments.
- Add apb_clk description.
- Add output port for HDMI/DP connector
PHY:
- Alphabetically sorted in Kconfig and Makefile for DP and HDMI PHY
- Remove unused registers define from HDMI and DP PHY drivers.
- More description in phy_hdmi.h.
- Add apb_clk to HDMI and DP phy driver.
HDMI/DP:
- Use get_unaligned_le32() to replace hardcode type conversion
  in HDMI AVI infoframe data fill function.
- Add mailbox mutex lock in HDMI/DP driver for phy functions
  to reslove race conditions between HDMI/DP and PHY drivers.
- Add apb_clk to both HDMI and DP driver.
- Rename some function names and add prefix with "cdns_hdmi/cdns_dp".
- Remove bpc 12 and 16 optional that not supported.

v2->v3:
Address comments for dt-bindings files.
- Correct dts-bindings file names 
  Rename phy-cadence-hdptx-dp.yaml to cdns,mhdp-imx8mq-dp.yaml
  Rename phy-cadence-hdptx-hdmi.yaml to cdns,mhdp-imx8mq-hdmi.yaml
- Drop redundant words and descriptions.
- Correct hdmi/dp node name.

v2 is a completely different version compared to v1.
Previous v1 can be available here [1].

v1->v2:
- Reuse Cadence mailbox access functions from mhdp8546 instead of
  rockchip DP.
- Mailbox access functions be convert to marco functions
  that will be referenced by HDP-TX PHY(HDMI/DP) driver too.
- Plain bridge instead of component driver.
- Standalone Cadence HDP-TX PHY(HDMI/DP) driver.
- Audio driver are removed from the patch set, it will be add in another
  patch set later.

[1] https://patchwork.kernel.org/project/linux-rockchip/cover/cover.1590982881.git.Sandor.yu@nxp.com/

Sandor Yu (10):
  drm: bridge: cadence: convert mailbox functions to macro functions
  dt-bindings: display: bridge: Add MHDP DP for i.MX8MQ
  drm: bridge: cadence: Add MHDP DP driver for i.MX8MQ
  phy: Add HDMI configuration options
  dt-bindings: display: bridge: Add MHDP HDMI for i.MX8MQ
  drm: bridge: cadence: Add MHDP HDMI driver for i.MX8MQ
  dt-bindings: phy: Add Cadence HDP-TX DP PHY
  phy: cadence: Add driver for HDP-TX DisplyPort PHY
  dt-bindings: phy: Add Cadence HDP-TX HDMI PHY
  phy: cadence: Add driver for HDP-TX HDMI PHY

 .../display/bridge/cdns,mhdp-imx8mq-dp.yaml   |   93 ++
 .../display/bridge/cdns,mhdp-imx8mq-hdmi.yaml |   93 ++
 .../bindings/phy/cdns,hdptx-dp-phy.yaml       |   68 ++
 .../bindings/phy/cdns,hdptx-hdmi-phy.yaml     |   52 +
 drivers/gpu/drm/bridge/cadence/Kconfig        |   25 +
 drivers/gpu/drm/bridge/cadence/Makefile       |    3 +
 drivers/gpu/drm/bridge/cadence/cdns-dp-core.c | 1071 +++++++++++++++++
 .../gpu/drm/bridge/cadence/cdns-hdmi-core.c   | 1018 ++++++++++++++++
 .../gpu/drm/bridge/cadence/cdns-mhdp-common.h |  400 ++++++
 .../drm/bridge/cadence/cdns-mhdp8546-core.c   |  197 +--
 .../drm/bridge/cadence/cdns-mhdp8546-core.h   |    1 -
 drivers/phy/cadence/Kconfig                   |   16 +
 drivers/phy/cadence/Makefile                  |    2 +
 drivers/phy/cadence/phy-cadence-hdptx-dp.c    |  737 ++++++++++++
 drivers/phy/cadence/phy-cadence-hdptx-hdmi.c  |  891 ++++++++++++++
 include/drm/bridge/cdns-mhdp-mailbox.h        |  240 ++++
 include/linux/phy/phy-hdmi.h                  |   38 +
 include/linux/phy/phy.h                       |    7 +-
 18 files changed, 4755 insertions(+), 197 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/cdns,mhdp-imx8mq-dp.yaml
 create mode 100644 Documentation/devicetree/bindings/display/bridge/cdns,mhdp-imx8mq-hdmi.yaml
 create mode 100644 Documentation/devicetree/bindings/phy/cdns,hdptx-dp-phy.yaml
 create mode 100644 Documentation/devicetree/bindings/phy/cdns,hdptx-hdmi-phy.yaml
 create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-dp-core.c
 create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c
 create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp-common.h
 create mode 100644 drivers/phy/cadence/phy-cadence-hdptx-dp.c
 create mode 100644 drivers/phy/cadence/phy-cadence-hdptx-hdmi.c
 create mode 100644 include/drm/bridge/cdns-mhdp-mailbox.h
 create mode 100644 include/linux/phy/phy-hdmi.h

Comments

Alexander Stein Nov. 21, 2022, 8:36 a.m. UTC | #1
Hello Sandor,

thanks for the updated series.

Am Montag, 21. November 2022, 08:23:50 CET schrieb Sandor Yu:
> The patch set initial support for Cadence MHDP(HDMI/DP) DRM bridge
> drivers and Cadence HDP-TX PHY(HDMI/DP) drivers for iMX8MQ.
> 
> The patch set compose of DRM bridge drivers and PHY drivers.
> Both of them need the followed two patches to pass build.
>   drm: bridge: cadence: convert mailbox functions to macro functions
>   phy: Add HDMI configuration options
> 
> DRM bridges driver patches:
>   dts-bingings: display: bridge: Add MHDP HDMI bindings for i.MX8MQ
>   drm: bridge: cadence: Add MHDP DP driver for i.MX8MQ
>   dts-bindings: display: bridge: Add MHDP DP bindings for i.MX8MQ
>   drm: bridge: cadence: Add MHDP HDMI driver for i.MX8MQ
> 
> PHY driver patches:
>   dts-bindings: phy: Add Cadence HDP-TX DP PHY bindings
>   phy: cadence: Add driver for HDP-TX DisplyPort PHY
>   dts-bindings: phy: Add Cadence HDP-TX HDMI PHY bindings
>   phy: cadence: Add driver for HDP-TX HDMI PHY
> 
> v3->v4:
> dt-bindings:
> - Correct dt-bindings coding style and address review comments.
> - Add apb_clk description.
> - Add output port for HDMI/DP connector
> PHY:
> - Alphabetically sorted in Kconfig and Makefile for DP and HDMI PHY
> - Remove unused registers define from HDMI and DP PHY drivers.
> - More description in phy_hdmi.h.
> - Add apb_clk to HDMI and DP phy driver.
> HDMI/DP:
> - Use get_unaligned_le32() to replace hardcode type conversion
>   in HDMI AVI infoframe data fill function.
> - Add mailbox mutex lock in HDMI/DP driver for phy functions
>   to reslove race conditions between HDMI/DP and PHY drivers.
> - Add apb_clk to both HDMI and DP driver.
> - Rename some function names and add prefix with "cdns_hdmi/cdns_dp".
> - Remove bpc 12 and 16 optional that not supported.

With the apb_clk enabled now, I can use both HDMI and PHY driver as modules 
now. Thanks!

Best regards,
Alexander

> v2->v3:
> Address comments for dt-bindings files.
> - Correct dts-bindings file names
>   Rename phy-cadence-hdptx-dp.yaml to cdns,mhdp-imx8mq-dp.yaml
>   Rename phy-cadence-hdptx-hdmi.yaml to cdns,mhdp-imx8mq-hdmi.yaml
> - Drop redundant words and descriptions.
> - Correct hdmi/dp node name.
> 
> v2 is a completely different version compared to v1.
> Previous v1 can be available here [1].
> 
> v1->v2:
> - Reuse Cadence mailbox access functions from mhdp8546 instead of
>   rockchip DP.
> - Mailbox access functions be convert to marco functions
>   that will be referenced by HDP-TX PHY(HDMI/DP) driver too.
> - Plain bridge instead of component driver.
> - Standalone Cadence HDP-TX PHY(HDMI/DP) driver.
> - Audio driver are removed from the patch set, it will be add in another
>   patch set later.
> 
> [1]
> https://patchwork.kernel.org/project/linux-rockchip/cover/cover.1590982881.
> git.Sandor.yu@nxp.com/
> 
> Sandor Yu (10):
>   drm: bridge: cadence: convert mailbox functions to macro functions
>   dt-bindings: display: bridge: Add MHDP DP for i.MX8MQ
>   drm: bridge: cadence: Add MHDP DP driver for i.MX8MQ
>   phy: Add HDMI configuration options
>   dt-bindings: display: bridge: Add MHDP HDMI for i.MX8MQ
>   drm: bridge: cadence: Add MHDP HDMI driver for i.MX8MQ
>   dt-bindings: phy: Add Cadence HDP-TX DP PHY
>   phy: cadence: Add driver for HDP-TX DisplyPort PHY
>   dt-bindings: phy: Add Cadence HDP-TX HDMI PHY
>   phy: cadence: Add driver for HDP-TX HDMI PHY
> 
>  .../display/bridge/cdns,mhdp-imx8mq-dp.yaml   |   93 ++
>  .../display/bridge/cdns,mhdp-imx8mq-hdmi.yaml |   93 ++
>  .../bindings/phy/cdns,hdptx-dp-phy.yaml       |   68 ++
>  .../bindings/phy/cdns,hdptx-hdmi-phy.yaml     |   52 +
>  drivers/gpu/drm/bridge/cadence/Kconfig        |   25 +
>  drivers/gpu/drm/bridge/cadence/Makefile       |    3 +
>  drivers/gpu/drm/bridge/cadence/cdns-dp-core.c | 1071 +++++++++++++++++
>  .../gpu/drm/bridge/cadence/cdns-hdmi-core.c   | 1018 ++++++++++++++++
>  .../gpu/drm/bridge/cadence/cdns-mhdp-common.h |  400 ++++++
>  .../drm/bridge/cadence/cdns-mhdp8546-core.c   |  197 +--
>  .../drm/bridge/cadence/cdns-mhdp8546-core.h   |    1 -
>  drivers/phy/cadence/Kconfig                   |   16 +
>  drivers/phy/cadence/Makefile                  |    2 +
>  drivers/phy/cadence/phy-cadence-hdptx-dp.c    |  737 ++++++++++++
>  drivers/phy/cadence/phy-cadence-hdptx-hdmi.c  |  891 ++++++++++++++
>  include/drm/bridge/cdns-mhdp-mailbox.h        |  240 ++++
>  include/linux/phy/phy-hdmi.h                  |   38 +
>  include/linux/phy/phy.h                       |    7 +-
>  18 files changed, 4755 insertions(+), 197 deletions(-)
>  create mode 100644
> Documentation/devicetree/bindings/display/bridge/cdns,mhdp-imx8mq-dp.yaml
> create mode 100644
> Documentation/devicetree/bindings/display/bridge/cdns,mhdp-imx8mq-hdmi.yaml
> create mode 100644
> Documentation/devicetree/bindings/phy/cdns,hdptx-dp-phy.yaml create mode
> 100644 Documentation/devicetree/bindings/phy/cdns,hdptx-hdmi-phy.yaml
> create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-dp-core.c
>  create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c
>  create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp-common.h
>  create mode 100644 drivers/phy/cadence/phy-cadence-hdptx-dp.c
>  create mode 100644 drivers/phy/cadence/phy-cadence-hdptx-hdmi.c
>  create mode 100644 include/drm/bridge/cdns-mhdp-mailbox.h
>  create mode 100644 include/linux/phy/phy-hdmi.h
Fabio Estevam Nov. 22, 2022, 6:08 p.m. UTC | #2
Hi Sandor,

On Mon, Nov 21, 2022 at 4:27 AM Sandor Yu <Sandor.yu@nxp.com> wrote:
>
> Mailbox access functions could be share to other mhdp driver and
> HDP-TX HDMI/DP PHY drivers, move those functions to head file
> include/drm/bridge/cdns-mhdp-mailbox.h and convert them to
> macro functions.

What is the reason for converting the functions to macro?
Sandor Yu Nov. 23, 2022, 6:36 a.m. UTC | #3
> -----Original Message-----
> From: Fabio Estevam <festevam@gmail.com>
> Sent: 2022年11月23日 2:09
> To: Sandor Yu <sandor.yu@nxp.com>
> Cc: andrzej.hajda@intel.com; neil.armstrong@linaro.org;
> robert.foss@linaro.org; Laurent.pinchart@ideasonboard.com;
> jonas@kwiboo.se; jernej.skrabec@gmail.com; airlied@gmail.com;
> daniel@ffwll.ch; robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org;
> shawnguo@kernel.org; s.hauer@pengutronix.de; kishon@ti.com;
> vkoul@kernel.org; dri-devel@lists.freedesktop.org;
> devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; linux-phy@lists.infradead.org;
> alexander.stein@ew.tq-group.com; kernel@pengutronix.de; dl-linux-imx
> <linux-imx@nxp.com>; Oliver Brown <oliver.brown@nxp.com>
> Subject: [EXT] Re: [PATCH v4 01/10] drm: bridge: cadence: convert mailbox
> functions to macro functions
> 
> Caution: EXT Email
> 
> Hi Sandor,
> 
> On Mon, Nov 21, 2022 at 4:27 AM Sandor Yu <Sandor.yu@nxp.com> wrote:
> >
> > Mailbox access functions could be share to other mhdp driver and
> > HDP-TX HDMI/DP PHY drivers, move those functions to head file
> > include/drm/bridge/cdns-mhdp-mailbox.h and convert them to macro
> > functions.
> 
> What is the reason for converting the functions to macro?
Both HDMI PHY driver and HDMI bridge driver need mailbox API function to access register and get status from firmware.
Covert those functions to macro could be easy reused by both PHY and bridge driver.

B.R
Sandor