mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-02-13 11:51:54 +00:00
56 lines
2 KiB
Diff
56 lines
2 KiB
Diff
From b6b62f912d8aa4bd47780b3de56dc35ee820aad9 Mon Sep 17 00:00:00 2001
|
|
From: Maxime Ripard <maxime@cerno.tech>
|
|
Date: Wed, 22 Sep 2021 14:54:17 +0200
|
|
Subject: [PATCH 002/634] drm/vc4: hdmi: Set a default HSM rate
|
|
|
|
When the firmware doesn't setup the HSM rate (such as when booting
|
|
without an HDMI cable plugged in), its rate is 0 and thus any register
|
|
access results in a CPU stall, even though HSM is enabled.
|
|
|
|
Let's enforce a minimum rate at boot to avoid this issue.
|
|
|
|
Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
|
|
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
|
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
|
|
Tested-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
|
|
Tested-by: Michael Stapelberg <michael@stapelberg.ch>
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/20210922125419.4125779-4-maxime@cerno.tech
|
|
---
|
|
drivers/gpu/drm/vc4/vc4_hdmi.c | 14 ++++++++++++++
|
|
1 file changed, 14 insertions(+)
|
|
|
|
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
|
index ed8a4b7f8b6e..623a4699bd21 100644
|
|
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
|
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
|
@@ -94,6 +94,7 @@
|
|
# define VC4_HD_M_SW_RST BIT(2)
|
|
# define VC4_HD_M_ENABLE BIT(0)
|
|
|
|
+#define HSM_MIN_CLOCK_FREQ 120000000
|
|
#define CEC_CLOCK_FREQ 40000
|
|
|
|
#define HDMI_14_MAX_TMDS_CLK (340 * 1000 * 1000)
|
|
@@ -2161,6 +2162,19 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
|
|
vc4_hdmi->disable_4kp60 = true;
|
|
}
|
|
|
|
+ /*
|
|
+ * If we boot without any cable connected to the HDMI connector,
|
|
+ * the firmware will skip the HSM initialization and leave it
|
|
+ * with a rate of 0, resulting in a bus lockup when we're
|
|
+ * accessing the registers even if it's enabled.
|
|
+ *
|
|
+ * Let's put a sensible default at runtime_resume so that we
|
|
+ * don't end up in this situation.
|
|
+ */
|
|
+ ret = clk_set_min_rate(vc4_hdmi->hsm_clock, HSM_MIN_CLOCK_FREQ);
|
|
+ if (ret)
|
|
+ goto err_put_ddc;
|
|
+
|
|
if (vc4_hdmi->variant->reset)
|
|
vc4_hdmi->variant->reset(vc4_hdmi);
|
|
|
|
--
|
|
2.33.1
|
|
|