Skip to content

Commit 7da2fda

Browse files
jiezhan0214chanwoochoi
authored andcommitted
PM / devfreq: Add HiSilicon uncore frequency scaling driver
Add the HiSilicon uncore frequency scaling driver for Kunpeng SoCs based on the devfreq framework. The uncore domain contains shared computing resources, including system interconnects and L3 cache. The uncore frequency significantly impacts the system-wide performance as well as power consumption. This driver adds support for runtime management of uncore frequency from kernel and userspace. The main function includes setting and getting frequencies, changing frequency scaling policies, and querying the list of CPUs whose performance is significantly related to this uncore frequency domain, etc. The driver communicates with a platform controller through an ACPI PCC mailbox to take the actual actions of frequency scaling. Co-developed-by: Lifeng Zheng <zhenglifeng1@huawei.com> Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Jie Zhan <zhanjie9@hisilicon.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Link: https://patchwork.kernel.org/project/linux-pm/patch/20250623143401.4095045-3-zhanjie9@hisilicon.com/
1 parent 45b9d1d commit 7da2fda

4 files changed

Lines changed: 679 additions & 0 deletions

File tree

Documentation/ABI/testing/sysfs-class-devfreq

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,12 @@ Description:
132132

133133
A list of governors that support the node:
134134
- simple_ondemand
135+
136+
What: /sys/class/devfreq/.../related_cpus
137+
Date: June 2025
138+
Contact: Linux power management list <linux-pm@vger.kernel.org>
139+
Description: The list of CPUs whose performance is closely related to the
140+
frequency of this devfreq domain.
141+
142+
This file is only present if a specific devfreq device is
143+
closely associated with a subset of CPUs.

drivers/devfreq/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ config ARM_EXYNOS_BUS_DEVFREQ
9090
and adjusts the operating frequencies and voltages with OPP support.
9191
This does not yet operate with optimal voltages.
9292

93+
config ARM_HISI_UNCORE_DEVFREQ
94+
tristate "HiSilicon uncore DEVFREQ Driver"
95+
depends on ACPI && ACPI_PPTT && PCC
96+
select DEVFREQ_GOV_PERFORMANCE
97+
select DEVFREQ_GOV_USERSPACE
98+
help
99+
This adds a DEVFREQ driver that manages uncore frequency scaling for
100+
HiSilicon Kunpeng SoCs. This enables runtime management of uncore
101+
frequency scaling from kernel and userspace. The uncore domain
102+
contains system interconnects and L3 cache.
103+
93104
config ARM_IMX_BUS_DEVFREQ
94105
tristate "i.MX Generic Bus DEVFREQ Driver"
95106
depends on ARCH_MXC || COMPILE_TEST

drivers/devfreq/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ obj-$(CONFIG_DEVFREQ_GOV_PASSIVE) += governor_passive.o
99

1010
# DEVFREQ Drivers
1111
obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o
12+
obj-$(CONFIG_ARM_HISI_UNCORE_DEVFREQ) += hisi_uncore_freq.o
1213
obj-$(CONFIG_ARM_IMX_BUS_DEVFREQ) += imx-bus.o
1314
obj-$(CONFIG_ARM_IMX8M_DDRC_DEVFREQ) += imx8m-ddrc.o
1415
obj-$(CONFIG_ARM_MEDIATEK_CCI_DEVFREQ) += mtk-cci-devfreq.o

0 commit comments

Comments
 (0)