Loading drivers/soc/qcom/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,14 @@ config QCOM_KONA_LLCC data required to configure LLCC so that clients can start using the LLCC slices. config QCOM_LITO_LLCC tristate "Qualcomm Technologies, Inc. LITO LLCC driver" depends on QCOM_LLCC help Say yes here to enable the LLCC driver for LITO. This provides data required to configure LLCC so that clients can start using the LLCC slices. config QCOM_SDM845_LLCC tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver" depends on QCOM_LLCC Loading drivers/soc/qcom/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o obj-$(CONFIG_QCOM_IPCC) += qcom_ipcc.o obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o obj-$(CONFIG_QCOM_KONA_LLCC) += llcc-kona.o obj-$(CONFIG_QCOM_LITO_LLCC) += llcc-lito.o obj-$(CONFIG_QCOM_APR) += apr.o obj-$(CONFIG_QCOM_SECURE_BUFFER) += secure_buffer.o obj-$(CONFIG_MSM_TZ_SMMU) += msm_tz_smmu.o Loading drivers/soc/qcom/llcc-lito.c 0 → 100644 +95 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019, The Linux Foundation. All rights reserved. * */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/soc/qcom/llcc-qcom.h> /* * SCT entry contains of the following parameters * uid: Unique id for the client's use case * slice_id: llcc slice id for each client * max_cap: The maximum capacity of the cache slice provided in KB * priority: Priority of the client used to select victim line for replacement * fixed_size: Determine of the slice has a fixed capacity * bonus_ways: Bonus ways to be used by any slice, bonus way is used only if * it't not a reserved way. * res_ways: Reserved ways for the cache slice, the reserved ways cannot be used * by any other client than the one its assigned to. * cache_mode: Each slice operates as a cache, this controls the mode of the * slice normal or TCM * probe_target_ways: Determines what ways to probe for access hit. When * configured to 1 only bonus and reseved ways are probed. * when configured to 0 all ways in llcc are probed. * dis_cap_alloc: Disable capacity based allocation for a client * write_scid_en: Bit enables write cache support for a given scid. * retain_on_pc: If this bit is set and client has maitained active vote * then the ways assigned to this client are not flushed on power * collapse. * activate_on_init: Activate the slice immidiately after the SCT is programmed */ #define SCT_ENTRY(uid, sid, mc, p, fs, bway, rway, cmod, ptw, dca, wse, rp, a) \ { \ .usecase_id = uid, \ .slice_id = sid, \ .max_cap = mc, \ .priority = p, \ .fixed_size = fs, \ .bonus_ways = bway, \ .res_ways = rway, \ .cache_mode = cmod, \ .probe_target_ways = ptw, \ .dis_cap_alloc = dca, \ .write_scid_en = wse, \ .retain_on_pc = rp, \ .activate_on_init = a, \ } static struct llcc_slice_config lito_data[] = { SCT_ENTRY(LLCC_CPUSS, 1, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 1), SCT_ENTRY(LLCC_VIDSC0, 2, 0, 2, 1, 0x0, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_VIDSC1, 3, 0, 2, 1, 0x0, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_AUDIO, 6, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MDMHPGRW, 7, 512, 2, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MDM, 8, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MDMHW, 9, 1024, 0, 0, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_CMPT, 10, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_GPUHTW, 11, 256, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_GPU, 12, 256, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_DISP, 16, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MDMHPFX, 20, 512, 2, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MDMPNG, 21, 1024, 0, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_AUDHW, 22, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_NPU, 23, 512, 2, 1, 0x0, 0xF00, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MODEMVPE, 29, 128, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_APTCM, 30, 128, 3, 0, 0x0, 0x3, 1, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_WRTCH, 31, 128, 1, 1, 0x3, 0x0, 0, 0, 0, 0, 0, 0), }; static int lito_qcom_llcc_probe(struct platform_device *pdev) { return qcom_llcc_probe(pdev, lito_data, ARRAY_SIZE(lito_data)); } static const struct of_device_id lito_qcom_llcc_of_match[] = { { .compatible = "qcom,lito-llcc", }, { }, }; static struct platform_driver lito_qcom_llcc_driver = { .driver = { .name = "lito-llcc", .of_match_table = lito_qcom_llcc_of_match, }, .probe = lito_qcom_llcc_probe, }; module_platform_driver(lito_qcom_llcc_driver); MODULE_DESCRIPTION("QCOM lito LLCC driver"); MODULE_LICENSE("GPL v2"); include/linux/soc/qcom/llcc-qcom.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * */ Loading @@ -16,6 +16,7 @@ #define LLCC_AUDIO 6 #define LLCC_MDMHPGRW 7 #define LLCC_MDM 8 #define LLCC_MDMHW 9 #define LLCC_CMPT 10 #define LLCC_GPUHTW 11 #define LLCC_GPU 12 Loading @@ -34,6 +35,7 @@ #define LLCC_PIMEM 25 #define LLCC_DISPVG 27 #define LLCC_CVP 28 #define LLCC_MODEMVPE 29 #define LLCC_APTCM 30 #define LLCC_WRTCH 31 #define LLCC_CVPFW 32 Loading Loading
drivers/soc/qcom/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,14 @@ config QCOM_KONA_LLCC data required to configure LLCC so that clients can start using the LLCC slices. config QCOM_LITO_LLCC tristate "Qualcomm Technologies, Inc. LITO LLCC driver" depends on QCOM_LLCC help Say yes here to enable the LLCC driver for LITO. This provides data required to configure LLCC so that clients can start using the LLCC slices. config QCOM_SDM845_LLCC tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver" depends on QCOM_LLCC Loading
drivers/soc/qcom/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o obj-$(CONFIG_QCOM_IPCC) += qcom_ipcc.o obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o obj-$(CONFIG_QCOM_KONA_LLCC) += llcc-kona.o obj-$(CONFIG_QCOM_LITO_LLCC) += llcc-lito.o obj-$(CONFIG_QCOM_APR) += apr.o obj-$(CONFIG_QCOM_SECURE_BUFFER) += secure_buffer.o obj-$(CONFIG_MSM_TZ_SMMU) += msm_tz_smmu.o Loading
drivers/soc/qcom/llcc-lito.c 0 → 100644 +95 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019, The Linux Foundation. All rights reserved. * */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/soc/qcom/llcc-qcom.h> /* * SCT entry contains of the following parameters * uid: Unique id for the client's use case * slice_id: llcc slice id for each client * max_cap: The maximum capacity of the cache slice provided in KB * priority: Priority of the client used to select victim line for replacement * fixed_size: Determine of the slice has a fixed capacity * bonus_ways: Bonus ways to be used by any slice, bonus way is used only if * it't not a reserved way. * res_ways: Reserved ways for the cache slice, the reserved ways cannot be used * by any other client than the one its assigned to. * cache_mode: Each slice operates as a cache, this controls the mode of the * slice normal or TCM * probe_target_ways: Determines what ways to probe for access hit. When * configured to 1 only bonus and reseved ways are probed. * when configured to 0 all ways in llcc are probed. * dis_cap_alloc: Disable capacity based allocation for a client * write_scid_en: Bit enables write cache support for a given scid. * retain_on_pc: If this bit is set and client has maitained active vote * then the ways assigned to this client are not flushed on power * collapse. * activate_on_init: Activate the slice immidiately after the SCT is programmed */ #define SCT_ENTRY(uid, sid, mc, p, fs, bway, rway, cmod, ptw, dca, wse, rp, a) \ { \ .usecase_id = uid, \ .slice_id = sid, \ .max_cap = mc, \ .priority = p, \ .fixed_size = fs, \ .bonus_ways = bway, \ .res_ways = rway, \ .cache_mode = cmod, \ .probe_target_ways = ptw, \ .dis_cap_alloc = dca, \ .write_scid_en = wse, \ .retain_on_pc = rp, \ .activate_on_init = a, \ } static struct llcc_slice_config lito_data[] = { SCT_ENTRY(LLCC_CPUSS, 1, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 1), SCT_ENTRY(LLCC_VIDSC0, 2, 0, 2, 1, 0x0, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_VIDSC1, 3, 0, 2, 1, 0x0, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_AUDIO, 6, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MDMHPGRW, 7, 512, 2, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MDM, 8, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MDMHW, 9, 1024, 0, 0, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_CMPT, 10, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_GPUHTW, 11, 256, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_GPU, 12, 256, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_DISP, 16, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MDMHPFX, 20, 512, 2, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MDMPNG, 21, 1024, 0, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_AUDHW, 22, 1024, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_NPU, 23, 512, 2, 1, 0x0, 0xF00, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_MODEMVPE, 29, 128, 1, 1, 0x0FF, 0x0, 0, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_APTCM, 30, 128, 3, 0, 0x0, 0x3, 1, 0, 0, 0, 1, 0), SCT_ENTRY(LLCC_WRTCH, 31, 128, 1, 1, 0x3, 0x0, 0, 0, 0, 0, 0, 0), }; static int lito_qcom_llcc_probe(struct platform_device *pdev) { return qcom_llcc_probe(pdev, lito_data, ARRAY_SIZE(lito_data)); } static const struct of_device_id lito_qcom_llcc_of_match[] = { { .compatible = "qcom,lito-llcc", }, { }, }; static struct platform_driver lito_qcom_llcc_driver = { .driver = { .name = "lito-llcc", .of_match_table = lito_qcom_llcc_of_match, }, .probe = lito_qcom_llcc_probe, }; module_platform_driver(lito_qcom_llcc_driver); MODULE_DESCRIPTION("QCOM lito LLCC driver"); MODULE_LICENSE("GPL v2");
include/linux/soc/qcom/llcc-qcom.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * */ Loading @@ -16,6 +16,7 @@ #define LLCC_AUDIO 6 #define LLCC_MDMHPGRW 7 #define LLCC_MDM 8 #define LLCC_MDMHW 9 #define LLCC_CMPT 10 #define LLCC_GPUHTW 11 #define LLCC_GPU 12 Loading @@ -34,6 +35,7 @@ #define LLCC_PIMEM 25 #define LLCC_DISPVG 27 #define LLCC_CVP 28 #define LLCC_MODEMVPE 29 #define LLCC_APTCM 30 #define LLCC_WRTCH 31 #define LLCC_CVPFW 32 Loading