Message ID | 20200930081645.3434-1-jun.nie@linaro.org |
---|---|
Headers | show |
Series | Consolidate RPM interconnect and support to MSM8939 | expand |
Le mercredi 30 septembre 2020 à 16:16 +0800, Jun Nie a écrit : > Add RPM based interconnect driver implements the set and aggregate > functionalities that translates bandwidth requests into RPM messages. > These modules provide a common set of functionalities for all > Qualcomm RPM based interconnect providers and should help reduce code > duplication when adding new providers. > > Signed-off-by: Jun Nie <jun.nie@linaro.org> > --- > drivers/interconnect/qcom/Makefile | 3 +- > drivers/interconnect/qcom/icc-rpm.c | 194 ++++++++++++++++++++++ > drivers/interconnect/qcom/icc-rpm.h | 73 +++++++++ > drivers/interconnect/qcom/msm8916.c | 241 ++-------------------------- > 4 files changed, 279 insertions(+), 232 deletions(-) > create mode 100644 drivers/interconnect/qcom/icc-rpm.c > create mode 100644 drivers/interconnect/qcom/icc-rpm.h > > diff --git a/drivers/interconnect/qcom/Makefile > b/drivers/interconnect/qcom/Makefile > index 1702ece67dc5..f5e803489de0 100644 > --- a/drivers/interconnect/qcom/Makefile > +++ b/drivers/interconnect/qcom/Makefile > @@ -9,7 +9,7 @@ icc-rpmh-obj := icc-rpmh.o > qnoc-sc7180-objs := sc7180.o > qnoc-sdm845-objs := sdm845.o > qnoc-sm8150-objs := sm8150.o > -icc-smd-rpm-objs := smd-rpm.o > +icc-smd-rpm-objs := smd-rpm.o icc-rpm.o > > obj-$(CONFIG_INTERCONNECT_QCOM_BCM_VOTER) += icc-bcm-voter.o > obj-$(CONFIG_INTERCONNECT_QCOM_MSM8916) += qnoc-msm8916.o > @@ -21,3 +21,4 @@ obj-$(CONFIG_INTERCONNECT_QCOM_SC7180) += qnoc-sc7180.o > obj-$(CONFIG_INTERCONNECT_QCOM_SDM845) += qnoc-sdm845.o > obj-$(CONFIG_INTERCONNECT_QCOM_SM8150) += qnoc-sm8150.o > obj-$(CONFIG_INTERCONNECT_QCOM_SMD_RPM) += icc-smd-rpm.o > +obj-$(CONFIG_INTERCONNECT_QCOM_SMD_RPM) += icc-smd-rpm.o Duplicate ? Thanks for msm8939 work, please Cc: me on any related patch :-)
On Wed, Sep 30, 2020 at 04:16:43PM +0800, Jun Nie wrote: > MSM8916 and QCS404 bindings are almost identical, so combine them into one. > This will make it easier to add interconnect bindings for more SoC with RPM. > > Signed-off-by: Jun Nie <jun.nie@linaro.org> > --- > .../bindings/interconnect/qcom,qcs404.yaml | 77 ------------------- > .../{qcom,msm8916.yaml => qcom,rpm.yaml} | 24 +++--- > 2 files changed, 14 insertions(+), 87 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml > rename Documentation/devicetree/bindings/interconnect/{qcom,msm8916.yaml => qcom,rpm.yaml} (76%) > > diff --git a/Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml b/Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml > deleted file mode 100644 > index 3fbb8785fbc9..000000000000 > --- a/Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml > +++ /dev/null > @@ -1,77 +0,0 @@ > -# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > -%YAML 1.2 > ---- > -$id: http://devicetree.org/schemas/interconnect/qcom,qcs404.yaml# > -$schema: http://devicetree.org/meta-schemas/core.yaml# > - > -title: Qualcomm QCS404 Network-On-Chip interconnect > - > -maintainers: > - - Georgi Djakov <georgi.djakov@linaro.org> > - > -description: | > - The Qualcomm QCS404 interconnect providers support adjusting the > - bandwidth requirements between the various NoC fabrics. > - > -properties: > - reg: > - maxItems: 1 > - > - compatible: > - enum: > - - qcom,qcs404-bimc > - - qcom,qcs404-pcnoc > - - qcom,qcs404-snoc > - > - '#interconnect-cells': > - const: 1 > - > - clock-names: > - items: > - - const: bus > - - const: bus_a > - > - clocks: > - items: > - - description: Bus Clock > - - description: Bus A Clock > - > -required: > - - compatible > - - reg > - - '#interconnect-cells' > - - clock-names > - - clocks > - > -additionalProperties: false > - > -examples: > - - | > - #include <dt-bindings/clock/qcom,rpmcc.h> > - > - bimc: interconnect@400000 { > - reg = <0x00400000 0x80000>; > - compatible = "qcom,qcs404-bimc"; > - #interconnect-cells = <1>; > - clock-names = "bus", "bus_a"; > - clocks = <&rpmcc RPM_SMD_BIMC_CLK>, > - <&rpmcc RPM_SMD_BIMC_A_CLK>; > - }; > - > - pnoc: interconnect@500000 { > - reg = <0x00500000 0x15080>; > - compatible = "qcom,qcs404-pcnoc"; > - #interconnect-cells = <1>; > - clock-names = "bus", "bus_a"; > - clocks = <&rpmcc RPM_SMD_PNOC_CLK>, > - <&rpmcc RPM_SMD_PNOC_A_CLK>; > - }; > - > - snoc: interconnect@580000 { > - reg = <0x00580000 0x23080>; > - compatible = "qcom,qcs404-snoc"; > - #interconnect-cells = <1>; > - clock-names = "bus", "bus_a"; > - clocks = <&rpmcc RPM_SMD_SNOC_CLK>, > - <&rpmcc RPM_SMD_SNOC_A_CLK>; > - }; > diff --git a/Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml b/Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml > similarity index 76% > rename from Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml > rename to Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml > index e1009ae4e8f7..e9f856357822 100644 > --- a/Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml > +++ b/Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml > @@ -1,28 +1,32 @@ > # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > %YAML 1.2 > --- > -$id: http://devicetree.org/schemas/interconnect/qcom,msm8916.yaml# > +$id: http://devicetree.org/schemas/interconnect/qcom,rpm.yaml# > $schema: http://devicetree.org/meta-schemas/core.yaml# > > -title: Qualcomm MSM8916 Network-On-Chip interconnect > +title: Qualcomm RPM Network-On-Chip Interconnect > > maintainers: > - Georgi Djakov <georgi.djakov@linaro.org> > > description: | > - The Qualcomm MSM8916 interconnect providers support adjusting the > - bandwidth requirements between the various NoC fabrics. > + RPM interconnect providers support system bandwidth requirements through > + RPM processor. The provider is able to communicate with the RPM through > + the RPM shared memory device. > > properties: > - compatible: > - enum: > - - qcom,msm8916-bimc > - - qcom,msm8916-pcnoc > - - qcom,msm8916-snoc > - > reg: > maxItems: 1 > > + compatible: > + enum: Wrong indentation... With that fixed, Reviewed-by: Rob Herring <robh@kernel.org> > + - qcom,msm8916-bimc > + - qcom,msm8916-pcnoc > + - qcom,msm8916-snoc > + - qcom,qcs404-bimc > + - qcom,qcs404-pcnoc > + - qcom,qcs404-snoc > + > '#interconnect-cells': > const: 1 > > -- > 2.17.1 >
On Wed, Sep 30, 2020 at 04:16:43PM +0800, Jun Nie wrote: > MSM8916 and QCS404 bindings are almost identical, so combine them into one. > This will make it easier to add interconnect bindings for more SoC with RPM. > > Signed-off-by: Jun Nie <jun.nie@linaro.org> > --- > .../bindings/interconnect/qcom,qcs404.yaml | 77 ------------------- > .../{qcom,msm8916.yaml => qcom,rpm.yaml} | 24 +++--- > 2 files changed, 14 insertions(+), 87 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml > rename Documentation/devicetree/bindings/interconnect/{qcom,msm8916.yaml => qcom,rpm.yaml} (76%) > > diff --git a/Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml b/Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml > deleted file mode 100644 > index 3fbb8785fbc9..000000000000 > --- a/Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml > +++ /dev/null > @@ -1,77 +0,0 @@ > -# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > -%YAML 1.2 > ---- > -$id: http://devicetree.org/schemas/interconnect/qcom,qcs404.yaml# > -$schema: http://devicetree.org/meta-schemas/core.yaml# > - > -title: Qualcomm QCS404 Network-On-Chip interconnect > - > -maintainers: > - - Georgi Djakov <georgi.djakov@linaro.org> > - > -description: | > - The Qualcomm QCS404 interconnect providers support adjusting the > - bandwidth requirements between the various NoC fabrics. > - > -properties: > - reg: > - maxItems: 1 > - > - compatible: > - enum: > - - qcom,qcs404-bimc > - - qcom,qcs404-pcnoc > - - qcom,qcs404-snoc > - > - '#interconnect-cells': > - const: 1 > - > - clock-names: > - items: > - - const: bus > - - const: bus_a > - > - clocks: > - items: > - - description: Bus Clock > - - description: Bus A Clock > - > -required: > - - compatible > - - reg > - - '#interconnect-cells' > - - clock-names > - - clocks > - > -additionalProperties: false > - > -examples: > - - | > - #include <dt-bindings/clock/qcom,rpmcc.h> > - > - bimc: interconnect@400000 { > - reg = <0x00400000 0x80000>; > - compatible = "qcom,qcs404-bimc"; > - #interconnect-cells = <1>; > - clock-names = "bus", "bus_a"; > - clocks = <&rpmcc RPM_SMD_BIMC_CLK>, > - <&rpmcc RPM_SMD_BIMC_A_CLK>; > - }; > - > - pnoc: interconnect@500000 { > - reg = <0x00500000 0x15080>; > - compatible = "qcom,qcs404-pcnoc"; > - #interconnect-cells = <1>; > - clock-names = "bus", "bus_a"; > - clocks = <&rpmcc RPM_SMD_PNOC_CLK>, > - <&rpmcc RPM_SMD_PNOC_A_CLK>; > - }; > - > - snoc: interconnect@580000 { > - reg = <0x00580000 0x23080>; > - compatible = "qcom,qcs404-snoc"; > - #interconnect-cells = <1>; > - clock-names = "bus", "bus_a"; > - clocks = <&rpmcc RPM_SMD_SNOC_CLK>, > - <&rpmcc RPM_SMD_SNOC_A_CLK>; > - }; > diff --git a/Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml b/Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml > similarity index 76% > rename from Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml > rename to Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml > index e1009ae4e8f7..e9f856357822 100644 > --- a/Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml > +++ b/Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml > @@ -1,28 +1,32 @@ > # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > %YAML 1.2 > --- > -$id: http://devicetree.org/schemas/interconnect/qcom,msm8916.yaml# > +$id: http://devicetree.org/schemas/interconnect/qcom,rpm.yaml# > $schema: http://devicetree.org/meta-schemas/core.yaml# > > -title: Qualcomm MSM8916 Network-On-Chip interconnect > +title: Qualcomm RPM Network-On-Chip Interconnect > > maintainers: > - Georgi Djakov <georgi.djakov@linaro.org> > > description: | > - The Qualcomm MSM8916 interconnect providers support adjusting the > - bandwidth requirements between the various NoC fabrics. > + RPM interconnect providers support system bandwidth requirements through > + RPM processor. The provider is able to communicate with the RPM through > + the RPM shared memory device. And here the indentation is wrong too. > > properties: > - compatible: > - enum: > - - qcom,msm8916-bimc > - - qcom,msm8916-pcnoc > - - qcom,msm8916-snoc > - > reg: > maxItems: 1 > > + compatible: > + enum: > + - qcom,msm8916-bimc > + - qcom,msm8916-pcnoc > + - qcom,msm8916-snoc > + - qcom,qcs404-bimc > + - qcom,qcs404-pcnoc > + - qcom,qcs404-snoc > + > '#interconnect-cells': > const: 1 > > -- > 2.17.1 >
> > obj-$(CONFIG_INTERCONNECT_QCOM_SMD_RPM) += icc-smd-rpm.o > > +obj-$(CONFIG_INTERCONNECT_QCOM_SMD_RPM) += icc-smd-rpm.o > > Duplicate ? > > Thanks for msm8939 work, please Cc: me on any related patch :-) > > OK, will CC you on next version. This issue should be a typo in vim. Thanks for reminder. Regards, Jun
Hi Jun, Thanks for working on this. On 9/30/20 11:16, Jun Nie wrote: > Add RPM based interconnect driver implements the set and aggregate > functionalities that translates bandwidth requests into RPM messages. > These modules provide a common set of functionalities for all > Qualcomm RPM based interconnect providers and should help reduce code > duplication when adding new providers. > > Signed-off-by: Jun Nie <jun.nie@linaro.org> > --- > drivers/interconnect/qcom/Makefile | 3 +- > drivers/interconnect/qcom/icc-rpm.c | 194 ++++++++++++++++++++++ > drivers/interconnect/qcom/icc-rpm.h | 73 +++++++++ > drivers/interconnect/qcom/msm8916.c | 241 ++-------------------------- > 4 files changed, 279 insertions(+), 232 deletions(-) > create mode 100644 drivers/interconnect/qcom/icc-rpm.c > create mode 100644 drivers/interconnect/qcom/icc-rpm.h > > diff --git a/drivers/interconnect/qcom/Makefile b/drivers/interconnect/qcom/Makefile > index 1702ece67dc5..f5e803489de0 100644 > --- a/drivers/interconnect/qcom/Makefile > +++ b/drivers/interconnect/qcom/Makefile > @@ -9,7 +9,7 @@ icc-rpmh-obj := icc-rpmh.o > qnoc-sc7180-objs := sc7180.o > qnoc-sdm845-objs := sdm845.o > qnoc-sm8150-objs := sm8150.o > -icc-smd-rpm-objs := smd-rpm.o > +icc-smd-rpm-objs := smd-rpm.o icc-rpm.o > > obj-$(CONFIG_INTERCONNECT_QCOM_BCM_VOTER) += icc-bcm-voter.o > obj-$(CONFIG_INTERCONNECT_QCOM_MSM8916) += qnoc-msm8916.o > @@ -21,3 +21,4 @@ obj-$(CONFIG_INTERCONNECT_QCOM_SC7180) += qnoc-sc7180.o > obj-$(CONFIG_INTERCONNECT_QCOM_SDM845) += qnoc-sdm845.o > obj-$(CONFIG_INTERCONNECT_QCOM_SM8150) += qnoc-sm8150.o > obj-$(CONFIG_INTERCONNECT_QCOM_SMD_RPM) += icc-smd-rpm.o > +obj-$(CONFIG_INTERCONNECT_QCOM_SMD_RPM) += icc-smd-rpm.o Duplicate line. > diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c > new file mode 100644 > index 000000000000..4ddcb6cd4b84 > --- /dev/null > +++ b/drivers/interconnect/qcom/icc-rpm.c [..] > +int qnoc_probe(struct platform_device *pdev, size_t cd_size, int cd_num, > + const struct clk_bulk_data *cd) > +{ > + struct device *dev = &pdev->dev; > + const struct qcom_icc_desc *desc; > + struct icc_onecell_data *data; > + struct icc_provider *provider; > + struct qcom_icc_node **qnodes; > + struct qcom_icc_provider *qp; > + struct icc_node *node; > + size_t num_nodes, i; > + int ret; > + > + /* wait for the RPM proxy */ > + if (!qcom_icc_rpm_smd_available()) > + return -EPROBE_DEFER; > + > + desc = of_device_get_match_data(dev); > + if (!desc) > + return -EINVAL; > + > + qnodes = desc->nodes; > + num_nodes = desc->num_nodes; > + > + qp = devm_kzalloc(dev, sizeof(*qp), GFP_KERNEL); > + if (!qp) > + return -ENOMEM; > + > + data = devm_kzalloc(dev, struct_size(data, nodes, num_nodes), > + GFP_KERNEL); > + if (!data) > + return -ENOMEM; > + > + qp->bus_clks = devm_kmemdup(dev, cd, cd_size, > + GFP_KERNEL); > + if (!qp->bus_clks) > + return -ENOMEM; > + > + qp->num_clks = cd_num; > + ret = devm_clk_bulk_get(dev, qp->num_clks, qp->bus_clks); > + if (ret) > + return ret; > + > + ret = clk_bulk_prepare_enable(qp->num_clks, qp->bus_clks); > + if (ret) > + return ret; > + > + provider = &qp->provider; > + INIT_LIST_HEAD(&provider->nodes); > + provider->dev = dev; > + provider->set = qcom_icc_set; > + provider->aggregate = icc_std_aggregate; > + provider->xlate = of_icc_xlate_onecell; > + provider->data = data; > + > + ret = icc_provider_add(provider); > + if (ret) { > + dev_err(dev, "error adding interconnect provider: %d\n", ret); > + clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); > + return ret; > + } > + > + for (i = 0; i < num_nodes; i++) { > + size_t j; > + > + node = icc_node_create(qnodes[i]->id); > + if (IS_ERR(node)) { > + ret = PTR_ERR(node); > + goto err; > + } > + > + node->name = qnodes[i]->name; > + node->data = qnodes[i]; > + icc_node_add(node, provider); > + > + dev_dbg(dev, "registered node %s\n", node->name); Please drop this line. > + > + /* populate links */ Please drop this comment. > + for (j = 0; j < qnodes[i]->num_links; j++) > + icc_link_create(node, qnodes[i]->links[j]); > + > + data->nodes[i] = node; > + } > + data->num_nodes = num_nodes; > + > + platform_set_drvdata(pdev, qp); > + > + return 0; > +err: > + icc_nodes_remove(provider); > + clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); > + icc_provider_del(provider); > + > + return ret; > +} > +EXPORT_SYMBOL(qnoc_probe); > + > +int qnoc_remove(struct platform_device *pdev) > +{ > + struct qcom_icc_provider *qp = platform_get_drvdata(pdev); > + > + icc_nodes_remove(&qp->provider); > + clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks); > + return icc_provider_del(&qp->provider); > +} > +EXPORT_SYMBOL(qnoc_remove); > diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h > new file mode 100644 > index 000000000000..b75bb59d79b7 > --- /dev/null > +++ b/drivers/interconnect/qcom/icc-rpm.h > @@ -0,0 +1,73 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Copyright (C) 2020 Linaro Ltd > + */ > + > +#ifndef __DRIVERS_INTERCONNECT_QCOM_SMD_RPM_COMMON_H > +#define __DRIVERS_INTERCONNECT_QCOM_SMD_RPM_COMMON_H Would be nice if this matches with path and filename: __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H All the rest looks good. Thanks, Georgi
Georgi Djakov <georgi.djakov@linaro.org> 于2020年11月26日周四 下午8:20写道: > > On 9/30/20 11:16, Jun Nie wrote: > > This patch set split shared RPM based interconnect operation code and add > > support to MSM8939 interconnect. > > > > Hi Jun, > > Are you planning to refresh this patchset? Yes. Just come back from a long vocation. Thanks for reminder! Jun > > Thanks, > Georgi