2022-07-13 06:48:45

by Peng Fan (OSS)

[permalink] [raw]
Subject: [PATCH V2 0/6] imx: add i.MX8MP hdmi blk ctrl hdcp/hrv and vpu blk ctrl

From: Peng Fan <[email protected]>

V2:
- Add A-b from DT maintainer for patch 1
- Per DT maintainer, I added description for items. To
make it consistent, I also added description to i.MX8MM.
- Per Adam, change VPU H1/h1 to VC8000E/vc8000e in the patchset.

This patchset is to add more blk ctrl support for i.MX8MP
- Add HDMI HDCP/HRV BLK CTRL support
- Add VPU BLK CTRL support
- Add PGC VPU node which supplies power domain for VPU BLK
This patchset is based on:
https://lore.kernel.org/all/[email protected]/

repo: https://github.com/MrVan/linux/tree/imx8mp-blk-ctrl

Peng Fan (6):
dt-bindings: power: imx8mp-power: add HDMI HDCP/HRV
dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl
soc: imx: add i.MX8MP HDMI blk ctrl HDCP/HRV
soc: imx: imx8m-blk-ctrl: add i.MX8MP VPU blk ctrl
arm64: dts: imx8mp: add vpu pgc nodes
arm64: dts: imx8mp: add VPU blk ctrl node

.../soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml | 93 ++++++++++++++++---
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 45 +++++++++
drivers/soc/imx/imx8m-blk-ctrl.c | 43 +++++++++
drivers/soc/imx/imx8mp-blk-ctrl.c | 30 ++++++
include/dt-bindings/power/imx8mp-power.h | 6 ++
5 files changed, 206 insertions(+), 11 deletions(-)

--
2.25.1


2022-07-13 06:49:34

by Peng Fan (OSS)

[permalink] [raw]
Subject: [PATCH V2 1/6] dt-bindings: power: imx8mp-power: add HDMI HDCP/HRV

From: Peng Fan <[email protected]>

Add i.MX8MP HDMI HDCP and HRV entries.

Signed-off-by: Peng Fan <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
---
include/dt-bindings/power/imx8mp-power.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/dt-bindings/power/imx8mp-power.h b/include/dt-bindings/power/imx8mp-power.h
index 7789bcca3223..14b9c5ac9c82 100644
--- a/include/dt-bindings/power/imx8mp-power.h
+++ b/include/dt-bindings/power/imx8mp-power.h
@@ -49,5 +49,7 @@
#define IMX8MP_HDMIBLK_PD_TRNG 4
#define IMX8MP_HDMIBLK_PD_HDMI_TX 5
#define IMX8MP_HDMIBLK_PD_HDMI_TX_PHY 6
+#define IMX8MP_HDMIBLK_PD_HDCP 7
+#define IMX8MP_HDMIBLK_PD_HRV 8

#endif
--
2.25.1

2022-07-13 06:49:41

by Peng Fan (OSS)

[permalink] [raw]
Subject: [PATCH V2 5/6] arm64: dts: imx8mp: add vpu pgc nodes

From: Peng Fan <[email protected]>

Add i.MX8MP PGC nodes for vpu, which are used to supply power for VPU.

Signed-off-by: Peng Fan <[email protected]>
---
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 27 +++++++++++++++++++++++
1 file changed, 27 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index 0b165f98a82c..34af983b0210 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -598,6 +598,33 @@ pgc_ispdwp: power-domain@18 {
reg = <IMX8MP_POWER_DOMAIN_MEDIAMIX_ISPDWP>;
clocks = <&clk IMX8MP_CLK_MEDIA_ISP_ROOT>;
};
+
+ pgc_vpumix: power-domain@19 {
+ #power-domain-cells = <0>;
+ reg = <IMX8MP_POWER_DOMAIN_VPUMIX>;
+ clocks =<&clk IMX8MP_CLK_VPU_ROOT>;
+ };
+
+ pgc_vpu_g1: power-domain@20 {
+ #power-domain-cells = <0>;
+ power-domains = <&pgc_vpumix>;
+ reg = <IMX8MP_POWER_DOMAIN_VPU_G1>;
+ clocks = <&clk IMX8MP_CLK_VPU_G1_ROOT>;
+ };
+
+ pgc_vpu_g2: power-domain@21 {
+ #power-domain-cells = <0>;
+ power-domains = <&pgc_vpumix>;
+ reg = <IMX8MP_POWER_DOMAIN_VPU_G2>;
+ clocks = <&clk IMX8MP_CLK_VPU_G2_ROOT>;
+ };
+
+ pgc_vpu_vc8000e: power-domain@22 {
+ #power-domain-cells = <0>;
+ power-domains = <&pgc_vpumix>;
+ reg = <IMX8MP_POWER_DOMAIN_VPU_VC8000E>;
+ clocks = <&clk IMX8MP_CLK_VPU_VC8KE_ROOT>;
+ };
};
};
};
--
2.25.1

2022-07-13 07:05:53

by Peng Fan (OSS)

[permalink] [raw]
Subject: [PATCH V2 2/6] dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl

From: Peng Fan <[email protected]>

i.MX8MP VPU blk ctrl module has similar design as i.MX8MM, so reuse
the i.MX8MM VPU blk ctrl yaml file. And add description for the items.

Signed-off-by: Peng Fan <[email protected]>
---
.../soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml | 93 ++++++++++++++++---
include/dt-bindings/power/imx8mp-power.h | 4 +
2 files changed, 86 insertions(+), 11 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml
index 26487daa64d9..d05930f61f95 100644
--- a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml
+++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml
@@ -28,24 +28,15 @@ properties:

power-domains:
minItems: 4
- maxItems: 4

power-domain-names:
- items:
- - const: bus
- - const: g1
- - const: g2
- - const: h1
+ minItems: 4

clocks:
minItems: 3
- maxItems: 3

clock-names:
- items:
- - const: g1
- - const: g2
- - const: h1
+ minItems: 3

required:
- compatible
@@ -55,6 +46,86 @@ required:
- clocks
- clock-names

+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: fsl,imx8mm-vpu-blk-ctrl
+ then:
+ properties:
+ power-domains:
+ items:
+ - description: bus power domain
+ - description: G1 decoder power domain
+ - description: G2 decoder power domain
+ - description: H1 encoder power domain
+
+ power-domain-names:
+ items:
+ - const: bus
+ - const: g1
+ - const: g2
+ - const: h1
+
+ clocks:
+ items:
+ - description: G1 decoder clk
+ - description: G2 decoder clk
+ - description: H1 encoder clk
+
+ clock-names:
+ items:
+ - const: g1
+ - const: g2
+ - const: h1
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: fsl,imx8mp-vpu-blk-ctrl
+ then:
+ properties:
+ power-domains:
+ items:
+ - description: bus power domain
+ - description: G1 decoder power domain
+ - description: G2 decoder power domain
+ - description: VC8000E encoder power domain
+
+ power-domain-names:
+ items:
+ - const: bus
+ - const: g1
+ - const: g2
+ - const: vc8000e
+
+ clocks:
+ items:
+ - description: G1 decoder clk
+ - description: G2 decoder clk
+ - description: VC8000E encoder clk
+
+ clock-names:
+ items:
+ - const: g1
+ - const: g2
+ - const: vc8000e
+
+ interconnects:
+ items:
+ - description: G1 decoder interconnect
+ - description: G2 decoder interconnect
+ - description: VC8000E encoder interconnect
+
+ interconnect-names:
+ items:
+ - const: g1
+ - const: g2
+ - const: vc8000e
+
+
additionalProperties: false

examples:
diff --git a/include/dt-bindings/power/imx8mp-power.h b/include/dt-bindings/power/imx8mp-power.h
index 14b9c5ac9c82..2fe3c2abad13 100644
--- a/include/dt-bindings/power/imx8mp-power.h
+++ b/include/dt-bindings/power/imx8mp-power.h
@@ -52,4 +52,8 @@
#define IMX8MP_HDMIBLK_PD_HDCP 7
#define IMX8MP_HDMIBLK_PD_HRV 8

+#define IMX8MP_VPUBLK_PD_G1 0
+#define IMX8MP_VPUBLK_PD_G2 1
+#define IMX8MP_VPUBLK_PD_VC8000E 2
+
#endif
--
2.25.1

2022-07-13 09:08:14

by Peng Fan

[permalink] [raw]
Subject: RE: [PATCH V2 2/6] dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl

Hi Krzysztof,

> Subject: Re: [PATCH V2 2/6] dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl
>
> On 13/07/2022 08:36, Peng Fan (OSS) wrote:
> > From: Peng Fan <[email protected]>
> >
> > i.MX8MP VPU blk ctrl module has similar design as i.MX8MM, so reuse
> > the i.MX8MM VPU blk ctrl yaml file. And add description for the items.
> >
> > Signed-off-by: Peng Fan <[email protected]>
> > ---
> > .../soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml | 93 ++++++++++++++++---
> > include/dt-bindings/power/imx8mp-power.h | 4 +
> > 2 files changed, 86 insertions(+), 11 deletions(-)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-
> ctrl.ya
> > ml
> > b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-
> ctrl.ya
> > ml index 26487daa64d9..d05930f61f95 100644
> > ---
> > a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-
> ctrl.ya
> > ml
> > +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-
> ctr
> > +++ l.yaml
> > @@ -28,24 +28,15 @@ properties:
> >
> > power-domains:
> > minItems: 4
> > - maxItems: 4
>
> This is not correct. maxItems must stay, but you could drop minItems,
> prefferrably in separate patch.
[Peng Fan]

Ok, I will only keep maxItems. For separate patch, you mean
separate adding description for i.MX8MM to one patch, right?

>
> >
> > power-domain-names:
> > - items:
> > - - const: bus
> > - - const: g1
> > - - const: g2
> > - - const: h1
> > + minItems: 4
>
> maxItems instead

Got it. Will only keep maxItems

>
> >
> > clocks:
> > minItems: 3
> > - maxItems: 3
>
> Same error...
Got it. Will only keep maxItems

Thanks,
Peng.
>
> Best regards,
> Krzysztof

2022-07-13 09:09:25

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH V2 2/6] dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl

On 13/07/2022 08:36, Peng Fan (OSS) wrote:
> From: Peng Fan <[email protected]>
>
> i.MX8MP VPU blk ctrl module has similar design as i.MX8MM, so reuse
> the i.MX8MM VPU blk ctrl yaml file. And add description for the items.
>
> Signed-off-by: Peng Fan <[email protected]>
> ---
> .../soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml | 93 ++++++++++++++++---
> include/dt-bindings/power/imx8mp-power.h | 4 +
> 2 files changed, 86 insertions(+), 11 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml
> index 26487daa64d9..d05930f61f95 100644
> --- a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml
> +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml
> @@ -28,24 +28,15 @@ properties:
>
> power-domains:
> minItems: 4
> - maxItems: 4

This is not correct. maxItems must stay, but you could drop minItems,
prefferrably in separate patch.

>
> power-domain-names:
> - items:
> - - const: bus
> - - const: g1
> - - const: g2
> - - const: h1
> + minItems: 4

maxItems instead

>
> clocks:
> minItems: 3
> - maxItems: 3

Same error...

Best regards,
Krzysztof

2022-07-13 09:45:57

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH V2 2/6] dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl

On 13/07/2022 11:03, Peng Fan wrote:
> Hi Krzysztof,
>
>> Subject: Re: [PATCH V2 2/6] dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl
>>
>> On 13/07/2022 08:36, Peng Fan (OSS) wrote:
>>> From: Peng Fan <[email protected]>
>>>
>>> i.MX8MP VPU blk ctrl module has similar design as i.MX8MM, so reuse
>>> the i.MX8MM VPU blk ctrl yaml file. And add description for the items.
>>>
>>> Signed-off-by: Peng Fan <[email protected]>
>>> ---
>>> .../soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml | 93 ++++++++++++++++---
>>> include/dt-bindings/power/imx8mp-power.h | 4 +
>>> 2 files changed, 86 insertions(+), 11 deletions(-)
>>>
>>> diff --git
>>> a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-
>> ctrl.ya
>>> ml
>>> b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-
>> ctrl.ya
>>> ml index 26487daa64d9..d05930f61f95 100644
>>> ---
>>> a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-
>> ctrl.ya
>>> ml
>>> +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-
>> ctr
>>> +++ l.yaml
>>> @@ -28,24 +28,15 @@ properties:
>>>
>>> power-domains:
>>> minItems: 4
>>> - maxItems: 4
>>
>> This is not correct. maxItems must stay, but you could drop minItems,
>> prefferrably in separate patch.
> [Peng Fan]
>
> Ok, I will only keep maxItems. For separate patch, you mean
> separate adding description for i.MX8MM to one patch, right?

I mean, a new patch doing cleanup. You currently have minItems and
maxItems set as the same value. In such case minItems is not necessary.
You could remove all of minItems (when equal to maxItems) before adding
new device support.


Best regards,
Krzysztof

2022-07-13 09:47:07

by Peng Fan

[permalink] [raw]
Subject: RE: [PATCH V2 2/6] dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl

> Subject: Re: [PATCH V2 2/6] dt-bindings: soc: imx: add i.MX8MP vpu blk ctrl
>
> On 13/07/2022 11:03, Peng Fan wrote:
> > Hi Krzysztof,
> >
> >> Subject: Re: [PATCH V2 2/6] dt-bindings: soc: imx: add i.MX8MP vpu
> >> blk ctrl
> >>
> >> On 13/07/2022 08:36, Peng Fan (OSS) wrote:
> >>> From: Peng Fan <[email protected]>
> >>>
> >>> i.MX8MP VPU blk ctrl module has similar design as i.MX8MM, so reuse
> >>> the i.MX8MM VPU blk ctrl yaml file. And add description for the items.
> >>>
> >>> Signed-off-by: Peng Fan <[email protected]>
> >>> ---
> >>> .../soc/imx/fsl,imx8mm-vpu-blk-ctrl.yaml | 93 ++++++++++++++++---
> >>> include/dt-bindings/power/imx8mp-power.h | 4 +
> >>> 2 files changed, 86 insertions(+), 11 deletions(-)
> >>>
> >>> diff --git
> >>> a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-
> >> ctrl.ya
> >>> ml
> >>> b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-
> >> ctrl.ya
> >>> ml index 26487daa64d9..d05930f61f95 100644
> >>> ---
> >>> a/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-blk-
> >> ctrl.ya
> >>> ml
> >>> +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx8mm-vpu-
> blk-
> >> ctr
> >>> +++ l.yaml
> >>> @@ -28,24 +28,15 @@ properties:
> >>>
> >>> power-domains:
> >>> minItems: 4
> >>> - maxItems: 4
> >>
> >> This is not correct. maxItems must stay, but you could drop minItems,
> >> prefferrably in separate patch.
> > [Peng Fan]
> >
> > Ok, I will only keep maxItems. For separate patch, you mean separate
> > adding description for i.MX8MM to one patch, right?
>
> I mean, a new patch doing cleanup. You currently have minItems and
> maxItems set as the same value. In such case minItems is not necessary.
> You could remove all of minItems (when equal to maxItems) before adding
> new device support.

Thanks, got it. I will wait for a few days to collect comments on other
parts before V3.

Thanks,
Peng.
>
>
> Best regards,
> Krzysztof

2023-03-27 05:13:49

by Greg Ungerer

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: imx8mp: add vpu pgc nodes

On 22/8/22 14:45, Peng Fan wrote:
> Add i.MX8MP PGC nodes for vpu, which are used to supply power for VPU.
>
> Signed-off-by: Peng Fan <[email protected]>
> Signed-off-by: Shawn Guo <[email protected]>
> ---
> arch/arm64/boot/dts/freescale/imx8mp.dtsi | 27 +++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> index 0b165f98a82c..34af983b0210 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> @@ -598,6 +598,33 @@ pgc_ispdwp: power-domain@18 {
> reg = <IMX8MP_POWER_DOMAIN_MEDIAMIX_ISPDWP>;
> clocks = <&clk IMX8MP_CLK_MEDIA_ISP_ROOT>;
> };
> +
> + pgc_vpumix: power-domain@19 {
> + #power-domain-cells = <0>;
> + reg = <IMX8MP_POWER_DOMAIN_VPUMIX>;
> + clocks =<&clk IMX8MP_CLK_VPU_ROOT>;
> + };
> +
> + pgc_vpu_g1: power-domain@20 {
> + #power-domain-cells = <0>;
> + power-domains = <&pgc_vpumix>;
> + reg = <IMX8MP_POWER_DOMAIN_VPU_G1>;
> + clocks = <&clk IMX8MP_CLK_VPU_G1_ROOT>;
> + };
> +
> + pgc_vpu_g2: power-domain@21 {
> + #power-domain-cells = <0>;
> + power-domains = <&pgc_vpumix>;
> + reg = <IMX8MP_POWER_DOMAIN_VPU_G2>;
> + clocks = <&clk IMX8MP_CLK_VPU_G2_ROOT>;
> + };
> +
> + pgc_vpu_vc8000e: power-domain@22 {
> + #power-domain-cells = <0>;
> + power-domains = <&pgc_vpumix>;
> + reg = <IMX8MP_POWER_DOMAIN_VPU_VC8000E>;
> + clocks = <&clk IMX8MP_CLK_VPU_VC8KE_ROOT>;
> + };
> };
> };
> };

This change causes new error messages to come out during boot, for example:

...
imx-pgc imx-pgc-domain.8: failed to command PGC
imx-pgc imx-pgc-domain.8: failed to command PGC
imx-pgc imx-pgc-domain.8: failed to command PGC
30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 197, base_baud = 1500000) is a IMX
...
hwmon hwmon1: temp1_input not attached to any thermal zone
imx-pgc imx-pgc-domain.8: failed to command PGC
imx-pgc imx-pgc-domain.8: failed to command PGC
imx-pgc imx-pgc-domain.8: failed to command PGC
...

They don't seem to cause any problems on the hardware I am using, well,
at least not that I have found so far.

This first appeared for me in linux-6.1. But it is the same in todays
linux 6.3-rc4. Reverting this change (not completely trivial due to a
couple of commits after it that rely on it) fixes it - no more errors.

Regards
Greg


2023-03-27 10:12:05

by Peng Fan

[permalink] [raw]
Subject: RE: [PATCH] arm64: dts: imx8mp: add vpu pgc nodes

> Subject: Re: [PATCH] arm64: dts: imx8mp: add vpu pgc nodes
>
> On 22/8/22 14:45, Peng Fan wrote:
> > Add i.MX8MP PGC nodes for vpu, which are used to supply power for VPU.
> >
> > Signed-off-by: Peng Fan <[email protected]>
> > Signed-off-by: Shawn Guo <[email protected]>
> > ---
> > arch/arm64/boot/dts/freescale/imx8mp.dtsi | 27
> > +++++++++++++++++++++++
> > 1 file changed, 27 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > index 0b165f98a82c..34af983b0210 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > @@ -598,6 +598,33 @@ pgc_ispdwp: power-domain@18 {
> > reg =
> <IMX8MP_POWER_DOMAIN_MEDIAMIX_ISPDWP>;
> > clocks = <&clk IMX8MP_CLK_MEDIA_ISP_ROOT>;
> > };
> > +
> > + pgc_vpumix: power-domain@19 {
> > + #power-domain-cells = <0>;
> > + reg = <IMX8MP_POWER_DOMAIN_VPUMIX>;
> > + clocks =<&clk IMX8MP_CLK_VPU_ROOT>;
> > + };
> > +
> > + pgc_vpu_g1: power-domain@20 {
> > + #power-domain-cells = <0>;
> > + power-domains = <&pgc_vpumix>;
> > + reg = <IMX8MP_POWER_DOMAIN_VPU_G1>;
> > + clocks = <&clk IMX8MP_CLK_VPU_G1_ROOT>;
> > + };
> > +
> > + pgc_vpu_g2: power-domain@21 {
> > + #power-domain-cells = <0>;
> > + power-domains = <&pgc_vpumix>;
> > + reg = <IMX8MP_POWER_DOMAIN_VPU_G2>;
> > + clocks = <&clk IMX8MP_CLK_VPU_G2_ROOT>;
> > + };
> > +
> > + pgc_vpu_vc8000e: power-domain@22 {
> > + #power-domain-cells = <0>;
> > + power-domains = <&pgc_vpumix>;
> > + reg =
> <IMX8MP_POWER_DOMAIN_VPU_VC8000E>;
> > + clocks = <&clk
> IMX8MP_CLK_VPU_VC8KE_ROOT>;
> > + };
> > };
> > };
> > };
>
> This change causes new error messages to come out during boot, for
> example:
>
> ...
> imx-pgc imx-pgc-domain.8: failed to command PGC
> imx-pgc imx-pgc-domain.8: failed to command PGC
> imx-pgc imx-pgc-domain.8: failed to command PGC
> 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 197, base_baud =
> 1500000) is a IMX
> ...
> hwmon hwmon1: temp1_input not attached to any thermal zone
> imx-pgc imx-pgc-domain.8: failed to command PGC
> imx-pgc imx-pgc-domain.8: failed to command PGC
> imx-pgc imx-pgc-domain.8: failed to command PGC
> ...
>
> They don't seem to cause any problems on the hardware I am using, well, at
> least not that I have found so far.
>
> This first appeared for me in linux-6.1. But it is the same in todays linux 6.3-
> rc4. Reverting this change (not completely trivial due to a couple of commits
> after it that rely on it) fixes it - no more errors.
[Peng Fan]

The VPU BLK CTRL seems not enabled.

Regards,
Peng.

>
> Regards
> Greg
>

2023-03-27 13:28:37

by Greg Ungerer

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: imx8mp: add vpu pgc nodes

Hi Peng,

On 27/3/23 20:01, Peng Fan wrote:
>> Subject: Re: [PATCH] arm64: dts: imx8mp: add vpu pgc nodes
>>
>> On 22/8/22 14:45, Peng Fan wrote:
>>> Add i.MX8MP PGC nodes for vpu, which are used to supply power for VPU.
>>>
>>> Signed-off-by: Peng Fan <[email protected]>
>>> Signed-off-by: Shawn Guo <[email protected]>
>>> ---
>>> arch/arm64/boot/dts/freescale/imx8mp.dtsi | 27
>>> +++++++++++++++++++++++
>>> 1 file changed, 27 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
>>> b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
>>> index 0b165f98a82c..34af983b0210 100644
>>> --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
>>> +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
>>> @@ -598,6 +598,33 @@ pgc_ispdwp: power-domain@18 {
>>> reg =
>> <IMX8MP_POWER_DOMAIN_MEDIAMIX_ISPDWP>;
>>> clocks = <&clk IMX8MP_CLK_MEDIA_ISP_ROOT>;
>>> };
>>> +
>>> + pgc_vpumix: power-domain@19 {
>>> + #power-domain-cells = <0>;
>>> + reg = <IMX8MP_POWER_DOMAIN_VPUMIX>;
>>> + clocks =<&clk IMX8MP_CLK_VPU_ROOT>;
>>> + };
>>> +
>>> + pgc_vpu_g1: power-domain@20 {
>>> + #power-domain-cells = <0>;
>>> + power-domains = <&pgc_vpumix>;
>>> + reg = <IMX8MP_POWER_DOMAIN_VPU_G1>;
>>> + clocks = <&clk IMX8MP_CLK_VPU_G1_ROOT>;
>>> + };
>>> +
>>> + pgc_vpu_g2: power-domain@21 {
>>> + #power-domain-cells = <0>;
>>> + power-domains = <&pgc_vpumix>;
>>> + reg = <IMX8MP_POWER_DOMAIN_VPU_G2>;
>>> + clocks = <&clk IMX8MP_CLK_VPU_G2_ROOT>;
>>> + };
>>> +
>>> + pgc_vpu_vc8000e: power-domain@22 {
>>> + #power-domain-cells = <0>;
>>> + power-domains = <&pgc_vpumix>;
>>> + reg =
>> <IMX8MP_POWER_DOMAIN_VPU_VC8000E>;
>>> + clocks = <&clk
>> IMX8MP_CLK_VPU_VC8KE_ROOT>;
>>> + };
>>> };
>>> };
>>> };
>>
>> This change causes new error messages to come out during boot, for
>> example:
>>
>> ...
>> imx-pgc imx-pgc-domain.8: failed to command PGC
>> imx-pgc imx-pgc-domain.8: failed to command PGC
>> imx-pgc imx-pgc-domain.8: failed to command PGC
>> 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 197, base_baud =
>> 1500000) is a IMX
>> ...
>> hwmon hwmon1: temp1_input not attached to any thermal zone
>> imx-pgc imx-pgc-domain.8: failed to command PGC
>> imx-pgc imx-pgc-domain.8: failed to command PGC
>> imx-pgc imx-pgc-domain.8: failed to command PGC
>> ...
>>
>> They don't seem to cause any problems on the hardware I am using, well, at
>> least not that I have found so far.
>>
>> This first appeared for me in linux-6.1. But it is the same in todays linux 6.3-
>> rc4. Reverting this change (not completely trivial due to a couple of commits
>> after it that rely on it) fixes it - no more errors.
> [Peng Fan]
>
> The VPU BLK CTRL seems not enabled.

How to enable it?
I have the blk-ctrl config options enabled:

#
# i.MX SoC drivers
#
CONFIG_IMX_GPCV2_PM_DOMAINS=y
CONFIG_SOC_IMX8M=y
CONFIG_SOC_IMX9=y
CONFIG_IMX8M_BLK_CTRL=y
CONFIG_IMX9_BLK_CTRL=y
# end of i.MX SoC drivers

Running with the full arm64 defconfig and using the imx8mp-evk.dtb still
outputs these messages:

[ 18.150679] imx-pgc imx-pgc-domain.8: failed to command PGC
[ 18.159241] imx-pgc imx-pgc-domain.8: failed to command PGC
[ 18.167822] imx-pgc imx-pgc-domain.8: failed to command PGC

Or do you mean something more fundamental, like the hardware block not
being enabled by boot loader? (Something to keep in mind is that the
platform I am using has no video output, only serial console).

Regards
Greg

2023-03-28 02:19:45

by Peng Fan

[permalink] [raw]
Subject: RE: [PATCH] arm64: dts: imx8mp: add vpu pgc nodes



> -----Original Message-----
> From: Greg Ungerer <[email protected]>
> Sent: 2023年3月27日 21:24
> To: Peng Fan <[email protected]>; Peng Fan (OSS)
> <[email protected]>
> Cc: [email protected]; [email protected]; Aisheng Dong
> <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> dl-linux-imx <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected]
> Subject: Re: [PATCH] arm64: dts: imx8mp: add vpu pgc nodes
>
> Hi Peng,
>
> On 27/3/23 20:01, Peng Fan wrote:
> >> Subject: Re: [PATCH] arm64: dts: imx8mp: add vpu pgc nodes
> >>
> >> On 22/8/22 14:45, Peng Fan wrote:
> >>> Add i.MX8MP PGC nodes for vpu, which are used to supply power for
> VPU.
> >>>
> >>> Signed-off-by: Peng Fan <[email protected]>
> >>> Signed-off-by: Shawn Guo <[email protected]>
> >>> ---
> >>> arch/arm64/boot/dts/freescale/imx8mp.dtsi | 27
> >>> +++++++++++++++++++++++
> >>> 1 file changed, 27 insertions(+)
> >>>
> >>> diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> >>> b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> >>> index 0b165f98a82c..34af983b0210 100644
> >>> --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> >>> +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> >>> @@ -598,6 +598,33 @@ pgc_ispdwp: power-domain@18 {
> >>> reg =
> >> <IMX8MP_POWER_DOMAIN_MEDIAMIX_ISPDWP>;
> >>> clocks = <&clk
> IMX8MP_CLK_MEDIA_ISP_ROOT>;
> >>> };
> >>> +
> >>> + pgc_vpumix: power-domain@19 {
> >>> + #power-domain-cells = <0>;
> >>> + reg = <IMX8MP_POWER_DOMAIN_VPUMIX>;
> >>> + clocks =<&clk IMX8MP_CLK_VPU_ROOT>;
> >>> + };
> >>> +
> >>> + pgc_vpu_g1: power-domain@20 {
> >>> + #power-domain-cells = <0>;
> >>> + power-domains = <&pgc_vpumix>;
> >>> + reg = <IMX8MP_POWER_DOMAIN_VPU_G1>;
> >>> + clocks = <&clk IMX8MP_CLK_VPU_G1_ROOT>;
> >>> + };
> >>> +
> >>> + pgc_vpu_g2: power-domain@21 {
> >>> + #power-domain-cells = <0>;
> >>> + power-domains = <&pgc_vpumix>;
> >>> + reg = <IMX8MP_POWER_DOMAIN_VPU_G2>;
> >>> + clocks = <&clk IMX8MP_CLK_VPU_G2_ROOT>;
> >>> + };
> >>> +
> >>> + pgc_vpu_vc8000e: power-domain@22 {
> >>> + #power-domain-cells = <0>;
> >>> + power-domains = <&pgc_vpumix>;
> >>> + reg =
> >> <IMX8MP_POWER_DOMAIN_VPU_VC8000E>;
> >>> + clocks = <&clk
> >> IMX8MP_CLK_VPU_VC8KE_ROOT>;
> >>> + };
> >>> };
> >>> };
> >>> };
> >>
> >> This change causes new error messages to come out during boot, for
> >> example:
> >>
> >> ...
> >> imx-pgc imx-pgc-domain.8: failed to command PGC
> >> imx-pgc imx-pgc-domain.8: failed to command PGC
> >> imx-pgc imx-pgc-domain.8: failed to command PGC
> >> 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 197,
> >> base_baud =
> >> 1500000) is a IMX
> >> ...
> >> hwmon hwmon1: temp1_input not attached to any thermal zone
> >> imx-pgc imx-pgc-domain.8: failed to command PGC
> >> imx-pgc imx-pgc-domain.8: failed to command PGC
> >> imx-pgc imx-pgc-domain.8: failed to command PGC
> >> ...
> >>
> >> They don't seem to cause any problems on the hardware I am using,
> >> well, at least not that I have found so far.
> >>
> >> This first appeared for me in linux-6.1. But it is the same in todays
> >> linux 6.3- rc4. Reverting this change (not completely trivial due to
> >> a couple of commits after it that rely on it) fixes it - no more errors.
> > [Peng Fan]
> >
> > The VPU BLK CTRL seems not enabled.
>
> How to enable it?
> I have the blk-ctrl config options enabled:
>
> #
> # i.MX SoC drivers
> #
> CONFIG_IMX_GPCV2_PM_DOMAINS=y
> CONFIG_SOC_IMX8M=y
> CONFIG_SOC_IMX9=y
> CONFIG_IMX8M_BLK_CTRL=y
> CONFIG_IMX9_BLK_CTRL=y
> # end of i.MX SoC drivers
>
> Running with the full arm64 defconfig and using the imx8mp-evk.dtb still
> outputs these messages:
>
> [ 18.150679] imx-pgc imx-pgc-domain.8: failed to command PGC
> [ 18.159241] imx-pgc imx-pgc-domain.8: failed to command PGC
> [ 18.167822] imx-pgc imx-pgc-domain.8: failed to command PGC
>
> Or do you mean something more fundamental, like the hardware block not
> being enabled by boot loader? (Something to keep in mind is that the
> platform I am using has no video output, only serial console).
[Peng Fan]

The imx8mp vpu blk ctrl already in imx8m-blk-ctrl.c, so it should work.
Have you enabled imx8mp interconnect driver?
CONFIG_INTERCONNECT_IMX8MP

Regards,
Peng.

>
> Regards
> Greg

2023-03-28 02:45:39

by Greg Ungerer

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: imx8mp: add vpu pgc nodes



On 28/3/23 12:15, Peng Fan wrote:
>
>
>> -----Original Message-----
>> From: Greg Ungerer <[email protected]>
>> Sent: 2023年3月27日 21:24
>> To: Peng Fan <[email protected]>; Peng Fan (OSS)
>> <[email protected]>
>> Cc: [email protected]; [email protected]; Aisheng Dong
>> <[email protected]>; [email protected];
>> [email protected]; [email protected]; [email protected];
>> [email protected]; [email protected];
>> [email protected]; [email protected];
>> dl-linux-imx <[email protected]>; [email protected];
>> [email protected]; [email protected]; [email protected];
>> [email protected]; [email protected]; [email protected]
>> Subject: Re: [PATCH] arm64: dts: imx8mp: add vpu pgc nodes
>>
>> Hi Peng,
>>
>> On 27/3/23 20:01, Peng Fan wrote:
>>>> Subject: Re: [PATCH] arm64: dts: imx8mp: add vpu pgc nodes
>>>>
>>>> On 22/8/22 14:45, Peng Fan wrote:
>>>>> Add i.MX8MP PGC nodes for vpu, which are used to supply power for
>> VPU.
>>>>>
>>>>> Signed-off-by: Peng Fan <[email protected]>
>>>>> Signed-off-by: Shawn Guo <[email protected]>
>>>>> ---
>>>>> arch/arm64/boot/dts/freescale/imx8mp.dtsi | 27
>>>>> +++++++++++++++++++++++
>>>>> 1 file changed, 27 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
>>>>> b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
>>>>> index 0b165f98a82c..34af983b0210 100644
>>>>> --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
>>>>> +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
>>>>> @@ -598,6 +598,33 @@ pgc_ispdwp: power-domain@18 {
>>>>> reg =
>>>> <IMX8MP_POWER_DOMAIN_MEDIAMIX_ISPDWP>;
>>>>> clocks = <&clk
>> IMX8MP_CLK_MEDIA_ISP_ROOT>;
>>>>> };
>>>>> +
>>>>> + pgc_vpumix: power-domain@19 {
>>>>> + #power-domain-cells = <0>;
>>>>> + reg = <IMX8MP_POWER_DOMAIN_VPUMIX>;
>>>>> + clocks =<&clk IMX8MP_CLK_VPU_ROOT>;
>>>>> + };
>>>>> +
>>>>> + pgc_vpu_g1: power-domain@20 {
>>>>> + #power-domain-cells = <0>;
>>>>> + power-domains = <&pgc_vpumix>;
>>>>> + reg = <IMX8MP_POWER_DOMAIN_VPU_G1>;
>>>>> + clocks = <&clk IMX8MP_CLK_VPU_G1_ROOT>;
>>>>> + };
>>>>> +
>>>>> + pgc_vpu_g2: power-domain@21 {
>>>>> + #power-domain-cells = <0>;
>>>>> + power-domains = <&pgc_vpumix>;
>>>>> + reg = <IMX8MP_POWER_DOMAIN_VPU_G2>;
>>>>> + clocks = <&clk IMX8MP_CLK_VPU_G2_ROOT>;
>>>>> + };
>>>>> +
>>>>> + pgc_vpu_vc8000e: power-domain@22 {
>>>>> + #power-domain-cells = <0>;
>>>>> + power-domains = <&pgc_vpumix>;
>>>>> + reg =
>>>> <IMX8MP_POWER_DOMAIN_VPU_VC8000E>;
>>>>> + clocks = <&clk
>>>> IMX8MP_CLK_VPU_VC8KE_ROOT>;
>>>>> + };
>>>>> };
>>>>> };
>>>>> };
>>>>
>>>> This change causes new error messages to come out during boot, for
>>>> example:
>>>>
>>>> ...
>>>> imx-pgc imx-pgc-domain.8: failed to command PGC
>>>> imx-pgc imx-pgc-domain.8: failed to command PGC
>>>> imx-pgc imx-pgc-domain.8: failed to command PGC
>>>> 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 197,
>>>> base_baud =
>>>> 1500000) is a IMX
>>>> ...
>>>> hwmon hwmon1: temp1_input not attached to any thermal zone
>>>> imx-pgc imx-pgc-domain.8: failed to command PGC
>>>> imx-pgc imx-pgc-domain.8: failed to command PGC
>>>> imx-pgc imx-pgc-domain.8: failed to command PGC
>>>> ...
>>>>
>>>> They don't seem to cause any problems on the hardware I am using,
>>>> well, at least not that I have found so far.
>>>>
>>>> This first appeared for me in linux-6.1. But it is the same in todays
>>>> linux 6.3- rc4. Reverting this change (not completely trivial due to
>>>> a couple of commits after it that rely on it) fixes it - no more errors.
>>> [Peng Fan]
>>>
>>> The VPU BLK CTRL seems not enabled.
>>
>> How to enable it?
>> I have the blk-ctrl config options enabled:
>>
>> #
>> # i.MX SoC drivers
>> #
>> CONFIG_IMX_GPCV2_PM_DOMAINS=y
>> CONFIG_SOC_IMX8M=y
>> CONFIG_SOC_IMX9=y
>> CONFIG_IMX8M_BLK_CTRL=y
>> CONFIG_IMX9_BLK_CTRL=y
>> # end of i.MX SoC drivers
>>
>> Running with the full arm64 defconfig and using the imx8mp-evk.dtb still
>> outputs these messages:
>>
>> [ 18.150679] imx-pgc imx-pgc-domain.8: failed to command PGC
>> [ 18.159241] imx-pgc imx-pgc-domain.8: failed to command PGC
>> [ 18.167822] imx-pgc imx-pgc-domain.8: failed to command PGC
>>
>> Or do you mean something more fundamental, like the hardware block not
>> being enabled by boot loader? (Something to keep in mind is that the
>> platform I am using has no video output, only serial console).
> [Peng Fan]
>
> The imx8mp vpu blk ctrl already in imx8m-blk-ctrl.c, so it should work.
> Have you enabled imx8mp interconnect driver?
> CONFIG_INTERCONNECT_IMX8MP

Yes, it is enabled:

CONFIG_INTERCONNECT=y
CONFIG_INTERCONNECT_IMX=y
# CONFIG_INTERCONNECT_IMX8MM is not set
# CONFIG_INTERCONNECT_IMX8MN is not set
# CONFIG_INTERCONNECT_IMX8MQ is not set
CONFIG_INTERCONNECT_IMX8MP=y

Regards
Greg