linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/8] Add interconnect for i.MX8MP blk ctrl
@ 2022-06-16  7:39 Peng Fan (OSS)
  2022-06-16  7:39 ` [PATCH V2 1/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP media " Peng Fan (OSS)
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Peng Fan (OSS) @ 2022-06-16  7:39 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: festevam, linux-imx, laurent.pinchart, paul.elder, marex,
	aford173, devicetree, linux-arm-kernel, linux-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>


V2:
 Use a low bandwidth value instead INT_MAX
 Minor fix to move fsl,imx8mp.h out to dts patch, not driver patch
 Add A-b tag from DT maintainer

i.MX8MP NoC settings is invalid after related power domain up. So
need to set valid values after power domain up.

This patchset is to bind interconnect for each entry in blk ctrl.

This patchset is not include DVFS DDRC feature.

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

Peng Fan (8):
  dt-bindings: soc: imx: add interconnect property for i.MX8MP media blk
    ctrl
  dt-bindings: soc: imx: add interconnect property for i.MX8MP hdmi blk
    ctrl
  dt-bindings: soc: imx: add interconnect property for i.MX8MP hsio blk
    ctrl
  soc: imx: add icc paths for i.MX8MP media blk ctrl
  soc: imx: add icc paths for i.MX8MP hsio/hdmi blk ctrl
  arm64: dts: imx8mp: add NoC node
  arm64: dts: imx8mp: add interconnects for media blk ctrl
  arm64: dts: imx8mp: add interconnect for hsio blk ctrl

 .../soc/imx/fsl,imx8mp-hdmi-blk-ctrl.yaml     |  9 +++++
 .../soc/imx/fsl,imx8mp-hsio-blk-ctrl.yaml     | 10 +++++
 .../soc/imx/fsl,imx8mp-media-blk-ctrl.yaml    | 14 +++++++
 arch/arm64/boot/dts/freescale/imx8mp.dtsi     | 39 +++++++++++++++++++
 drivers/soc/imx/imx8m-blk-ctrl.c              | 32 +++++++++++++++
 drivers/soc/imx/imx8mp-blk-ctrl.c             | 29 ++++++++++++++
 6 files changed, 133 insertions(+)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH V2 1/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP media blk ctrl
  2022-06-16  7:39 [PATCH V2 0/8] Add interconnect for i.MX8MP blk ctrl Peng Fan (OSS)
@ 2022-06-16  7:39 ` Peng Fan (OSS)
  2022-06-16  7:39 ` [PATCH V2 2/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP hdmi " Peng Fan (OSS)
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Peng Fan (OSS) @ 2022-06-16  7:39 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: festevam, linux-imx, laurent.pinchart, paul.elder, marex,
	aford173, devicetree, linux-arm-kernel, linux-kernel, Peng Fan,
	Krzysztof Kozlowski

From: Peng Fan <peng.fan@nxp.com>

Add interconnect property for i.MX8MP mediamix blk ctrl

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../soc/imx/fsl,imx8mp-media-blk-ctrl.yaml         | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml
index b246d8386ba4..dadb6108e321 100644
--- a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml
+++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml
@@ -64,6 +64,20 @@ properties:
       - const: isp
       - const: phy
 
+  interconnects:
+    maxItems: 8
+
+  interconnect-names:
+    items:
+      - const: lcdif-rd
+      - const: lcdif-wr
+      - const: isi0
+      - const: isi1
+      - const: isi2
+      - const: isp0
+      - const: isp1
+      - const: dwe
+
 required:
   - compatible
   - reg
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH V2 2/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP hdmi blk ctrl
  2022-06-16  7:39 [PATCH V2 0/8] Add interconnect for i.MX8MP blk ctrl Peng Fan (OSS)
  2022-06-16  7:39 ` [PATCH V2 1/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP media " Peng Fan (OSS)
@ 2022-06-16  7:39 ` Peng Fan (OSS)
  2022-06-16  7:39 ` [PATCH V2 3/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP hsio " Peng Fan (OSS)
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Peng Fan (OSS) @ 2022-06-16  7:39 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: festevam, linux-imx, laurent.pinchart, paul.elder, marex,
	aford173, devicetree, linux-arm-kernel, linux-kernel, Peng Fan,
	Krzysztof Kozlowski

From: Peng Fan <peng.fan@nxp.com>

Add interconnect property for i.MX8MP hdmi blk ctrl

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/soc/imx/fsl,imx8mp-hdmi-blk-ctrl.yaml       | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-hdmi-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-hdmi-blk-ctrl.yaml
index 563e1d0e327f..1be4ce2a45e8 100644
--- a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-hdmi-blk-ctrl.yaml
+++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-hdmi-blk-ctrl.yaml
@@ -52,6 +52,15 @@ properties:
       - const: ref_266m
       - const: ref_24m
 
+  interconnects:
+    maxItems: 3
+
+  interconnect-names:
+    items:
+      - const: hrv
+      - const: lcdif-hdmi
+      - const: hdcp
+
 required:
   - compatible
   - reg
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH V2 3/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP hsio blk ctrl
  2022-06-16  7:39 [PATCH V2 0/8] Add interconnect for i.MX8MP blk ctrl Peng Fan (OSS)
  2022-06-16  7:39 ` [PATCH V2 1/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP media " Peng Fan (OSS)
  2022-06-16  7:39 ` [PATCH V2 2/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP hdmi " Peng Fan (OSS)
@ 2022-06-16  7:39 ` Peng Fan (OSS)
  2022-06-16  7:39 ` [PATCH V2 4/8] soc: imx: add icc paths for i.MX8MP media " Peng Fan (OSS)
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Peng Fan (OSS) @ 2022-06-16  7:39 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: festevam, linux-imx, laurent.pinchart, paul.elder, marex,
	aford173, devicetree, linux-arm-kernel, linux-kernel, Peng Fan,
	Krzysztof Kozlowski

From: Peng Fan <peng.fan@nxp.com>

Add interconnect property for i.MX8MP hsio blk ctrl

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/soc/imx/fsl,imx8mp-hsio-blk-ctrl.yaml     | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-hsio-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-hsio-blk-ctrl.yaml
index c1e29d94f40e..c29181a9745b 100644
--- a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-hsio-blk-ctrl.yaml
+++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-hsio-blk-ctrl.yaml
@@ -48,6 +48,16 @@ properties:
       - const: usb
       - const: pcie
 
+  interconnects:
+    maxItems: 4
+
+  interconnect-names:
+    items:
+      - const: noc-pcie
+      - const: usb1
+      - const: usb2
+      - const: pcie
+
 required:
   - compatible
   - reg
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH V2 4/8] soc: imx: add icc paths for i.MX8MP media blk ctrl
  2022-06-16  7:39 [PATCH V2 0/8] Add interconnect for i.MX8MP blk ctrl Peng Fan (OSS)
                   ` (2 preceding siblings ...)
  2022-06-16  7:39 ` [PATCH V2 3/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP hsio " Peng Fan (OSS)
@ 2022-06-16  7:39 ` Peng Fan (OSS)
  2022-06-16 10:09   ` kernel test robot
  2022-06-16 23:18   ` kernel test robot
  2022-06-16  7:39 ` [PATCH V2 5/8] soc: imx: add icc paths for i.MX8MP hsio/hdmi " Peng Fan (OSS)
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 12+ messages in thread
From: Peng Fan (OSS) @ 2022-06-16  7:39 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: festevam, linux-imx, laurent.pinchart, paul.elder, marex,
	aford173, devicetree, linux-arm-kernel, linux-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Add interconnect paths for i.MX8MP media blk ctrl

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/soc/imx/imx8m-blk-ctrl.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c
index 7ebc28709e94..fc0b94be6439 100644
--- a/drivers/soc/imx/imx8m-blk-ctrl.c
+++ b/drivers/soc/imx/imx8m-blk-ctrl.c
@@ -5,6 +5,7 @@
  */
 
 #include <linux/device.h>
+#include <linux/interconnect.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
@@ -37,6 +38,8 @@ struct imx8m_blk_ctrl_domain_data {
 	const char *name;
 	const char * const *clk_names;
 	int num_clks;
+	const char * const *path_names;
+	int num_paths;
 	const char *gpc_name;
 	u32 rst_mask;
 	u32 clk_mask;
@@ -52,11 +55,13 @@ struct imx8m_blk_ctrl_domain_data {
 };
 
 #define DOMAIN_MAX_CLKS 4
+#define DOMAIN_MAX_PATHS 4
 
 struct imx8m_blk_ctrl_domain {
 	struct generic_pm_domain genpd;
 	const struct imx8m_blk_ctrl_domain_data *data;
 	struct clk_bulk_data clks[DOMAIN_MAX_CLKS];
+	struct icc_bulk_data paths[DOMAIN_MAX_PATHS];
 	struct device *power_dev;
 	struct imx8m_blk_ctrl *bc;
 };
@@ -117,6 +122,10 @@ static int imx8m_blk_ctrl_power_on(struct generic_pm_domain *genpd)
 	if (data->mipi_phy_rst_mask)
 		regmap_set_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask);
 
+	ret = icc_bulk_set_bw(data->num_paths, domain->paths);
+	if (ret)
+		dev_err(bc->dev, "failed to set icc bw\n");
+
 	/* disable upstream clocks */
 	clk_bulk_disable_unprepare(data->num_clks, domain->clks);
 
@@ -228,6 +237,19 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
 		for (j = 0; j < data->num_clks; j++)
 			domain->clks[j].id = data->clk_names[j];
 
+		for (j = 0; j < data->num_paths; j++) {
+			domain->paths[j].name = data->path_names[j];
+			/* Fake value for now, just let ICC could configure NoC mode/priority */
+			domain->paths[j].avg_bw = 1;
+			domain->paths[j].peak_bw = 1;
+		}
+
+		ret = devm_of_icc_bulk_get(dev, data->num_paths, domain->paths);
+		if (ret) {
+			dev_err_probe(dev, ret, "failed to get noc entries\n");
+			goto cleanup_pds;
+		}
+
 		ret = devm_clk_bulk_get(dev, data->num_clks, domain->clks);
 		if (ret) {
 			dev_err_probe(dev, ret, "failed to get clock\n");
@@ -647,6 +669,8 @@ static const struct imx8m_blk_ctrl_domain_data imx8mp_media_blk_ctl_domain_data[
 		.gpc_name = "lcdif1",
 		.rst_mask = BIT(4) | BIT(5) | BIT(23),
 		.clk_mask = BIT(4) | BIT(5) | BIT(23),
+		.path_names = (const char *[]){"lcdif-rd", "lcdif-wr"},
+		.num_paths = 2,
 	},
 	[IMX8MP_MEDIABLK_PD_ISI] = {
 		.name = "mediablk-isi",
@@ -655,6 +679,8 @@ static const struct imx8m_blk_ctrl_domain_data imx8mp_media_blk_ctl_domain_data[
 		.gpc_name = "isi",
 		.rst_mask = BIT(6) | BIT(7),
 		.clk_mask = BIT(6) | BIT(7),
+		.path_names = (const char *[]){"isi0", "isi1", "isi2"},
+		.num_paths = 3,
 	},
 	[IMX8MP_MEDIABLK_PD_MIPI_CSI2_2] = {
 		.name = "mediablk-mipi-csi2-2",
@@ -672,6 +698,8 @@ static const struct imx8m_blk_ctrl_domain_data imx8mp_media_blk_ctl_domain_data[
 		.gpc_name = "lcdif2",
 		.rst_mask = BIT(11) | BIT(12) | BIT(24),
 		.clk_mask = BIT(11) | BIT(12) | BIT(24),
+		.path_names = (const char *[]){"lcdif-rd", "lcdif-wr"},
+		.num_paths = 2,
 	},
 	[IMX8MP_MEDIABLK_PD_ISP] = {
 		.name = "mediablk-isp",
@@ -680,6 +708,8 @@ static const struct imx8m_blk_ctrl_domain_data imx8mp_media_blk_ctl_domain_data[
 		.gpc_name = "isp",
 		.rst_mask = BIT(16) | BIT(17) | BIT(18),
 		.clk_mask = BIT(16) | BIT(17) | BIT(18),
+		.path_names = (const char *[]){"isp0", "isp1"},
+		.num_paths = 2,
 	},
 	[IMX8MP_MEDIABLK_PD_DWE] = {
 		.name = "mediablk-dwe",
@@ -688,6 +718,8 @@ static const struct imx8m_blk_ctrl_domain_data imx8mp_media_blk_ctl_domain_data[
 		.gpc_name = "dwe",
 		.rst_mask = BIT(19) | BIT(20) | BIT(21),
 		.clk_mask = BIT(19) | BIT(20) | BIT(21),
+		.path_names = (const char *[]){"dwe"},
+		.num_paths = 1,
 	},
 	[IMX8MP_MEDIABLK_PD_MIPI_DSI_2] = {
 		.name = "mediablk-mipi-dsi-2",
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH V2 5/8] soc: imx: add icc paths for i.MX8MP hsio/hdmi blk ctrl
  2022-06-16  7:39 [PATCH V2 0/8] Add interconnect for i.MX8MP blk ctrl Peng Fan (OSS)
                   ` (3 preceding siblings ...)
  2022-06-16  7:39 ` [PATCH V2 4/8] soc: imx: add icc paths for i.MX8MP media " Peng Fan (OSS)
@ 2022-06-16  7:39 ` Peng Fan (OSS)
  2022-06-16 10:40   ` kernel test robot
  2022-06-16  7:39 ` [PATCH V2 6/8] arm64: dts: imx8mp: add NoC node Peng Fan (OSS)
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 12+ messages in thread
From: Peng Fan (OSS) @ 2022-06-16  7:39 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: festevam, linux-imx, laurent.pinchart, paul.elder, marex,
	aford173, devicetree, linux-arm-kernel, linux-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Add interconnect paths for i.MX8MP hsio/hdmi blk ctrl

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/soc/imx/imx8mp-blk-ctrl.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/soc/imx/imx8mp-blk-ctrl.c b/drivers/soc/imx/imx8mp-blk-ctrl.c
index 4ca2ede6871b..58ff8ec70cfb 100644
--- a/drivers/soc/imx/imx8mp-blk-ctrl.c
+++ b/drivers/soc/imx/imx8mp-blk-ctrl.c
@@ -6,6 +6,7 @@
 
 #include <linux/clk.h>
 #include <linux/device.h>
+#include <linux/interconnect.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
@@ -36,15 +37,19 @@ struct imx8mp_blk_ctrl_domain_data {
 	const char *name;
 	const char * const *clk_names;
 	int num_clks;
+	const char * const *path_names;
+	int num_paths;
 	const char *gpc_name;
 };
 
 #define DOMAIN_MAX_CLKS 2
+#define DOMAIN_MAX_PATHS 3
 
 struct imx8mp_blk_ctrl_domain {
 	struct generic_pm_domain genpd;
 	const struct imx8mp_blk_ctrl_domain_data *data;
 	struct clk_bulk_data clks[DOMAIN_MAX_CLKS];
+	struct icc_bulk_data paths[DOMAIN_MAX_PATHS];
 	struct device *power_dev;
 	struct imx8mp_blk_ctrl *bc;
 	int id;
@@ -144,6 +149,8 @@ static const struct imx8mp_blk_ctrl_domain_data imx8mp_hsio_domain_data[] = {
 		.clk_names = (const char *[]){ "usb" },
 		.num_clks = 1,
 		.gpc_name = "usb",
+		.path_names = (const char *[]){"usb1", "usb2"},
+		.num_paths = 2,
 	},
 	[IMX8MP_HSIOBLK_PD_USB_PHY1] = {
 		.name = "hsioblk-usb-phy1",
@@ -158,6 +165,8 @@ static const struct imx8mp_blk_ctrl_domain_data imx8mp_hsio_domain_data[] = {
 		.clk_names = (const char *[]){ "pcie" },
 		.num_clks = 1,
 		.gpc_name = "pcie",
+		.path_names = (const char *[]){"noc-pcie", "pcie"},
+		.num_paths = 2,
 	},
 	[IMX8MP_HSIOBLK_PD_PCIE_PHY] = {
 		.name = "hsioblk-pcie-phy",
@@ -322,6 +331,8 @@ static const struct imx8mp_blk_ctrl_domain_data imx8mp_hdmi_domain_data[] = {
 		.clk_names = (const char *[]){ "axi", "apb" },
 		.num_clks = 2,
 		.gpc_name = "lcdif",
+		.path_names = (const char *[]){"lcdif-hdmi"},
+		.num_paths = 1,
 	},
 	[IMX8MP_HDMIBLK_PD_PAI] = {
 		.name = "hdmiblk-pai",
@@ -395,6 +406,10 @@ static int imx8mp_blk_ctrl_power_on(struct generic_pm_domain *genpd)
 		goto clk_disable;
 	}
 
+	ret = icc_bulk_set_bw(data->num_paths, domain->paths);
+	if (ret)
+		dev_err(bc->dev, "failed to set icc bw\n");
+
 	clk_bulk_disable_unprepare(data->num_clks, domain->clks);
 
 	return 0;
@@ -514,6 +529,20 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
 		for (j = 0; j < data->num_clks; j++)
 			domain->clks[j].id = data->clk_names[j];
 
+		for (j = 0; j < data->num_paths; j++) {
+			domain->paths[j].name = data->path_names[j];
+			/* Fake value for now, just let ICC could configure NoC mode/priority */
+			domain->paths[j].avg_bw = 1;
+			domain->paths[j].peak_bw = 1;
+		}
+
+		ret = devm_of_icc_bulk_get(dev, data->num_paths, domain->paths);
+		if (ret) {
+			dev_err_probe(dev, ret, "failed to get noc entries\n");
+			goto cleanup_pds;
+		}
+
+
 		ret = devm_clk_bulk_get(dev, data->num_clks, domain->clks);
 		if (ret) {
 			dev_err_probe(dev, ret, "failed to get clock\n");
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH V2 6/8] arm64: dts: imx8mp: add NoC node
  2022-06-16  7:39 [PATCH V2 0/8] Add interconnect for i.MX8MP blk ctrl Peng Fan (OSS)
                   ` (4 preceding siblings ...)
  2022-06-16  7:39 ` [PATCH V2 5/8] soc: imx: add icc paths for i.MX8MP hsio/hdmi " Peng Fan (OSS)
@ 2022-06-16  7:39 ` Peng Fan (OSS)
  2022-06-16  7:39 ` [PATCH V2 7/8] arm64: dts: imx8mp: add interconnects for media blk ctrl Peng Fan (OSS)
  2022-06-16  7:39 ` [PATCH V2 8/8] arm64: dts: imx8mp: add interconnect for hsio " Peng Fan (OSS)
  7 siblings, 0 replies; 12+ messages in thread
From: Peng Fan (OSS) @ 2022-06-16  7:39 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: festevam, linux-imx, laurent.pinchart, paul.elder, marex,
	aford173, devicetree, linux-arm-kernel, linux-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Add i.MX8MP NoC node

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 b2f4a5f1f73c..dd6ee0a79cce 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>
 #include <dt-bindings/power/imx8mp-power.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
@@ -1018,6 +1019,27 @@ eqos: ethernet@30bf0000 {
 			};
 		};
 
+		noc: interconnect@32700000 {
+			compatible = "fsl,imx8mp-noc", "fsl,imx8m-noc", "syscon";
+			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>;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH V2 7/8] arm64: dts: imx8mp: add interconnects for media blk ctrl
  2022-06-16  7:39 [PATCH V2 0/8] Add interconnect for i.MX8MP blk ctrl Peng Fan (OSS)
                   ` (5 preceding siblings ...)
  2022-06-16  7:39 ` [PATCH V2 6/8] arm64: dts: imx8mp: add NoC node Peng Fan (OSS)
@ 2022-06-16  7:39 ` Peng Fan (OSS)
  2022-06-16  7:39 ` [PATCH V2 8/8] arm64: dts: imx8mp: add interconnect for hsio " Peng Fan (OSS)
  7 siblings, 0 replies; 12+ messages in thread
From: Peng Fan (OSS) @ 2022-06-16  7:39 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: festevam, linux-imx, laurent.pinchart, paul.elder, marex,
	aford173, devicetree, linux-arm-kernel, linux-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Add interconnect property for media blk ctrl

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index dd6ee0a79cce..c9bd2e502b26 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -1065,6 +1065,18 @@ media_blk_ctrl: blk-ctrl@32ec0000 {
 						     "lcdif1", "isi", "mipi-csi2",
 						     "lcdif2", "isp", "dwe",
 						     "mipi-dsi2";
+				interconnects =
+					<&noc IMX8MP_ICM_LCDIF_RD &noc IMX8MP_ICN_MEDIA>,
+					<&noc IMX8MP_ICM_LCDIF_WR &noc IMX8MP_ICN_MEDIA>,
+					<&noc IMX8MP_ICM_ISI0 &noc IMX8MP_ICN_MEDIA>,
+					<&noc IMX8MP_ICM_ISI1 &noc IMX8MP_ICN_MEDIA>,
+					<&noc IMX8MP_ICM_ISI2 &noc IMX8MP_ICN_MEDIA>,
+					<&noc IMX8MP_ICM_ISP0 &noc IMX8MP_ICN_MEDIA>,
+					<&noc IMX8MP_ICM_ISP1 &noc IMX8MP_ICN_MEDIA>,
+					<&noc IMX8MP_ICM_DWE &noc IMX8MP_ICN_MEDIA>;
+				interconnect-names = "lcdif-rd", "lcdif-wr", "isi0",
+						     "isi1", "isi2", "isp0", "isp1",
+						     "dwe";
 				clocks = <&clk IMX8MP_CLK_MEDIA_APB_ROOT>,
 					 <&clk IMX8MP_CLK_MEDIA_AXI_ROOT>,
 					 <&clk IMX8MP_CLK_MEDIA_CAM1_PIX_ROOT>,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH V2 8/8] arm64: dts: imx8mp: add interconnect for hsio blk ctrl
  2022-06-16  7:39 [PATCH V2 0/8] Add interconnect for i.MX8MP blk ctrl Peng Fan (OSS)
                   ` (6 preceding siblings ...)
  2022-06-16  7:39 ` [PATCH V2 7/8] arm64: dts: imx8mp: add interconnects for media blk ctrl Peng Fan (OSS)
@ 2022-06-16  7:39 ` Peng Fan (OSS)
  7 siblings, 0 replies; 12+ messages in thread
From: Peng Fan (OSS) @ 2022-06-16  7:39 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: festevam, linux-imx, laurent.pinchart, paul.elder, marex,
	aford173, devicetree, linux-arm-kernel, linux-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Add interconnect property for hsio blk ctrl

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index c9bd2e502b26..751b5fafe203 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -1108,6 +1108,11 @@ hsio_blk_ctrl: blk-ctrl@32f10000 {
 						<&pgc_hsiomix>, <&pgc_pcie_phy>;
 				power-domain-names = "bus", "usb", "usb-phy1",
 						     "usb-phy2", "pcie", "pcie-phy";
+				interconnects = <&noc IMX8MP_ICM_NOC_PCIE &noc IMX8MP_ICN_HSIO>,
+						<&noc IMX8MP_ICM_USB1 &noc IMX8MP_ICN_HSIO>,
+						<&noc IMX8MP_ICM_USB2 &noc IMX8MP_ICN_HSIO>,
+						<&noc IMX8MP_ICM_PCIE &noc IMX8MP_ICN_HSIO>;
+				interconnect-names = "noc-pcie", "usb1", "usb2", "pcie";
 				#power-domain-cells = <1>;
 			};
 		};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH V2 4/8] soc: imx: add icc paths for i.MX8MP media blk ctrl
  2022-06-16  7:39 ` [PATCH V2 4/8] soc: imx: add icc paths for i.MX8MP media " Peng Fan (OSS)
@ 2022-06-16 10:09   ` kernel test robot
  2022-06-16 23:18   ` kernel test robot
  1 sibling, 0 replies; 12+ messages in thread
From: kernel test robot @ 2022-06-16 10:09 UTC (permalink / raw)
  To: Peng Fan (OSS), robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: kbuild-all, festevam, linux-imx, laurent.pinchart, paul.elder,
	marex, aford173, devicetree, linux-arm-kernel, linux-kernel,
	Peng Fan

Hi "Peng,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on shawnguo/for-next linus/master v5.19-rc2 next-20220616]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Peng-Fan-OSS/Add-interconnect-for-i-MX8MP-blk-ctrl/20220616-153932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arc-randconfig-r043-20220616 (https://download.01.org/0day-ci/archive/20220616/202206161757.tudlinMv-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/118c632adf7409c5a51e85fa0c61286665116b10
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Peng-Fan-OSS/Add-interconnect-for-i-MX8MP-blk-ctrl/20220616-153932
        git checkout 118c632adf7409c5a51e85fa0c61286665116b10
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash drivers/soc/imx/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/soc/imx/imx8m-blk-ctrl.c: In function 'imx8m_blk_ctrl_probe':
>> drivers/soc/imx/imx8m-blk-ctrl.c:247:23: error: implicit declaration of function 'devm_of_icc_bulk_get'; did you mean 'of_icc_bulk_get'? [-Werror=implicit-function-declaration]
     247 |                 ret = devm_of_icc_bulk_get(dev, data->num_paths, domain->paths);
         |                       ^~~~~~~~~~~~~~~~~~~~
         |                       of_icc_bulk_get
   cc1: some warnings being treated as errors


vim +247 drivers/soc/imx/imx8m-blk-ctrl.c

   178	
   179	static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
   180	{
   181		const struct imx8m_blk_ctrl_data *bc_data;
   182		struct device *dev = &pdev->dev;
   183		struct imx8m_blk_ctrl *bc;
   184		void __iomem *base;
   185		int i, ret;
   186	
   187		struct regmap_config regmap_config = {
   188			.reg_bits	= 32,
   189			.val_bits	= 32,
   190			.reg_stride	= 4,
   191		};
   192	
   193		bc = devm_kzalloc(dev, sizeof(*bc), GFP_KERNEL);
   194		if (!bc)
   195			return -ENOMEM;
   196	
   197		bc->dev = dev;
   198	
   199		bc_data = of_device_get_match_data(dev);
   200	
   201		base = devm_platform_ioremap_resource(pdev, 0);
   202		if (IS_ERR(base))
   203			return PTR_ERR(base);
   204	
   205		regmap_config.max_register = bc_data->max_reg;
   206		bc->regmap = devm_regmap_init_mmio(dev, base, &regmap_config);
   207		if (IS_ERR(bc->regmap))
   208			return dev_err_probe(dev, PTR_ERR(bc->regmap),
   209					     "failed to init regmap\n");
   210	
   211		bc->domains = devm_kcalloc(dev, bc_data->num_domains,
   212					   sizeof(struct imx8m_blk_ctrl_domain),
   213					   GFP_KERNEL);
   214		if (!bc->domains)
   215			return -ENOMEM;
   216	
   217		bc->onecell_data.num_domains = bc_data->num_domains;
   218		bc->onecell_data.xlate = imx8m_blk_ctrl_xlate;
   219		bc->onecell_data.domains =
   220			devm_kcalloc(dev, bc_data->num_domains,
   221				     sizeof(struct generic_pm_domain *), GFP_KERNEL);
   222		if (!bc->onecell_data.domains)
   223			return -ENOMEM;
   224	
   225		bc->bus_power_dev = genpd_dev_pm_attach_by_name(dev, "bus");
   226		if (IS_ERR(bc->bus_power_dev))
   227			return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev),
   228					     "failed to attach power domain\n");
   229	
   230		for (i = 0; i < bc_data->num_domains; i++) {
   231			const struct imx8m_blk_ctrl_domain_data *data = &bc_data->domains[i];
   232			struct imx8m_blk_ctrl_domain *domain = &bc->domains[i];
   233			int j;
   234	
   235			domain->data = data;
   236	
   237			for (j = 0; j < data->num_clks; j++)
   238				domain->clks[j].id = data->clk_names[j];
   239	
   240			for (j = 0; j < data->num_paths; j++) {
   241				domain->paths[j].name = data->path_names[j];
   242				/* Fake value for now, just let ICC could configure NoC mode/priority */
   243				domain->paths[j].avg_bw = 1;
   244				domain->paths[j].peak_bw = 1;
   245			}
   246	
 > 247			ret = devm_of_icc_bulk_get(dev, data->num_paths, domain->paths);
   248			if (ret) {
   249				dev_err_probe(dev, ret, "failed to get noc entries\n");
   250				goto cleanup_pds;
   251			}
   252	
   253			ret = devm_clk_bulk_get(dev, data->num_clks, domain->clks);
   254			if (ret) {
   255				dev_err_probe(dev, ret, "failed to get clock\n");
   256				goto cleanup_pds;
   257			}
   258	
   259			domain->power_dev =
   260				dev_pm_domain_attach_by_name(dev, data->gpc_name);
   261			if (IS_ERR(domain->power_dev)) {
   262				dev_err_probe(dev, PTR_ERR(domain->power_dev),
   263					      "failed to attach power domain\n");
   264				ret = PTR_ERR(domain->power_dev);
   265				goto cleanup_pds;
   266			}
   267			dev_set_name(domain->power_dev, "%s", data->name);
   268	
   269			domain->genpd.name = data->name;
   270			domain->genpd.power_on = imx8m_blk_ctrl_power_on;
   271			domain->genpd.power_off = imx8m_blk_ctrl_power_off;
   272			domain->bc = bc;
   273	
   274			ret = pm_genpd_init(&domain->genpd, NULL, true);
   275			if (ret) {
   276				dev_err_probe(dev, ret, "failed to init power domain\n");
   277				dev_pm_domain_detach(domain->power_dev, true);
   278				goto cleanup_pds;
   279			}
   280	
   281			/*
   282			 * We use runtime PM to trigger power on/off of the upstream GPC
   283			 * domain, as a strict hierarchical parent/child power domain
   284			 * setup doesn't allow us to meet the sequencing requirements.
   285			 * This means we have nested locking of genpd locks, without the
   286			 * nesting being visible at the genpd level, so we need a
   287			 * separate lock class to make lockdep aware of the fact that
   288			 * this are separate domain locks that can be nested without a
   289			 * self-deadlock.
   290			 */
   291			lockdep_set_class(&domain->genpd.mlock,
   292					  &blk_ctrl_genpd_lock_class);
   293	
   294			bc->onecell_data.domains[i] = &domain->genpd;
   295		}
   296	
   297		ret = of_genpd_add_provider_onecell(dev->of_node, &bc->onecell_data);
   298		if (ret) {
   299			dev_err_probe(dev, ret, "failed to add power domain provider\n");
   300			goto cleanup_pds;
   301		}
   302	
   303		bc->power_nb.notifier_call = bc_data->power_notifier_fn;
   304		ret = dev_pm_genpd_add_notifier(bc->bus_power_dev, &bc->power_nb);
   305		if (ret) {
   306			dev_err_probe(dev, ret, "failed to add power notifier\n");
   307			goto cleanup_provider;
   308		}
   309	
   310		dev_set_drvdata(dev, bc);
   311	
   312		return 0;
   313	
   314	cleanup_provider:
   315		of_genpd_del_provider(dev->of_node);
   316	cleanup_pds:
   317		for (i--; i >= 0; i--) {
   318			pm_genpd_remove(&bc->domains[i].genpd);
   319			dev_pm_domain_detach(bc->domains[i].power_dev, true);
   320		}
   321	
   322		dev_pm_domain_detach(bc->bus_power_dev, true);
   323	
   324		return ret;
   325	}
   326	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH V2 5/8] soc: imx: add icc paths for i.MX8MP hsio/hdmi blk ctrl
  2022-06-16  7:39 ` [PATCH V2 5/8] soc: imx: add icc paths for i.MX8MP hsio/hdmi " Peng Fan (OSS)
@ 2022-06-16 10:40   ` kernel test robot
  0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2022-06-16 10:40 UTC (permalink / raw)
  To: Peng Fan (OSS), robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: kbuild-all, festevam, linux-imx, laurent.pinchart, paul.elder,
	marex, aford173, devicetree, linux-arm-kernel, linux-kernel,
	Peng Fan

Hi "Peng,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on shawnguo/for-next linus/master v5.19-rc2 next-20220616]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Peng-Fan-OSS/Add-interconnect-for-i-MX8MP-blk-ctrl/20220616-153932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arc-randconfig-r043-20220616 (https://download.01.org/0day-ci/archive/20220616/202206161809.ZDbwd4YD-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/60034edb256677d3671a2409c83c8a0a2c11d101
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Peng-Fan-OSS/Add-interconnect-for-i-MX8MP-blk-ctrl/20220616-153932
        git checkout 60034edb256677d3671a2409c83c8a0a2c11d101
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash drivers/soc/imx/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/soc/imx/imx8mp-blk-ctrl.c: In function 'imx8mp_blk_ctrl_probe':
>> drivers/soc/imx/imx8mp-blk-ctrl.c:539:23: error: implicit declaration of function 'devm_of_icc_bulk_get'; did you mean 'of_icc_bulk_get'? [-Werror=implicit-function-declaration]
     539 |                 ret = devm_of_icc_bulk_get(dev, data->num_paths, domain->paths);
         |                       ^~~~~~~~~~~~~~~~~~~~
         |                       of_icc_bulk_get
   cc1: some warnings being treated as errors


vim +539 drivers/soc/imx/imx8mp-blk-ctrl.c

   466	
   467	static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
   468	{
   469		const struct imx8mp_blk_ctrl_data *bc_data;
   470		struct device *dev = &pdev->dev;
   471		struct imx8mp_blk_ctrl *bc;
   472		void __iomem *base;
   473		int num_domains, i, ret;
   474	
   475		struct regmap_config regmap_config = {
   476			.reg_bits	= 32,
   477			.val_bits	= 32,
   478			.reg_stride	= 4,
   479		};
   480	
   481		bc = devm_kzalloc(dev, sizeof(*bc), GFP_KERNEL);
   482		if (!bc)
   483			return -ENOMEM;
   484	
   485		bc->dev = dev;
   486	
   487		bc_data = of_device_get_match_data(dev);
   488		num_domains = bc_data->num_domains;
   489	
   490		base = devm_platform_ioremap_resource(pdev, 0);
   491		if (IS_ERR(base))
   492			return PTR_ERR(base);
   493	
   494		regmap_config.max_register = bc_data->max_reg;
   495		bc->regmap = devm_regmap_init_mmio(dev, base, &regmap_config);
   496		if (IS_ERR(bc->regmap))
   497			return dev_err_probe(dev, PTR_ERR(bc->regmap),
   498					     "failed to init regmap\n");
   499	
   500		bc->domains = devm_kcalloc(dev, num_domains,
   501					   sizeof(struct imx8mp_blk_ctrl_domain),
   502					   GFP_KERNEL);
   503		if (!bc->domains)
   504			return -ENOMEM;
   505	
   506		bc->onecell_data.num_domains = num_domains;
   507		bc->onecell_data.xlate = imx8m_blk_ctrl_xlate;
   508		bc->onecell_data.domains =
   509			devm_kcalloc(dev, num_domains,
   510				     sizeof(struct generic_pm_domain *), GFP_KERNEL);
   511		if (!bc->onecell_data.domains)
   512			return -ENOMEM;
   513	
   514		bc->bus_power_dev = genpd_dev_pm_attach_by_name(dev, "bus");
   515		if (IS_ERR(bc->bus_power_dev))
   516			return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev),
   517					     "failed to attach bus power domain\n");
   518	
   519		bc->power_off = bc_data->power_off;
   520		bc->power_on = bc_data->power_on;
   521	
   522		for (i = 0; i < num_domains; i++) {
   523			const struct imx8mp_blk_ctrl_domain_data *data = &bc_data->domains[i];
   524			struct imx8mp_blk_ctrl_domain *domain = &bc->domains[i];
   525			int j;
   526	
   527			domain->data = data;
   528	
   529			for (j = 0; j < data->num_clks; j++)
   530				domain->clks[j].id = data->clk_names[j];
   531	
   532			for (j = 0; j < data->num_paths; j++) {
   533				domain->paths[j].name = data->path_names[j];
   534				/* Fake value for now, just let ICC could configure NoC mode/priority */
   535				domain->paths[j].avg_bw = 1;
   536				domain->paths[j].peak_bw = 1;
   537			}
   538	
 > 539			ret = devm_of_icc_bulk_get(dev, data->num_paths, domain->paths);
   540			if (ret) {
   541				dev_err_probe(dev, ret, "failed to get noc entries\n");
   542				goto cleanup_pds;
   543			}
   544	
   545	
   546			ret = devm_clk_bulk_get(dev, data->num_clks, domain->clks);
   547			if (ret) {
   548				dev_err_probe(dev, ret, "failed to get clock\n");
   549				goto cleanup_pds;
   550			}
   551	
   552			domain->power_dev =
   553				dev_pm_domain_attach_by_name(dev, data->gpc_name);
   554			if (IS_ERR(domain->power_dev)) {
   555				dev_err_probe(dev, PTR_ERR(domain->power_dev),
   556					      "failed to attach power domain %s\n",
   557					      data->gpc_name);
   558				ret = PTR_ERR(domain->power_dev);
   559				goto cleanup_pds;
   560			}
   561			dev_set_name(domain->power_dev, "%s", data->name);
   562	
   563			domain->genpd.name = data->name;
   564			domain->genpd.power_on = imx8mp_blk_ctrl_power_on;
   565			domain->genpd.power_off = imx8mp_blk_ctrl_power_off;
   566			domain->bc = bc;
   567			domain->id = i;
   568	
   569			ret = pm_genpd_init(&domain->genpd, NULL, true);
   570			if (ret) {
   571				dev_err_probe(dev, ret, "failed to init power domain\n");
   572				dev_pm_domain_detach(domain->power_dev, true);
   573				goto cleanup_pds;
   574			}
   575	
   576			/*
   577			 * We use runtime PM to trigger power on/off of the upstream GPC
   578			 * domain, as a strict hierarchical parent/child power domain
   579			 * setup doesn't allow us to meet the sequencing requirements.
   580			 * This means we have nested locking of genpd locks, without the
   581			 * nesting being visible at the genpd level, so we need a
   582			 * separate lock class to make lockdep aware of the fact that
   583			 * this are separate domain locks that can be nested without a
   584			 * self-deadlock.
   585			 */
   586			lockdep_set_class(&domain->genpd.mlock,
   587					  &blk_ctrl_genpd_lock_class);
   588	
   589			bc->onecell_data.domains[i] = &domain->genpd;
   590		}
   591	
   592		ret = of_genpd_add_provider_onecell(dev->of_node, &bc->onecell_data);
   593		if (ret) {
   594			dev_err_probe(dev, ret, "failed to add power domain provider\n");
   595			goto cleanup_pds;
   596		}
   597	
   598		bc->power_nb.notifier_call = bc_data->power_notifier_fn;
   599		ret = dev_pm_genpd_add_notifier(bc->bus_power_dev, &bc->power_nb);
   600		if (ret) {
   601			dev_err_probe(dev, ret, "failed to add power notifier\n");
   602			goto cleanup_provider;
   603		}
   604	
   605		dev_set_drvdata(dev, bc);
   606	
   607		return 0;
   608	
   609	cleanup_provider:
   610		of_genpd_del_provider(dev->of_node);
   611	cleanup_pds:
   612		for (i--; i >= 0; i--) {
   613			pm_genpd_remove(&bc->domains[i].genpd);
   614			dev_pm_domain_detach(bc->domains[i].power_dev, true);
   615		}
   616	
   617		dev_pm_domain_detach(bc->bus_power_dev, true);
   618	
   619		return ret;
   620	}
   621	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH V2 4/8] soc: imx: add icc paths for i.MX8MP media blk ctrl
  2022-06-16  7:39 ` [PATCH V2 4/8] soc: imx: add icc paths for i.MX8MP media " Peng Fan (OSS)
  2022-06-16 10:09   ` kernel test robot
@ 2022-06-16 23:18   ` kernel test robot
  1 sibling, 0 replies; 12+ messages in thread
From: kernel test robot @ 2022-06-16 23:18 UTC (permalink / raw)
  To: Peng Fan (OSS), robh+dt, krzysztof.kozlowski+dt, shawnguo, s.hauer
  Cc: llvm, kbuild-all, festevam, linux-imx, laurent.pinchart,
	paul.elder, marex, aford173, devicetree, linux-arm-kernel,
	linux-kernel, Peng Fan

Hi "Peng,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on shawnguo/for-next linus/master v5.19-rc2 next-20220616]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Peng-Fan-OSS/Add-interconnect-for-i-MX8MP-blk-ctrl/20220616-153932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: hexagon-randconfig-r045-20220616 (https://download.01.org/0day-ci/archive/20220617/202206170720.eTetqCJ6-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f0e608de27b3d568000046eebf3712ab542979d6)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/118c632adf7409c5a51e85fa0c61286665116b10
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Peng-Fan-OSS/Add-interconnect-for-i-MX8MP-blk-ctrl/20220616-153932
        git checkout 118c632adf7409c5a51e85fa0c61286665116b10
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/soc/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/soc/imx/imx8m-blk-ctrl.c:247:9: error: call to undeclared function 'devm_of_icc_bulk_get'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                   ret = devm_of_icc_bulk_get(dev, data->num_paths, domain->paths);
                         ^
   1 error generated.


vim +/devm_of_icc_bulk_get +247 drivers/soc/imx/imx8m-blk-ctrl.c

   178	
   179	static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
   180	{
   181		const struct imx8m_blk_ctrl_data *bc_data;
   182		struct device *dev = &pdev->dev;
   183		struct imx8m_blk_ctrl *bc;
   184		void __iomem *base;
   185		int i, ret;
   186	
   187		struct regmap_config regmap_config = {
   188			.reg_bits	= 32,
   189			.val_bits	= 32,
   190			.reg_stride	= 4,
   191		};
   192	
   193		bc = devm_kzalloc(dev, sizeof(*bc), GFP_KERNEL);
   194		if (!bc)
   195			return -ENOMEM;
   196	
   197		bc->dev = dev;
   198	
   199		bc_data = of_device_get_match_data(dev);
   200	
   201		base = devm_platform_ioremap_resource(pdev, 0);
   202		if (IS_ERR(base))
   203			return PTR_ERR(base);
   204	
   205		regmap_config.max_register = bc_data->max_reg;
   206		bc->regmap = devm_regmap_init_mmio(dev, base, &regmap_config);
   207		if (IS_ERR(bc->regmap))
   208			return dev_err_probe(dev, PTR_ERR(bc->regmap),
   209					     "failed to init regmap\n");
   210	
   211		bc->domains = devm_kcalloc(dev, bc_data->num_domains,
   212					   sizeof(struct imx8m_blk_ctrl_domain),
   213					   GFP_KERNEL);
   214		if (!bc->domains)
   215			return -ENOMEM;
   216	
   217		bc->onecell_data.num_domains = bc_data->num_domains;
   218		bc->onecell_data.xlate = imx8m_blk_ctrl_xlate;
   219		bc->onecell_data.domains =
   220			devm_kcalloc(dev, bc_data->num_domains,
   221				     sizeof(struct generic_pm_domain *), GFP_KERNEL);
   222		if (!bc->onecell_data.domains)
   223			return -ENOMEM;
   224	
   225		bc->bus_power_dev = genpd_dev_pm_attach_by_name(dev, "bus");
   226		if (IS_ERR(bc->bus_power_dev))
   227			return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev),
   228					     "failed to attach power domain\n");
   229	
   230		for (i = 0; i < bc_data->num_domains; i++) {
   231			const struct imx8m_blk_ctrl_domain_data *data = &bc_data->domains[i];
   232			struct imx8m_blk_ctrl_domain *domain = &bc->domains[i];
   233			int j;
   234	
   235			domain->data = data;
   236	
   237			for (j = 0; j < data->num_clks; j++)
   238				domain->clks[j].id = data->clk_names[j];
   239	
   240			for (j = 0; j < data->num_paths; j++) {
   241				domain->paths[j].name = data->path_names[j];
   242				/* Fake value for now, just let ICC could configure NoC mode/priority */
   243				domain->paths[j].avg_bw = 1;
   244				domain->paths[j].peak_bw = 1;
   245			}
   246	
 > 247			ret = devm_of_icc_bulk_get(dev, data->num_paths, domain->paths);
   248			if (ret) {
   249				dev_err_probe(dev, ret, "failed to get noc entries\n");
   250				goto cleanup_pds;
   251			}
   252	
   253			ret = devm_clk_bulk_get(dev, data->num_clks, domain->clks);
   254			if (ret) {
   255				dev_err_probe(dev, ret, "failed to get clock\n");
   256				goto cleanup_pds;
   257			}
   258	
   259			domain->power_dev =
   260				dev_pm_domain_attach_by_name(dev, data->gpc_name);
   261			if (IS_ERR(domain->power_dev)) {
   262				dev_err_probe(dev, PTR_ERR(domain->power_dev),
   263					      "failed to attach power domain\n");
   264				ret = PTR_ERR(domain->power_dev);
   265				goto cleanup_pds;
   266			}
   267			dev_set_name(domain->power_dev, "%s", data->name);
   268	
   269			domain->genpd.name = data->name;
   270			domain->genpd.power_on = imx8m_blk_ctrl_power_on;
   271			domain->genpd.power_off = imx8m_blk_ctrl_power_off;
   272			domain->bc = bc;
   273	
   274			ret = pm_genpd_init(&domain->genpd, NULL, true);
   275			if (ret) {
   276				dev_err_probe(dev, ret, "failed to init power domain\n");
   277				dev_pm_domain_detach(domain->power_dev, true);
   278				goto cleanup_pds;
   279			}
   280	
   281			/*
   282			 * We use runtime PM to trigger power on/off of the upstream GPC
   283			 * domain, as a strict hierarchical parent/child power domain
   284			 * setup doesn't allow us to meet the sequencing requirements.
   285			 * This means we have nested locking of genpd locks, without the
   286			 * nesting being visible at the genpd level, so we need a
   287			 * separate lock class to make lockdep aware of the fact that
   288			 * this are separate domain locks that can be nested without a
   289			 * self-deadlock.
   290			 */
   291			lockdep_set_class(&domain->genpd.mlock,
   292					  &blk_ctrl_genpd_lock_class);
   293	
   294			bc->onecell_data.domains[i] = &domain->genpd;
   295		}
   296	
   297		ret = of_genpd_add_provider_onecell(dev->of_node, &bc->onecell_data);
   298		if (ret) {
   299			dev_err_probe(dev, ret, "failed to add power domain provider\n");
   300			goto cleanup_pds;
   301		}
   302	
   303		bc->power_nb.notifier_call = bc_data->power_notifier_fn;
   304		ret = dev_pm_genpd_add_notifier(bc->bus_power_dev, &bc->power_nb);
   305		if (ret) {
   306			dev_err_probe(dev, ret, "failed to add power notifier\n");
   307			goto cleanup_provider;
   308		}
   309	
   310		dev_set_drvdata(dev, bc);
   311	
   312		return 0;
   313	
   314	cleanup_provider:
   315		of_genpd_del_provider(dev->of_node);
   316	cleanup_pds:
   317		for (i--; i >= 0; i--) {
   318			pm_genpd_remove(&bc->domains[i].genpd);
   319			dev_pm_domain_detach(bc->domains[i].power_dev, true);
   320		}
   321	
   322		dev_pm_domain_detach(bc->bus_power_dev, true);
   323	
   324		return ret;
   325	}
   326	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-06-16 23:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16  7:39 [PATCH V2 0/8] Add interconnect for i.MX8MP blk ctrl Peng Fan (OSS)
2022-06-16  7:39 ` [PATCH V2 1/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP media " Peng Fan (OSS)
2022-06-16  7:39 ` [PATCH V2 2/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP hdmi " Peng Fan (OSS)
2022-06-16  7:39 ` [PATCH V2 3/8] dt-bindings: soc: imx: add interconnect property for i.MX8MP hsio " Peng Fan (OSS)
2022-06-16  7:39 ` [PATCH V2 4/8] soc: imx: add icc paths for i.MX8MP media " Peng Fan (OSS)
2022-06-16 10:09   ` kernel test robot
2022-06-16 23:18   ` kernel test robot
2022-06-16  7:39 ` [PATCH V2 5/8] soc: imx: add icc paths for i.MX8MP hsio/hdmi " Peng Fan (OSS)
2022-06-16 10:40   ` kernel test robot
2022-06-16  7:39 ` [PATCH V2 6/8] arm64: dts: imx8mp: add NoC node Peng Fan (OSS)
2022-06-16  7:39 ` [PATCH V2 7/8] arm64: dts: imx8mp: add interconnects for media blk ctrl Peng Fan (OSS)
2022-06-16  7:39 ` [PATCH V2 8/8] arm64: dts: imx8mp: add interconnect for hsio " Peng Fan (OSS)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).