Skip to contentSkip to conversation

drm/meson: fix G12A HDMI PLL settings for 4K60 1000/1001 variations

PATCH In review Neil Armstrong 2 participants 3 messages Jun 5, 2019 – Jun 7, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/meson: fix G12A HDMI PLL settings for 4K60 1000/1001 variations

The Amlogic G12A HDMI PLL needs some specific settings to lock with different fractional values for the 5,4GHz mode.

Handle the 1000/1001 variation fractional case here to avoid having the PLL in an non lockable state.

Fixes 202b9808f8ed ("drm/meson: Add G12A Video Clock setup")
---
 drivers/gpu/drm/meson/meson_vclk.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/meson/meson_vclk.c +11 -2
index 44250eff8a3f..83fc2fc82001 100644
@@ -553,8 +553,17 @@ void meson_hdmi_pll_set_params(struct meson_drm *priv, unsigned int m,
 
 		/* G12A HDMI PLL Needs specific parameters for 5.4GHz */
 		if (m >= 0xf7) {
-			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL4, 0xea68dc00);
-			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL5, 0x65771290);
+			if (frac < 0x10000) {
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL4,
+							0x6a685c00);
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL5,
+							0x11551293);
+			} else {
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL4,
+							0xea68dc00);
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL5,
+							0x65771290);
+			}
 			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL6, 0x39272000);
 			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL7, 0x55540000);
 		} else {
Signature · 1 line
2.21.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 26 lines · Neil Armstrong

The Amlogic G12A HDMI PLL needs some specific settings to lock with different fractional values for the 5,4GHz mode.

Handle the 1000/1001 variation fractional case here to avoid having the PLL in an non lockable state.

Fixes 202b9808f8ed ("drm/meson: Add G12A Video Clock setup")
---
 drivers/gpu/drm/meson/meson_vclk.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/meson/meson_vclk.c +4 -2
index 44250eff8a3f..83fc2fc82001 100644
@@ -553,8 +553,17 @@ void meson_hdmi_pll_set_params(struct meson_drm *priv, unsigned int m,
 
 		/* G12A HDMI PLL Needs specific parameters for 5.4GHz */
 		if (m >= 0xf7) {
-			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL4, 0xea68dc00);
-			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL5, 0x65771290);
+			if (frac < 0x10000) {
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL4,
+							0x6a685c00);
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL5,

drivers/gpu/drm/meson/meson_vclk.c void meson_hdmi_pll_set_params(struct meson_drm *priv, unsigned int m, · line 569

Quoted 10 lines
drivers/gpu/drm/meson/meson_vclk.c +7 -0
+							0x11551293);
+			} else {
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL4,
+							0xea68dc00);
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL5,
+							0x65771290);
+			}
 			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL6, 0x39272000);
 			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL7, 0x55540000);
 		} else {

nit: this is continuing with more magic constants, and it would be nice to have them converted to #define'd bitfields. But since that isn't a new problem in this patch, it's fine to cleanup later.

Kevin

author Applied
#2 lore raw
Quoted 32 lines · Kevin Hilman
Quoted 30 lines · Neil Armstrong

The Amlogic G12A HDMI PLL needs some specific settings to lock with different fractional values for the 5,4GHz mode.

Handle the 1000/1001 variation fractional case here to avoid having the PLL in an non lockable state.

Fixes 202b9808f8ed ("drm/meson: Add G12A Video Clock setup")
---
 drivers/gpu/drm/meson/meson_vclk.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/meson/meson_vclk.c +8 -2
index 44250eff8a3f..83fc2fc82001 100644
@@ -553,8 +553,17 @@ void meson_hdmi_pll_set_params(struct meson_drm *priv, unsigned int m,
 
 		/* G12A HDMI PLL Needs specific parameters for 5.4GHz */
 		if (m >= 0xf7) {
-			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL4, 0xea68dc00);
-			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL5, 0x65771290);
+			if (frac < 0x10000) {
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL4,
+							0x6a685c00);
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL5,
+							0x11551293);
+			} else {
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL4,
+							0xea68dc00);
Quoted 8 lines

drivers/gpu/drm/meson/meson_vclk.c void meson_hdmi_pll_set_params(struct meson_drm *priv, unsigned int m, · line 569

Quoted 6 lines
drivers/gpu/drm/meson/meson_vclk.c +3 -0
+				regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL5,
+							0x65771290);
+			}
 			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL6, 0x39272000);
 			regmap_write(priv->hhi, HHI_HDMI_PLL_CNTL7, 0x55540000);
 		} else {

Applied to drm-misc-fixes

Quoted 4 lines

nit: this is continuing with more magic constants, and it would be nice to have them converted to #define'd bitfields. But since that isn't a new problem in this patch, it's fine to cleanup later.

Yep, it's on our to priority.

Neil

Quoted 3 lines

Kevin