Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'qcom-drivers-for-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/drivers

Qualcomm ARM Based Driver Updates for v5.5

* Add Bjorn as QCOM co-maintainer
* Add LLLC yaml bindings and SC7180 support
* Fixups/Cleanup for LLLC
* Add SMD-RPM MSM8976 compatible and interconnect device
* Add missing RPMD SMD perf level

* tag 'qcom-drivers-for-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
MAINTAINERS: Add myself as co-maintainer for QCOM
dt-bindings: msm: Add LLCC for SC7180
dt-bindings: msm: Convert LLCC bindings to YAML
soc: qcom: llcc: Add configuration data for SC7180
soc: qcom: llcc: Move regmap config to local variable
soc: qcom: llcc: Name regmaps to avoid collisions
soc: qcom: Fix llcc-qcom definitions to include
soc: qcom: rpmpd: Add rpm power domains for msm8976
dt-bindings: power: Add missing rpmpd smd performance level
soc: qcom: smd-rpm: Add MSM8976 compatible
soc: qcom: socinfo: add sdm845 and sda845 soc ids
soc: qcom: smd-rpm: Create RPM interconnect proxy child device
soc: qcom: Make llcc-qcom a generic driver
soc: qcom: Rename llcc-slice to llcc-qcom
soc: qcom: llcc cleanup to get rid of sdm845 specific driver file

Link: https://lore.kernel.org/r/1573068840-13098-4-git-send-email-agross@kernel.org
Signed-off-by: Olof Johansson <olof@lixom.net>

+251 -243
-41
Documentation/devicetree/bindings/arm/msm/qcom,llcc.txt
··· 1 - == Introduction== 2 - 3 - LLCC (Last Level Cache Controller) provides last level of cache memory in SOC, 4 - that can be shared by multiple clients. Clients here are different cores in the 5 - SOC, the idea is to minimize the local caches at the clients and migrate to 6 - common pool of memory. Cache memory is divided into partitions called slices 7 - which are assigned to clients. Clients can query the slice details, activate 8 - and deactivate them. 9 - 10 - Properties: 11 - - compatible: 12 - Usage: required 13 - Value type: <string> 14 - Definition: must be "qcom,sdm845-llcc" 15 - 16 - - reg: 17 - Usage: required 18 - Value Type: <prop-encoded-array> 19 - Definition: The first element specifies the llcc base start address and 20 - the size of the register region. The second element specifies 21 - the llcc broadcast base address and size of the register region. 22 - 23 - - reg-names: 24 - Usage: required 25 - Value Type: <stringlist> 26 - Definition: Register region names. Must be "llcc_base", "llcc_broadcast_base". 27 - 28 - - interrupts: 29 - Usage: required 30 - Definition: The interrupt is associated with the llcc edac device. 31 - It's used for llcc cache single and double bit error detection 32 - and reporting. 33 - 34 - Example: 35 - 36 - cache-controller@1100000 { 37 - compatible = "qcom,sdm845-llcc"; 38 - reg = <0x1100000 0x200000>, <0x1300000 0x50000> ; 39 - reg-names = "llcc_base", "llcc_broadcast_base"; 40 - interrupts = <GIC_SPI 582 IRQ_TYPE_LEVEL_HIGH>; 41 - };
+55
Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/msm/qcom,llcc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Last Level Cache Controller 8 + 9 + maintainers: 10 + - Rishabh Bhatnagar <rishabhb@codeaurora.org> 11 + - Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org> 12 + 13 + description: | 14 + LLCC (Last Level Cache Controller) provides last level of cache memory in SoC, 15 + that can be shared by multiple clients. Clients here are different cores in the 16 + SoC, the idea is to minimize the local caches at the clients and migrate to 17 + common pool of memory. Cache memory is divided into partitions called slices 18 + which are assigned to clients. Clients can query the slice details, activate 19 + and deactivate them. 20 + 21 + properties: 22 + compatible: 23 + enum: 24 + - qcom,sc7180-llcc 25 + - qcom,sdm845-llcc 26 + 27 + reg: 28 + items: 29 + - description: LLCC base register region 30 + - description: LLCC broadcast base register region 31 + 32 + reg-names: 33 + items: 34 + - const: llcc_base 35 + - const: llcc_broadcast_base 36 + 37 + interrupts: 38 + maxItems: 1 39 + 40 + required: 41 + - compatible 42 + - reg 43 + - reg-names 44 + - interrupts 45 + 46 + examples: 47 + - | 48 + #include <dt-bindings/interrupt-controller/arm-gic.h> 49 + 50 + cache-controller@1100000 { 51 + compatible = "qcom,sdm845-llcc"; 52 + reg = <0x1100000 0x200000>, <0x1300000 0x50000> ; 53 + reg-names = "llcc_base", "llcc_broadcast_base"; 54 + interrupts = <GIC_SPI 582 IRQ_TYPE_LEVEL_HIGH>; 55 + };
+1
Documentation/devicetree/bindings/power/qcom,rpmpd.txt
··· 5 5 6 6 Required Properties: 7 7 - compatible: Should be one of the following 8 + * qcom,msm8976-rpmpd: RPM Power domain for the msm8976 family of SoC 8 9 * qcom,msm8996-rpmpd: RPM Power domain for the msm8996 family of SoC 9 10 * qcom,msm8998-rpmpd: RPM Power domain for the msm8998 family of SoC 10 11 * qcom,qcs404-rpmpd: RPM Power domain for the qcs404 family of SoC
+1
Documentation/devicetree/bindings/soc/qcom/qcom,smd-rpm.txt
··· 22 22 "qcom,rpm-apq8084" 23 23 "qcom,rpm-msm8916" 24 24 "qcom,rpm-msm8974" 25 + "qcom,rpm-msm8976" 25 26 "qcom,rpm-msm8998" 26 27 "qcom,rpm-sdm660" 27 28 "qcom,rpm-qcs404"
+1
MAINTAINERS
··· 2102 2102 2103 2103 ARM/QUALCOMM SUPPORT 2104 2104 M: Andy Gross <agross@kernel.org> 2105 + M: Bjorn Andersson <bjorn.andersson@linaro.org> 2105 2106 L: linux-arm-msm@vger.kernel.org 2106 2107 S: Maintained 2107 2108 F: Documentation/devicetree/bindings/soc/qcom/
+3 -11
drivers/soc/qcom/Kconfig
··· 58 58 depends on ARCH_QCOM || COMPILE_TEST 59 59 help 60 60 Qualcomm Technologies, Inc. platform specific 61 - Last Level Cache Controller(LLCC) driver. This provides interfaces 62 - to clients that use the LLCC. Say yes here to enable LLCC slice 63 - driver. 64 - 65 - config QCOM_SDM845_LLCC 66 - tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver" 67 - depends on QCOM_LLCC 68 - help 69 - Say yes here to enable the LLCC driver for SDM845. This provides 70 - data required to configure LLCC so that clients can start using the 71 - LLCC slices. 61 + Last Level Cache Controller(LLCC) driver for platforms such as, 62 + SDM845. This provides interfaces to clients that use the LLCC. 63 + Say yes here to enable LLCC slice driver. 72 64 73 65 config QCOM_MDT_LOADER 74 66 tristate
+1 -2
drivers/soc/qcom/Makefile
··· 21 21 obj-$(CONFIG_QCOM_SOCINFO) += socinfo.o 22 22 obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o 23 23 obj-$(CONFIG_QCOM_APR) += apr.o 24 - obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o 25 - obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o 24 + obj-$(CONFIG_QCOM_LLCC) += llcc-qcom.o 26 25 obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o 27 26 obj-$(CONFIG_QCOM_RPMPD) += rpmpd.o
-100
drivers/soc/qcom/llcc-sdm845.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 4 - * 5 - */ 6 - 7 - #include <linux/kernel.h> 8 - #include <linux/module.h> 9 - #include <linux/of.h> 10 - #include <linux/of_device.h> 11 - #include <linux/soc/qcom/llcc-qcom.h> 12 - 13 - /* 14 - * SCT(System Cache Table) entry contains of the following members: 15 - * usecase_id: Unique id for the client's use case 16 - * slice_id: llcc slice id for each client 17 - * max_cap: The maximum capacity of the cache slice provided in KB 18 - * priority: Priority of the client used to select victim line for replacement 19 - * fixed_size: Boolean indicating if the slice has a fixed capacity 20 - * bonus_ways: Bonus ways are additional ways to be used for any slice, 21 - * if client ends up using more than reserved cache ways. Bonus 22 - * ways are allocated only if they are not reserved for some 23 - * other client. 24 - * res_ways: Reserved ways for the cache slice, the reserved ways cannot 25 - * be used by any other client than the one its assigned to. 26 - * cache_mode: Each slice operates as a cache, this controls the mode of the 27 - * slice: normal or TCM(Tightly Coupled Memory) 28 - * probe_target_ways: Determines what ways to probe for access hit. When 29 - * configured to 1 only bonus and reserved ways are probed. 30 - * When configured to 0 all ways in llcc are probed. 31 - * dis_cap_alloc: Disable capacity based allocation for a client 32 - * retain_on_pc: If this bit is set and client has maintained active vote 33 - * then the ways assigned to this client are not flushed on power 34 - * collapse. 35 - * activate_on_init: Activate the slice immediately after the SCT is programmed 36 - */ 37 - #define SCT_ENTRY(uid, sid, mc, p, fs, bway, rway, cmod, ptw, dca, rp, a) \ 38 - { \ 39 - .usecase_id = uid, \ 40 - .slice_id = sid, \ 41 - .max_cap = mc, \ 42 - .priority = p, \ 43 - .fixed_size = fs, \ 44 - .bonus_ways = bway, \ 45 - .res_ways = rway, \ 46 - .cache_mode = cmod, \ 47 - .probe_target_ways = ptw, \ 48 - .dis_cap_alloc = dca, \ 49 - .retain_on_pc = rp, \ 50 - .activate_on_init = a, \ 51 - } 52 - 53 - static struct llcc_slice_config sdm845_data[] = { 54 - SCT_ENTRY(LLCC_CPUSS, 1, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 1), 55 - SCT_ENTRY(LLCC_VIDSC0, 2, 512, 2, 1, 0x0, 0x0f0, 0, 0, 1, 1, 0), 56 - SCT_ENTRY(LLCC_VIDSC1, 3, 512, 2, 1, 0x0, 0x0f0, 0, 0, 1, 1, 0), 57 - SCT_ENTRY(LLCC_ROTATOR, 4, 563, 2, 1, 0x0, 0x00e, 2, 0, 1, 1, 0), 58 - SCT_ENTRY(LLCC_VOICE, 5, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0), 59 - SCT_ENTRY(LLCC_AUDIO, 6, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0), 60 - SCT_ENTRY(LLCC_MDMHPGRW, 7, 1024, 2, 0, 0xfc, 0xf00, 0, 0, 1, 1, 0), 61 - SCT_ENTRY(LLCC_MDM, 8, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0), 62 - SCT_ENTRY(LLCC_CMPT, 10, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0), 63 - SCT_ENTRY(LLCC_GPUHTW, 11, 512, 1, 1, 0xc, 0x0, 0, 0, 1, 1, 0), 64 - SCT_ENTRY(LLCC_GPU, 12, 2304, 1, 0, 0xff0, 0x2, 0, 0, 1, 1, 0), 65 - SCT_ENTRY(LLCC_MMUHWT, 13, 256, 2, 0, 0x0, 0x1, 0, 0, 1, 0, 1), 66 - SCT_ENTRY(LLCC_CMPTDMA, 15, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0), 67 - SCT_ENTRY(LLCC_DISP, 16, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0), 68 - SCT_ENTRY(LLCC_VIDFW, 17, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0), 69 - SCT_ENTRY(LLCC_MDMHPFX, 20, 1024, 2, 1, 0x0, 0xf00, 0, 0, 1, 1, 0), 70 - SCT_ENTRY(LLCC_MDMPNG, 21, 1024, 0, 1, 0x1e, 0x0, 0, 0, 1, 1, 0), 71 - SCT_ENTRY(LLCC_AUDHW, 22, 1024, 1, 1, 0xffc, 0x2, 0, 0, 1, 1, 0), 72 - }; 73 - 74 - static int sdm845_qcom_llcc_remove(struct platform_device *pdev) 75 - { 76 - return qcom_llcc_remove(pdev); 77 - } 78 - 79 - static int sdm845_qcom_llcc_probe(struct platform_device *pdev) 80 - { 81 - return qcom_llcc_probe(pdev, sdm845_data, ARRAY_SIZE(sdm845_data)); 82 - } 83 - 84 - static const struct of_device_id sdm845_qcom_llcc_of_match[] = { 85 - { .compatible = "qcom,sdm845-llcc", }, 86 - { } 87 - }; 88 - 89 - static struct platform_driver sdm845_qcom_llcc_driver = { 90 - .driver = { 91 - .name = "sdm845-llcc", 92 - .of_match_table = sdm845_qcom_llcc_of_match, 93 - }, 94 - .probe = sdm845_qcom_llcc_probe, 95 - .remove = sdm845_qcom_llcc_remove, 96 - }; 97 - module_platform_driver(sdm845_qcom_llcc_driver); 98 - 99 - MODULE_DESCRIPTION("QCOM sdm845 LLCC driver"); 100 - MODULE_LICENSE("GPL v2");
+118 -14
drivers/soc/qcom/llcc-slice.c drivers/soc/qcom/llcc-qcom.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 4 4 * 5 5 */ 6 6 ··· 11 11 #include <linux/kernel.h> 12 12 #include <linux/module.h> 13 13 #include <linux/mutex.h> 14 + #include <linux/of.h> 14 15 #include <linux/of_device.h> 15 16 #include <linux/regmap.h> 16 17 #include <linux/sizes.h> ··· 47 46 48 47 #define BANK_OFFSET_STRIDE 0x80000 49 48 50 - static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER; 51 - 52 - static const struct regmap_config llcc_regmap_config = { 53 - .reg_bits = 32, 54 - .reg_stride = 4, 55 - .val_bits = 32, 56 - .fast_io = true, 49 + /** 50 + * llcc_slice_config - Data associated with the llcc slice 51 + * @usecase_id: Unique id for the client's use case 52 + * @slice_id: llcc slice id for each client 53 + * @max_cap: The maximum capacity of the cache slice provided in KB 54 + * @priority: Priority of the client used to select victim line for replacement 55 + * @fixed_size: Boolean indicating if the slice has a fixed capacity 56 + * @bonus_ways: Bonus ways are additional ways to be used for any slice, 57 + * if client ends up using more than reserved cache ways. Bonus 58 + * ways are allocated only if they are not reserved for some 59 + * other client. 60 + * @res_ways: Reserved ways for the cache slice, the reserved ways cannot 61 + * be used by any other client than the one its assigned to. 62 + * @cache_mode: Each slice operates as a cache, this controls the mode of the 63 + * slice: normal or TCM(Tightly Coupled Memory) 64 + * @probe_target_ways: Determines what ways to probe for access hit. When 65 + * configured to 1 only bonus and reserved ways are probed. 66 + * When configured to 0 all ways in llcc are probed. 67 + * @dis_cap_alloc: Disable capacity based allocation for a client 68 + * @retain_on_pc: If this bit is set and client has maintained active vote 69 + * then the ways assigned to this client are not flushed on power 70 + * collapse. 71 + * @activate_on_init: Activate the slice immediately after it is programmed 72 + */ 73 + struct llcc_slice_config { 74 + u32 usecase_id; 75 + u32 slice_id; 76 + u32 max_cap; 77 + u32 priority; 78 + bool fixed_size; 79 + u32 bonus_ways; 80 + u32 res_ways; 81 + u32 cache_mode; 82 + u32 probe_target_ways; 83 + bool dis_cap_alloc; 84 + bool retain_on_pc; 85 + bool activate_on_init; 57 86 }; 87 + 88 + struct qcom_llcc_config { 89 + const struct llcc_slice_config *sct_data; 90 + int size; 91 + }; 92 + 93 + static const struct llcc_slice_config sc7180_data[] = { 94 + { LLCC_CPUSS, 1, 256, 1, 0, 0xf, 0x0, 0, 0, 0, 1, 1 }, 95 + { LLCC_MDM, 8, 128, 1, 0, 0xf, 0x0, 0, 0, 0, 1, 0 }, 96 + { LLCC_GPUHTW, 11, 128, 1, 0, 0xf, 0x0, 0, 0, 0, 1, 0 }, 97 + { LLCC_GPU, 12, 128, 1, 0, 0xf, 0x0, 0, 0, 0, 1, 0 }, 98 + }; 99 + 100 + static const struct llcc_slice_config sdm845_data[] = { 101 + { LLCC_CPUSS, 1, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 1 }, 102 + { LLCC_VIDSC0, 2, 512, 2, 1, 0x0, 0x0f0, 0, 0, 1, 1, 0 }, 103 + { LLCC_VIDSC1, 3, 512, 2, 1, 0x0, 0x0f0, 0, 0, 1, 1, 0 }, 104 + { LLCC_ROTATOR, 4, 563, 2, 1, 0x0, 0x00e, 2, 0, 1, 1, 0 }, 105 + { LLCC_VOICE, 5, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0 }, 106 + { LLCC_AUDIO, 6, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0 }, 107 + { LLCC_MDMHPGRW, 7, 1024, 2, 0, 0xfc, 0xf00, 0, 0, 1, 1, 0 }, 108 + { LLCC_MDM, 8, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0 }, 109 + { LLCC_CMPT, 10, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0 }, 110 + { LLCC_GPUHTW, 11, 512, 1, 1, 0xc, 0x0, 0, 0, 1, 1, 0 }, 111 + { LLCC_GPU, 12, 2304, 1, 0, 0xff0, 0x2, 0, 0, 1, 1, 0 }, 112 + { LLCC_MMUHWT, 13, 256, 2, 0, 0x0, 0x1, 0, 0, 1, 0, 1 }, 113 + { LLCC_CMPTDMA, 15, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0 }, 114 + { LLCC_DISP, 16, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0 }, 115 + { LLCC_VIDFW, 17, 2816, 1, 0, 0xffc, 0x2, 0, 0, 1, 1, 0 }, 116 + { LLCC_MDMHPFX, 20, 1024, 2, 1, 0x0, 0xf00, 0, 0, 1, 1, 0 }, 117 + { LLCC_MDMPNG, 21, 1024, 0, 1, 0x1e, 0x0, 0, 0, 1, 1, 0 }, 118 + { LLCC_AUDHW, 22, 1024, 1, 1, 0xffc, 0x2, 0, 0, 1, 1, 0 }, 119 + }; 120 + 121 + static const struct qcom_llcc_config sc7180_cfg = { 122 + .sct_data = sc7180_data, 123 + .size = ARRAY_SIZE(sc7180_data), 124 + }; 125 + 126 + static const struct qcom_llcc_config sdm845_cfg = { 127 + .sct_data = sdm845_data, 128 + .size = ARRAY_SIZE(sdm845_data), 129 + }; 130 + 131 + static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER; 58 132 59 133 /** 60 134 * llcc_slice_getd - get llcc slice descriptor ··· 377 301 return ret; 378 302 } 379 303 380 - int qcom_llcc_remove(struct platform_device *pdev) 304 + static int qcom_llcc_remove(struct platform_device *pdev) 381 305 { 382 306 /* Set the global pointer to a error code to avoid referencing it */ 383 307 drv_data = ERR_PTR(-ENODEV); 384 308 return 0; 385 309 } 386 - EXPORT_SYMBOL_GPL(qcom_llcc_remove); 387 310 388 311 static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, 389 312 const char *name) 390 313 { 391 314 struct resource *res; 392 315 void __iomem *base; 316 + struct regmap_config llcc_regmap_config = { 317 + .reg_bits = 32, 318 + .reg_stride = 4, 319 + .val_bits = 32, 320 + .fast_io = true, 321 + }; 393 322 394 323 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); 395 324 if (!res) ··· 404 323 if (IS_ERR(base)) 405 324 return ERR_CAST(base); 406 325 326 + llcc_regmap_config.name = name; 407 327 return devm_regmap_init_mmio(&pdev->dev, base, &llcc_regmap_config); 408 328 } 409 329 410 - int qcom_llcc_probe(struct platform_device *pdev, 411 - const struct llcc_slice_config *llcc_cfg, u32 sz) 330 + static int qcom_llcc_probe(struct platform_device *pdev) 412 331 { 413 332 u32 num_banks; 414 333 struct device *dev = &pdev->dev; 415 334 int ret, i; 416 335 struct platform_device *llcc_edac; 336 + const struct qcom_llcc_config *cfg; 337 + const struct llcc_slice_config *llcc_cfg; 338 + u32 sz; 417 339 418 340 drv_data = devm_kzalloc(dev, sizeof(*drv_data), GFP_KERNEL); 419 341 if (!drv_data) { ··· 445 361 num_banks &= LLCC_LB_CNT_MASK; 446 362 num_banks >>= LLCC_LB_CNT_SHIFT; 447 363 drv_data->num_banks = num_banks; 364 + 365 + cfg = of_device_get_match_data(&pdev->dev); 366 + llcc_cfg = cfg->sct_data; 367 + sz = cfg->size; 448 368 449 369 for (i = 0; i < sz; i++) 450 370 if (llcc_cfg[i].slice_id > drv_data->max_slices) ··· 495 407 drv_data = ERR_PTR(-ENODEV); 496 408 return ret; 497 409 } 498 - EXPORT_SYMBOL_GPL(qcom_llcc_probe); 499 - MODULE_LICENSE("GPL v2"); 410 + 411 + static const struct of_device_id qcom_llcc_of_match[] = { 412 + { .compatible = "qcom,sc7180-llcc", .data = &sc7180_cfg }, 413 + { .compatible = "qcom,sdm845-llcc", .data = &sdm845_cfg }, 414 + { } 415 + }; 416 + 417 + static struct platform_driver qcom_llcc_driver = { 418 + .driver = { 419 + .name = "qcom-llcc", 420 + .of_match_table = qcom_llcc_of_match, 421 + }, 422 + .probe = qcom_llcc_probe, 423 + .remove = qcom_llcc_remove, 424 + }; 425 + module_platform_driver(qcom_llcc_driver); 426 + 500 427 MODULE_DESCRIPTION("Qualcomm Last Level Cache Controller"); 428 + MODULE_LICENSE("GPL v2");
+23
drivers/soc/qcom/rpmpd.c
··· 115 115 116 116 static DEFINE_MUTEX(rpmpd_lock); 117 117 118 + /* msm8976 RPM Power Domains */ 119 + DEFINE_RPMPD_PAIR(msm8976, vddcx, vddcx_ao, SMPA, LEVEL, 2); 120 + DEFINE_RPMPD_PAIR(msm8976, vddmx, vddmx_ao, SMPA, LEVEL, 6); 121 + 122 + DEFINE_RPMPD_VFL(msm8976, vddcx_vfl, RWSC, 2); 123 + DEFINE_RPMPD_VFL(msm8976, vddmx_vfl, RWSM, 6); 124 + 125 + static struct rpmpd *msm8976_rpmpds[] = { 126 + [MSM8976_VDDCX] = &msm8976_vddcx, 127 + [MSM8976_VDDCX_AO] = &msm8976_vddcx_ao, 128 + [MSM8976_VDDCX_VFL] = &msm8976_vddcx_vfl, 129 + [MSM8976_VDDMX] = &msm8976_vddmx, 130 + [MSM8976_VDDMX_AO] = &msm8976_vddmx_ao, 131 + [MSM8976_VDDMX_VFL] = &msm8976_vddmx_vfl, 132 + }; 133 + 134 + static const struct rpmpd_desc msm8976_desc = { 135 + .rpmpds = msm8976_rpmpds, 136 + .num_pds = ARRAY_SIZE(msm8976_rpmpds), 137 + .max_state = RPM_SMD_LEVEL_TURBO_HIGH, 138 + }; 139 + 118 140 /* msm8996 RPM Power domains */ 119 141 DEFINE_RPMPD_PAIR(msm8996, vddcx, vddcx_ao, SMPA, CORNER, 1); 120 142 DEFINE_RPMPD_PAIR(msm8996, vddmx, vddmx_ao, SMPA, CORNER, 2); ··· 220 198 }; 221 199 222 200 static const struct of_device_id rpmpd_match_table[] = { 201 + { .compatible = "qcom,msm8976-rpmpd", .data = &msm8976_desc }, 223 202 { .compatible = "qcom,msm8996-rpmpd", .data = &msm8996_desc }, 224 203 { .compatible = "qcom,msm8998-rpmpd", .data = &msm8998_desc }, 225 204 { .compatible = "qcom,qcs404-rpmpd", .data = &qcs404_desc },
+17 -1
drivers/soc/qcom/smd-rpm.c
··· 19 19 /** 20 20 * struct qcom_smd_rpm - state of the rpm device driver 21 21 * @rpm_channel: reference to the smd channel 22 + * @icc: interconnect proxy device 22 23 * @ack: completion for acks 23 24 * @lock: mutual exclusion around the send/complete pair 24 25 * @ack_status: result of the rpm request 25 26 */ 26 27 struct qcom_smd_rpm { 27 28 struct rpmsg_endpoint *rpm_channel; 29 + struct platform_device *icc; 28 30 struct device *dev; 29 31 30 32 struct completion ack; ··· 195 193 static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) 196 194 { 197 195 struct qcom_smd_rpm *rpm; 196 + int ret; 198 197 199 198 rpm = devm_kzalloc(&rpdev->dev, sizeof(*rpm), GFP_KERNEL); 200 199 if (!rpm) ··· 208 205 rpm->rpm_channel = rpdev->ept; 209 206 dev_set_drvdata(&rpdev->dev, rpm); 210 207 211 - return of_platform_populate(rpdev->dev.of_node, NULL, NULL, &rpdev->dev); 208 + rpm->icc = platform_device_register_data(&rpdev->dev, "icc_smd_rpm", -1, 209 + NULL, 0); 210 + if (IS_ERR(rpm->icc)) 211 + return PTR_ERR(rpm->icc); 212 + 213 + ret = of_platform_populate(rpdev->dev.of_node, NULL, NULL, &rpdev->dev); 214 + if (ret) 215 + platform_device_unregister(rpm->icc); 216 + 217 + return ret; 212 218 } 213 219 214 220 static void qcom_smd_rpm_remove(struct rpmsg_device *rpdev) 215 221 { 222 + struct qcom_smd_rpm *rpm = dev_get_drvdata(&rpdev->dev); 223 + 224 + platform_device_unregister(rpm->icc); 216 225 of_platform_depopulate(&rpdev->dev); 217 226 } 218 227 ··· 232 217 { .compatible = "qcom,rpm-apq8084" }, 233 218 { .compatible = "qcom,rpm-msm8916" }, 234 219 { .compatible = "qcom,rpm-msm8974" }, 220 + { .compatible = "qcom,rpm-msm8976" }, 235 221 { .compatible = "qcom,rpm-msm8996" }, 236 222 { .compatible = "qcom,rpm-msm8998" }, 237 223 { .compatible = "qcom,rpm-sdm660" },
+2
drivers/soc/qcom/socinfo.c
··· 198 198 { 310, "MSM8996AU" }, 199 199 { 311, "APQ8096AU" }, 200 200 { 312, "APQ8096SG" }, 201 + { 321, "SDM845" }, 202 + { 341, "SDA845" }, 201 203 }; 202 204 203 205 static const char *socinfo_machine(struct device *dev, unsigned int id)
+9
include/dt-bindings/power/qcom-rpmpd.h
··· 27 27 #define RPMH_REGULATOR_LEVEL_TURBO 384 28 28 #define RPMH_REGULATOR_LEVEL_TURBO_L1 416 29 29 30 + /* MSM8976 Power Domain Indexes */ 31 + #define MSM8976_VDDCX 0 32 + #define MSM8976_VDDCX_AO 1 33 + #define MSM8976_VDDCX_VFL 2 34 + #define MSM8976_VDDMX 3 35 + #define MSM8976_VDDMX_AO 4 36 + #define MSM8976_VDDMX_VFL 5 37 + 30 38 /* MSM8996 Power Domain Indexes */ 31 39 #define MSM8996_VDDCX 0 32 40 #define MSM8996_VDDCX_AO 1 ··· 76 68 #define RPM_SMD_LEVEL_NOM_PLUS 320 77 69 #define RPM_SMD_LEVEL_TURBO 384 78 70 #define RPM_SMD_LEVEL_TURBO_NO_CPR 416 71 + #define RPM_SMD_LEVEL_TURBO_HIGH 448 79 72 #define RPM_SMD_LEVEL_BINNING 512 80 73 81 74 #endif
+20 -74
include/linux/soc/qcom/llcc-qcom.h
··· 38 38 }; 39 39 40 40 /** 41 - * llcc_slice_config - Data associated with the llcc slice 42 - * @usecase_id: usecase id for which the llcc slice is used 43 - * @slice_id: llcc slice id assigned to each slice 44 - * @max_cap: maximum capacity of the llcc slice 45 - * @priority: priority of the llcc slice 46 - * @fixed_size: whether the llcc slice can grow beyond its size 47 - * @bonus_ways: bonus ways associated with llcc slice 48 - * @res_ways: reserved ways associated with llcc slice 49 - * @cache_mode: mode of the llcc slice 50 - * @probe_target_ways: Probe only reserved and bonus ways on a cache miss 51 - * @dis_cap_alloc: Disable capacity based allocation 52 - * @retain_on_pc: Retain through power collapse 53 - * @activate_on_init: activate the slice on init 41 + * llcc_edac_reg_data - llcc edac registers data for each error type 42 + * @name: Name of the error 43 + * @synd_reg: Syndrome register address 44 + * @count_status_reg: Status register address to read the error count 45 + * @ways_status_reg: Status register address to read the error ways 46 + * @reg_cnt: Number of registers 47 + * @count_mask: Mask value to get the error count 48 + * @ways_mask: Mask value to get the error ways 49 + * @count_shift: Shift value to get the error count 50 + * @ways_shift: Shift value to get the error ways 54 51 */ 55 - struct llcc_slice_config { 56 - u32 usecase_id; 57 - u32 slice_id; 58 - u32 max_cap; 59 - u32 priority; 60 - bool fixed_size; 61 - u32 bonus_ways; 62 - u32 res_ways; 63 - u32 cache_mode; 64 - u32 probe_target_ways; 65 - bool dis_cap_alloc; 66 - bool retain_on_pc; 67 - bool activate_on_init; 52 + struct llcc_edac_reg_data { 53 + char *name; 54 + u64 synd_reg; 55 + u64 count_status_reg; 56 + u64 ways_status_reg; 57 + u32 reg_cnt; 58 + u32 count_mask; 59 + u32 ways_mask; 60 + u8 count_shift; 61 + u8 ways_shift; 68 62 }; 69 63 70 64 /** ··· 85 91 unsigned long *bitmap; 86 92 u32 *offsets; 87 93 int ecc_irq; 88 - }; 89 - 90 - /** 91 - * llcc_edac_reg_data - llcc edac registers data for each error type 92 - * @name: Name of the error 93 - * @synd_reg: Syndrome register address 94 - * @count_status_reg: Status register address to read the error count 95 - * @ways_status_reg: Status register address to read the error ways 96 - * @reg_cnt: Number of registers 97 - * @count_mask: Mask value to get the error count 98 - * @ways_mask: Mask value to get the error ways 99 - * @count_shift: Shift value to get the error count 100 - * @ways_shift: Shift value to get the error ways 101 - */ 102 - struct llcc_edac_reg_data { 103 - char *name; 104 - u64 synd_reg; 105 - u64 count_status_reg; 106 - u64 ways_status_reg; 107 - u32 reg_cnt; 108 - u32 count_mask; 109 - u32 ways_mask; 110 - u8 count_shift; 111 - u8 ways_shift; 112 94 }; 113 95 114 96 #if IS_ENABLED(CONFIG_QCOM_LLCC) ··· 124 154 */ 125 155 int llcc_slice_deactivate(struct llcc_slice_desc *desc); 126 156 127 - /** 128 - * qcom_llcc_probe - program the sct table 129 - * @pdev: platform device pointer 130 - * @table: soc sct table 131 - * @sz: Size of the config table 132 - */ 133 - int qcom_llcc_probe(struct platform_device *pdev, 134 - const struct llcc_slice_config *table, u32 sz); 135 - 136 - /** 137 - * qcom_llcc_remove - remove the sct table 138 - * @pdev: Platform device pointer 139 - */ 140 - int qcom_llcc_remove(struct platform_device *pdev); 141 157 #else 142 158 static inline struct llcc_slice_desc *llcc_slice_getd(u32 uid) 143 159 { ··· 152 196 static inline int llcc_slice_deactivate(struct llcc_slice_desc *desc) 153 197 { 154 198 return -EINVAL; 155 - } 156 - static inline int qcom_llcc_probe(struct platform_device *pdev, 157 - const struct llcc_slice_config *table, u32 sz) 158 - { 159 - return -ENODEV; 160 - } 161 - 162 - static inline int qcom_llcc_remove(struct platform_device *pdev) 163 - { 164 - return -ENODEV; 165 199 } 166 200 #endif 167 201