• Dmitry Rokosov's avatar
    arm64: dts: amlogic: axg: initialize default SoC capacitance · a06d4fde
    Dmitry Rokosov authored
    The capacitance value is required for the usage of the cpufreq cooling
    device and power_allocator thermal governor in the appropriate energy
    model.
    
    It helps to compute the power estimated by the SoC at the appropriate
    frequency. If it is the frequency of an existing OPP, or at the
    frequency of the first OPP above the requested value otherwise.
    
    The power is estimated as P = C * V^2 * f, with C being the SoC's
    capacitance and V and f respectively representing the voltage and
    frequency of the OPP.
    
    Since AXG SoC doesn't have SCMI protocol support, we need to initialize
    capacitance using the 'dynamic-power-coefficient' DT entry. Its value is
    retrieved from the vendor kernel, and it gives us the following
    freq2power mapping:
        +-----------+--------+
        | frequency,| power, |
        |    MHz    |   uW   |
        +-----------+--------+
        |     100   |  10354 |
        +-----------+--------+
        |     250   |  27104 |
        +-----------+--------+
        |     500   |  55447 |
        +-----------+--------+
        |     667   |  77327 |
        +-----------+--------+
        |    1000   | 129024 |
        +-----------+--------+
        |    1200   | 164656 |
        +-----------+--------+
        |    1296   | 192489 |
        +-----------+--------+
        |    1416   | 239870 |
        +-----------+--------+
    Signed-off-by: default avatarDmitry Rokosov <ddrokosov@salutedevices.com>
    Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
    Link: https://lore.kernel.org/r/20240209212816.11187-3-ddrokosov@salutedevices.comSigned-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
    a06d4fde
meson-axg.dtsi 44.8 KB