Skip to content

Commit d81f50b

Browse files
gugulotmichalsimek
authored andcommitted
phy: xilinx-xhdmiphy: Add support for FRL 6G 3-lane mode
FRL 6G mode works with 3-lane or 4-lane mode. Based on the number of lanes retimer chip needs to be configured. Currently driver configures the retimer chip always in 4-lane though link is trained with 3-lane or 4-lane in 6G FRL mode. Fix programming retimer chip based on the number of lanes link trained with in 6G FRL mode. Signed-off-by: Rajesh Gugulothu <rajesh.gugulothu@amd.com> Reviewed-by: Vishal Sagar <vishal.sagar@amd.com>
1 parent 3371328 commit d81f50b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

drivers/phy/xilinx/xhdmiphy.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ static int xhdmiphy_clk_srcsel(struct xhdmiphy_dev *priv, u8 dir, u8 clksrc)
7272
}
7373

7474
static int xhdmiphy_set_lrate(struct xhdmiphy_dev *priv, u8 dir, u8 mode,
75-
u64 lrate)
75+
u64 lrate, u8 lanes)
7676
{
77-
if (priv->data && !priv->data->set_linerate(dir, mode, lrate))
77+
if (priv->data && !priv->data->set_linerate(dir, mode, lrate, lanes))
7878
return 0;
7979

8080
dev_dbg(priv->dev, "failed to set linerate\n");
@@ -146,7 +146,7 @@ static int xhdmiphy_configure(struct phy *phy, union phy_configure_opts *opts)
146146
xhdmiphy_clk_srcsel(phy_dev, phy_lane->direction,
147147
tmds_mode);
148148
xhdmiphy_set_lrate(phy_dev, phy_lane->direction, 0,
149-
cfg->rx_refclk_hz);
149+
cfg->rx_refclk_hz, 0);
150150
cfg->config_hdmi20 = 0;
151151
} else if (!cfg->config_hdmi20 && cfg->config_hdmi21) {
152152
/*
@@ -166,7 +166,7 @@ static int xhdmiphy_configure(struct phy *phy, union phy_configure_opts *opts)
166166
frl_mode);
167167
xhdmiphy_clkdet_freq_reset(phy_dev, XHDMIPHY_DIR_RX);
168168
xhdmiphy_set_lrate(phy_dev, phy_lane->direction, 1,
169-
cfg->linerate);
169+
cfg->linerate, cfg->nchannels);
170170
cfg->config_hdmi21 = 0;
171171
} else if (cfg->rx_get_refclk) {
172172
cfg->rx_refclk_hz = phy_dev->rx_refclk_hz;
@@ -221,7 +221,7 @@ static int xhdmiphy_configure(struct phy *phy, union phy_configure_opts *opts)
221221
dev_info(phy_dev->dev,
222222
"tx_tmdsclk %lld\n", cfg->tx_tmdsclk);
223223
xhdmiphy_set_lrate(phy_dev, phy_lane->direction, 0,
224-
cfg->tx_tmdsclk);
224+
cfg->tx_tmdsclk, 0);
225225
} else if (cfg->config_hdmi21) {
226226
if (phy_dev->conf.tx_refclk_sel !=
227227
phy_dev->conf.tx_frl_refclk_sel) {
@@ -236,7 +236,8 @@ static int xhdmiphy_configure(struct phy *phy, union phy_configure_opts *opts)
236236
xhdmiphy_clkdet_freq_reset(phy_dev,
237237
XHDMIPHY_DIR_TX);
238238
xhdmiphy_set_lrate(phy_dev, phy_lane->direction,
239-
1, cfg->linerate);
239+
1, cfg->linerate,
240+
cfg->nchannels);
240241
}
241242
cfg->config_hdmi21 = 0;
242243
} else if (cfg->resetgtpll) {

drivers/phy/xilinx/xhdmiphy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ struct hdmi21_cfg {
990990

991991
struct clk_config {
992992
int (*sel_mux)(u8 direction, u8 clksrc);
993-
int (*set_linerate)(u8 direction, u8 mode, u64 lrate);
993+
int (*set_linerate)(u8 direction, u8 mode, u64 lrate, u8 lanes);
994994
};
995995

996996
struct xhdmiphy_conf {

0 commit comments

Comments
 (0)