From 9d6c7ee7c4bb21e9ca61e4f73be1bdff658434cd Mon Sep 17 00:00:00 2001 From: Abel Vesa Date: Thu, 6 Jan 2022 19:05:01 +0200 Subject: [PATCH 1/4] interconnect: imx: Add imx_icc_get_bw function to set initial avg and peak Set the initial avg and peak to 0 in order to avoid setting them to INT_MAX by the interconnect core. Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220106170501.3513423-1-abel.vesa@nxp.com Signed-off-by: Georgi Djakov --- drivers/interconnect/imx/imx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/interconnect/imx/imx.c b/drivers/interconnect/imx/imx.c index c770951a909c90..249ca25d1d556e 100644 --- a/drivers/interconnect/imx/imx.c +++ b/drivers/interconnect/imx/imx.c @@ -25,6 +25,14 @@ struct imx_icc_node { struct dev_pm_qos_request qos_req; }; +static int imx_icc_get_bw(struct icc_node *node, u32 *avg, u32 *peak) +{ + *avg = 0; + *peak = 0; + + return 0; +} + static int imx_icc_node_set(struct icc_node *node) { struct device *dev = node->provider->dev; @@ -241,6 +249,7 @@ int imx_icc_register(struct platform_device *pdev, if (!provider) return -ENOMEM; provider->set = imx_icc_set; + provider->get_bw = imx_icc_get_bw; provider->aggregate = icc_std_aggregate; provider->xlate = of_icc_xlate_onecell; provider->data = data; From dfeef93fe3eee6b7b5cbe209be3dbad59426f189 Mon Sep 17 00:00:00 2001 From: Bryan O'Donoghue Date: Sat, 29 Jan 2022 03:27:34 +0000 Subject: [PATCH 2/4] dt-bindings: interconnect: Convert snoc-mm to a sub-node of snoc snoc and snoc-mm in downstream use the same address space a mistake which we have carried over into upstream. In silicon terms snoc-mm has been tacked on to the original snoc which came from msm8916. Convert to a better description where snoc-mm is a sub-node of snoc, thus avoiding a mmio remap collision when using the RPM interconnect driver. Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Bryan O'Donoghue Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220129032735.2410936-2-bryan.odonoghue@linaro.org Signed-off-by: Georgi Djakov --- .../bindings/interconnect/qcom,rpm.yaml | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml b/Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml index e4c3c2818119e5..89853b48251337 100644 --- a/Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml +++ b/Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml @@ -26,7 +26,6 @@ properties: - qcom,msm8939-bimc - qcom,msm8939-pcnoc - qcom,msm8939-snoc - - qcom,msm8939-snoc-mm - qcom,msm8996-a0noc - qcom,msm8996-a1noc - qcom,msm8996-a2noc @@ -80,7 +79,6 @@ allOf: - qcom,msm8939-bimc - qcom,msm8939-pcnoc - qcom,msm8939-snoc - - qcom,msm8939-snoc-mm - qcom,msm8996-a1noc - qcom,msm8996-a2noc - qcom,msm8996-bimc @@ -107,6 +105,37 @@ allOf: - description: Bus Clock - description: Bus A Clock + # Child node's properties + patternProperties: + '^interconnect-[a-z0-9]+$': + type: object + description: + snoc-mm is a child of snoc, sharing snoc's register address space. + + properties: + compatible: + enum: + - qcom,msm8939-snoc-mm + + '#interconnect-cells': + const: 1 + + clock-names: + items: + - const: bus + - const: bus_a + + clocks: + items: + - description: Bus Clock + - description: Bus A Clock + + required: + - compatible + - '#interconnect-cells' + - clock-names + - clocks + - if: properties: compatible: From 62dab57943a38213f51f002a9583aeaf7e510d08 Mon Sep 17 00:00:00 2001 From: Bryan O'Donoghue Date: Sat, 29 Jan 2022 03:27:35 +0000 Subject: [PATCH 3/4] interconnect: qcom: msm8939: Remove snoc_mm specific regmap Booting tip-of-tree on msm8939 we find the following error caused by our modelling of snoc and snoc_mm as peer devices with the same address space. [ 1.212340] qnoc-msm8939 580000.interconnect_mm: can't request region for resource [mem 0x00580000-0x0059407f] [ 1.212391] qnoc-msm8939 580000.interconnect_mm: Cannot ioremap interconnect bus resource [ 1.221524] qnoc-msm8939: probe of 580000.interconnect_mm failed with error -16 Declaring snoc_mm as a child device of snoc mitigates the fault and is consistent with a similar extant implementation in qcm2290. Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20220129032735.2410936-3-bryan.odonoghue@linaro.org Signed-off-by: Georgi Djakov --- drivers/interconnect/qcom/msm8939.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/interconnect/qcom/msm8939.c b/drivers/interconnect/qcom/msm8939.c index d188f3636e4c3a..f9c2d7d3100dd5 100644 --- a/drivers/interconnect/qcom/msm8939.c +++ b/drivers/interconnect/qcom/msm8939.c @@ -1301,19 +1301,11 @@ static struct qcom_icc_node *msm8939_snoc_mm_nodes[] = { [SNOC_MM_INT_2] = &mm_int_2, }; -static const struct regmap_config msm8939_snoc_mm_regmap_config = { - .reg_bits = 32, - .reg_stride = 4, - .val_bits = 32, - .max_register = 0x14080, - .fast_io = true, -}; - static struct qcom_icc_desc msm8939_snoc_mm = { .type = QCOM_ICC_NOC, .nodes = msm8939_snoc_mm_nodes, .num_nodes = ARRAY_SIZE(msm8939_snoc_mm_nodes), - .regmap_cfg = &msm8939_snoc_mm_regmap_config, + .regmap_cfg = &msm8939_snoc_regmap_config, .qos_offset = 0x7000, }; From e45f1c1d70cae0d7a28ad60f9c6391e210354f0b Mon Sep 17 00:00:00 2001 From: Georgi Djakov Date: Tue, 1 Mar 2022 11:07:35 +0200 Subject: [PATCH 4/4] interconnect: Add stubs for the bulk API Add stub functions for the bulk API to allow compile testing. Reviewed-by: Alex Elder Link: https://lore.kernel.org/r/20220301090735.26599-1-djakov@kernel.org Signed-off-by: Georgi Djakov --- include/linux/interconnect.h | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/include/linux/interconnect.h b/include/linux/interconnect.h index f2dd2fc8d3cdf5..f685777b875e35 100644 --- a/include/linux/interconnect.h +++ b/include/linux/interconnect.h @@ -38,13 +38,6 @@ struct icc_bulk_data { u32 peak_bw; }; -int __must_check of_icc_bulk_get(struct device *dev, int num_paths, - struct icc_bulk_data *paths); -void icc_bulk_put(int num_paths, struct icc_bulk_data *paths); -int icc_bulk_set_bw(int num_paths, const struct icc_bulk_data *paths); -int icc_bulk_enable(int num_paths, const struct icc_bulk_data *paths); -void icc_bulk_disable(int num_paths, const struct icc_bulk_data *paths); - #if IS_ENABLED(CONFIG_INTERCONNECT) struct icc_path *icc_get(struct device *dev, const int src_id, @@ -58,6 +51,12 @@ int icc_disable(struct icc_path *path); int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw); void icc_set_tag(struct icc_path *path, u32 tag); const char *icc_get_name(struct icc_path *path); +int __must_check of_icc_bulk_get(struct device *dev, int num_paths, + struct icc_bulk_data *paths); +void icc_bulk_put(int num_paths, struct icc_bulk_data *paths); +int icc_bulk_set_bw(int num_paths, const struct icc_bulk_data *paths); +int icc_bulk_enable(int num_paths, const struct icc_bulk_data *paths); +void icc_bulk_disable(int num_paths, const struct icc_bulk_data *paths); #else @@ -112,6 +111,29 @@ static inline const char *icc_get_name(struct icc_path *path) return NULL; } +static inline int of_icc_bulk_get(struct device *dev, int num_paths, struct icc_bulk_data *paths) +{ + return 0; +} + +static inline void icc_bulk_put(int num_paths, struct icc_bulk_data *paths) +{ +} + +static inline int icc_bulk_set_bw(int num_paths, const struct icc_bulk_data *paths) +{ + return 0; +} + +static inline int icc_bulk_enable(int num_paths, const struct icc_bulk_data *paths) +{ + return 0; +} + +static inline void icc_bulk_disable(int num_paths, const struct icc_bulk_data *paths) +{ +} + #endif /* CONFIG_INTERCONNECT */ #endif /* __LINUX_INTERCONNECT_H */