Consolidate RPM interconnect and support to MSM8939
Subsystems (3)
cover Consolidate RPM interconnect and support to MSM8939
This patch set split shared RPM based interconnect operation code and add support to MSM8939 interconnect.
Jun Nie (5):
interconnect: qcom: Consolidate interconnect RPM support
interconnect: qcom: qcs404: use shared code
dt-bindings: interconnect: single yaml file for RPM interconnect
drivers
dt-bindings: interconnect: Add Qualcomm MSM8939 DT bindings
interconnect: qcom: Add MSM8939 interconnect provider driver
.../bindings/interconnect/qcom,qcs404.yaml | 77 ----
.../{qcom,msm8916.yaml => qcom,rpm.yaml} | 28 +-
drivers/interconnect/qcom/Kconfig | 9 +
drivers/interconnect/qcom/Makefile | 5 +-
drivers/interconnect/qcom/icc-rpm.c | 194 ++++++++++
drivers/interconnect/qcom/icc-rpm.h | 73 ++++
drivers/interconnect/qcom/msm8916.c | 241 +-----------
drivers/interconnect/qcom/msm8939.c | 355 ++++++++++++++++++
drivers/interconnect/qcom/qcs404.c | 242 +-----------
.../dt-bindings/interconnect/qcom,msm8939.h | 105 ++++++
10 files changed, 776 insertions(+), 553 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml
rename Documentation/devicetree/bindings/interconnect/{qcom,msm8916.yaml => qcom,rpm.yaml} (72%)
create mode 100644 drivers/interconnect/qcom/icc-rpm.c
create mode 100644 drivers/interconnect/qcom/icc-rpm.h
create mode 100644 drivers/interconnect/qcom/msm8939.c
create mode 100644 include/dt-bindings/interconnect/qcom,msm8939.hSignature · 1 line
2.17.1
PATCH 1/5 interconnect: qcom: Consolidate interconnect RPM support
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.
--- 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
drivers/interconnect/qcom/Makefile +2 -1
@@ -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
drivers/interconnect/qcom/icc-rpm.c new file +194 -0
194 lines not on this page · raw message
drivers/interconnect/qcom/icc-rpm.h new file +73 -0
73 lines not on this page · raw message
drivers/interconnect/qcom/msm8916.c +10 -231
302 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 2/5 interconnect: qcom: qcs404: use shared code
In reply to Jun NieUse shared code for aggregate functionalities and probe function to remove duplicated code.
--- drivers/interconnect/qcom/qcs404.c | 242 +---------------------------- 1 file changed, 8 insertions(+), 234 deletions(-)
drivers/interconnect/qcom/qcs404.c +8 -234
@@ -9,15 +9,12 @@#include <linux/interconnect-provider.h> #include <linux/io.h> #include <linux/module.h> -#include <linux/of_device.h> -#include <linux/of_platform.h> #include <linux/platform_device.h> -#include <linux/slab.h> +#include <linux/of_device.h> -#include "smd-rpm.h" -#define RPM_BUS_MASTER_REQ 0x73616d62 -#define RPM_BUS_SLAVE_REQ 0x766c7362 +#include "smd-rpm.h" +#include "icc-rpm.h" enum {QCS404_MASTER_AMPSS_M0 =1 ,
@@ -95,67 +92,11 @@ enum { QCS404_SLAVE_LPASS, }; -#define to_qcom_provider (_provider) \ - container_of(_provider, struct qcom_icc_provider, provider) - -static const struct clk_bulk_data bus_clocks[] = { +static const struct clk_bulk_data qcs404_bus_clocks[] = { { .id ="bus" }, { .id ="bus_a" }, }; -/** -* struct qcom_icc_provider - Qualcomm specific interconnect provider -* @provider: generic interconnect provider -* @bus_clks: the clk_bulk_data table of bus clocks -* @num_clks: the total number of clk_bulk_data entries -*/ -struct qcom_icc_provider { -struct icc_provider provider; -struct clk_bulk_data *bus_clks; -int num_clks; -}; - -#define QCS404_MAX_LINKS 12 - -/** -* struct qcom_icc_node - Qualcomm specific interconnect nodes -* @name: the node name used in debugfs -* @id: a unique node identifier -* @links: an array of nodes where we can go next while traversing -* @num_links: the total number of @links -* @buswidth: width of the interconnect between a node and the bus (bytes) -* @mas_rpm_id: RPM id for devices that are bus masters -* @slv_rpm_id: RPM id for devices that are bus slaves -* @rate: current bus clock rate in Hz -*/ -struct qcom_icc_node { -unsigned char *name; -u16 id; -u16 links[QCS404_MAX_LINKS ]; -u16 num_links; -u16 buswidth; -int mas_rpm_id; -int slv_rpm_id; -u64 rate; -}; - -struct qcom_icc_desc { -struct qcom_icc_node **nodes; -size_t num_nodes; -}; - -#define DEFINE_QNODE (_name, _id, _buswidth, _mas_rpm_id, _slv_rpm_id, \ - ...) \ - static struct qcom_icc_node _name = { \ - .name = #_name, \ - .id = _id, \ - .buswidth = _buswidth, \ - .mas_rpm_id = _mas_rpm_id, \ - .slv_rpm_id = _slv_rpm_id, \ - .num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })), \ - .links = { __VA_ARGS__ }, \ - } -DEFINE_QNODE (mas_apps_proc,QCS404_MASTER_AMPSS_M0 ,8 ,0 ,-1 ,QCS404_SLAVE_EBI_CH0 ,QCS404_BIMC_SNOC_SLV );DEFINE_QNODE (mas_oxili,QCS404_MASTER_GRAPHICS_3D ,8 ,6 ,-1 ,QCS404_SLAVE_EBI_CH0 ,QCS404_BIMC_SNOC_SLV );DEFINE_QNODE (mas_mdp,QCS404_MASTER_MDP_PORT0 ,8 ,8 ,-1 ,QCS404_SLAVE_EBI_CH0 ,QCS404_BIMC_SNOC_SLV );
@@ -327,178 +268,11 @@ static struct qcom_icc_desc qcs404_snoc = { .num_nodes = ARRAY_SIZE(qcs404_snoc_nodes), }; -static int qcom_icc_set (struct icc_node *src,struct icc_node *dst) -{ -struct qcom_icc_provider *qp; -struct qcom_icc_node *qn; -struct icc_provider *provider; -struct icc_node *n; -u64 sum_bw; -u64 max_peak_bw; -u64 rate; -u32 agg_avg =0 ; -u32 agg_peak =0 ; -int ret, i; - - qn = src->data; - provider = src->provider; - qp =to_qcom_provider (provider); - -list_for_each_entry (n, &provider->nodes, node_list) - provider->aggregate (n,0 , n->avg_bw, n->peak_bw, - &agg_avg, &agg_peak); - - sum_bw =icc_units_to_bps (agg_avg); - max_peak_bw =icc_units_to_bps (agg_peak); - -/* send bandwidth request message to the RPM processor */ -if (qn->mas_rpm_id !=-1 ) { - ret =qcom_icc_rpm_smd_send (QCOM_SMD_RPM_ACTIVE_STATE , -RPM_BUS_MASTER_REQ , - qn->mas_rpm_id, - sum_bw); -if (ret) { -pr_err ("qcom_icc_rpm_smd_send mas %d error %d\n" , - qn->mas_rpm_id, ret); -return ret; - } - } - -if (qn->slv_rpm_id !=-1 ) { - ret =qcom_icc_rpm_smd_send (QCOM_SMD_RPM_ACTIVE_STATE , -RPM_BUS_SLAVE_REQ , - qn->slv_rpm_id, - sum_bw); -if (ret) { -pr_err ("qcom_icc_rpm_smd_send slv error %d\n" , - ret); -return ret; - } - } - - rate =max (sum_bw, max_peak_bw); - -do_div (rate, qn->buswidth); - -if (qn->rate == rate) -return 0 ; - -for (i =0 ; i < qp->num_clks; i++) { - ret =clk_set_rate (qp->bus_clks[i].clk, rate); -if (ret) { -pr_err ("%s clk_set_rate error: %d\n" , - qp->bus_clks[i].id, ret); -return ret; - } - } - - qn->rate = rate; -return 0 ; -} - -static int qnoc_probe (struct platform_device *pdev) +static int qcs404_qnoc_probe (struct platform_device *pdev) { -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, bus_clocks,sizeof (bus_clocks), -GFP_KERNEL ); -if (!qp->bus_clks) -return -ENOMEM ; - - qp->num_clks =ARRAY_SIZE (bus_clocks); - 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); - -/* populate links */ -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; -} - -static 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); +return qnoc_probe (pdev,sizeof (qcs404_bus_clocks), +ARRAY_SIZE (qcs404_bus_clocks), qcs404_bus_clocks); }static const struct of_device_id qcs404_noc_of_match[] = {
@@ -510,7 +284,7 @@ static const struct of_device_id qcs404_noc_of_match[] = {MODULE_DEVICE_TABLE (of, qcs404_noc_of_match);static struct platform_driver qcs404_noc_driver = { - .probe = qnoc_probe, + .probe = qcs404_qnoc_probe, .remove = qnoc_remove, .driver = { .name ="qnoc-qcs404" ,
Signature · 1 line
2.17.1
PATCH 3/5 dt-bindings: interconnect: single yaml file for RPM interconnect drivers
In reply to Jun NieMSM8916 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.
---
.../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%)Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml deleted +0 -77
@@ -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 <[email protected]> - -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>; - };
Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml renamed from Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml +14 -10
@@ -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 <[email protected]> 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: + - qcom,msm8916-bimc + - qcom,msm8916-pcnoc + - qcom,msm8916-snoc + - qcom,qcs404-bimc + - qcom,qcs404-pcnoc + - qcom,qcs404-snoc + '#interconnect-cells': const: 1
Signature · 1 line
2.17.1
PATCH 4/5 dt-bindings: interconnect: Add Qualcomm MSM8939 DT bindings
In reply to Jun NieThe Qualcomm MSM8939 platform has several bus fabrics that could be controlled and tuned dynamically according to the bandwidth demand.
--- .../bindings/interconnect/qcom,rpm.yaml | 4 + .../dt-bindings/interconnect/qcom,msm8939.h | 105 ++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 include/dt-bindings/interconnect/qcom,msm8939.h
Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml +4 -0
@@ -23,6 +23,10 @@ properties: - qcom,msm8916-bimc - qcom,msm8916-pcnoc - qcom,msm8916-snoc + - qcom,msm8939-bimc + - qcom,msm8939-pcnoc + - qcom,msm8939-snoc + - qcom,msm8939-snoc-mm - qcom,qcs404-bimc - qcom,qcs404-pcnoc - qcom,qcs404-snoc
include/dt-bindings/interconnect/qcom,msm8939.h new file +105 -0
105 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 5/5 interconnect: qcom: Add MSM8939 interconnect provider driver
In reply to Jun NieAdd driver for the Qualcomm interconnect buses found in MSM8939 based platforms. The topology consists of four NoCs that are controlled by a remote processor that collects the aggregated bandwidth for each master-slave pairs.
--- drivers/interconnect/qcom/Kconfig | 9 + drivers/interconnect/qcom/Makefile | 2 + drivers/interconnect/qcom/msm8939.c | 355 ++++++++++++++++++++++++++++ 3 files changed, 366 insertions(+) create mode 100644 drivers/interconnect/qcom/msm8939.c
drivers/interconnect/qcom/Kconfig +9 -0
@@ -17,6 +17,15 @@ config INTERCONNECT_QCOM_MSM8916 This is a driver for the Qualcomm Network-on-Chip on msm8916-based platforms. +config INTERCONNECT_QCOM_MSM8939 + tristate "Qualcomm MSM8939 interconnect driver" + depends on INTERCONNECT_QCOM + depends on QCOM_SMD_RPM + select INTERCONNECT_QCOM_SMD_RPM + help + This is a driver for the Qualcomm Network-on-Chip on msm8939-based + platforms. + config INTERCONNECT_QCOM_MSM8974 tristate "Qualcomm MSM8974 interconnect driver" depends on INTERCONNECT_QCOM
drivers/interconnect/qcom/Makefile +2 -0
@@ -2,6 +2,7 @@ icc-bcm-voter-objs := bcm-voter.o qnoc-msm8916-objs := msm8916.o +qnoc-msm8939-objs := msm8939.o qnoc-msm8974-objs := msm8974.o icc-osm-l3-objs := osm-l3.o qnoc-qcs404-objs := qcs404.o
@@ -13,6 +14,7 @@ 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 +obj-$(CONFIG_INTERCONNECT_QCOM_MSM8939) += qnoc-msm8939.o obj-$(CONFIG_INTERCONNECT_QCOM_MSM8974) += qnoc-msm8974.o obj-$(CONFIG_INTERCONNECT_QCOM_OSM_L3) += icc-osm-l3.o obj-$(CONFIG_INTERCONNECT_QCOM_QCS404) += qnoc-qcs404.o
drivers/interconnect/qcom/msm8939.c new file +355 -0
355 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [PATCH 1/5] interconnect: qcom: Consolidate interconnect RPM support
In reply to Jun NieQuoted 31 lines · Jun Nie
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 <[email protected]>--- 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.hdrivers/interconnect/qcom/Makefile +1
-1@@ -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
drivers/interconnect/qcom/Makefile obj-$(CONFIG_INTERCONNECT_QCOM_SC7180) += qnoc-sc7180.o · line 24
Quoted 4 lines
drivers/interconnect/qcom/Makefile +1
-0@@ -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 :-)
Re: [PATCH 3/5] dt-bindings: interconnect: single yaml file for RPM interconnect drivers
In reply to Jun NieQuoted 124 lines · Jun Nie
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 <[email protected]>--- .../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%)Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml deleted +0
-77@@ -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 <[email protected]> - -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>; - };Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml renamed from Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml +5
-5@@ -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 <[email protected]> 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:
Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml renamed from Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml +2
-5- enum: - - qcom,msm8916-bimc - - qcom,msm8916-pcnoc - - qcom,msm8916-snoc - reg: maxItems: 1 + compatible: + enum:
Wrong indentation...
With that fixed,
Quoted 13 lines
Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml renamed from Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml +7
-0+ - qcom,msm8916-bimc + - qcom,msm8916-pcnoc + - qcom,msm8916-snoc + - qcom,qcs404-bimc + - qcom,qcs404-pcnoc + - qcom,qcs404-snoc + '#interconnect-cells': const: 1Signature · 1 line
2.17.1
Rob Herring
maintainerRe: [PATCH 3/5] dt-bindings: interconnect: single yaml file for RPM interconnect drivers
In reply to Jun NieQuoted 111 lines · Jun Nie
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 <[email protected]>--- .../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%)Documentation/devicetree/bindings/interconnect/qcom,qcs404.yaml deleted +0
-77@@ -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 <[email protected]> - -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>; - };Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml renamed from Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml +2
-2@@ -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
Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml line 15
Quoted 10 lines
Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml renamed from Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml +3
-2maintainers: - Georgi Djakov <[email protected]> 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.
Quoted 26 lines
Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml renamed from Documentation/devicetree/bindings/interconnect/qcom,msm8916.yaml +9
-6properties: - 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: 1Signature · 1 line
2.17.1
Re: [PATCH 4/5] dt-bindings: interconnect: Add Qualcomm MSM8939 DT bindings
In reply to Jun NieQuoted 10 lines · Jun Nie
The Qualcomm MSM8939 platform has several bus fabrics that could be controlled and tuned dynamically according to the bandwidth demand.
Signed-off-by Jun Nie <[email protected]>--- .../bindings/interconnect/qcom,rpm.yaml | 4 + .../dt-bindings/interconnect/qcom,msm8939.h | 105 ++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 include/dt-bindings/interconnect/qcom,msm8939.h
Re: [PATCH 1/5] interconnect: qcom: Consolidate interconnect RPM support
In reply to Vincent KnechtQuoted 8 lines
Quoted 2 lines
obj-$(CONFIG_INTERCONNECT_QCOM_SMD_RPM) += icc-smd-rpm.o
+obj-$(CONFIG_INTERCONNECT_QCOM_SMD_RPM) += icc-smd-rpm.oDuplicate ?
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
Re: [PATCH 1/5] interconnect: qcom: Consolidate interconnect RPM support
In reply to Jun NieHi Jun,
Thanks for working on this.
Quoted 30 lines · Jun Nie
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 <[email protected]>--- 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.hdrivers/interconnect/qcom/Makefile +1
-1@@ -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
drivers/interconnect/qcom/Makefile obj-$(CONFIG_INTERCONNECT_QCOM_SC7180) += qnoc-sc7180.o · line 24
Quoted 4 lines
drivers/interconnect/qcom/Makefile +1
-0@@ -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.
Quoted 5 lines
drivers/interconnect/qcom/icc-rpm.c new file +0
-0
[..]
Quoted 66 lines
drivers/interconnect/qcom/icc-rpm.c new file +66
-0+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);
drivers/interconnect/qcom/icc-rpm.c line 164
Quoted 10 lines
drivers/interconnect/qcom/icc-rpm.c new file +10
-0+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.
drivers/interconnect/qcom/icc-rpm.c
Quoted 2 lines
drivers/interconnect/qcom/icc-rpm.c new file +2
-0+ +/* populate links */
Please drop this comment.
Quoted 34 lines
drivers/interconnect/qcom/icc-rpm.c new file +28
-0+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);drivers/interconnect/qcom/icc-rpm.h new file +0
-0
drivers/interconnect/qcom/icc-rpm.h line 7
Quoted 7 lines
drivers/interconnect/qcom/icc-rpm.h new file +7
-0@@ -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
Re: [PATCH 5/5] interconnect: qcom: Add MSM8939 interconnect provider driver
In reply to Jun NieQuoted 63 lines · Jun Nie
Add driver for the Qualcomm interconnect buses found in MSM8939 based platforms. The topology consists of four NoCs that are controlled by a remote processor that collects the aggregated bandwidth for each master-slave pairs.
Signed-off-by Jun Nie <[email protected]>--- drivers/interconnect/qcom/Kconfig | 9 + drivers/interconnect/qcom/Makefile | 2 + drivers/interconnect/qcom/msm8939.c | 355 ++++++++++++++++++++++++++++ 3 files changed, 366 insertions(+) create mode 100644 drivers/interconnect/qcom/msm8939.cdrivers/interconnect/qcom/Kconfig +9
-0@@ -17,6 +17,15 @@ config INTERCONNECT_QCOM_MSM8916 This is a driver for the Qualcomm Network-on-Chip on msm8916-based platforms. +config INTERCONNECT_QCOM_MSM8939 + tristate "Qualcomm MSM8939 interconnect driver" + depends on INTERCONNECT_QCOM + depends on QCOM_SMD_RPM + select INTERCONNECT_QCOM_SMD_RPM + help + This is a driver for the Qualcomm Network-on-Chip on msm8939-based + platforms. + config INTERCONNECT_QCOM_MSM8974 tristate "Qualcomm MSM8974 interconnect driver" depends on INTERCONNECT_QCOMdrivers/interconnect/qcom/Makefile +2
-0@@ -2,6 +2,7 @@ icc-bcm-voter-objs := bcm-voter.o qnoc-msm8916-objs := msm8916.o +qnoc-msm8939-objs := msm8939.o qnoc-msm8974-objs := msm8974.o icc-osm-l3-objs := osm-l3.o qnoc-qcs404-objs := qcs404.o@@ -13,6 +14,7 @@ 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 +obj-$(CONFIG_INTERCONNECT_QCOM_MSM8939) += qnoc-msm8939.o obj-$(CONFIG_INTERCONNECT_QCOM_MSM8974) += qnoc-msm8974.o obj-$(CONFIG_INTERCONNECT_QCOM_OSM_L3) += icc-osm-l3.o obj-$(CONFIG_INTERCONNECT_QCOM_QCS404) += qnoc-qcs404.odrivers/interconnect/qcom/msm8939.c new file +4
-0@@ -0,0 +1,355 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (C) 2020 Linaro Ltd +* Author: Jun Nie <[email protected]>
drivers/interconnect/qcom/msm8939.c line 14
Quoted 10 lines
drivers/interconnect/qcom/msm8939.c new file +10
-0+* With reference of msm8916 interconnect driver of Georgi Djakov. +*/ + +#include <linux/clk.h> +#include <linux/device.h> +#include <linux/interconnect-provider.h> +#include <linux/io.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/of_device.h>
Nit: Move this above platform_device.h to make it sorted.
Quoted 6 lines
drivers/interconnect/qcom/msm8939.c new file +6
-0+ +#include <dt-bindings/interconnect/qcom,msm8939.h> + +#include "smd-rpm.h" +#include "icc-rpm.h" +
[..]
Quoted 5 lines
drivers/interconnect/qcom/msm8939.c new file +5
-0+static const struct of_device_id msm8939_noc_of_match[] = { + { .compatible ="qcom,msm8939-bimc" , .data = &msm8939_bimc }, + { .compatible ="qcom,msm8939-pcnoc" , .data = &msm8939_pcnoc }, + { .compatible ="qcom,msm8939-snoc" , .data = &msm8939_snoc }, + { .compatible ="qcom,msm8939-snoc-mm" , .data = &msm8939_snoc_mm },
drivers/interconnect/qcom/msm8939.c line 349
Quoted 10 lines
drivers/interconnect/qcom/msm8939.c new file +10
-0+ { } +}; +MODULE_DEVICE_TABLE (of, msm8939_noc_of_match); + +static struct platform_driver msm8939_noc_driver = { + .probe = msm8939_qnoc_probe, + .remove = qnoc_remove, + .driver = { + .name ="qnoc-msm8939" , + .of_match_table = msm8939_noc_of_match,
The sync_state patches got merged, so please add this:
.sync_state = icc_sync_state,
Thanks,
Georgi
Quoted 7 lines
drivers/interconnect/qcom/msm8939.c new file +6
-0+ }, +}; +module_platform_driver (msm8939_noc_driver); +MODULE_AUTHOR ("Jun Nie <[email protected]>" ); +MODULE_DESCRIPTION ("Qualcomm MSM8939 NoC driver" ); +MODULE_LICENSE ("GPL v2" );
Quoted 3 lines · Jun Nie
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?
Thanks,
Georgi
Quoted 9 lines · Georgi Djakov <[email protected]> 于2020年11月26日周四 下午8:20写道:
Quoted 3 lines · Jun Nie
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
Quoted 3 lines
Thanks,
Georgi