Re: [PATCH 1/2] clk: qcom: gcc-ipq6018: keep port 5 on uniphy1 at SGMII rates
From: Konrad Dybcio
Date: Wed Dec 02 2026 - 11:38:30 EST
On 11/8/26 8:23 AM, André Valentin wrote:
> Port 5 can be clocked from uniphy1, which runs at 312.5 MHz with the
> PHY in 2500BASE-X and at 125 MHz in SGMII. The port 5 RX and TX
> frequency tables serve uniphy1 only at 312.5 MHz: 125 MHz lists
> uniphy1 / 2.5 and then uniphy0 / 1, 25 MHz lists uniphy1 / 12.5 and
> then uniphy0 / 5. __clk_rcg2_select_conf() takes the first config that
> gives the rate exactly, so once uniphy1 runs at 125 MHz, a 1G or 100M
> rate that reaches the RCG moves the port onto uniphy0 whenever uniphy0
> runs at 125 MHz, and otherwise leaves it on uniphy1 at 50 MHz (1G) or
> 10 MHz (100M).
>
> Add uniphy1 / 1 to the 125 MHz configs and uniphy1 / 5 to the 25 MHz
> configs. They go after the existing uniphy1 entries, which serve uniphy1
> at 312.5 MHz, so that 2500BASE-X keeps its divider, and before uniphy0.
>
> gcc-ipq8074 does the same for port 6, whose tables list uniphy2 / 1 and
> uniphy2 / 5.
>
> Suggested-by: Julius Bairaktaris <julius@xxxxxxxxxxxxxx>
> Signed-off-by: André Valentin <avalentin@xxxxxxxxxxx>
> ---
> drivers/clk/qcom/gcc-ipq6018.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/clk/qcom/gcc-ipq6018.c b/drivers/clk/qcom/gcc-ipq6018.c
> index 6943dc51153..a86b52e4276 100644
> --- a/drivers/clk/qcom/gcc-ipq6018.c
> +++ b/drivers/clk/qcom/gcc-ipq6018.c
> @@ -513,11 +513,13 @@ static struct clk_rcg2 apss_ahb_clk_src = {
>
> static const struct freq_conf ftbl_nss_port5_rx_clk_src_25[] = {
> C(P_UNIPHY1_RX, 12.5, 0, 0),
> + C(P_UNIPHY1_RX, 5, 0, 0),
> C(P_UNIPHY0_RX, 5, 0, 0),
Won't this make the UNIPHY0_RX frequency unreachable? What provides
the uniphy clock?
Konrad