[PATCH RFC RFT v2 3/3] clk: meson: pll: Remove the dedicated n parameter

Jerome Brunet jbrunet at baylibre.com
Fri Nov 27 05:21:32 PST 2026


> >> -static const struct pll_params_table axg_pcie_pll_params_table[] = {
> >> -     {
> >> -             .m = 200,
> >> -             .n = 3,
> >> +/*
> >> + * A pre-divider value of 3 provides the best performance for
> >> + * the AXG PCIe PLL.
> >> + */
> > Again, define performance here. what does it mean ?
> 
> 
> To clarify what "performance" means in that comment:
> 
> Some target frequencies cannot be achieved with N=1, requiring a non 1 
> pre-divider.
> 
> N may not be 1 for Amlogic fixed PLLs and PCIe PLLs.
> 
> This AXG PCIe PLL is designed based on N=3 for optimal bandwidth.
> 
> 
> The AXG PCIe PLL rate is:
> 
> 24Mhz/3 * 200 /2/8 =100Mhz.
> 
> 
> I will update the comment:
> 
> /*
> 
>   * This AXG PCIe PLL needs pre-divider 3 to hit the target frequency 
> 100Mhz,
> 
>   * which also yields optimal bandwidth.
> 
>   */

All I'm seeing in your explanation is "ability" to reach a rate, nothing remotly
"performance" related. Either drop the word or explain what mean better.

> 
> >> +static const struct clk_div_table axg_pcie_prediv_div_table[] = {
> >> +     { .val = 3, .div = 3 },
> >> +     { /* sentinel */ }
> >> +};
> >> +
> >> +static struct clk_regmap axg_pcie_prediv = {
> >> +     .data = &(struct clk_regmap_div_data){
> >> +             .offset = HHI_PCIE_PLL_CNTL,
> >> +             .shift   = 9,
> >> +             .width   = 5,
> >> +             .table = axg_pcie_prediv_div_table,
> >> +             .flags = CLK_DIVIDER_INVALID_ZERO,
> >> +     },
> >> +     .hw.init = &(struct clk_init_data){
> >> +             .name = "pcie_prediv",
> >> +             .ops = &clk_regmap_divider_ops,
> >> +             .parent_data = &(const struct clk_parent_data) {
> >> +                     .fw_name = "xtal",
> >> +             },
> >> +             .num_parents = 1,
> >>        },
> >> +};
> >> +
> >> +static const struct pll_mult_table axg_pcie_pll_params_table[] = {
> >> +     PLL_MULT(200),
> >>        { /* sentinel */ },
> >>   };
> >>

[...]

> >>
> >> -static const struct pll_params_table sys_pll_params_table[] = {
> >> -     PLL_PARAMS(50, 1),
> >> -     PLL_PARAMS(51, 1),
> >> -     PLL_PARAMS(52, 1),
> >> -     PLL_PARAMS(53, 1),
> >> -     PLL_PARAMS(54, 1),
> >> -     PLL_PARAMS(55, 1),
> >> -     PLL_PARAMS(56, 1),
> >> -     PLL_PARAMS(57, 1),
> >> -     PLL_PARAMS(58, 1),
> >> -     PLL_PARAMS(59, 1),
> >> -     PLL_PARAMS(60, 1),
> >> -     PLL_PARAMS(61, 1),
> >> -     PLL_PARAMS(62, 1),
> >> -     PLL_PARAMS(63, 1),
> >> -     PLL_PARAMS(64, 1),
> >> -     PLL_PARAMS(65, 1),
> >> -     PLL_PARAMS(66, 1),
> >> -     PLL_PARAMS(67, 1),
> >> -     PLL_PARAMS(68, 1),
> >> -     PLL_PARAMS(84, 1),
> >> +static const struct pll_mult_table sys_pll_params_table[] = {
> >> +     PLL_MULT(50),
> >> +     PLL_MULT(51),
> >> +     PLL_MULT(52),
> >> +     PLL_MULT(53),
> >> +     PLL_MULT(54),
> >> +     PLL_MULT(55),
> >> +     PLL_MULT(56),
> >> +     PLL_MULT(57),
> >> +     PLL_MULT(58),
> >> +     PLL_MULT(59),
> >> +     PLL_MULT(60),
> >> +     PLL_MULT(61),
> >> +     PLL_MULT(62),
> >> +     PLL_MULT(63),
> >> +     PLL_MULT(64),
> >> +     PLL_MULT(65),
> >> +     PLL_MULT(66),
> >> +     PLL_MULT(67),
> >> +     PLL_MULT(68),
> >> +     PLL_MULT(84),
> >>        { /* sentinel */ },
> >>   };
> >>
> >> +static const struct clk_div_table meson8b_fixed_prediv_div_table[] = {
> >> +     { .val = 4, .div = 4 },
> > Previous table was showing a prediv of 1 ... here it jumps to 4 without
> > an explanation !
> >
> > Also, it is a RO clock, so what is the point ?
> 
> 
> This is similar to the AXG PCIe PLL case. The pre-divider is fixed at 4,
> which lets this fixed PLL output 2550MHz and gives optimal bandwidth.
> The table was used so the fixed PLL DCO rate can be calculated correctly.
> Without the table or `CLK_DIVIDER_ONE_BASED`, the divider would be 
> interpreted as 5,
> leading to wrong DCO rate calculation.

But you are hidding a fix in a rework then.

Your rework should keep the prediv as it was.
Then you can change explaining clearly why you are doing it, with a proper fixes tag.

-- 
Jerome




More information about the linux-arm-kernel mailing list