mbox series

[V3,00/10] interconnect: support i.MX8MP

Message ID 20220703091132.1412063-1-peng.fan@oss.nxp.com
Headers show
Series interconnect: support i.MX8MP | expand

Message

Peng Fan (OSS) July 3, 2022, 9:11 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>

V3:
 - Drop patch "interconnect: imx: set of_node for interconnect provider"
 - Driver License Update
 - Correct devm_of_iomap return value check and minor update per ICC
 maintainer and Lucas's comments
 - Include devfreq patch
 - Include device tree patch to include NoC node

V2:
 Per dt maintainer: drop syscon, move binding file fsl,imx8mp.h out from driver
 Per ICC maintainer, add kernel doc and add static inline for an API in header file
 Rename max_node_id to num_nodes
 Describe more on the registers.

This patchset is to support i.MX8MP NoC settings, i.MX8MP NoC initial
value after power up is invalid, need set a valid value after related
power domain up.

This patchset also includes two patch[1,2] during my development to enable
the ICC feature for i.MX8MP.

I not include ddrc DVFS in this patchset, ths patchset is only to
support NoC value mode/priority/ext_control being set to a valid value
that suggested by i.MX Chip Design Team. The value is same as NXP
downstream one inside Arm Trusted Firmware:
https://source.codeaurora.org/external/imx/imx-atf/tree/plat/imx/imx8m/imx8mp/gpc.c?h=lf_v2.4#n97

A repo created here: https://github.com/MrVan/linux/tree/imx8mp-interconnect

Peng Fan (10):
  dt-bindings: interconnect: imx8m: Add bindings for imx8mp noc
  dt-bindings: interconnect: add fsl,imx8mp.h
  interconnect: add device managed bulk API
  interconnect: imx: fix max_node_id
  interconnect: imx: set src node
  interconnect: imx: introduce imx_icc_provider
  interconnect: imx: configure NoC mode/prioriry/ext_control
  interconnect: imx: Add platform driver for imx8mp
  PM / devfreq: imx: Register i.MX8MP interconnect device
  arm64: dts: imx8mp: add NoC node

 .../bindings/interconnect/fsl,imx8m-noc.yaml  |   6 +-
 arch/arm64/boot/dts/freescale/imx8mp.dtsi     |  22 ++
 drivers/devfreq/imx-bus.c                     |   1 +
 drivers/interconnect/bulk.c                   |  42 +++
 drivers/interconnect/imx/Kconfig              |   4 +
 drivers/interconnect/imx/Makefile             |   2 +
 drivers/interconnect/imx/imx.c                |  84 ++++--
 drivers/interconnect/imx/imx.h                |  49 +++-
 drivers/interconnect/imx/imx8mm.c             |   2 +-
 drivers/interconnect/imx/imx8mn.c             |   2 +-
 drivers/interconnect/imx/imx8mp.c             | 259 ++++++++++++++++++
 drivers/interconnect/imx/imx8mq.c             |   2 +-
 include/dt-bindings/interconnect/fsl,imx8mp.h |  59 ++++
 include/linux/interconnect.h                  |   7 +
 14 files changed, 518 insertions(+), 23 deletions(-)
 create mode 100644 drivers/interconnect/imx/imx8mp.c
 create mode 100644 include/dt-bindings/interconnect/fsl,imx8mp.h

Comments

Chanwoo Choi July 3, 2022, 1:55 p.m. UTC | #1
On 22. 7. 3. 18:11, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Same to i.MX8MM/N/Q, register i.MX8MP interconnect device to make
> i.MX8MP Interconnect driver work.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/devfreq/imx-bus.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/devfreq/imx-bus.c b/drivers/devfreq/imx-bus.c
> index f87067fc574d..a727067980fb 100644
> --- a/drivers/devfreq/imx-bus.c
> +++ b/drivers/devfreq/imx-bus.c
> @@ -145,6 +145,7 @@ 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,imx8mp-noc", .data = "imx8mp-interconnect", },
>  	{ .compatible = "fsl,imx8m-noc", },
>  	{ .compatible = "fsl,imx8m-nic", },
>  	{ /* sentinel */ },

Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Georgi Djakov July 4, 2022, 1:50 p.m. UTC | #2
Hi Peng,

On 3.07.22 12:11, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Add i.MX8MP NoC node to make the interconnect i.MX8MP driver could work.
> Currently dynamic frequency scaling of the i.MX8MP NoC has not been
> supported, only NoC initial settings are configured by interconnect
> driver.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>   arch/arm64/boot/dts/freescale/imx8mp.dtsi | 22 ++++++++++++++++++++++
>   1 file changed, 22 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> index eb2d516278eb..13a2ee77d3c6 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> @@ -4,6 +4,7 @@
>    */
>   
>   #include <dt-bindings/clock/imx8mp-clock.h>
> +#include <dt-bindings/interconnect/fsl,imx8mp.h>

It's also possible to drop this line for now and add it in the next patches when we add the 
interconnect consumers. This will allow merging this DT patch independently. But it's up to Shawn.

>   #include <dt-bindings/power/imx8mp-power.h>
>   #include <dt-bindings/gpio/gpio.h>
>   #include <dt-bindings/input/input.h>
> @@ -1019,6 +1020,27 @@ eqos: ethernet@30bf0000 {
>   			};
>   		};
>   
> +		noc: interconnect@32700000 {
> +			compatible = "fsl,imx8mp-noc", "fsl,imx8m-noc", "syscon";

I got the impression that we are dropping the syscon, or not?

> +			reg = <0x32700000 0x100000>;
> +			clocks = <&clk IMX8MP_CLK_NOC>;
> +			#interconnect-cells = <1>;
> +
> +			operating-points-v2 = <&noc_opp_table>;
> +
> +			noc_opp_table: opp-table {
> +				compatible = "operating-points-v2";
> +
> +				opp-200M {
> +					opp-hz = /bits/ 64 <200000000>;
> +				};
> +
> +				opp-1000M {
> +					opp-hz = /bits/ 64 <1000000000>;
> +				};
> +			};
> +		};
> +
>   		aips4: bus@32c00000 {
>   			compatible = "fsl,aips-bus", "simple-bus";
>   			reg = <0x32c00000 0x400000>;
Patches 1-9 look good and I am planning to merge them.

Thanks,
Georgi
Peng Fan July 5, 2022, 7:55 a.m. UTC | #3
Hi Georgi,

> Subject: Re: [PATCH V3 10/10] arm64: dts: imx8mp: add NoC node
> 
> 
> Hi Peng,
> 
> On 3.07.22 12:11, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Add i.MX8MP NoC node to make the interconnect i.MX8MP driver could
> work.
> > Currently dynamic frequency scaling of the i.MX8MP NoC has not been
> > supported, only NoC initial settings are configured by interconnect
> > driver.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >   arch/arm64/boot/dts/freescale/imx8mp.dtsi | 22
> ++++++++++++++++++++++
> >   1 file changed, 22 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > index eb2d516278eb..13a2ee77d3c6 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > @@ -4,6 +4,7 @@
> >    */
> >
> >   #include <dt-bindings/clock/imx8mp-clock.h>
> > +#include <dt-bindings/interconnect/fsl,imx8mp.h>
> 
> It's also possible to drop this line for now and add it in the next patches
> when we add the interconnect consumers. This will allow merging this DT
> patch independently. But it's up to Shawn.
> 
> >   #include <dt-bindings/power/imx8mp-power.h>
> >   #include <dt-bindings/gpio/gpio.h>
> >   #include <dt-bindings/input/input.h> @@ -1019,6 +1020,27 @@ eqos:
> > ethernet@30bf0000 {
> >   			};
> >   		};
> >
> > +		noc: interconnect@32700000 {
> > +			compatible = "fsl,imx8mp-noc", "fsl,imx8m-noc",
> "syscon";
> 
> I got the impression that we are dropping the syscon, or not?

I just checked the dt-bindings V1 mail. You are right, syscon
should be dropped.

> 
> > +			reg = <0x32700000 0x100000>;
> > +			clocks = <&clk IMX8MP_CLK_NOC>;
> > +			#interconnect-cells = <1>;
> > +
> > +			operating-points-v2 = <&noc_opp_table>;
> > +
> > +			noc_opp_table: opp-table {
> > +				compatible = "operating-points-v2";
> > +
> > +				opp-200M {
> > +					opp-hz = /bits/ 64 <200000000>;
> > +				};
> > +
> > +				opp-1000M {
> > +					opp-hz = /bits/ 64 <1000000000>;
> > +				};
> > +			};
> > +		};
> > +
> >   		aips4: bus@32c00000 {
> >   			compatible = "fsl,aips-bus", "simple-bus";
> >   			reg = <0x32c00000 0x400000>;
> Patches 1-9 look good and I am planning to merge them.

Thanks, Then I only need to repost this single patch for a new version.

Thanks,
Peng.
> 
> Thanks,
> Georgi