Loading arch/arm64/configs/vendor/bengal-perf_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -537,6 +537,7 @@ CONFIG_MSM_CDSP_LOADER=y CONFIG_QCOM_SMCINVOKE=y CONFIG_MSM_EVENT_TIMER=y CONFIG_MSM_PM=y CONFIG_QTI_L2_REUSE=y CONFIG_QTI_RPM_STATS_LOG=y CONFIG_QTEE_SHM_BRIDGE=y CONFIG_MEM_SHARE_QMI_SERVICE=y Loading arch/arm64/configs/vendor/bengal_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -561,6 +561,7 @@ CONFIG_MSM_CDSP_LOADER=y CONFIG_QCOM_SMCINVOKE=y CONFIG_MSM_EVENT_TIMER=y CONFIG_MSM_PM=y CONFIG_QTI_L2_REUSE=y CONFIG_QTI_RPM_STATS_LOG=y CONFIG_QTEE_SHM_BRIDGE=y CONFIG_MEM_SHARE_QMI_SERVICE=y Loading drivers/soc/qcom/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -747,6 +747,14 @@ config MSM_SUSPEND_STATS_FIRST_BUCKET endif # MSM_IDLE_STATS endif # MSM_PM config QTI_L2_REUSE bool "Qualcomm Technologies Inc (QTI) L2 reuse" depends on ARCH_QCOM help This module allows to configure the L2 reuse feature dynamically to let the power collapsed cluster's L2 cache usage by the active cluster cpu. Use sysfs interface to control enabling this feature. config QTI_RPM_STATS_LOG bool "Qualcomm Technologies RPM Stats Driver" depends on QCOM_RPMH || MSM_RPM_SMD Loading drivers/soc/qcom/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -97,3 +97,4 @@ obj-$(CONFIG_ICNSS) += icnss.o obj-$(CONFIG_ICNSS_QMI) += icnss_qmi.o wlan_firmware_service_v01.o obj-$(CONFIG_RMNET_CTL) += rmnet_ctl/ obj-$(CONFIG_QCOM_CX_IPEAK) += cx_ipeak.o obj-$(CONFIG_QTI_L2_REUSE) += l2_reuse.o drivers/soc/qcom/l2_reuse.c 0 → 100644 +71 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. */ #include <linux/arm-smccc.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/module.h> #include <linux/uaccess.h> #include <linux/sysfs.h> #include <linux/kobject.h> #define L2_REUSE_SMC_ID 0x02001F01 static bool l2_reuse_enable = true; static struct kobject *l2_reuse_kobj; static ssize_t sysfs_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return scnprintf(buf, PAGE_SIZE, "%u\n", l2_reuse_enable); } static ssize_t sysfs_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { struct arm_smccc_res res; int ret; ret = kstrtobool(buf, &l2_reuse_enable); if (ret) { pr_err("Invalid argument passed\n"); return ret; } arm_smccc_smc(L2_REUSE_SMC_ID, l2_reuse_enable, 1, 0, 0, 0, 0, 0, &res); return count; } struct kobj_attribute l2_reuse_attr = __ATTR(l2_reuse_enable, 0660, sysfs_show, sysfs_store); static int __init l2_reuse_driver_init(void) { l2_reuse_kobj = kobject_create_and_add("l2_reuse_enable", power_kobj); if (!l2_reuse_kobj) { pr_info("kobj creation for l2_reuse failed\n"); return 0; } if (sysfs_create_file(l2_reuse_kobj, &l2_reuse_attr.attr)) kobject_put(l2_reuse_kobj); return 0; } void __exit l2_reuse_driver_exit(void) { if (l2_reuse_kobj) { sysfs_remove_file(power_kobj, &l2_reuse_attr.attr); kobject_put(l2_reuse_kobj); } } module_init(l2_reuse_driver_init); module_exit(l2_reuse_driver_exit); MODULE_DESCRIPTION("Qualcomm Technologies Inc L2 REUSE Module"); MODULE_LICENSE("GPL v2"); Loading
arch/arm64/configs/vendor/bengal-perf_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -537,6 +537,7 @@ CONFIG_MSM_CDSP_LOADER=y CONFIG_QCOM_SMCINVOKE=y CONFIG_MSM_EVENT_TIMER=y CONFIG_MSM_PM=y CONFIG_QTI_L2_REUSE=y CONFIG_QTI_RPM_STATS_LOG=y CONFIG_QTEE_SHM_BRIDGE=y CONFIG_MEM_SHARE_QMI_SERVICE=y Loading
arch/arm64/configs/vendor/bengal_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -561,6 +561,7 @@ CONFIG_MSM_CDSP_LOADER=y CONFIG_QCOM_SMCINVOKE=y CONFIG_MSM_EVENT_TIMER=y CONFIG_MSM_PM=y CONFIG_QTI_L2_REUSE=y CONFIG_QTI_RPM_STATS_LOG=y CONFIG_QTEE_SHM_BRIDGE=y CONFIG_MEM_SHARE_QMI_SERVICE=y Loading
drivers/soc/qcom/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -747,6 +747,14 @@ config MSM_SUSPEND_STATS_FIRST_BUCKET endif # MSM_IDLE_STATS endif # MSM_PM config QTI_L2_REUSE bool "Qualcomm Technologies Inc (QTI) L2 reuse" depends on ARCH_QCOM help This module allows to configure the L2 reuse feature dynamically to let the power collapsed cluster's L2 cache usage by the active cluster cpu. Use sysfs interface to control enabling this feature. config QTI_RPM_STATS_LOG bool "Qualcomm Technologies RPM Stats Driver" depends on QCOM_RPMH || MSM_RPM_SMD Loading
drivers/soc/qcom/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -97,3 +97,4 @@ obj-$(CONFIG_ICNSS) += icnss.o obj-$(CONFIG_ICNSS_QMI) += icnss_qmi.o wlan_firmware_service_v01.o obj-$(CONFIG_RMNET_CTL) += rmnet_ctl/ obj-$(CONFIG_QCOM_CX_IPEAK) += cx_ipeak.o obj-$(CONFIG_QTI_L2_REUSE) += l2_reuse.o
drivers/soc/qcom/l2_reuse.c 0 → 100644 +71 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. */ #include <linux/arm-smccc.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/module.h> #include <linux/uaccess.h> #include <linux/sysfs.h> #include <linux/kobject.h> #define L2_REUSE_SMC_ID 0x02001F01 static bool l2_reuse_enable = true; static struct kobject *l2_reuse_kobj; static ssize_t sysfs_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return scnprintf(buf, PAGE_SIZE, "%u\n", l2_reuse_enable); } static ssize_t sysfs_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { struct arm_smccc_res res; int ret; ret = kstrtobool(buf, &l2_reuse_enable); if (ret) { pr_err("Invalid argument passed\n"); return ret; } arm_smccc_smc(L2_REUSE_SMC_ID, l2_reuse_enable, 1, 0, 0, 0, 0, 0, &res); return count; } struct kobj_attribute l2_reuse_attr = __ATTR(l2_reuse_enable, 0660, sysfs_show, sysfs_store); static int __init l2_reuse_driver_init(void) { l2_reuse_kobj = kobject_create_and_add("l2_reuse_enable", power_kobj); if (!l2_reuse_kobj) { pr_info("kobj creation for l2_reuse failed\n"); return 0; } if (sysfs_create_file(l2_reuse_kobj, &l2_reuse_attr.attr)) kobject_put(l2_reuse_kobj); return 0; } void __exit l2_reuse_driver_exit(void) { if (l2_reuse_kobj) { sysfs_remove_file(power_kobj, &l2_reuse_attr.attr); kobject_put(l2_reuse_kobj); } } module_init(l2_reuse_driver_init); module_exit(l2_reuse_driver_exit); MODULE_DESCRIPTION("Qualcomm Technologies Inc L2 REUSE Module"); MODULE_LICENSE("GPL v2");