• Neil Armstrong's avatar
    clk: meson: g12a: make VCLK2 and ENCL clock path configurable by CCF · b70cb1a2
    Neil Armstrong authored
    In order to setup the DSI clock, let's make the unused VCLK2 clock path
    configuration via CCF.
    
    The nocache option is removed from following clocks:
    - vclk2_sel
    - vclk2_input
    - vclk2_div
    - vclk2
    - vclk_div1
    - vclk2_div2_en
    - vclk2_div4_en
    - vclk2_div6_en
    - vclk2_div12_en
    - vclk2_div2
    - vclk2_div4
    - vclk2_div6
    - vclk2_div12
    - cts_encl_sel
    
    vclk2 and vclk2_div uses the newly introduced vclk regmap driver
    to handle the enable and reset bits.
    
    In order to set a rate on cts_encl via the vclk2 clock path,
    the NO_REPARENT flag is set on cts_encl_sel & vclk2_sel in order
    to keep CCF from selection a parent.
    The parents of cts_encl_sel & vclk2_sel are expected to be defined
    in DT or manually set by the display driver at some point.
    
    The following clock scheme is to be used for DSI:
    
    xtal
    \_ gp0_pll_dco
       \_ gp0_pll
          |- vclk2_sel
          |  \_ vclk2_input
          |     \_ vclk2_div
          |        \_ vclk2
          |           \_ vclk2_div1
          |              \_ cts_encl_sel
          |                 \_ cts_encl	-> to VPU LCD Encoder
          |- mipi_dsi_pxclk_sel
          \_ mipi_dsi_pxclk_div
             \_ mipi_dsi_pxclk		-> to DSI controller
    
    The mipi_dsi_pxclk_div is set as bypass with a single /1 entry in div_table
    in order to use the same GP0 for mipi_dsi_pxclk and vclk2_input.
    
    The SET_RATE_PARENT is only set on the mipi_dsi_pxclk_sel clock so the
    DSI bitclock is the reference base clock to calculate the vclk2_div value
    when pixel clock is set on the cts_encl endpoint.
    Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
    Link: https://lore.kernel.org/r/20240403-amlogic-v6-4-upstream-dsi-ccf-vim3-v12-3-99ecdfdc87fc@linaro.orgSigned-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
    b70cb1a2
Kconfig 4.86 KB