• Sam Protsenko's avatar
    clk: samsung: exynos850: Add CMU_CPUCL0 and CMU_CPUCL1 · dedf8734
    Sam Protsenko authored
    Implement support for CPU clock management units:
      - CMU_CPUCL0: clocks for cluster 0: 4 x Cortex-A55 (cpu0..cpu3)
      - CMU_CPUCL1: clocks for cluster 1: 4 x Cortex-A55 (cpu4..cpu7)
    
    CPU PLLs are generating main CPU clocks for each cluster, and there are
    alternate ("switch") clocks that can be used temporarily while
    re-configuring the PLL for a new rate. ACLK, ATCLK, PCLKDBG and
    PERIPHCLK clocks are driving corresponding buses. CLK_CLUSTERx_SCLK are
    actual leaf CPU clocks and should be used to change CPU rates. Also some
    CoreSight clocks can be derived from DBG_USER (debug clock).
    
    PLL table was extracted from ECT table. ECT stands for "Exynos
    Characteristic Table", it's a Samsung specific binary data populated by
    BL2 bootloader in RAM at 0x90000000 address, containing PLL tables for
    various CMUs and other hardware specific information.
    
    The particular PLL type used in CMU_CPUCL0 and CMU_CPUCL1 (pll0822x) is
    an integer PLL with middle FVCO. The equation to calculate its output
    rate is:
    
        fout = fin * M / (P*2^S)
    
    where:
    
        fin = 26 MHz (OSCCLK frequency)
        M = 64..1023
        P = 1..63
        S = 0..6
    
    The PLL table tries to keep "P" value low to reduce the locking time,
    which for pll0822x is "t = P * 150" (in OSCCLK cycles).
    Signed-off-by: default avatarSam Protsenko <semen.protsenko@linaro.org>
    Link: https://lore.kernel.org/r/20240301015118.30072-2-semen.protsenko@linaro.orgSigned-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    dedf8734
clk-exynos850.c 98.1 KB