[PATCH RFC RFT v3 07/13] clk: meson: gxbb: Model the PLL pre-divider as a divider clock
Jian Hu
jian.hu at amlogic.com
Wed Dec 2 01:19:31 PST 2026
On 12/1/2026 5:16 PM, sashiko-bot at kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issues to consider:
> - [High] clk: meson: gxbb: accidental revert of gxbb_cts_encp_sel mux
> shift to 20
> - [Medium] clk: meson: gxbb: missing zero-divisor flag on gxbb and gxl
> hdmi_prediv
> --
>
> commit 3ea24038e4185d59261a086515637e35e0fcb1ea
> Author: Jian Hu <jian.hu at amlogic.com>
>
> clk: meson: gxbb: Model the PLL pre-divider as a divider clock
>
> This commit models the GXBB and GXL PLL pre-dividers as separate divider
> clocks parenting the DCOs and replaces the GP0 PLL parameter tables with
> multiplier ranges.
>
>> diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c
>> index 2d5128c0bf9e6..b7350788b73ed 100644
>> --- a/drivers/clk/meson/gxbb.c
>> +++ b/drivers/clk/meson/gxbb.c
> [ ... ]
>> @@ -192,6 +210,28 @@ static struct clk_fixed_factor gxbb_hdmi_pll_pre_mult = {
>> },
>> };
>>
>> +static struct clk_regmap gxbb_hdmi_prediv = {
>> + .data = &(struct clk_regmap_div_data){
>> + .offset = HHI_HDMI_PLL_CNTL,
>> + .shift = 9,
>> + .width = 5,
>> + .flags = CLK_DIVIDER_ONE_BASED,
>> + },
>> + .hw.init = &(struct clk_init_data){
>> + .name = "hdmi_prediv",
>> + .ops = &clk_regmap_divider_ro_ops,
>> + .parent_hws = (const struct clk_hw *[]) {
>> + &gxbb_hdmi_pll_pre_mult.hw
>> + },
>> + .num_parents = 1,
>> + /*
>> + * Display directly handle hdmi pll registers ATM, we need
>> + * NOCACHE to keep our view of the clock as accurate as possible
>> + */
>> + .flags = CLK_GET_RATE_NOCACHE,
>> + },
>> +};
> [ ... ]
>> @@ -229,7 +264,29 @@ static struct clk_regmap gxbb_hdmi_pll_dco = {
>> .name = "hdmi_pll_dco",
>> .ops = &meson_clk_pll_ro_ops,
>> .parent_hws = (const struct clk_hw *[]) {
>> - &gxbb_hdmi_pll_pre_mult.hw
>> + &gxbb_hdmi_prediv.hw
>> + },
>> + .num_parents = 1,
>> + /*
>> + * Display directly handle hdmi pll registers ATM, we need
>> + * NOCACHE to keep our view of the clock as accurate as possible
>> + */
>> + .flags = CLK_GET_RATE_NOCACHE,
>> + },
>> +};
>> +
>> +static struct clk_regmap gxl_hdmi_prediv = {
>> + .data = &(struct clk_regmap_div_data){
>> + .offset = HHI_HDMI_PLL_CNTL,
>> + .shift = 9,
>> + .width = 5,
>> + .flags = CLK_DIVIDER_ONE_BASED,
>> + },
> [Severity: Medium]
> Should gxbb_hdmi_prediv and gxl_hdmi_prediv also set
> CLK_DIVIDER_INVALID_ZERO?
>
> Previously, meson_clk_pll_recalc_rate() returned 0 when the pre-divider n
> field read 0. With only CLK_DIVIDER_ONE_BASED, if HHI_HDMI_PLL_CNTL[13:9]
> is 0 at boot before the display driver initializes the HDMI PLL,
> divider_recalc_rate() triggers a WARN() during clock registration and
> returns the parent rate instead of 0 Hz.
Unlike G12A, the HDMI PLL on GXL and GXBB is pre-initialized by firmware.
The divider register reads back as 1 rather than 0 at clock registration
time,
so we do not need `CLK_DIVIDER_INVALID_ZERO` and no WARN will be triggered.
I will add comment for hdmi_prediv in v3.
>
> [ ... ]
>
>> @@ -2371,7 +2419,7 @@ static struct clk_regmap gxbb_cts_encp_sel = {
>> .data = &(struct clk_regmap_mux_data){
>> .offset = HHI_VID_CLK_DIV,
>> .mask = 0xf,
>> - .shift = 24,
>> + .shift = 20,
>> .table = gxbb_cts_parents_val_table,
>> },
>> .hw.init = &(struct clk_init_data){
> [Severity: High]
> Was this change to gxbb_cts_encp_sel.data.shift accidental?
>
> It reverts ebffd9ffac2c ("clk: meson: gxbb: fix ENCP clock selection"),
> causing cts_encp_sel to access the ENCT clock selector at bits [23:20] of
> HHI_VID_CLK_DIV instead of the ENCP clock selector at bits [27:24].
Ok, I will restore it.
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20261201-meson_refactor_n-v3-0-f85a4460fd80@amlogic.com?part=7
More information about the linux-amlogic
mailing list