mbox series

[0/2] phy: Add support for the HDMI TX PHY on Meson8/8b/8m2

Message ID 20210604190338.2248295-1-martin.blumenstingl@googlemail.com
Headers show
Series phy: Add support for the HDMI TX PHY on Meson8/8b/8m2 | expand

Message

Martin Blumenstingl June 4, 2021, 7:03 p.m. UTC
Amlogic Meson8/8b/8m2 SoCs embed a HDMI TX PHY. Unfortunately there is
no (public) documentation for this hardware. The best thing we have is
the 3.10 vendor kernel, which unfortunately doesn't document most
register bits (only a few are named there, the rest is all magic
numbers).
It is possible that this is a TranSwitch HDMI TX PHY based core, but
this is pure speculation.

Adding a driver for the HDMI TX PHY gets us one step closer to video
output on these older SoCs.


Martin Blumenstingl (2):
  dt-bindings: phy: Add the Amlogic Meson8 HDMI TX PHY bindings
  phy: amlogic: Add a new driver for the HDMI TX PHY on Meson8/8b/8m2

 .../phy/amlogic,meson8-hdmi-tx-phy.yaml       |  51 ++++++
 drivers/phy/amlogic/Kconfig                   |  11 ++
 drivers/phy/amlogic/Makefile                  |   1 +
 drivers/phy/amlogic/phy-meson8-hdmi-tx.c      | 150 ++++++++++++++++++
 4 files changed, 213 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/amlogic,meson8-hdmi-tx-phy.yaml
 create mode 100644 drivers/phy/amlogic/phy-meson8-hdmi-tx.c

Comments

Vinod Koul June 21, 2021, 6:18 a.m. UTC | #1
On 04-06-21, 21:03, Martin Blumenstingl wrote:
> Amlogic Meson8/8b/8m2 have a built-in HDMI PHY in the HHI register
> region. Unfortunately only few register bits are documented. For
> HHI_HDMI_PHY_CNTL0 the magic numbers are taken from the 3.10 vendor
> kernel.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  drivers/phy/amlogic/Kconfig              |  11 ++
>  drivers/phy/amlogic/Makefile             |   1 +
>  drivers/phy/amlogic/phy-meson8-hdmi-tx.c | 150 +++++++++++++++++++++++
>  3 files changed, 162 insertions(+)
>  create mode 100644 drivers/phy/amlogic/phy-meson8-hdmi-tx.c
> 
> diff --git a/drivers/phy/amlogic/Kconfig b/drivers/phy/amlogic/Kconfig
> index db5d0cd757e3..e6c3a2a8b769 100644
> --- a/drivers/phy/amlogic/Kconfig
> +++ b/drivers/phy/amlogic/Kconfig
> @@ -2,6 +2,17 @@
>  #
>  # Phy drivers for Amlogic platforms
>  #
> +config PHY_MESON8_HDMI_TX
> +	tristate "Meson8, Meson8b and Meson8m2 HDMI TX PHY driver"
> +	default ARCH_MESON
> +	depends on (ARCH_MESON && ARM) || COMPILE_TEST

depends on ARM seems redundant..

> + * Meson8, Meson8b and Meson8m2 HDMI TX PHY.
> + *
> + * Copyright (C) 2020 Martin Blumenstingl <martin.blumenstingl@googlemail.com>

2021..
Martin Blumenstingl June 22, 2021, 7:57 p.m. UTC | #2
Hi Vinod,

thanks for taking the time to review this!

On Mon, Jun 21, 2021 at 8:18 AM Vinod Koul <vkoul@kernel.org> wrote:
>
> On 04-06-21, 21:03, Martin Blumenstingl wrote:
> > Amlogic Meson8/8b/8m2 have a built-in HDMI PHY in the HHI register
> > region. Unfortunately only few register bits are documented. For
> > HHI_HDMI_PHY_CNTL0 the magic numbers are taken from the 3.10 vendor
> > kernel.
> >
> > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> > ---
> >  drivers/phy/amlogic/Kconfig              |  11 ++
> >  drivers/phy/amlogic/Makefile             |   1 +
> >  drivers/phy/amlogic/phy-meson8-hdmi-tx.c | 150 +++++++++++++++++++++++
> >  3 files changed, 162 insertions(+)
> >  create mode 100644 drivers/phy/amlogic/phy-meson8-hdmi-tx.c
> >
> > diff --git a/drivers/phy/amlogic/Kconfig b/drivers/phy/amlogic/Kconfig
> > index db5d0cd757e3..e6c3a2a8b769 100644
> > --- a/drivers/phy/amlogic/Kconfig
> > +++ b/drivers/phy/amlogic/Kconfig
> > @@ -2,6 +2,17 @@
> >  #
> >  # Phy drivers for Amlogic platforms
> >  #
> > +config PHY_MESON8_HDMI_TX
> > +     tristate "Meson8, Meson8b and Meson8m2 HDMI TX PHY driver"
> > +     default ARCH_MESON
> > +     depends on (ARCH_MESON && ARM) || COMPILE_TEST
>
> depends on ARM seems redundant..
config ARCH_MESON exists in arch/arm as well as arch/arm64
my idea was to hide it from the 64-bit SoCs since it's not used there

While reading your comment I spotted something for myself:
I think "default ARCH_MESON" should not be there.

> > + * Meson8, Meson8b and Meson8m2 HDMI TX PHY.
> > + *
> > + * Copyright (C) 2020 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
>
> 2021..
good catch, I'll fix this in v2


Best regards,
Martin