Skip to content

Commit

Permalink
soc: qcom: Add support for Core Power Reduction v3, v4 and Hardened
Browse files Browse the repository at this point in the history
This commit introduces a new driver, based on the one for cpr v1,
to enable support for the newer Qualcomm Core Power Reduction
hardware, known downstream as CPR3, CPR4 and CPRh, and support
for MSM8998 and SDM630 CPU power reduction.

In these new versions of the hardware, support for various new
features was introduced, including voltage reduction for the GPU,
security hardening and a new way of controlling CPU DVFS,
consisting in internal communication between microcontrollers,
specifically the CPR-Hardened and the Operating State Manager.

The CPR v3, v4 and CPRh are present in a broad range of SoCs,
from the mid-range to the high end ones including, but not limited
to, MSM8953/8996/8998, SDM630/636/660/845.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
[Konrad: rebase, apply review comments]
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
  • Loading branch information
kholk authored and intel-lab-lkp committed Jan 10, 2023
1 parent f17f405 commit d013cdd
Show file tree
Hide file tree
Showing 4 changed files with 2,949 additions and 1 deletion.
21 changes: 21 additions & 0 deletions drivers/soc/qcom/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ config QCOM_COMMAND_DB
config QCOM_CPR
tristate "QCOM Core Power Reduction (CPR) support"
depends on ARCH_QCOM && HAS_IOMEM
select QCOM_CPR_COMMON
select PM_OPP
select REGMAP
help
Expand All @@ -42,6 +43,26 @@ config QCOM_CPR
To compile this driver as a module, choose M here: the module will
be called qcom-cpr

config QCOM_CPR_COMMON
tristate

config QCOM_CPR3
tristate "QCOM Core Power Reduction (CPR v3/v4/Hardened) support"
depends on ARCH_QCOM && HAS_IOMEM
select PM_OPP
select REGMAP
help
Say Y here to enable support for the CPR hardware found on a broad
variety of Qualcomm SoCs like MSM8996, MSM8998, SDM630, SDM660,
SDM845 and others.

This driver populates OPP tables and makes adjustments to them
based on feedback from the CPR hardware. If you want to do CPU
and/or GPU frequency scaling say Y here.

To compile this driver as a module, choose M here: the module will
be called qcom-cpr3

config QCOM_GENI_SE
tristate "QCOM GENI Serial Engine Driver"
depends on ARCH_QCOM || COMPILE_TEST
Expand Down
4 changes: 3 additions & 1 deletion drivers/soc/qcom/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ CFLAGS_rpmh-rsc.o := -I$(src)
obj-$(CONFIG_QCOM_AOSS_QMP) += qcom_aoss.o
obj-$(CONFIG_QCOM_GENI_SE) += qcom-geni-se.o
obj-$(CONFIG_QCOM_COMMAND_DB) += cmd-db.o
obj-$(CONFIG_QCOM_CPR) += cpr-common.o cpr.o
obj-$(CONFIG_QCOM_CPR) += cpr.o
obj-$(CONFIG_QCOM_CPR_COMMON) += cpr-common.o
obj-$(CONFIG_QCOM_CPR3) += cpr3.o
obj-$(CONFIG_QCOM_DCC) += dcc.o
obj-$(CONFIG_QCOM_GSBI) += qcom_gsbi.o
obj-$(CONFIG_QCOM_MDT_LOADER) += mdt_loader.o
Expand Down
2 changes: 2 additions & 0 deletions drivers/soc/qcom/cpr-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ struct corner {
struct corner_data {
unsigned int fuse_corner;
unsigned long freq;
int oloop_vadj;
int cloop_vadj;
};

struct acc_desc {
Expand Down
Loading

0 comments on commit d013cdd

Please sign in to comment.