diff options
author | Taniya Das <tdas@codeaurora.org> | 2020-02-28 17:05:49 +0530 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2020-05-11 23:59:59 +0000 |
commit | 8ad0c86da28debba1cd65b1d1fc898697220581c (patch) | |
tree | 69db0bf744b8bbfe5b193a25469a21342376f0b9 /src/soc/qualcomm/sc7180/include | |
parent | 593a4c32dfc0d91d04596d9a85ddad36c28117e1 (diff) |
sc7180: clock: Add support to bump CPU levels
Add support to configure the Silver and L3 PLLs and switch the APSS
GFMUX to use the PLL to speed up the boot cores.
Tested: CPU speed frequency validated for speed bump
Change-Id: Iafd3b618fb72e0e8cc8dd297e4a3e16b83550883
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39234
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/soc/qualcomm/sc7180/include')
-rw-r--r-- | src/soc/qualcomm/sc7180/include/soc/addressmap.h | 2 | ||||
-rw-r--r-- | src/soc/qualcomm/sc7180/include/soc/clock.h | 55 |
2 files changed, 57 insertions, 0 deletions
diff --git a/src/soc/qualcomm/sc7180/include/soc/addressmap.h b/src/soc/qualcomm/sc7180/include/soc/addressmap.h index 72b6d1295e..c5b48bf44a 100644 --- a/src/soc/qualcomm/sc7180/include/soc/addressmap.h +++ b/src/soc/qualcomm/sc7180/include/soc/addressmap.h @@ -11,6 +11,8 @@ #define TLMM_NORTH_TILE_BASE 0x03900000 #define TLMM_SOUTH_TILE_BASE 0x03D00000 #define TLMM_WEST_TILE_BASE 0x03500000 +#define SILVER_PLL_BASE 0x18280000 +#define L3_PLL_BASE 0x18284000 /* * QUP SERIAL ENGINE BASE ADDRESSES diff --git a/src/soc/qualcomm/sc7180/include/soc/clock.h b/src/soc/qualcomm/sc7180/include/soc/clock.h index 79cf408b5c..d202605327 100644 --- a/src/soc/qualcomm/sc7180/include/soc/clock.h +++ b/src/soc/qualcomm/sc7180/include/soc/clock.h @@ -208,8 +208,63 @@ struct mdss_clock_config { uintptr_t cbcr; }; +/* CPU PLL */ +#define L_VAL_1516P8MHz 0x4F +#define L_VAL_1209P6MHz 0x3F + +struct sc7180_apss_pll { + u32 mode; + u32 l_val; + u32 alpha_val; + u32 user_ctl; + u32 config_ctl_lo; + u32 config_ctl_hi; + u32 config_ctl_u1; + u32 test_ctl_lo; + u32 test_ctl_hi; + u32 test_ctl_u1; + u32 opmode; + u8 _res0[0x38 - 0x2c]; + u32 status; +}; + +struct sc7180_apss_clock { + struct sc7180_apss_pll pll; + u8 _res0[0x88 - 0x40]; + u32 cfg_gfmux; +}; + +enum pll_config_ctl_lo { + CTUNE_SHFT = 2, + K_I_SHFT = 4, + K_P_SHFT = 7, + PFA_MSB_SHFT = 10, + REF_CONT_SHFT = 28, +}; + +enum pll_config_ctl_hi { + CUR_ADJ_SHFT = 0, + DMET_SHFT = 4, + RES_SHFT = 6, +}; + +enum pll_mode { + LOCK_DET_BMSK = 0x80000000, + RUN_MODE = 1, + OUTCTRL_SHFT = 0, + BYPASSNL_SHFT = 1, + RESET_SHFT = 2, +}; + +enum apss_gfmux { + GFMUX_SRC_SEL_BMSK = 0x3, + APCS_SRC_EARLY = 0x2, +}; + static struct sc7180_gcc *const gcc = (void *)GCC_BASE; static struct sc7180_aoss *const aoss = (void *)AOSS_CC_BASE; +static struct sc7180_apss_clock *const apss_silver = (void *)SILVER_PLL_BASE; +static struct sc7180_apss_clock *const apss_l3 = (void *)L3_PLL_BASE; void clock_init(void); void clock_reset_aop(void); |