Add SDM630/636/660 interconnect driver
Subsystems (3)
v4 cover Add SDM630/636/660 interconnect driver
From: AngeloGioacchino Del Regno <[email protected]>
This patch series adds the SDM660 interconnect provider driver in order to stop some timeouts and achieve some decent performance by avoiding to be NoC limited.
It's also providing some power consumption improvement, but I have only measured that as less heat, which is quite important when working on thermally constrained devices like smartphones.
Please note that this driver's yaml binding is referring to a MMCC clock, so this series does depend on the SDM660 MMCC driver that I have sent separately.
The multimedia clock is required only for the Multimedia NoC (mnoc).
This patch series has been tested against the following devices:
- Sony Xperia XA2 Ultra (SDM630 Nile Discovery)
- Sony Xperia 10 (SDM630 Ganges Kirin)
- Sony Xperia 10 Plus (SDM636 Ganges Mermaid)
Changes in v2:
- Added missing qcom,mmcc-sdm660.h dt-binding include in the interconnect/qcom,sdm660.yaml binding, as pointed out by Rob Herring
Changes in v3:
- Moved the dt-bindings/interconnect/qcom,sdm660.h header to dt-bindings commit.
Changes in v4:
- Fixed code style issues and removed unused defines as per Georgi Djakov's review
- Fixed the SDCC2 RPM master/slave IDs
- Added an exception to stop writing LIMITCMDS to M_BKE_HEALTH_3 as it doesn't exist there (it seems to be harmless to write that there, but it's incorrect to)
- Tested again on the aforementioned devices
AngeloGioacchino Del Regno (2):
dt-bindings: interconnect: Add bindings for Qualcomm SDM660 NoC
interconnect: qcom: Add SDM660 interconnect provider driver
.../bindings/interconnect/qcom,sdm660.yaml | 147 +++ drivers/interconnect/qcom/Kconfig | 9 + drivers/interconnect/qcom/Makefile | 2 + drivers/interconnect/qcom/sdm660.c | 922 ++++++++++++++++++ .../dt-bindings/interconnect/qcom,sdm660.h | 116 +++ 5 files changed, 1196 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sdm660.yaml create mode 100644 drivers/interconnect/qcom/sdm660.c create mode 100644 include/dt-bindings/interconnect/qcom,sdm660.h
Signature · 1 line
2.28.0
PATCH v4 1/2 dt-bindings: interconnect: Add bindings for Qualcomm SDM660 NoC
From: AngeloGioacchino Del Regno <[email protected]>
Add the bindings for the Qualcomm SDM660-class NoC, valid for SDM630, SDM636, SDM660 and SDA variants.
--- .../bindings/interconnect/qcom,sdm660.yaml | 147 ++++++++++++++++++ .../dt-bindings/interconnect/qcom,sdm660.h | 116 ++++++++++++++ 2 files changed, 263 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sdm660.yaml create mode 100644 include/dt-bindings/interconnect/qcom,sdm660.h
Documentation/devicetree/bindings/interconnect/qcom,sdm660.yaml new file +147 -0
@@ -0,0 +1,147 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/interconnect/qcom,sdm660.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm SDM660 Network-On-Chip interconnect + +maintainers: + - AngeloGioacchino Del Regno <[email protected]> + +description: | + The Qualcomm SDM660 interconnect providers support adjusting the + bandwidth requirements between the various NoC fabrics. + +properties: + reg: + maxItems: 1 + + compatible: + enum: + - qcom,sdm660-a2noc + - qcom,sdm660-bimc + - qcom,sdm660-cnoc + - qcom,sdm660-gnoc + - qcom,sdm660-mnoc + - qcom,sdm660-snoc + + '#interconnect-cells': + const: 1 + + clocks: + minItems: 1 + maxItems: 3 + + clock-names: + minItems: 1 + maxItems: 3 + +required: + - compatible + - reg + - '#interconnect-cells' + - clock-names + - clocks + +additionalProperties: false + +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,sdm660-mnoc + then: + properties: + clocks: + items: + - description: Bus Clock. + - description: Bus A Clock. + - description: CPU-NoC High-performance Bus Clock. + clock-names: + items: + - const: bus + - const: bus_a + - const: iface + + - if: + properties: + compatible: + contains: + enum: + - qcom,sdm660-a2noc + - qcom,sdm660-bimc + - qcom,sdm660-cnoc + - qcom,sdm660-gnoc + - qcom,sdm660-snoc + then: + properties: + clocks: + items: + - description: Bus Clock. + - description: Bus A Clock. + clock-names: + items: + - const: bus + - const: bus_a + +examples: + - | + #include <dt-bindings/clock/qcom,rpmcc.h> + #include <dt-bindings/clock/qcom,mmcc-sdm660.h> + + bimc: interconnect@1008000 { + compatible = "qcom,sdm660-bimc"; + reg = <0x01008000 0x78000>; + #interconnect-cells = <1>; + clock-names = "bus", "bus_a"; + clocks = <&rpmcc RPM_SMD_BIMC_CLK>, + <&rpmcc RPM_SMD_BIMC_A_CLK>; + }; + + cnoc: interconnect@1500000 { + compatible = "qcom,sdm660-cnoc"; + reg = <0x01500000 0x10000>; + #interconnect-cells = <1>; + clock-names = "bus", "bus_a"; + clocks = <&rpmcc RPM_SMD_CNOC_CLK>, + <&rpmcc RPM_SMD_CNOC_A_CLK>; + }; + + snoc: interconnect@1626000 { + compatible = "qcom,sdm660-snoc"; + reg = <0x01626000 0x7090>; + #interconnect-cells = <1>; + clock-names = "bus", "bus_a"; + clocks = <&rpmcc RPM_SMD_SNOC_CLK>, + <&rpmcc RPM_SMD_SNOC_A_CLK>; + }; + + a2noc: interconnect@1704000 { + compatible = "qcom,sdm660-a2noc"; + reg = <0x01704000 0xc100>; + #interconnect-cells = <1>; + clock-names = "bus", "bus_a"; + clocks = <&rpmcc RPM_SMD_AGGR2_NOC_CLK>, + <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>; + }; + + mnoc: interconnect@1745000 { + compatible = "qcom,sdm660-mnoc"; + reg = <0x01745000 0xa010>; + #interconnect-cells = <1>; + clock-names = "bus", "bus_a", "iface"; + clocks = <&rpmcc RPM_SMD_MMSSNOC_AXI_CLK>, + <&rpmcc RPM_SMD_MMSSNOC_AXI_CLK_A>, + <&mmcc AHB_CLK_SRC>; + }; + + gnoc: interconnect@17900000 { + compatible = "qcom,sdm660-gnoc"; + reg = <0x17900000 0xe000>; + #interconnect-cells = <1>; + clock-names = "bus", "bus_a"; + clocks = <&xo_board>, <&xo_board>; + };
include/dt-bindings/interconnect/qcom,sdm660.h new file +116 -0
116 lines not on this page · raw message
Signature · 1 line
2.28.0
Rob Herring
maintainerRe: [PATCH v4 1/2] dt-bindings: interconnect: Add bindings for Qualcomm SDM660 NoC
Quoted 5 lines · On Sat, 17 Oct 2020 15:37:17 +0200, [email protected] wrote:
From: AngeloGioacchino Del Regno <[email protected]>
Add the bindings for the Qualcomm SDM660-class NoC, valid for SDM630, SDM636, SDM660 and SDA variants.
Quoted 8 lines
Signed-off-by AngeloGioacchino Del Regno <[email protected]>--- .../bindings/interconnect/qcom,sdm660.yaml | 147 ++++++++++++++++++ .../dt-bindings/interconnect/qcom,sdm660.h | 116 ++++++++++++++ 2 files changed, 263 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sdm660.yaml create mode 100644 include/dt-bindings/interconnect/qcom,sdm660.h
My bot found errors running 'make dt_binding_check' on your patch:
Documentation/devicetree/bindings/interconnect/qcom,sdm660.example.dts:20:18: fatal error: dt-bindings/clock/qcom,mmcc-sdm660.h: No such file or directory
20 | #include <dt-bindings/clock/qcom,mmcc-sdm660.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.lib:342: Documentation/devicetree/bindings/interconnect/qcom,sdm660.example.dt.yaml] Error 1 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1366: dt_binding_check] Error 2
See https://patchwork.ozlabs.org/patch/1383662
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure dt-schema is up to date:
pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
Please check and re-submit.
Re: [PATCH v4 1/2] dt-bindings: interconnect: Add bindings for Qualcomm SDM660 NoC
In reply to [email protected]Quoted 5 lines · On Sat, 17 Oct 2020 15:37:17 +0200, [email protected] wrote:
From: AngeloGioacchino Del Regno <[email protected]>
Add the bindings for the Qualcomm SDM660-class NoC, valid for SDM630, SDM636, SDM660 and SDA variants.
Quoted 8 lines
Signed-off-by AngeloGioacchino Del Regno <[email protected]>--- .../bindings/interconnect/qcom,sdm660.yaml | 147 ++++++++++++++++++ .../dt-bindings/interconnect/qcom,sdm660.h | 116 ++++++++++++++ 2 files changed, 263 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sdm660.yaml create mode 100644 include/dt-bindings/interconnect/qcom,sdm660.h
Re: [PATCH v4 1/2] dt-bindings: interconnect: Add bindings for Qualcomm SDM660 NoC
Quoted 3 lines
Documentation/devicetree/bindings/interconnect/qcom,sdm660.example.dts:20:18: fatal error:dt-bindings/clock/qcom,mmcc-sdm660.h: No such file or directory
20 | #include <dt-bindings/clock/qcom,mmcc-sdm660.h>| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This patch depends on my MMCC patch (sent by angelo).
Rob Herring
maintainerRe: [PATCH v4 1/2] dt-bindings: interconnect: Add bindings for Qualcomm SDM660 NoC
Quoted 6 lines · Martin Botka
Quoted 4 lines
Documentation/devicetree/bindings/interconnect/qcom,sdm660.example.dts:20:18: fatal error:dt-bindings/clock/qcom,mmcc-sdm660.h: No such file or directory
20 | #include <dt-bindings/clock/qcom,mmcc-sdm660.h>| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This patch depends on my MMCC patch (sent by angelo).
Seems this landed in linux-next now and the dependency is not there. Revert, drop, or fix the dependency please.
Rob
Re: [PATCH v4 1/2] dt-bindings: interconnect: Add bindings for Qualcomm SDM660 NoC
Quoted 11 lines · Rob Herring
Quoted 6 lines · Martin Botka
Quoted 4 lines
Documentation/devicetree/bindings/interconnect/qcom,sdm660.example.dts:20:18: fatal error:dt-bindings/clock/qcom,mmcc-sdm660.h: No such file or directory
20 | #include <dt-bindings/clock/qcom,mmcc-sdm660.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This patch depends on my MMCC patch (sent by angelo).
Seems this landed in linux-next now and the dependency is not there. Revert, drop, or fix the dependency please.
Thanks Rob. I'll drop it for now.
BR,
Georgi
PATCH v4 2/2 interconnect: qcom: Add SDM660 interconnect provider driver
In reply to [email protected]From: AngeloGioacchino Del Regno <[email protected]>
Introduce a driver for the Qualcomm interconnect busses found in the SDM630/SDM636/SDM660 SoCs.
The topology consists of several NoCs that are controlled by a remote processor that collects the aggregated bandwidth for each master-slave pairs.
On a note, these chips are managing the "bus QoS" in a "hybrid"
fashion: some of the paths in the topology are managed through (and by, of course) the RPM uC, while some others are "AP Owned", meaning that the AP shall do direct writes to the appropriate QoS registers for the specific paths and ports, instead of sending an indication to the RPM and leaving the job to that one.
--- drivers/interconnect/qcom/Kconfig | 9 + drivers/interconnect/qcom/Makefile | 2 + drivers/interconnect/qcom/sdm660.c | 922 +++++++++++++++++++++++++++++ 3 files changed, 933 insertions(+) create mode 100644 drivers/interconnect/qcom/sdm660.c
drivers/interconnect/qcom/Kconfig +9 -0
@@ -42,6 +42,15 @@ config INTERCONNECT_QCOM_QCS404 This is a driver for the Qualcomm Network-on-Chip on qcs404-based platforms. +config INTERCONNECT_QCOM_SDM660 + tristate "Qualcomm SDM660 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 sdm660-based + platforms. + config INTERCONNECT_QCOM_RPMH tristate
drivers/interconnect/qcom/Makefile +2 -0
@@ -7,6 +7,7 @@ icc-osm-l3-objs := osm-l3.o qnoc-qcs404-objs := qcs404.o icc-rpmh-obj := icc-rpmh.o qnoc-sc7180-objs := sc7180.o +qnoc-sdm660-objs := sdm660.o qnoc-sdm845-objs := sdm845.o qnoc-sm8150-objs := sm8150.o qnoc-sm8250-objs := sm8250.o
@@ -19,6 +20,7 @@ obj-$(CONFIG_INTERCONNECT_QCOM_OSM_L3) += icc-osm-l3.o obj-$(CONFIG_INTERCONNECT_QCOM_QCS404) += qnoc-qcs404.o obj-$(CONFIG_INTERCONNECT_QCOM_RPMH) += icc-rpmh.o obj-$(CONFIG_INTERCONNECT_QCOM_SC7180) += qnoc-sc7180.o +obj-$(CONFIG_INTERCONNECT_QCOM_SDM660) += qnoc-sdm660.o obj-$(CONFIG_INTERCONNECT_QCOM_SDM845) += qnoc-sdm845.o obj-$(CONFIG_INTERCONNECT_QCOM_SM8150) += qnoc-sm8150.o obj-$(CONFIG_INTERCONNECT_QCOM_SM8250) += qnoc-sm8250.o
drivers/interconnect/qcom/sdm660.c new file +922 -0
922 lines not on this page · raw message
Signature · 1 line
2.28.0
Re: [PATCH v4 2/2] interconnect: qcom: Add SDM660 interconnect provider driver
Quoted 15 lines · On 10/17/20 16:37, [email protected] wrote:
From: AngeloGioacchino Del Regno <[email protected]>
Introduce a driver for the Qualcomm interconnect busses found in the SDM630/SDM636/SDM660 SoCs.
The topology consists of several NoCs that are controlled by a remote processor that collects the aggregated bandwidth for each master-slave pairs.On a note, these chips are managing the "bus QoS" in a "hybrid"
fashion: some of the paths in the topology are managed through (and by, of course) the RPM uC, while some others are "AP Owned", meaning that the AP shall do direct writes to the appropriate QoS registers for the specific paths and ports, instead of sending an indication to the RPM and leaving the job to that one.
Quoted 8 lines
Signed-off-by AngeloGioacchino Del Regno <[email protected]>--- drivers/interconnect/qcom/Kconfig | 9 + drivers/interconnect/qcom/Makefile | 2 + drivers/interconnect/qcom/sdm660.c | 922 +++++++++++++++++++++++++++++ 3 files changed, 933 insertions(+) create mode 100644 drivers/interconnect/qcom/sdm660.c
[..]> +static const struct of_device_id sdm660_noc_of_match[] = {
Quoted 6 lines
drivers/interconnect/qcom/sdm660.c new file +6
-0+ { .compatible = "qcom,sdm660-a2noc", .data = &sdm660_a2noc }, + { .compatible = "qcom,sdm660-bimc", .data = &sdm660_bimc }, + { .compatible = "qcom,sdm660-cnoc", .data = &sdm660_cnoc }, + { .compatible = "qcom,sdm660-gnoc", .data = &sdm660_gnoc }, + { .compatible = "qcom,sdm660-mnoc", .data = &sdm660_mnoc }, + { .compatible = "qcom,sdm660-snoc", .data = &sdm660_snoc },
drivers/interconnect/qcom/sdm660.c line 917
Quoted 10 lines
drivers/interconnect/qcom/sdm660.c new file +10
-0+ { }, +}; +MODULE_DEVICE_TABLE (of, sdm660_noc_of_match); + +static struct platform_driver sdm660_noc_driver = { + .probe = qnoc_probe, + .remove = qnoc_remove, + .driver = { + .name ="qnoc-sdm660" , + .of_match_table = sdm660_noc_of_match,
Just noticed that here we should set the sync_state callback:
.sync_state = icc_sync_state,
I will fix it up before applying. Are you planning to send a patch that adds the DT nodes?
Thanks,
Georgi
Quoted 5 lines
drivers/interconnect/qcom/sdm660.c new file +5
-0+ }, +}; +module_platform_driver (sdm660_noc_driver); +MODULE_DESCRIPTION ("Qualcomm sdm660 NoC driver" ); +MODULE_LICENSE ("GPL v2" );
Re: [PATCH v4 2/2] interconnect: qcom: Add SDM660 interconnect provider driver
Il giorno mar 3 nov 2020 alle ore 17:24 Georgi Djakov <[email protected]> ha scritto:
Quoted 46 lines · On 10/17/20 16:37, [email protected] wrote:
Quoted 15 lines
From: AngeloGioacchino Del Regno <[email protected]>
Introduce a driver for the Qualcomm interconnect busses found in the SDM630/SDM636/SDM660 SoCs.
The topology consists of several NoCs that are controlled by a remote processor that collects the aggregated bandwidth for each master-slave pairs.On a note, these chips are managing the "bus QoS" in a "hybrid"
fashion: some of the paths in the topology are managed through (and by, of course) the RPM uC, while some others are "AP Owned", meaning that the AP shall do direct writes to the appropriate QoS registers for the specific paths and ports, instead of sending an indication to the RPM and leaving the job to that one.Quoted 8 lines
Signed-off-by AngeloGioacchino Del Regno <[email protected]>--- drivers/interconnect/qcom/Kconfig | 9 + drivers/interconnect/qcom/Makefile | 2 + drivers/interconnect/qcom/sdm660.c | 922 +++++++++++++++++++++++++++++ 3 files changed, 933 insertions(+) create mode 100644 drivers/interconnect/qcom/sdm660.c[..]> +static const struct
of_device_idsdm660_noc_of_match[] = {Quoted 6 lines
drivers/interconnect/qcom/sdm660.c new file +6
-0+ { .compatible = "qcom,sdm660-a2noc", .data = &sdm660_a2noc }, + { .compatible = "qcom,sdm660-bimc", .data = &sdm660_bimc }, + { .compatible = "qcom,sdm660-cnoc", .data = &sdm660_cnoc }, + { .compatible = "qcom,sdm660-gnoc", .data = &sdm660_gnoc }, + { .compatible = "qcom,sdm660-mnoc", .data = &sdm660_mnoc }, + { .compatible = "qcom,sdm660-snoc", .data = &sdm660_snoc },drivers/interconnect/qcom/sdm660.c line 917
Quoted 10 lines
drivers/interconnect/qcom/sdm660.c new file +10
-0+ { }, +}; +MODULE_DEVICE_TABLE (of, sdm660_noc_of_match); + +static struct platform_driver sdm660_noc_driver = { + .probe = qnoc_probe, + .remove = qnoc_remove, + .driver = { + .name ="qnoc-sdm660" , + .of_match_table = sdm660_noc_of_match,Just noticed that here we should set the
sync_statecallback:
.sync_state =icc_sync_state,
Quoted 6 lines
I will fix it up before applying. Are you planning to send a patch that adds the DT nodes?
Thanks,
Georgi
I'm sorry for the extremely late reply... Anyway, yes, we have lots of patches that are bringing up almost the entire feature set in the SDM630/660 SoCs and we are waiting for them to get merged in before sending the DT updates.
Cheers,
Angelo
Quoted 5 lines
Quoted 5 lines
drivers/interconnect/qcom/sdm660.c new file +5
-0+ }, +}; +module_platform_driver (sdm660_noc_driver); +MODULE_DESCRIPTION ("Qualcomm sdm660 NoC driver" ); +MODULE_LICENSE ("GPL v2" );
Re: [PATCH v4 2/2] interconnect: qcom: Add SDM660 interconnect provider driver
MMCC got merged via the clk-next tree, so.. since this driver was technically in, say for the dt-bindings conflict.. can we get it merged again? :)
Konrad
Re: [PATCH v4 2/2] interconnect: qcom: Add SDM660 interconnect provider driver
Quoted 3 lines · Konrad Dybcio
MMCC got merged via the clk-next tree, so.. since this driver was technically in, say for the dt-bindings conflict.. can we get it merged again? :)
Thanks for the update! I'll take it for v5.13.
Cheers,
Georgi