interconnect: Add imx support via devfreq
Subsystems (4)
v3 cover interconnect: Add imx support via devfreq
This series adds interconnect scaling support for imx8m series chips. It uses a per-SOC interconnect provider layered on top of multiple instances of devfreq for scalable nodes along the interconnect.
Existing qcom interconnect providers mostly translate bandwidth requests into firmware calls but equivalent firmware on imx8m is much thinner. Scaling support for individual nodes is implemented as distinct devfreq drivers instead.
The imx interconnect provider doesn't communicate with devfreq directly but rather computes "minimum frequencies" for nodes along the path and creates dev_pm_qos requests.
Since there is no single devicetree node that can represent the "interconnect" the main NOC is picked as the "interconnect provider" and will probe the interconnect platform device if #interconnect-cells is present. This avoids introducing "virtual" devices but it means that DT bindings of main NOC includes properties for both devfreq and interconnect.
Only the ddrc and main noc are scalable right now but more can be added.
Also available on a github branch (with various unrelated changes):
https://github.com/cdleonard/linux/tree/next_leonard
Changes since v2:
* Fix unused variable in imx_bus_target
* Sort imx before qcom in interconnect makefile/kconfig
* Use icc_std_aggregate
* Adjust prints in imx interconnect core.
* Adjust included guarts for dt bindings
* Remove imx_icc_unregister warning when there are active users, should be handled inside core instead.
Changes since v1:
* Fix dt_bindings_check for yaml and reduce example to fit current features
* Fix comment spelling in imx-bus
* Drop mentions of passive governor from imx-bus (will repost later)
* Improve error message in imx_bus_init_icc
* Use dev_pm_opp_set_rate
Changes since RFCv6:
* Allow building interconnect drivers as modules
* Handle icc_provider_del errors in imx_icc_unregister (like EBUSY).
* Rename imx-devfreq to imx-bus, similar to exynos-bus
* Explain why imx bus clock enabling is not required
Changes since RFCv5:
* Replace scanning for interconnect-node-id with explicit scalable-nodes/scalable-node-ids property on NoC.
* Now passes make dtbs_check
* Remove struct imx_icc_provider
* Switch to of_icc_xlate_onecell
* Use of_find_device_by_node to fetch QoS target, this causes fewer probe deferrals, removes dependency on devfreq API and even allows reloading ddrc module at runtime
* Add imx_icc_node_destroy helper
* Remove 0/1 on DEFINE_BUS_SLAVE/MASTER which created spurious links
Changes since RFCv4:
* Drop icc proxy nonsense
* Make devfreq driver for NOC probe the ICC driver if #interconnect-cells is present
* Move NOC support to interconnect series and rename the node in DT
* Add support for all chips at once, differences are not intereseting and there is more community interest for 8mq than 8mm.
Changes since RFCv3:
* Remove the virtual "icc" node and add devfreq nodes as proxy providers
* Fix build on 32-bit arm (reported by kbuilt test robot)
* Remove ARCH_MXC_ARM64 (never existed in upstream)
* Remove _numlinks, calculate instead
* Replace __BUSFREQ_H header guard
* Improve commit message and comment spelling
* Fix checkpatch issues
Link to RFCv3: https://patchwork.kernel.org/cover/11078671/
Changes since RFCv2 and initial work by Alexandre Bailon:
* Relying on devfreq and dev_pm_qos instead of CLK
* No more "platform opp" stuff
* No more special suspend handling: use suspend-opp on devfreq instead
* Replace all mentions of "busfreq" with "interconnect" Link to v2: https://patchwork.kernel.org/cover/11021563/
Leonard Crestez (8):
dt-bindings: interconnect: Add bindings for imx8m noc PM / devfreq: Add generic imx bus scaling driver PM / devfreq: imx: Register interconnect device
interconnect: Add imx core driver
interconnect: imx: Add platform driver for imx8mm
interconnect: imx: Add platform driver for imx8mq
interconnect: imx: Add platform driver for imx8mn
arm64: dts: imx8m: Add NOC nodes
.../bindings/interconnect/fsl,imx8m-noc.yaml | 101 +++++++ arch/arm64/boot/dts/freescale/imx8mm.dtsi | 24 ++ arch/arm64/boot/dts/freescale/imx8mn.dtsi | 24 ++ arch/arm64/boot/dts/freescale/imx8mq.dtsi | 24 ++ drivers/devfreq/Kconfig | 8 + drivers/devfreq/Makefile | 1 + drivers/devfreq/imx-bus.c | 179 +++++++++++ drivers/interconnect/Kconfig | 1 + drivers/interconnect/Makefile | 1 + drivers/interconnect/imx/Kconfig | 17 ++ drivers/interconnect/imx/Makefile | 9 + drivers/interconnect/imx/imx.c | 284 ++++++++++++++++++ drivers/interconnect/imx/imx.h | 61 ++++ drivers/interconnect/imx/imx8mm.c | 105 +++++++ drivers/interconnect/imx/imx8mn.c | 94 ++++++ drivers/interconnect/imx/imx8mq.c | 103 +++++++ include/dt-bindings/interconnect/imx8mm.h | 50 +++ include/dt-bindings/interconnect/imx8mn.h | 41 +++ include/dt-bindings/interconnect/imx8mq.h | 48 +++ 19 files changed, 1175 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/fsl,imx8m-noc.yaml create mode 100644 drivers/devfreq/imx-bus.c create mode 100644 drivers/interconnect/imx/Kconfig create mode 100644 drivers/interconnect/imx/Makefile create mode 100644 drivers/interconnect/imx/imx.c create mode 100644 drivers/interconnect/imx/imx.h create mode 100644 drivers/interconnect/imx/imx8mm.c create mode 100644 drivers/interconnect/imx/imx8mn.c create mode 100644 drivers/interconnect/imx/imx8mq.c create mode 100644 include/dt-bindings/interconnect/imx8mm.h create mode 100644 include/dt-bindings/interconnect/imx8mn.h create mode 100644 include/dt-bindings/interconnect/imx8mq.h
Signature · 1 line
2.17.1
PATCH v3 1/8 dt-bindings: interconnect: Add bindings for imx8m noc
Add initial dt bindings for the interconnects inside i.MX chips. Multiple external IPs are involved but SOC integration means the software controllable interfaces are very similar.
Main NOC node acts as interconnect provider if #interconnect-cells is present. Currently there is a single imx interconnect provider for the whole SOC.
Other pieces of scalable interconnects can be present, each with their own OPP table.
--- .../bindings/interconnect/fsl,imx8m-noc.yaml | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/fsl,imx8m-noc.yaml
Documentation/devicetree/bindings/interconnect/fsl,imx8m-noc.yaml new file +101 -0
@@ -0,0 +1,101 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/interconnect/fsl,imx8m-noc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic i.MX bus frequency device + +maintainers: + - Leonard Crestez <[email protected]> + +description: | + The i.MX SoC family has multiple buses for which clock frequency (and + sometimes voltage) can be adjusted. + + Some of those buses expose register areas mentioned in the memory maps as GPV + ("Global Programmers View") but not all. Access to this area might be denied + for normal (non-secure) world. + + The buses are based on externally licensed IPs such as ARM NIC-301 and + Arteris FlexNOC but DT bindings are specific to the integration of these bus + interconnect IPs into imx SOCs. + +properties: + compatible: + oneOf: + - items: + - enum: + - fsl,imx8mn-nic + - fsl,imx8mm-nic + - fsl,imx8mq-nic + - const: fsl,imx8m-nic + - items: + - enum: + - fsl,imx8mn-noc + - fsl,imx8mm-noc + - fsl,imx8mq-noc + - const: fsl,imx8m-noc + - const: fsl,imx8m-nic + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + operating-points-v2: true + opp-table: true + + fsl,ddrc: + $ref: "/schemas/types.yaml#/definitions/phandle" + description: + Phandle to DDR Controller. + + '#interconnect-cells': + description: + If specified then also act as an interconnect provider. Should only be + set once per soc on the main noc. + const: 1 + +required: + - compatible + - clocks + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/imx8mm-clock.h> + #include <dt-bindings/interconnect/imx8mm.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + + noc: interconnect@32700000 { + compatible = "fsl,imx8mm-noc", "fsl,imx8m-noc"; + reg = <0x32700000 0x100000>; + clocks = <&clk IMX8MM_CLK_NOC>; + #interconnect-cells = <1>; + fsl,ddrc = <&ddrc>; + + operating-points-v2 = <&noc_opp_table>; + noc_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-133M { + opp-hz = /bits/ 64 <133333333>; + }; + opp-800M { + opp-hz = /bits/ 64 <800000000>; + }; + }; + }; + + ddrc: memory-controller@3d400000 { + compatible = "fsl,imx8mm-ddrc", "fsl,imx8m-ddrc"; + reg = <0x3d400000 0x400000>; + clock-names = "core", "pll", "alt", "apb"; + clocks = <&clk IMX8MM_CLK_DRAM_CORE>, + <&clk IMX8MM_DRAM_PLL>, + <&clk IMX8MM_CLK_DRAM_ALT>, + <&clk IMX8MM_CLK_DRAM_APB>; + };
Signature · 1 line
2.17.1
PATCH v3 3/8 PM / devfreq: imx: Register interconnect device
In reply to Leonard CrestezThere is no single device which can represent the imx interconnect. Instead of adding a virtual one just make the main &noc act as the global interconnect provider.
The imx interconnect provider driver will scale the NOC and DDRC based on bandwidth request. More scalable nodes can be added in the future, for example for audio/display/vpu/gpu NICs.
--- drivers/devfreq/imx-bus.c | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)
drivers/devfreq/imx-bus.c +41 -0
@@ -14,10 +14,11 @@struct imx_bus {struct devfreq_dev_profile profile;struct devfreq *devfreq;struct clk *clk; +struct platform_device *icc_pdev; };static int imx_bus_target (struct device *dev,unsigned long *freq,u32 flags) {
@@ -56,11 +57,44 @@ static int imx_bus_get_dev_status(struct device *dev,return 0 ; }static void imx_bus_exit (struct device *dev) { +struct imx_bus *priv =dev_get_drvdata (dev); +dev_pm_opp_of_remove_table (dev); +platform_device_unregister (priv->icc_pdev); +} + +/* imx_bus_init_icc() - register matching icc provider if required */ +static int imx_bus_init_icc (struct device *dev) +{ +struct imx_bus *priv =dev_get_drvdata (dev); +const char *icc_driver_name; + +if (!of_get_property (dev->of_node,"#interconnect-cells" ,0 )) +return 0 ; +if (!IS_ENABLED (CONFIG_INTERCONNECT_IMX )) { +dev_warn (dev,"imx interconnect drivers disabled\n" ); +return 0 ; + } + + icc_driver_name =of_device_get_match_data (dev); +if (!icc_driver_name) { +dev_err (dev,"unknown interconnect driver\n" ); +return 0 ; + } + + priv->icc_pdev =platform_device_register_data ( + dev, icc_driver_name,-1 ,NULL ,0 ); +if (IS_ERR (priv->icc_pdev)) { +dev_err (dev,"failed to register icc provider %s: %ld\n" , + icc_driver_name,PTR_ERR (priv->devfreq)); +return PTR_ERR (priv->devfreq); + } + +return 0 ; }static int imx_bus_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;
@@ -108,18 +142,25 @@ static int imx_bus_probe(struct platform_device *pdev) ret =PTR_ERR (priv->devfreq);dev_err (dev,"failed to add devfreq device: %d\n" , ret); goto err; } + ret =imx_bus_init_icc (dev); +if (ret) + goto err; +return 0 ; err:dev_pm_opp_of_remove_table (dev);return ret; }static const struct of_device_id imx_bus_of_match[] = { + { .compatible ="fsl,imx8mq-noc" , .data ="imx8mq-interconnect" , }, + { .compatible ="fsl,imx8mm-noc" , .data ="imx8mm-interconnect" , }, + { .compatible ="fsl,imx8mn-noc" , .data ="imx8mn-interconnect" , }, { .compatible ="fsl,imx8m-noc" , }, { .compatible ="fsl,imx8m-nic" , }, {/* sentinel */ }, };MODULE_DEVICE_TABLE (of, imx_bus_of_match);
Signature · 1 line
2.17.1
PATCH v3 4/8 interconnect: Add imx core driver
In reply to Leonard CrestezThis adds support for i.MX SoC family to interconnect framework.
Platform drivers can describe the interconnect graph and several adjustment knobs where icc node bandwidth is converted to a DEV_PM_QOS_MIN_FREQUENCY request.
The interconnect provider is probed through the main NOC device and other adjustable nodes on the same graph are found from a fsl,scalable-nodes phandle array property.
--- drivers/interconnect/Kconfig | 1 + drivers/interconnect/Makefile | 1 + drivers/interconnect/imx/Kconfig | 5 + drivers/interconnect/imx/Makefile | 3 + drivers/interconnect/imx/imx.c | 284 ++++++++++++++++++++++++++++++ drivers/interconnect/imx/imx.h | 61 +++++++ 6 files changed, 355 insertions(+) create mode 100644 drivers/interconnect/imx/Kconfig create mode 100644 drivers/interconnect/imx/Makefile create mode 100644 drivers/interconnect/imx/imx.c create mode 100644 drivers/interconnect/imx/imx.h
drivers/interconnect/Kconfig +1 -0
@@ -9,8 +9,9 @@ menuconfig INTERCONNECT If unsure, say no. if INTERCONNECT +source "drivers/interconnect/imx/Kconfig" source "drivers/interconnect/qcom/Kconfig" endif
drivers/interconnect/Makefile +1 -0
@@ -2,6 +2,7 @@ CFLAGS_core.o := -I$(src) icc-core-objs := core.o obj-$(CONFIG_INTERCONNECT) += icc-core.o +obj-$(CONFIG_INTERCONNECT_IMX) += imx/ obj-$(CONFIG_INTERCONNECT_QCOM) += qcom/
drivers/interconnect/imx/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config INTERCONNECT_IMX + tristate "i.MX interconnect drivers" + depends on ARCH_MXC || COMPILE_TEST + help + Generic interconnect drivers for i.MX SOCs
drivers/interconnect/imx/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +imx-interconnect-objs := imx.o + +obj-$(CONFIG_INTERCONNECT_IMX) += imx-interconnect.o
drivers/interconnect/imx/imx.c new file +284 -0
284 lines not on this page · raw message
drivers/interconnect/imx/imx.h new file +61 -0
61 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 5/8 interconnect: imx: Add platform driver for imx8mm
In reply to Leonard CrestezAdd a platform driver for the i.MX8MM SoC describing bus topology.
Bandwidth adjustments is currently only supported on the DDRC and main NOC. Scaling for the vpu/gpu/display NICs could be added in the future.
--- drivers/interconnect/imx/Kconfig | 4 + drivers/interconnect/imx/Makefile | 2 + drivers/interconnect/imx/imx8mm.c | 105 ++++++++++++++++++++++ include/dt-bindings/interconnect/imx8mm.h | 50 +++++++++++ 4 files changed, 161 insertions(+) create mode 100644 drivers/interconnect/imx/imx8mm.c create mode 100644 include/dt-bindings/interconnect/imx8mm.h
drivers/interconnect/imx/Kconfig +4 -0
@@ -1,5 +1,9 @@ config INTERCONNECT_IMX tristate "i.MX interconnect drivers" depends on ARCH_MXC || COMPILE_TEST help Generic interconnect drivers for i.MX SOCs + +config INTERCONNECT_IMX8MM + tristate "i.MX8MM interconnect driver" + depends on INTERCONNECT_IMX
drivers/interconnect/imx/Makefile +2 -0
@@ -1,3 +1,5 @@ imx-interconnect-objs := imx.o +imx8mm-interconnect-objs := imx8mm.o obj-$(CONFIG_INTERCONNECT_IMX) += imx-interconnect.o +obj-$(CONFIG_INTERCONNECT_IMX8MM) += imx8mm-interconnect.o
drivers/interconnect/imx/imx8mm.c new file +105 -0
105 lines not on this page · raw message
include/dt-bindings/interconnect/imx8mm.h new file +50 -0
50 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 6/8 interconnect: imx: Add platform driver for imx8mq
In reply to Leonard CrestezAdd a platform driver for the i.MX8MQ SoC describing bus topology, based on internal documentation.
--- drivers/interconnect/imx/Kconfig | 4 + drivers/interconnect/imx/Makefile | 2 + drivers/interconnect/imx/imx8mq.c | 103 ++++++++++++++++++++++ include/dt-bindings/interconnect/imx8mq.h | 48 ++++++++++ 4 files changed, 157 insertions(+) create mode 100644 drivers/interconnect/imx/imx8mq.c create mode 100644 include/dt-bindings/interconnect/imx8mq.h
drivers/interconnect/imx/Kconfig +4 -0
@@ -5,5 +5,9 @@ config INTERCONNECT_IMX Generic interconnect drivers for i.MX SOCs config INTERCONNECT_IMX8MM tristate "i.MX8MM interconnect driver" depends on INTERCONNECT_IMX + +config INTERCONNECT_IMX8MQ + tristate "i.MX8MQ interconnect driver" + depends on INTERCONNECT_IMX
drivers/interconnect/imx/Makefile +2 -0
@@ -1,5 +1,7 @@ imx-interconnect-objs := imx.o imx8mm-interconnect-objs := imx8mm.o +imx8mq-interconnect-objs := imx8mq.o obj-$(CONFIG_INTERCONNECT_IMX) += imx-interconnect.o obj-$(CONFIG_INTERCONNECT_IMX8MM) += imx8mm-interconnect.o +obj-$(CONFIG_INTERCONNECT_IMX8MQ) += imx8mq-interconnect.o
drivers/interconnect/imx/imx8mq.c new file +103 -0
103 lines not on this page · raw message
include/dt-bindings/interconnect/imx8mq.h new file +48 -0
48 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 8/8 arm64: dts: imx8m: Add NOC nodes
In reply to Leonard CrestezAdd nodes for the main interconnect of the imx8m series chips.
These nodes are bound to by devfreq and interconnect drivers.
--- arch/arm64/boot/dts/freescale/imx8mm.dtsi | 24 +++++++++++++++++++++++ arch/arm64/boot/dts/freescale/imx8mn.dtsi | 24 +++++++++++++++++++++++ arch/arm64/boot/dts/freescale/imx8mq.dtsi | 24 +++++++++++++++++++++++ 3 files changed, 72 insertions(+)
arch/arm64/boot/dts/freescale/imx8mm.dtsi +24 -0
@@ -6,10 +6,11 @@ #include <dt-bindings/clock/imx8mm-clock.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/thermal/thermal.h> +#include <dt-bindings/interconnect/imx8mm.h> #include "imx8mm-pinfunc.h" / { interrupt-parent = <&gic>;
@@ -860,10 +861,33 @@ status = "disabled"; }; }; + noc: interconnect@32700000 { + compatible = "fsl,imx8mm-noc", "fsl,imx8m-noc"; + reg = <0x32700000 0x100000>; + clocks = <&clk IMX8MM_CLK_NOC>; + fsl,ddrc = <&ddrc>; + #interconnect-cells = <1>; + operating-points-v2 = <&noc_opp_table>; + + noc_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-150M { + opp-hz = /bits/ 64 <150000000>; + }; + opp-375M { + opp-hz = /bits/ 64 <375000000>; + }; + opp-750M { + opp-hz = /bits/ 64 <750000000>; + }; + }; + }; + aips4: bus@32c00000 { compatible = "fsl,aips-bus", "simple-bus"; reg = <0x32df0000 0x10000>; #address-cells = <1>; #size-cells = <1>;
arch/arm64/boot/dts/freescale/imx8mn.dtsi +24 -0
@@ -6,10 +6,11 @@ #include <dt-bindings/clock/imx8mn-clock.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/thermal/thermal.h> +#include <dt-bindings/interconnect/imx8mn.h> #include "imx8mn-pinfunc.h" / { interrupt-parent = <&gic>;
@@ -751,10 +752,33 @@ status = "disabled"; }; }; + noc: interconnect@32700000 { + compatible = "fsl,imx8mn-noc", "fsl,imx8m-noc"; + reg = <0x32700000 0x100000>; + clocks = <&clk IMX8MN_CLK_NOC>; + fsl,ddrc = <&ddrc>; + #interconnect-cells = <1>; + operating-points-v2 = <&noc_opp_table>; + + noc_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-100M { + opp-hz = /bits/ 64 <100000000>; + }; + opp-600M { + opp-hz = /bits/ 64 <600000000>; + }; + opp-800M { + opp-hz = /bits/ 64 <800000000>; + }; + }; + }; + aips4: bus@32c00000 { compatible = "fsl,aips-bus", "simple-bus"; reg = <0x32df0000 0x10000>; #address-cells = <1>; #size-cells = <1>;
arch/arm64/boot/dts/freescale/imx8mq.dtsi +24 -0
@@ -9,10 +9,11 @@ #include <dt-bindings/reset/imx8mq-reset.h> #include <dt-bindings/gpio/gpio.h> #include "dt-bindings/input/input.h" #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/thermal/thermal.h> +#include <dt-bindings/interconnect/imx8mq.h> #include "imx8mq-pinfunc.h" / { interrupt-parent = <&gpc>;
@@ -1026,10 +1027,33 @@ fsl,num-rx-queues = <3>; status = "disabled"; }; }; + noc: interconnect@32700000 { + compatible = "fsl,imx8mq-noc", "fsl,imx8m-noc"; + reg = <0x32700000 0x100000>; + clocks = <&clk IMX8MQ_CLK_NOC>; + fsl,ddrc = <&ddrc>; + #interconnect-cells = <1>; + operating-points-v2 = <&noc_opp_table>; + + noc_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-133M { + opp-hz = /bits/ 64 <133333333>; + }; + opp-400M { + opp-hz = /bits/ 64 <400000000>; + }; + opp-800M { + opp-hz = /bits/ 64 <800000000>; + }; + }; + }; + bus@32c00000 { /* AIPS4 */ compatible = "fsl,aips-bus", "simple-bus"; reg = <0x32df0000 0x10000>; #address-cells = <1>; #size-cells = <1>;
Signature · 1 line
2.17.1
PATCH v3 7/8 interconnect: imx: Add platform driver for imx8mn
In reply to Leonard CrestezAdd a platform driver for the i.MX8MN SoC describing bus topology, based on internal documentation.
--- drivers/interconnect/imx/Kconfig | 4 + drivers/interconnect/imx/Makefile | 2 + drivers/interconnect/imx/imx8mn.c | 94 +++++++++++++++++++++++ include/dt-bindings/interconnect/imx8mn.h | 41 ++++++++++ 4 files changed, 141 insertions(+) create mode 100644 drivers/interconnect/imx/imx8mn.c create mode 100644 include/dt-bindings/interconnect/imx8mn.h
drivers/interconnect/imx/Kconfig +4 -0
@@ -6,8 +6,12 @@ config INTERCONNECT_IMX config INTERCONNECT_IMX8MM tristate "i.MX8MM interconnect driver" depends on INTERCONNECT_IMX +config INTERCONNECT_IMX8MN + tristate "i.MX8MN interconnect driver" + depends on INTERCONNECT_IMX + config INTERCONNECT_IMX8MQ tristate "i.MX8MQ interconnect driver" depends on INTERCONNECT_IMX
drivers/interconnect/imx/Makefile +2 -0
@@ -1,7 +1,9 @@ imx-interconnect-objs := imx.o imx8mm-interconnect-objs := imx8mm.o imx8mq-interconnect-objs := imx8mq.o +imx8mn-interconnect-objs := imx8mn.o obj-$(CONFIG_INTERCONNECT_IMX) += imx-interconnect.o obj-$(CONFIG_INTERCONNECT_IMX8MM) += imx8mm-interconnect.o obj-$(CONFIG_INTERCONNECT_IMX8MQ) += imx8mq-interconnect.o +obj-$(CONFIG_INTERCONNECT_IMX8MN) += imx8mn-interconnect.o
drivers/interconnect/imx/imx8mn.c new file +94 -0
94 lines not on this page · raw message
include/dt-bindings/interconnect/imx8mn.h new file +41 -0
41 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 2/8 PM / devfreq: Add generic imx bus scaling driver
In reply to Leonard CrestezAdd initial support for dynamic frequency switching on pieces of the imx interconnect fabric.
All this driver does is set a clk rate based on an opp table, it does not map register areas.
--- drivers/devfreq/Kconfig | 8 +++ drivers/devfreq/Makefile | 1 + drivers/devfreq/imx-bus.c | 138 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 drivers/devfreq/imx-bus.c
drivers/devfreq/Kconfig +8 -0
@@ -89,10 +89,18 @@ config ARM_EXYNOS_BUS_DEVFREQ Each memory bus group could contain many memoby bus block. It reads PPMU counters of memory controllers by using DEVFREQ-event device and adjusts the operating frequencies and voltages with OPP support. This does not yet operate with optimal voltages. +config ARM_IMX_BUS_DEVFREQ + tristate "i.MX Generic Bus DEVFREQ Driver" + depends on ARCH_MXC || COMPILE_TEST + select DEVFREQ_GOV_USERSPACE + help + This adds the generic DEVFREQ driver for i.MX interconnects. It + allows adjusting NIC/NOC frequency. + config ARM_IMX8M_DDRC_DEVFREQ tristate "i.MX8M DDRC DEVFREQ Driver" depends on (ARCH_MXC && HAVE_ARM_SMCCC) || \ (COMPILE_TEST && HAVE_ARM_SMCCC) select DEVFREQ_GOV_SIMPLE_ONDEMAND
drivers/devfreq/Makefile +1 -0
@@ -7,10 +7,11 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o obj-$(CONFIG_DEVFREQ_GOV_USERSPACE) += governor_userspace.o obj-$(CONFIG_DEVFREQ_GOV_PASSIVE) += governor_passive.o # DEVFREQ Drivers obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o +obj-$(CONFIG_ARM_IMX_BUS_DEVFREQ) += imx-bus.o obj-$(CONFIG_ARM_IMX8M_DDRC_DEVFREQ) += imx8m-ddrc.o obj-$(CONFIG_ARM_RK3399_DMC_DEVFREQ) += rk3399_dmc.o obj-$(CONFIG_ARM_TEGRA_DEVFREQ) += tegra30-devfreq.o obj-$(CONFIG_ARM_TEGRA20_DEVFREQ) += tegra20-devfreq.o
drivers/devfreq/imx-bus.c new file +138 -0
138 lines not on this page · raw message
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v3 2/8] PM / devfreq: Add generic imx bus scaling driver
Quoted 15 lines · Leonard Crestez
Add initial support for dynamic frequency switching on pieces of the imx interconnect fabric.
All this driver does is set a clk rate based on an opp table, it does not map register areas.
Signed-off-by Leonard Crestez <[email protected]>Tested-by Martin Kepplinger <[email protected]>--- drivers/devfreq/Kconfig | 8 +++ drivers/devfreq/Makefile | 1 + drivers/devfreq/imx-bus.c | 138 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 drivers/devfreq/imx-bus.c
(snip)
Signature · 3 lines
Best Regards, Chanwoo Choi Samsung Electronics
Re: [PATCH v3 8/8] arm64: dts: imx8m: Add NOC nodes
In reply to Leonard CrestezQuoted 152 lines · Leonard Crestez
Add nodes for the main interconnect of the imx8m series chips.
These nodes are bound to by devfreq and interconnect drivers.
Signed-off-by Leonard Crestez <[email protected]>--- arch/arm64/boot/dts/freescale/imx8mm.dtsi | 24 +++++++++++++++++++++++ arch/arm64/boot/dts/freescale/imx8mn.dtsi | 24 +++++++++++++++++++++++ arch/arm64/boot/dts/freescale/imx8mq.dtsi | 24 +++++++++++++++++++++++ 3 files changed, 72 insertions(+)arch/arm64/boot/dts/freescale/imx8mm.dtsi +24
-0@@ -6,10 +6,11 @@ #include <dt-bindings/clock/imx8mm-clock.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/thermal/thermal.h> +#include <dt-bindings/interconnect/imx8mm.h> #include "imx8mm-pinfunc.h" / { interrupt-parent = <&gic>;@@ -860,10 +861,33 @@ status = "disabled"; }; }; + noc: interconnect@32700000 { + compatible = "fsl,imx8mm-noc", "fsl,imx8m-noc"; + reg = <0x32700000 0x100000>; + clocks = <&clk IMX8MM_CLK_NOC>; + fsl,ddrc = <&ddrc>; + #interconnect-cells = <1>; + operating-points-v2 = <&noc_opp_table>; + + noc_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-150M { + opp-hz = /bits/ 64 <150000000>; + }; + opp-375M { + opp-hz = /bits/ 64 <375000000>; + }; + opp-750M { + opp-hz = /bits/ 64 <750000000>; + }; + }; + }; + aips4: bus@32c00000 { compatible = "fsl,aips-bus", "simple-bus"; reg = <0x32df0000 0x10000>; #address-cells = <1>; #size-cells = <1>;arch/arm64/boot/dts/freescale/imx8mn.dtsi +24
-0@@ -6,10 +6,11 @@ #include <dt-bindings/clock/imx8mn-clock.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/thermal/thermal.h> +#include <dt-bindings/interconnect/imx8mn.h> #include "imx8mn-pinfunc.h" / { interrupt-parent = <&gic>;@@ -751,10 +752,33 @@ status = "disabled"; }; }; + noc: interconnect@32700000 { + compatible = "fsl,imx8mn-noc", "fsl,imx8m-noc"; + reg = <0x32700000 0x100000>; + clocks = <&clk IMX8MN_CLK_NOC>; + fsl,ddrc = <&ddrc>; + #interconnect-cells = <1>; + operating-points-v2 = <&noc_opp_table>; + + noc_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-100M { + opp-hz = /bits/ 64 <100000000>; + }; + opp-600M { + opp-hz = /bits/ 64 <600000000>; + }; + opp-800M { + opp-hz = /bits/ 64 <800000000>; + }; + }; + }; + aips4: bus@32c00000 { compatible = "fsl,aips-bus", "simple-bus"; reg = <0x32df0000 0x10000>; #address-cells = <1>; #size-cells = <1>;arch/arm64/boot/dts/freescale/imx8mq.dtsi +19
-0@@ -9,10 +9,11 @@ #include <dt-bindings/reset/imx8mq-reset.h> #include <dt-bindings/gpio/gpio.h> #include "dt-bindings/input/input.h" #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/thermal/thermal.h> +#include <dt-bindings/interconnect/imx8mq.h> #include "imx8mq-pinfunc.h" / { interrupt-parent = <&gpc>;@@ -1026,10 +1027,33 @@ fsl,num-rx-queues = <3>; status = "disabled"; }; }; + noc: interconnect@32700000 { + compatible = "fsl,imx8mq-noc", "fsl,imx8m-noc"; + reg = <0x32700000 0x100000>; + clocks = <&clk IMX8MQ_CLK_NOC>; + fsl,ddrc = <&ddrc>; + #interconnect-cells = <1>; + operating-points-v2 = <&noc_opp_table>; + + noc_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-133M { + opp-hz = /bits/ 64 <133333333>; + }; + opp-400M { + opp-hz = /bits/ 64 <400000000>; + }; + opp-800M {
arch/arm64/boot/dts/freescale/imx8mq.dtsi line 1059
Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mq.dtsi +5
-0+ opp-hz = /bits/ 64 <800000000>; + }; + }; + }; + bus@32c00000 { /* AIPS4 */ compatible = "fsl,aips-bus", "simple-bus"; reg = <0x32df0000 0x10000>; #address-cells = <1>; #size-cells = <1>;
imx8mq:
martin
Re: [PATCH v3 1/8] dt-bindings: interconnect: Add bindings for imx8m noc
In reply to Leonard CrestezQuoted 8 lines · Leonard Crestez
Add initial dt bindings for the interconnects inside i.MX chips. Multiple external IPs are involved but SOC integration means the software controllable interfaces are very similar.
Main NOC node acts as interconnect provider if #interconnect-cells is present. Currently there is a single imx interconnect provider for the whole SOC.
Quoted 9 lines
Other pieces of scalable interconnects can be present, each with their own OPP table.
Signed-off-by Leonard Crestez <[email protected]>--- .../bindings/interconnect/fsl,imx8m-noc.yaml | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/fsl,imx8m-noc.yaml
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi,
Quoted 13 lines · Leonard Crestez
This series adds interconnect scaling support for imx8m series chips. It uses a per-SOC interconnect provider layered on top of multiple instances of devfreq for scalable nodes along the interconnect.
Existing qcom interconnect providers mostly translate bandwidth requests into firmware calls but equivalent firmware on imx8m is much thinner. Scaling support for individual nodes is implemented as distinct devfreq drivers instead.
The imx interconnect provider doesn't communicate with devfreq directly but rather computes "minimum frequencies" for nodes along the path and creates
dev_pm_qosrequests.
Quoted 6 lines
Since there is no single devicetree node that can represent the "interconnect" the main NOC is picked as the "interconnect provider" and will probe the interconnect platform device if #interconnect-cells is present. This avoids introducing "virtual" devices but it means that DT bindings of main NOC includes properties for both devfreq and interconnect.
Thank you for your work Leonard! There is no build dependency between the devfreq and interconnect patches, so i can apply patches 1,4-7.
Chanwoo, should i take also the two devfreq patches with your Ack?
Thanks,
Georgi
Chanwoo Choi
maintainerHi,
Quoted 23 lines · Georgi Djakov
Hi,
Quoted 13 lines · Leonard Crestez
This series adds interconnect scaling support for imx8m series chips. It uses a per-SOC interconnect provider layered on top of multiple instances of devfreq for scalable nodes along the interconnect.
Existing qcom interconnect providers mostly translate bandwidth requests into firmware calls but equivalent firmware on imx8m is much thinner. Scaling support for individual nodes is implemented as distinct devfreq drivers instead.
The imx interconnect provider doesn't communicate with devfreq directly but rather computes "minimum frequencies" for nodes along the path and creates
dev_pm_qosrequests.Quoted 6 lines
Since there is no single devicetree node that can represent the "interconnect" the main NOC is picked as the "interconnect provider" and will probe the interconnect platform device if #interconnect-cells is present. This avoids introducing "virtual" devices but it means that DT bindings of main NOC includes properties for both devfreq and interconnect.
Quoted 4 lines
Thank you for your work Leonard! There is no build dependency between the devfreq and interconnect patches, so i can apply patches 1,4-7.
Chanwoo, should i take also the two devfreq patches with your Ack?
As you commented, if there are no build dependency, I think it better to be merged to devfreq.git for the history.
I'll apply patch2,3 to devfreq git for v5.8-rc1.
Thanks.
Signature · 3 lines
Best Regards, Chanwoo Choi Samsung Electronics