[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ef66c2ac-380a-ebcf-a168-099f1ff709a6@i2se.com>
Date: Thu, 7 May 2020 19:36:52 +0200
From: Stefan Wahren <stefan.wahren@...e.com>
To: Maxime Ripard <maxime@...no.tech>,
Nicolas Saenz Julienne <nsaenzjulienne@...e.de>,
Eric Anholt <eric@...olt.net>
Cc: Tim Gover <tim.gover@...pberrypi.com>,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
bcm-kernel-feedback-list@...adcom.com,
linux-rpi-kernel@...ts.infradead.org,
Phil Elwell <phil@...pberrypi.com>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2 89/91] drm/vc4: hdmi: Support the BCM2711 HDMI
controllers
Hi Maxime,
Am 24.04.20 um 17:35 schrieb Maxime Ripard:
> Now that the driver is ready for it, let's bring in the HDMI controllers
> variants for the BCM2711.
>
> Signed-off-by: Maxime Ripard <maxime@...no.tech>
> ---
> drivers/gpu/drm/vc4/vc4_hdmi.c | 276 +++++++++++++++++-
> drivers/gpu/drm/vc4/vc4_hdmi.h | 35 ++-
> drivers/gpu/drm/vc4/vc4_hdmi_phy.c | 468 +++++++++++++++++++++++++++++-
> drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 201 ++++++++++++-
> 4 files changed, 980 insertions(+)
...
> +
> +#define VC4_HDMI_RM_FORMAT_SHIFT_SHIFT 24
> +#define VC4_HDMI_RM_FORMAT_SHIFT_MASK VC4_MASK(25, 24)
> +
> +#define OSCILLATOR_FREQUENCY 54000000
Just want to mention that the oscillator frequency of the BCM2711 is
available via bcm2711.dtsi
> +
> void vc4_hdmi_phy_init(struct vc4_hdmi *vc4_hdmi, struct drm_display_mode *mode)
> {
> /* PHY should be in reset, like
> @@ -38,3 +155,354 @@ void vc4_hdmi_phy_rng_disable(struct vc4_hdmi *vc4_hdmi)
> HDMI_READ(HDMI_TX_PHY_CTL_0) |
> VC4_HDMI_TX_PHY_RNG_PWRDN);
> }
> +
> +static unsigned long long
> +phy_get_vco_freq(unsigned long long clock, u8 *vco_sel, u8 *vco_div)
> +{
> + unsigned long long vco_freq = clock;
> + unsigned int _vco_div = 0;
> + unsigned int _vco_sel = 0;
> +
> + while (vco_freq < 3000000000ULL) {
> + _vco_div++;
> + vco_freq = clock * _vco_div * 10;
> + }
> +
> + if (vco_freq > 4500000000ULL)
> + _vco_sel = 1;
> +
> + *vco_sel = _vco_sel;
> + *vco_div = _vco_div;
> +
> + return vco_freq;
> +}
> +
> +static u8 phy_get_cp_current(unsigned long vco_freq)
> +{
> + if (vco_freq < 3700000000ULL)
> + return 0x1c;
> +
> + return 0xc8;
The vendor tree contains a patch [1] for this return value, which said
that the value is a typo and causes warnings because the value must be 6
bit.
Btw that my tests with Raspberry Pi 3 and 4 were good so far.
[1] -
https://github.com/raspberrypi/linux/commit/71d5db1b342097fa4dc561202837beb934648b25
> +}
> +
Powered by blists - more mailing lists