PM / devfreq: Add initial imx support
Subsystems (5)
cover PM / devfreq: Add initial imx support
This adds devfreq support for imx8mm, covering dynamic scaling of internal NOC and DDR Controller
Scaling for simple busses (NIC/NOC) is done through the clk framework while DRAM scaling is performed in firmware with an "imx-ddrc" wrapper for devfreq.
Changes since RFCv3:
* Implement passive support and set NOC parent to DDRC
* Drop scaling AHB/AXI for now (NOC/DDRC use most power anyway)
* Split into two devreq drivers (and bindings) because the ddrc is
really a distinct piece of hardware.
* Stop relying on clk_min_rate
* Fetch info about dram clk parents from firmware instead of
hardcoding in driver. This can more easily support additional rates.
* Perform DRAM frequency inside devfreq instead of clk, mostly due to
objections to earlier RFCs for "imx8m-dram-clk"
* Link: https://patchwork.kernel.org/cover/11056779/
* Link: https://patchwork.kernel.org/patch/11049429/
Stephen: It would be very helpful if you could comment on the dram frequency switching code. I moved it outside of clk but now I have to use provider APIs outside of drivers/clk for parent manipulation. Few other drivers do that so maybe it's OK?
Scaling buses can cause problems for devices with realtime bandwith requirements such as display, the intention is to use the interconnect framework to make DEV_PM_QOS_MIN_FREQUENCY to devfreq. There are separate patches for that:
* https://patchwork.kernel.org/patch/11084279/
* https://patchwork.kernel.org/cover/11078671/
Leonard Crestez (7):
clk: imx8m: Set CLK_GET_RATE_NOCACHE on dram_alt/apb
dt-bindings: devfreq: Add bindings for generic imx buses PM / devfreq: Add generic imx bus driver
dt-bindings: devfreq: Add bindings for imx ddr controller PM / devfreq: Add dynamic scaling for imx ddr controller PM / devfreq: imx-ddrc: Measure bandwidth with perf
arm64: dts: imx8mm: Add devfreq nodes
.../devicetree/bindings/devfreq/imx-ddrc.yaml | 53 ++ .../devicetree/bindings/devfreq/imx.yaml | 50 ++ arch/arm64/boot/dts/freescale/imx8mm.dtsi | 51 +- drivers/clk/imx/clk-imx8mm.c | 6 +- drivers/clk/imx/clk-imx8mn.c | 6 +- drivers/clk/imx/clk-imx8mq.c | 7 +- drivers/devfreq/Kconfig | 12 + drivers/devfreq/Makefile | 1 + drivers/devfreq/imx-ddrc.c | 511 ++++++++++++++++++ drivers/devfreq/imx-devfreq.c | 148 +++++ 10 files changed, 837 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml create mode 100644 Documentation/devicetree/bindings/devfreq/imx.yaml create mode 100644 drivers/devfreq/imx-ddrc.c create mode 100644 drivers/devfreq/imx-devfreq.c
Signature · 1 line
2.17.1
PATCH 1/7 clk: imx8m: Set CLK_GET_RATE_NOCACHE on dram_alt/apb
Dram frequency changes required modifying these clocks outside the control of clk framework. Mark them as CLK_GET_RATE_NOCACHE so that rates are always read back from registers.
--- drivers/clk/imx/clk-imx8mm.c | 6 ++++-- drivers/clk/imx/clk-imx8mn.c | 6 ++++-- drivers/clk/imx/clk-imx8mq.c | 7 ++++--- 3 files changed, 12 insertions(+), 7 deletions(-)
drivers/clk/imx/clk-imx8mm.c +4 -2
@@ -526,12 +526,14 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)/* IPG */ clks[IMX8MM_CLK_IPG_ROOT ] =imx_clk_divider2 ("ipg_root" ,"ahb" , base +0x9080 ,0 ,1 ); clks[IMX8MM_CLK_IPG_AUDIO_ROOT ] =imx_clk_divider2 ("ipg_audio_root" ,"audio_ahb" , base +0x9180 ,0 ,1 );/* IP */ - clks[IMX8MM_CLK_DRAM_ALT ] =imx8m_clk_composite ("dram_alt" , imx8mm_dram_alt_sels, base +0xa000 ); - clks[IMX8MM_CLK_DRAM_APB ] =imx8m_clk_composite_critical ("dram_apb" , imx8mm_dram_apb_sels, base +0xa080 ); + clks[IMX8MM_CLK_DRAM_ALT ] =__imx8m_clk_composite ("dram_alt" , imx8mm_dram_alt_sels, base +0xa000 , +CLK_GET_RATE_NOCACHE ); + clks[IMX8MM_CLK_DRAM_APB ] =__imx8m_clk_composite ("dram_apb" , imx8mm_dram_apb_sels, base +0xa080 , +CLK_IS_CRITICAL |CLK_GET_RATE_NOCACHE ); clks[IMX8MM_CLK_VPU_G1 ] =imx8m_clk_composite ("vpu_g1" , imx8mm_vpu_g1_sels, base +0xa100 ); clks[IMX8MM_CLK_VPU_G2 ] =imx8m_clk_composite ("vpu_g2" , imx8mm_vpu_g2_sels, base +0xa180 ); clks[IMX8MM_CLK_DISP_DTRC ] =imx8m_clk_composite ("disp_dtrc" , imx8mm_disp_dtrc_sels, base +0xa200 ); clks[IMX8MM_CLK_DISP_DC8000 ] =imx8m_clk_composite ("disp_dc8000" , imx8mm_disp_dc8000_sels, base +0xa280 ); clks[IMX8MM_CLK_PCIE1_CTRL ] =imx8m_clk_composite ("pcie1_ctrl" , imx8mm_pcie1_ctrl_sels, base +0xa300 );
drivers/clk/imx/clk-imx8mn.c +4 -2
@@ -497,12 +497,14 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) clks[IMX8MN_CLK_AHB ] =imx8m_clk_composite_critical ("ahb" , imx8mn_ahb_sels, base +0x9000 ); clks[IMX8MN_CLK_AUDIO_AHB ] =imx8m_clk_composite ("audio_ahb" , imx8mn_audio_ahb_sels, base +0x9100 ); clks[IMX8MN_CLK_IPG_ROOT ] =imx_clk_divider2 ("ipg_root" ,"ahb" , base +0x9080 ,0 ,1 ); clks[IMX8MN_CLK_IPG_AUDIO_ROOT ] =imx_clk_divider2 ("ipg_audio_root" ,"audio_ahb" , base +0x9180 ,0 ,1 ); clks[IMX8MN_CLK_DRAM_CORE ] =imx_clk_mux2_flags ("dram_core_clk" , base +0x9800 ,24 ,1 , imx8mn_dram_core_sels,ARRAY_SIZE (imx8mn_dram_core_sels),CLK_IS_CRITICAL ); - clks[IMX8MN_CLK_DRAM_ALT ] =imx8m_clk_composite ("dram_alt" , imx8mn_dram_alt_sels, base +0xa000 ); - clks[IMX8MN_CLK_DRAM_APB ] =imx8m_clk_composite_critical ("dram_apb" , imx8mn_dram_apb_sels, base +0xa080 ); + clks[IMX8MN_CLK_DRAM_ALT ] =__imx8m_clk_composite ("dram_alt" , imx8mn_dram_alt_sels, base +0xa000 , +CLK_GET_RATE_NOCACHE ); + clks[IMX8MN_CLK_DRAM_APB ] =__imx8m_clk_composite ("dram_apb" , imx8mn_dram_apb_sels, base +0xa080 , +CLK_IS_CRITICAL |CLK_GET_RATE_NOCACHE ); clks[IMX8MN_CLK_DISP_PIXEL ] =imx8m_clk_composite ("disp_pixel" , imx8mn_disp_pixel_sels, base +0xa500 ); clks[IMX8MN_CLK_SAI2 ] =imx8m_clk_composite ("sai2" , imx8mn_sai2_sels, base +0xa600 ); clks[IMX8MN_CLK_SAI3 ] =imx8m_clk_composite ("sai3" , imx8mn_sai3_sels, base +0xa680 ); clks[IMX8MN_CLK_SAI5 ] =imx8m_clk_composite ("sai5" , imx8mn_sai5_sels, base +0xa780 ); clks[IMX8MN_CLK_SAI6 ] =imx8m_clk_composite ("sai6" , imx8mn_sai6_sels, base +0xa800 );
drivers/clk/imx/clk-imx8mq.c +4 -3
@@ -436,13 +436,14 @@ static int imx8mq_clocks_probe(struct platform_device *pdev) clks[IMX8MQ_CLK_IPG_ROOT ] =imx_clk_divider2 ("ipg_root" ,"ahb" , base +0x9080 ,0 ,1 ); clks[IMX8MQ_CLK_IPG_AUDIO_ROOT ] =imx_clk_divider2 ("ipg_audio_root" ,"audio_ahb" , base +0x9180 ,0 ,1 );/* IP */ clks[IMX8MQ_CLK_DRAM_CORE ] =imx_clk_mux2_flags ("dram_core_clk" , base +0x9800 ,24 ,1 , imx8mq_dram_core_sels,ARRAY_SIZE (imx8mq_dram_core_sels),CLK_IS_CRITICAL ); - - clks[IMX8MQ_CLK_DRAM_ALT ] =imx8m_clk_composite ("dram_alt" , imx8mq_dram_alt_sels, base +0xa000 ); - clks[IMX8MQ_CLK_DRAM_APB ] =imx8m_clk_composite_critical ("dram_apb" , imx8mq_dram_apb_sels, base +0xa080 ); + clks[IMX8MQ_CLK_DRAM_ALT ] =__imx8m_clk_composite ("dram_alt" , imx8mq_dram_alt_sels, base +0xa000 , +CLK_GET_RATE_NOCACHE ); + clks[IMX8MQ_CLK_DRAM_APB ] =__imx8m_clk_composite ("dram_apb" , imx8mq_dram_apb_sels, base +0xa080 , +CLK_IS_CRITICAL |CLK_GET_RATE_NOCACHE ); clks[IMX8MQ_CLK_VPU_G1 ] =imx8m_clk_composite ("vpu_g1" , imx8mq_vpu_g1_sels, base +0xa100 ); clks[IMX8MQ_CLK_VPU_G2 ] =imx8m_clk_composite ("vpu_g2" , imx8mq_vpu_g2_sels, base +0xa180 ); clks[IMX8MQ_CLK_DISP_DTRC ] =imx8m_clk_composite ("disp_dtrc" , imx8mq_disp_dtrc_sels, base +0xa200 ); clks[IMX8MQ_CLK_DISP_DC8000 ] =imx8m_clk_composite ("disp_dc8000" , imx8mq_disp_dc8000_sels, base +0xa280 ); clks[IMX8MQ_CLK_PCIE1_CTRL ] =imx8m_clk_composite ("pcie1_ctrl" , imx8mq_pcie1_ctrl_sels, base +0xa300 );
Signature · 1 line
2.17.1
PATCH 2/7 dt-bindings: devfreq: Add bindings for generic imx buses
In reply to Leonard CrestezAdd 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.
This is initially only for imx8mm but add an "fsl,imx8m-nic" fallback similar to exynos-bus.
--- .../devicetree/bindings/devfreq/imx.yaml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Documentation/devicetree/bindings/devfreq/imx.yaml
Documentation/devicetree/bindings/devfreq/imx.yaml new file +50 -0
@@ -0,0 +1,50 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/devfreq/imx.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 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: + contains: + enum: + - fsl,imx8m-noc + - fsl,imx8m-nic + + reg: + maxItems: 1 + description: GPV area + + clocks: + maxItems: 1 + +required: + - compatible + - clocks + +examples: + - | + #include <dt-bindings/clock/imx8mm-clock.h> + noc: noc@32700000 { + compatible = "fsl,imx8mm-noc", "fsl,imx8m-noc"; + reg = <0x32700000 0x100000>; + clocks = <&clk IMX8MM_CLK_NOC>; + operating-points-v2 = <&noc_opp_table>; + };
Signature · 1 line
2.17.1
PATCH 3/7 PM / devfreq: Add generic imx bus driver
In reply to Leonard CrestezAdd initial support for dynamic frequency switching on pieces of the imx interconnect fabric.
All this driver actually does is set a clk rate based on an opp table.
No attempt is made to map registers or anything clever.
--- drivers/devfreq/Kconfig | 12 +++ drivers/devfreq/Makefile | 1 + drivers/devfreq/imx-devfreq.c | 148 ++++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 drivers/devfreq/imx-devfreq.c
drivers/devfreq/Kconfig +12 -0
@@ -90,10 +90,22 @@ 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_DEVFREQ + tristate "i.MX DEVFREQ Driver" + depends on ARCH_MXC || COMPILE_TEST + select DEVFREQ_GOV_PASSIVE + select DEVFREQ_GOV_SIMPLE_ONDEMAND + select DEVFREQ_GOV_USERSPACE + select PM_OPP + help + This adds the DEVFREQ driver for the i.MX family of SoCs. + It allows adjusting frequencies for DDRC (DDR Controller) and various + NICs and NOCs which form the SOC interconnect fabric + config ARM_TEGRA_DEVFREQ tristate "NVIDIA Tegra30/114/124/210 DEVFREQ Driver" depends on ARCH_TEGRA_3x_SOC || ARCH_TEGRA_114_SOC || \ ARCH_TEGRA_132_SOC || ARCH_TEGRA_124_SOC || \ ARCH_TEGRA_210_SOC || \
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_DEVFREQ) += imx-devfreq.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 # DEVFREQ Event Drivers
drivers/devfreq/imx-devfreq.c new file +148 -0
148 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 4/7 dt-bindings: devfreq: Add bindings for imx ddr controller
In reply to Leonard CrestezAdd devicetree bindings for the i.MX DDR Controller on imx8m series chips. It supports dynamic frequency switching between multiple data rates and this is exposed to Linux via the devfreq subsystem.
--- .../devicetree/bindings/devfreq/imx-ddrc.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml new file +53 -0
@@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/devfreq/imx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: i.MX DDR Controller + +maintainers: + - Leonard Crestez <[email protected]> + +properties: + compatible: + contains: + enum: + - fsl,imx8m-ddrc + + reg: + maxItems: 1 + description: DDR Controller registers + + clocks: + minItems: 5 + maxItems: 5 + + clock-names: + items: + - const: dram_core + - const: dram_pll + - const: dram_alt_root + - const: dram_alt + - const: dram_apb + +required: + - reg + - compatible + - clocks + - clock-names + +examples: + - | + #include <dt-bindings/clock/imx8mm-clock.h> + ddrc: dram-controller@3d400000 { + compatible = "fsl,imx8mm-ddrc", "fsl,imx8m-ddrc"; + reg = <0x3d400000 0x400000>; + clock-names = "dram_core", "dram_pll", "dram_alt_root", "dram_alt", "dram_apb"; + clocks = <&clk IMX8MM_CLK_DRAM_CORE>, + <&clk IMX8MM_DRAM_PLL>, + <&clk IMX8MM_CLK_DRAM_ALT_ROOT>, + <&clk IMX8MM_CLK_DRAM_ALT>, + <&clk IMX8MM_CLK_DRAM_APB>; + operating-points-v2 = <&ddrc_opp_table>; + };
Signature · 1 line
2.17.1
PATCH 5/7 PM / devfreq: Add dynamic scaling for imx ddr controller
In reply to Leonard CrestezAdd driver for dynamic scaling the DDR Controller on imx8m chips. Actual frequency switching is implemented in TF-A, this driver just wraps the SMC calls and updates the clk tree.
--- drivers/devfreq/Makefile | 2 +- drivers/devfreq/imx-ddrc.c | 379 +++++++++++++++++++++++++++++++++++++ 2 files changed, 380 insertions(+), 1 deletion(-) create mode 100644 drivers/devfreq/imx-ddrc.c
drivers/devfreq/Makefile +1 -1
@@ -7,11 +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_DEVFREQ) += imx-devfreq.o +obj-$(CONFIG_ARM_IMX_DEVFREQ) += imx-devfreq.o imx-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 # DEVFREQ Event Drivers
drivers/devfreq/imx-ddrc.c new file +379 -0
379 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 6/7 PM / devfreq: imx-ddrc: Measure bandwidth with perf
In reply to Leonard CrestezThe imx8m ddrc has a performance monitoring block attached which can be used to measure bandwidth usage and automatically adjust frequency.
There is already a perf driver for that block so instead of implementing a devfreq events driver use the in-kernel perf API to implement get_dev_status directly.
--- drivers/devfreq/imx-ddrc.c | 136 ++++++++++++++++++++++++++++++++++++- 1 file changed, 134 insertions(+), 2 deletions(-)
drivers/devfreq/imx-ddrc.c +134 -2
@@ -11,10 +11,13 @@#include <linux/pm_opp.h> #include <linux/clk.h> #include <linux/clk-provider.h> #include <linux/arm-smccc.h> +#include <asm/perf_event.h> +#include <linux/perf_event.h> +#define IMX_SIP_DDR_DVFS 0xc2000004/* Values starting from 0 switch to specific frequency */ #define IMX_SIP_DDR_FREQ_SET_HIGH 0x00
@@ -81,10 +84,22 @@ struct imx_ddrc {struct clk *dram_alt;struct clk *dram_apb;int freq_count;struct imx_ddrc_freq freq_table[IMX_DDRC_MAX_FREQ_COUNT ]; + +/* For measuring load with perf events: */ +struct platform_device * pmu_pdev; +struct pmu *pmu; + +struct perf_event_attr rd_event_attr; +struct perf_event_attr wr_event_attr; +struct perf_event *rd_event; +struct perf_event *wr_event; + +u64 last_rd_val, last_rd_ena, last_rd_run; +u64 last_wr_val, last_wr_ena, last_wr_run; };static struct imx_ddrc_freq *imx_ddrc_find_freq (struct imx_ddrc * priv,unsigned long rate) {
@@ -233,17 +248,117 @@ static int imx_ddrc_get_cur_freq(struct device *dev, unsigned long *freq)static int imx_ddrc_get_dev_status (struct device *dev,struct devfreq_dev_status *stat) {struct imx_ddrc *priv =dev_get_drvdata (dev); - stat->busy_time =0 ; - stat->total_time =0 ; stat->current_frequency =clk_get_rate (priv->dram_core); +if (priv->rd_event && priv->wr_event) { +u64 rd_delta, rd_val, rd_ena, rd_run; +u64 wr_delta, wr_val, wr_ena, wr_run; + + rd_val =perf_event_read_value (priv->rd_event, &rd_ena, &rd_run); + wr_val =perf_event_read_value (priv->wr_event, &wr_ena, &wr_run); + + rd_delta = (rd_val - priv->last_rd_val) * (rd_ena - priv->last_rd_ena) / (rd_run - priv->last_rd_run); + priv->last_rd_val = rd_val; + priv->last_rd_ena = rd_ena; + priv->last_rd_run = rd_run; + wr_delta = (wr_val - priv->last_wr_val) * (wr_ena - priv->last_wr_ena) / (wr_run - priv->last_wr_run); + priv->last_wr_val = wr_val; + priv->last_wr_ena = wr_ena; + priv->last_wr_run = wr_run; + +/* magic numbers, possibly wrong */ + stat->busy_time =4 * (rd_delta + wr_delta); + stat->total_time = stat->current_frequency; + }else { + stat->busy_time =0 ; + stat->total_time =0 ; + } + +return 0 ; +} + +static int imx_ddrc_perf_disable (struct imx_ddrc *priv) +{ +/* release and set to NULL */ +if (!IS_ERR_OR_NULL (priv->rd_event)) +perf_event_release_kernel (priv->rd_event); +if (!IS_ERR_OR_NULL (priv->wr_event)) +perf_event_release_kernel (priv->wr_event); + priv->rd_event =NULL ; + priv->wr_event =NULL ; +return 0 ; } +static int imx_ddrc_perf_enable (struct imx_ddrc *priv) +{ +int ret; + + priv->rd_event_attr.size =sizeof (priv->rd_event_attr); + priv->rd_event_attr.type = priv->pmu->type; + priv->rd_event_attr.config =0x2a ; + + priv->rd_event =perf_event_create_kernel_counter ( + &priv->rd_event_attr,0 ,NULL ,NULL ,NULL ); +if (IS_ERR (priv->rd_event)) { + ret =PTR_ERR (priv->rd_event); + goto err; + } + + priv->wr_event_attr.size =sizeof (priv->wr_event_attr); + priv->wr_event_attr.type = priv->pmu->type; + priv->wr_event_attr.config =0x2b ; + + priv->wr_event =perf_event_create_kernel_counter ( + &priv->wr_event_attr,0 ,NULL ,NULL ,NULL ); +if (IS_ERR (priv->wr_event)) { + ret =PTR_ERR (priv->wr_event); + goto err; + } + +return 0 ; + +err: +imx_ddrc_perf_disable (priv); +return ret; +} + +static int imx_ddrc_init_events (struct device *dev, +struct device_node * events_node) +{ +struct imx_ddrc *priv =dev_get_drvdata (dev); +struct device_driver *driver; + +/* +* We need pmu->type for perf_event_attr but there is no API for +* mapping device_node to pmu. Fetch private data for imx-ddr-pmu and +* cast that to a struct pmu instead. +*/ + priv->pmu_pdev =of_find_device_by_node (events_node); +if (!priv->pmu_pdev) +return -EPROBE_DEFER ; + driver = priv->pmu_pdev->dev.driver; +if (!driver) +return -EPROBE_DEFER ; +if (strcmp (driver->name,"imx-ddr-pmu" )) { +dev_warn (dev,"devfreq-events node %pOF has unexpected driver %s\n" , + events_node, driver->name); +return -ENODEV ; + } + + priv->pmu =platform_get_drvdata (priv->pmu_pdev); +if (!priv->pmu) +return -EINVAL ; + +dev_info (dev,"events from pmu %s\n" , priv->pmu->name); + +return imx_ddrc_perf_enable (priv); +} +static int imx_ddrc_init_freq_info (struct device *dev) {struct imx_ddrc *priv =dev_get_drvdata (dev);struct arm_smccc_res res;int index;
@@ -291,10 +406,13 @@ static int imx_ddrc_init_freq_info(struct device *dev)static void imx_ddrc_exit (struct device *dev) {struct imx_ddrc *priv =dev_get_drvdata (dev); +imx_ddrc_perf_disable (priv); +platform_device_put (priv->pmu_pdev); +return dev_pm_opp_of_remove_table (dev); }static int imx_ddrc_probe (struct platform_device *pdev) {
@@ -342,10 +460,22 @@ static int imx_ddrc_probe(struct platform_device *pdev) priv->profile.get_dev_status = imx_ddrc_get_dev_status; priv->profile.exit = imx_ddrc_exit; priv->profile.get_cur_freq = imx_ddrc_get_cur_freq; priv->profile.initial_freq =clk_get_rate (priv->dram_core); +/* Handle devfreq-events */ + events_node =of_parse_phandle (dev->of_node,"devfreq-events" ,0 ); +if (events_node) { + ret =imx_ddrc_init_events (dev, events_node); +of_node_put (events_node); +if (ret) { +dev_warn (dev,"failed to init perf events: %d\n" , ret); + goto err; + } + gov =DEVFREQ_GOV_SIMPLE_ONDEMAND ; + } + priv->devfreq =devm_devfreq_add_device (dev, &priv->profile, gov,NULL );if (IS_ERR (priv->devfreq)) { ret =PTR_ERR (priv->devfreq);dev_err (dev,"failed to add devfreq device: %d\n" , ret);
@@ -353,10 +483,12 @@ static int imx_ddrc_probe(struct platform_device *pdev) }return 0 ; err: +imx_ddrc_perf_disable (priv); +platform_device_put (priv->pmu_pdev);dev_pm_opp_of_remove_table (dev);return ret; }static const struct of_device_id imx_ddrc_of_match[] = {
Signature · 1 line
2.17.1
PATCH 7/7 arm64: dts: imx8mm: Add devfreq nodes
In reply to Leonard CrestezAdd initial support for bus scaling on imx8m, starting with noc and ddrc because they're the biggest power hogs.
Add a devfreq-event link to the PMU in order to support on-demand scaling of ddrc based on measured dram bandwith usage. Make ddrc a parent of the NOC because all traffic to ddrc goes through
Support for proactive scaling via interconnect and support for scaling additional NICs will come later. The high-performance bus masters which need that (display, vpu, gpu) are not yet enabled in upstream anyway.
--- arch/arm64/boot/dts/freescale/imx8mm.dtsi | 51 ++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mm.dtsi +50 -1
@@ -122,10 +122,38 @@ clock-latency-ns = <150000>; opp-suspend; }; }; + ddrc_opp_table: ddrc-opp-table { + compatible = "operating-points-v2"; + + opp-25M { + opp-hz = /bits/ 64 <25000000>; + }; + opp-100M { + opp-hz = /bits/ 64 <100000000>; + }; + opp-750M { + opp-hz = /bits/ 64 <750000000>; + }; + }; + + noc_opp_table: noc-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>; + }; + }; + memory@40000000 { device_type = "memory"; reg = <0x0 0x40000000 0 0x80000000>; };
@@ -748,10 +776,18 @@ status = "disabled"; }; }; + noc: noc@32700000 { + compatible = "fsl,imx8mm-noc", "fsl,imx8m-noc"; + reg = <0x32700000 0x100000>; + clocks = <&clk IMX8MM_CLK_NOC>; + devfreq = <&ddrc>; + operating-points-v2 = <&noc_opp_table>; + }; + aips4: bus@32c00000 { compatible = "fsl,aips-bus", "simple-bus"; #address-cells = <1>; #size-cells = <1>; ranges = <0x32c00000 0x32c00000 0x400000>;
@@ -832,11 +868,24 @@ #interrupt-cells = <3>; interrupt-controller; interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>; }; - ddr-pmu@3d800000 { + ddrc: dram-controller@3d400000 { + compatible = "fsl,imx8mm-ddrc", "fsl,imx8m-ddrc"; + reg = <0x3d400000 0x400000>; + clock-names = "dram_core", "dram_pll", "dram_alt_root", "dram_alt", "dram_apb"; + clocks = <&clk IMX8MM_CLK_DRAM_CORE>, + <&clk IMX8MM_DRAM_PLL>, + <&clk IMX8MM_CLK_DRAM_ALT_ROOT>, + <&clk IMX8MM_CLK_DRAM_ALT>, + <&clk IMX8MM_CLK_DRAM_APB>; + devfreq-events = <&ddr_pmu>; + operating-points-v2 = <&ddrc_opp_table>; + }; + + ddr_pmu: ddr-pmu@3d800000 { compatible = "fsl,imx8mm-ddr-pmu", "fsl,imx8m-ddr-pmu"; reg = <0x3d800000 0x400000>; interrupt-parent = <&gic>; interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>; };
Signature · 1 line
2.17.1
Re: [PATCH 2/7] dt-bindings: devfreq: Add bindings for generic imx buses
In reply to Leonard CrestezQuoted 32 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.
This is initially only for imx8mm but add an "fsl,imx8m-nic" fallback similar to exynos-bus.
Signed-off-by Leonard Crestez <[email protected]>--- .../devicetree/bindings/devfreq/imx.yaml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Documentation/devicetree/bindings/devfreq/imx.yamlDocumentation/devicetree/bindings/devfreq/imx.yaml new file +12
-0@@ -0,0 +1,50 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/devfreq/imx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic i.MX bus frequency device + +maintainers: + - Leonard Crestez <[email protected]> + +description: |
Documentation/devicetree/bindings/devfreq/imx.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +10
-0+ 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 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.
No need to use the interconnect binding?
Documentation/devicetree/bindings/devfreq/imx.yaml line 29
Quoted 7 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +7
-0+ +properties: + compatible: + contains: + enum: + - fsl,imx8m-noc + - fsl,imx8m-nic
This means any combination of these 2 strings is valid. I suspect you want a given node to have only one of them, so drop 'contains'
Documentation/devicetree/bindings/devfreq/imx.yaml line 40
Quoted 11 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +11
-0+ + reg: + maxItems: 1 + description: GPV area + + clocks: + maxItems: 1 + +required: + - compatible + - clocks
reg?
Documentation/devicetree/bindings/devfreq/imx.yaml line 46
Quoted 6 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +6
-0+ +examples: + - | + #include <dt-bindings/clock/imx8mm-clock.h> + noc: noc@32700000 { + compatible = "fsl,imx8mm-noc", "fsl,imx8m-noc";
Doesn't match the schema. (Well, it does with 'contains', but fsl,imx8mm-noc is not documented.)
Documentation/devicetree/bindings/devfreq/imx.yaml line 49
Quoted 3 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +3
-0+ reg = <0x32700000 0x100000>; + clocks = <&clk IMX8MM_CLK_NOC>; + operating-points-v2 = <&noc_opp_table>;
Not documented.
Quoted 4 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +1
-1+ }; --2.17.1
Re: [PATCH 4/7] dt-bindings: devfreq: Add bindings for imx ddr controller
In reply to Leonard CrestezQuoted 21 lines · Leonard Crestez
Add devicetree bindings for the i.MX DDR Controller on imx8m series chips. It supports dynamic frequency switching between multiple data rates and this is exposed to Linux via the devfreq subsystem.
Signed-off-by Leonard Crestez <[email protected]>--- .../devicetree/bindings/devfreq/imx-ddrc.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/devfreq/imx-ddrc.yamlDocumentation/devicetree/bindings/devfreq/imx-ddrc.yaml new file +4
-0@@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/devfreq/imx.yaml#
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml line 14
Quoted 10 lines
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml new file +10
-0+$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: i.MX DDR Controller + +maintainers: + - Leonard Crestez <[email protected]> + +properties: + compatible: + contains:
Don't use 'contains'.
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml line 20
Quoted 6 lines
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml new file +6
-0+ enum: + - fsl,imx8m-ddrc + + reg: + maxItems: 1 + description: DDR Controller registers
Don't really need a description for a standard property with a single item.
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml line 23
Quoted 3 lines
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml new file +3
-0+ + clocks: + minItems: 5
Just maxItems is sufficient unless there's a variable number of items.
Quoted 5 lines
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml new file +5
-0+ maxItems: 5 + + clock-names: + items: + - const: dram_core
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml line 38
Quoted 10 lines
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml new file +10
-0+ - const: dram_pll + - const: dram_alt_root + - const: dram_alt + - const: dram_apb + +required: + - reg + - compatible + - clocks + - clock-names
You should add an 'additionalProperties: false' here.
Quoted 4 lines
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml new file +4
-0+ +examples: + - | + #include <dt-bindings/clock/imx8mm-clock.h>
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml line 52
Quoted 10 lines
Documentation/devicetree/bindings/devfreq/imx-ddrc.yaml new file +10
-0+ ddrc: dram-controller@3d400000 { + compatible = "fsl,imx8mm-ddrc", "fsl,imx8m-ddrc"; + reg = <0x3d400000 0x400000>; + clock-names = "dram_core", "dram_pll", "dram_alt_root", "dram_alt", "dram_apb"; + clocks = <&clk IMX8MM_CLK_DRAM_CORE>, + <&clk IMX8MM_DRAM_PLL>, + <&clk IMX8MM_CLK_DRAM_ALT_ROOT>, + <&clk IMX8MM_CLK_DRAM_ALT>, + <&clk IMX8MM_CLK_DRAM_APB>; + operating-points-v2 = <&ddrc_opp_table>;
Not documented. You can assume a common property has a type definition already (this one doesn't yet), so just this is enough:
operating-points-v2: true
Re: [PATCH 2/7] dt-bindings: devfreq: Add bindings for generic imx buses
In reply to Rob HerringQuoted 6 lines · Rob Herring
Quoted 4 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.
Quoted 13 lines
Documentation/devicetree/bindings/devfreq/imx.yaml line 22
Quoted 11 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +11
-0+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 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.No need to use the interconnect binding?
Separate RFC: https://patchwork.kernel.org/patch/11078673/
The interconnect is represented by a separate "virtual" node which might not be OK. There was also a recent RFC from samsung which turns devfreq nodes into interconnect providers:
https://patchwork.kernel.org/cover/11054417/
Is that preferable?
Quoted 5 lines
Documentation/devicetree/bindings/devfreq/imx.yaml line 40
Quoted 3 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +3
-0+required: + - compatible + - clocksreg?
This is deliberately optional: for some NICs the GPV register area is not exposed in the memory map. This is unusual but an accurate description of the hardware.
The current driver doesn't even attempt to map registers, it only adjusts the clock.
Quoted 8 lines
Documentation/devicetree/bindings/devfreq/imx.yaml line 46
Quoted 5 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +5
-0+examples: + - | + #include <dt-bindings/clock/imx8mm-clock.h> + noc: noc@32700000 { + compatible = "fsl,imx8mm-noc", "fsl,imx8m-noc";Doesn't match the schema. (Well, it does with 'contains', but fsl,imx8mm-noc is not documented.)
I'm confused about how per-SOC compatible strings works with validation. There is a rule that every SOC dtsi needs to add soc prefix to all device nodes but of_device_id in driver code doesn't need to be updated.
Without using "contains" on the "compatible" property then all SOC-specific compatible strings would need to be mentioned in every yaml files. Unless I'm missing something this means updating update every binding file for each new SOC?
I guess it can be useful because it also validates the compatible sequence itself.
For this current example something like this seems to work:
compatible:
oneOf:
- items:
- enum:
- fsl,imx8mm-nic
- fsl,imx8mq-nic
- const: fsl,imx8m-nic
- items:
- enum:
- fsl,imx8mm-noc
- fsl,imx8mq-noc
- const: fsl,imx8m-noc
--
Regards,
Leonard
RE: [PATCH 2/7] dt-bindings: devfreq: Add bindings for generic imx buses
In reply to Leonard CrestezQuoted 4 lines
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.
Quoted 8 lines
This is initially only for imx8mm but add an "fsl,imx8m-nic" fallback similar to exynos-bus.
Signed-off-by Leonard Crestez <[email protected]>---
.../devicetree/bindings/devfreq/imx.yaml| 50 +++++++++++++++++++1 file changed, 50 insertions(+)create mode 100644
Documentation/devicetree/bindings/devfreq/imx.yaml
MyungJoo Ham
maintainerRE: [PATCH 3/7] PM / devfreq: Add generic imx bus driver
In reply to Leonard CrestezQuoted 22 lines
Add initial support for dynamic frequency switching on pieces of the imx interconnect fabric.
All this driver actually does is set a clk rate based on an opp table.
No attempt is made to map registers or anything clever.
Signed-off-by Leonard Crestez <[email protected]>---
drivers/devfreq/Kconfig | 12 +++ drivers/devfreq/Makefile | 1 + drivers/devfreq/imx-devfreq.c | 148 ++++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+)create mode 100644
drivers/devfreq/imx-devfreq.cdrivers/devfreq/Kconfig +0
-0@@ -90,10 +90,22 @@ 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
drivers/devfreq/Kconfig config ARM_EXYNOS_BUS_DEVFREQ · line 101
Quoted 10 lines
drivers/devfreq/Kconfig +7
-0and adjusts the operating frequencies and voltages with OPP support. This does not yet operate with optimal voltages. +config ARM_IMX_DEVFREQ + tristate "i.MX DEVFREQ Driver" + depends on ARCH_MXC || COMPILE_TEST + select DEVFREQ_GOV_PASSIVE + select DEVFREQ_GOV_SIMPLE_ONDEMAND + select DEVFREQ_GOV_USERSPACE + select PM_OPP
Hello,
I have a simple question:
Does it support ALL ARCH_MXC SoCs?
Cheers,
MyungJoo
Re: [PATCH 3/7] PM / devfreq: Add generic imx bus driver
Quoted 5 lines · MyungJoo Ham
Quoted 5 lines
Add initial support for dynamic frequency switching on pieces of the imx interconnect fabric.
All this driver actually does is set a clk rate based on an opp table.
Quoted 9 lines
drivers/devfreq/Kconfig config ARM_EXYNOS_BUS_DEVFREQ · line 101
Quoted 7 lines
drivers/devfreq/Kconfig +7
-0+config ARM_IMX_DEVFREQ + tristate "i.MX DEVFREQ Driver" + depends on ARCH_MXC || COMPILE_TEST + select DEVFREQ_GOV_PASSIVE + select DEVFREQ_GOV_SIMPLE_ONDEMAND + select DEVFREQ_GOV_USERSPACE + select PM_OPPDoes it support ALL
ARCH_MXCSoCs?
Only imx8m currently but out of tree we support bus+dram frequency switching for ~10 imx6/7 SOCs, all other than imx7ulp.
When imx8 was upstreamed as the first 64-bit imx chip the arm64 maintainers told us to drop stuff like ARCH_FSL_IMX8MM so there is no per-soc kconfig more specific than "ARCH_MXC".
I guess we could make it depend on (ARCH_MXC && ARM64) but the ARM64 would eventually be dropped anyway.
--
Regards,
Leonard
Re: [PATCH 2/7] dt-bindings: devfreq: Add bindings for generic imx buses
In reply to Leonard CrestezQuoted 22 lines · Leonard Crestez
Quoted 6 lines · Rob Herring
Quoted 4 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.
Quoted 13 lines
Documentation/devicetree/bindings/devfreq/imx.yaml line 22
Quoted 11 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +11
-0+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 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.No need to use the interconnect binding?
Quoted 8 lines
Separate RFC: https://patchwork.kernel.org/patch/11078673/
The interconnect is represented by a separate "virtual" node which might not be OK. There was also a recent RFC from samsung which turns devfreq nodes into interconnect providers:
https://patchwork.kernel.org/cover/11054417/Is that preferable?
Virtual nodes are not OK.
Quoted 10 lines
Quoted 6 lines
Documentation/devicetree/bindings/devfreq/imx.yaml line 40
Quoted 4 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +3
-0+required: + - compatible + - clocksreg?
This is deliberately optional: for some NICs the GPV register area is not exposed in the memory map. This is unusual but an accurate description of the hardware.
Different h/w blocks should have different compatibles. GPV is an Arm thing and I'd expect FlexNOC to be different.
Quoted 2 lines
The current driver doesn't even attempt to map registers, it only adjusts the clock.
Irrelevant to the binding...
Quoted 10 lines
Quoted 9 lines
Documentation/devicetree/bindings/devfreq/imx.yaml line 46
Quoted 6 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +5
-0+examples: + - | + #include <dt-bindings/clock/imx8mm-clock.h> + noc: noc@32700000 { + compatible = "fsl,imx8mm-noc", "fsl,imx8m-noc";Doesn't match the schema. (Well, it does with 'contains', but fsl,imx8mm-noc is not documented.)
Quoted 8 lines
I'm confused about how per-SOC compatible strings works with validation. There is a rule that every SOC dtsi needs to add soc prefix to all device nodes but
of_device_idin driver code doesn't need to be updated.Without using "contains" on the "compatible" property then all SOC-specific compatible strings would need to be mentioned in every yaml files. Unless I'm missing something this means updating update every binding file for each new SOC?
Yes. The main exception is if various SoCs are just packaging, binning, or fuse differences.
Quoted 3 lines
I guess it can be useful because it also validates the compatible sequence itself.
Right. Order matters.
Quoted 15 lines
For this current example something like this seems to work:
compatible:
oneOf:
- items:
- enum:
- fsl,imx8mm-nic
- fsl,imx8mq-nic
- const: fsl,imx8m-nic
- items:
- enum:
- fsl,imx8mm-noc
- fsl,imx8mq-noc
- const: fsl,imx8m-noc
Looks correct.
Rob
Re: [PATCH 2/7] dt-bindings: devfreq: Add bindings for generic imx buses
Quoted 22 lines · Rob Herring
Quoted 21 lines · Leonard Crestez
Quoted 19 lines · Rob Herring
Quoted 5 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.
Documentation/devicetree/bindings/devfreq/imx.yaml new file +1
-0+description: |Documentation/devicetree/bindings/devfreq/imx.yaml line 22
Quoted 10 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +10
-0+ 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 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.No need to use the interconnect binding?
Quoted 7 lines
Quoted 5 lines
The interconnect is represented by a separate "virtual" node which might not be OK. There was also a recent RFC from samsung which turns devfreq nodes into interconnect providers:
Is that preferable?
Virtual nodes are not OK.
Then I'll try to make the "interconnect" device probe from a soc driver and turn devfreq nodes into interconnect providers backed by this same singleton device.
Still separate from this series.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Documentation/devicetree/bindings/devfreq/imx.yaml new file +3
-0+required: + - compatible + - clocks
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
reg?
This is deliberately optional: for some NICs the GPV register area is not exposed in the memory map. This is unusual but an accurate description of the hardware.
Different h/w blocks should have different compatibles. GPV is an Arm thing and I'd expect FlexNOC to be different.
The imx reference manuals call them both "GPV" though layout is indeed quite different (and for FlexNoC it's not even documented).
The h/w blocks do have different compat strings (imx8m-nic and imx8m-noc). They have a single binding document because didn't want to create two nearly-identical bindings, I assume it would be fine to split later if needed.
--
Regards,
Leonard