Fix imx6sl display power domain
Subsystems (2)
v2 cover Fix imx6sl display power domain
Right now the imx6sl display power domain is automatically shut down during boot so lcd doesn't work at all. This has been broken for a while with old gpc bindings, since nobody noticed fix by converting to new bindings.
Link to v1: https://lkml.org/lkml/2018/6/5/689
There is also a nasty errata here, treat it like on 6qp.
Previous version included a patch to improve lcdif power management, but since ERR006287 effectively disables runtime PM for display it is no longer strictly required.
This doesn't depend on other GPC patches I sent either, it's an unrelated fix.
Leonard Crestez (2):
soc: imx: gpc: Disable 6sl display power gating for ERR006287
ARM: dts: imx6sl: Convert gpc to new bindings
arch/arm/boot/dts/imx6sl.dtsi | 36 +++++++++++++++++++++++++++++++---- drivers/soc/imx/gpc.c | 10 ++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/2 soc: imx: gpc: Disable 6sl display power gating for ERR006287
The imx6sl chip errata document describes ERR006287 like this:
"""
Upon resuming from power gating, the modules in the display power domain (eLCDIF, EPDC, PXP and SPDC) might fail to perform register reads correctly.
When the modules listed above are used, do not use power gating on the display power domain.
"""
Handle this in linux in the same way as imx6qp ERR009619: make the DISP domain return -EBUSY on power_off.
--- drivers/soc/imx/gpc.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/soc/imx/gpc.c +10 -0
@@ -339,30 +339,35 @@ static struct imx_pm_domain imx_gpc_domains[] = { };struct imx_gpc_dt_data {int num_domains;bool err009619_present; +bool err006287_present; };static const struct imx_gpc_dt_data imx6q_dt_data = { .num_domains =2 , .err009619_present = false, + .err006287_present = false, };static const struct imx_gpc_dt_data imx6qp_dt_data = { .num_domains =2 , .err009619_present = true, + .err006287_present = false, };static const struct imx_gpc_dt_data imx6sl_dt_data = { .num_domains =3 , .err009619_present = false, + .err006287_present = true, };static const struct imx_gpc_dt_data imx6sx_dt_data = { .num_domains =4 , .err009619_present = false, + .err006287_present = false, };static const struct of_device_id imx_gpc_dt_ids[] = { { .compatible ="fsl,imx6q-gpc" , .data = &imx6q_dt_data }, { .compatible ="fsl,imx6qp-gpc" , .data = &imx6qp_dt_data },
@@ -467,10 +472,15 @@ static int imx_gpc_probe(struct platform_device *pdev)/* Disable PU power down in normal operation if ERR009619 is present */ if (of_id_data->err009619_present) imx_gpc_domains[GPC_PGC_DOMAIN_PU ].flags |=PGC_DOMAIN_FLAG_NO_PD ; +/* Disable DISP power down in normal operation if ERR006287 is present */ +if (of_id_data->err006287_present) + imx_gpc_domains[GPC_PGC_DOMAIN_DISPLAY ].flags |= +PGC_DOMAIN_FLAG_NO_PD ; +if (!pgc_node) { ret =imx_gpc_old_dt_init (&pdev->dev, regmap, of_id_data->num_domains);if (ret)return ret;
Signature · 1 line
2.17.1
Re: [PATCH v2 1/2] soc: imx: gpc: Disable 6sl display power gating for ERR006287
Quoted 62 lines · Leonard Crestez
The imx6sl chip errata document describes ERR006287 like this:
"""
Upon resuming from power gating, the modules in the display power domain (eLCDIF, EPDC, PXP and SPDC) might fail to perform register reads correctly.When the modules listed above are used, do not use power gating on the display power domain.
"""Handle this in linux in the same way as imx6qp ERR009619: make the DISP domain return
-EBUSYonpower_off.Signed-off-by Leonard Crestez <[email protected]>--- drivers/soc/imx/gpc.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/soc/imx/gpc.c +5
-0@@ -339,30 +339,35 @@ static struct imx_pm_domain imx_gpc_domains[] = { };struct imx_gpc_dt_data {int num_domains;bool err009619_present; +bool err006287_present; };static const struct imx_gpc_dt_data imx6q_dt_data = { .num_domains =2 , .err009619_present = false, + .err006287_present = false, };static const struct imx_gpc_dt_data imx6qp_dt_data = { .num_domains =2 , .err009619_present = true, + .err006287_present = false, };static const struct imx_gpc_dt_data imx6sl_dt_data = { .num_domains =3 , .err009619_present = false, + .err006287_present = true, };static const struct imx_gpc_dt_data imx6sx_dt_data = { .num_domains =4 , .err009619_present = false, + .err006287_present = false, };static const struct of_device_id imx_gpc_dt_ids[] = { { .compatible ="fsl,imx6q-gpc" , .data = &imx6q_dt_data }, { .compatible ="fsl,imx6qp-gpc" , .data = &imx6qp_dt_data },
drivers/soc/imx/gpc.c static int imx_gpc_probe(struct platform_device *pdev) · line 481
Quoted 10 lines
drivers/soc/imx/gpc.c +5
-0@@ -467,10 +472,15 @@ static int imx_gpc_probe(struct platform_device *pdev)/* Disable PU power down in normal operation if ERR009619 is present */ if (of_id_data->err009619_present) imx_gpc_domains[GPC_PGC_DOMAIN_PU ].flags |=PGC_DOMAIN_FLAG_NO_PD ; +/* Disable DISP power down in normal operation if ERR006287 is present */ +if (of_id_data->err006287_present) + imx_gpc_domains[GPC_PGC_DOMAIN_DISPLAY ].flags |= +PGC_DOMAIN_FLAG_NO_PD ; +
This looks like a use-case for an always powered on PM domain?
If that's the case, GENPD_FLAG_ALWAYS_ON does the trick, but more efficient as it enables genpd to take a few shortcuts when trying to power of a PM domain.
Quoted 8 lines
drivers/soc/imx/gpc.c +0
-1if (!pgc_node) { ret =imx_gpc_old_dt_init (&pdev->dev, regmap, of_id_data->num_domains);if (ret)return ret; --2.17.1
Kind regards
Uffe
Re: [PATCH v2 1/2] soc: imx: gpc: Disable 6sl display power gating for ERR006287
Quoted 90 lines · Ulf Hansson
Quoted 81 lines · Leonard Crestez
The imx6sl chip errata document describes ERR006287 like this:
"""
Upon resuming from power gating, the modules in the display power domain
(eLCDIF, EPDC, PXP and SPDC) might fail to perform register reads correctly.When the modules listed above are used, do not use power gating on the
display power domain.
"""%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Ferrata%2FIMX6SLCE.pdf%23page%3D62&a mp;data=02%7C01%7Cleonard.crestez%40nxp.com%7Cdbc5b00a97c548c470320 8d5e5ebfb24%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C6366677240 50833256&sdata=VgYIGGTYQ0ChR%2FCEBSZJ1D1JyfJRDi96YHa%2Byt4Qr5s% 3D&reserved=0
Handle this in linux in the same way as imx6qp ERR009619: make the DISP
domain return-EBUSYonpower_off.Signed-off-by Leonard Crestez <[email protected]>--- drivers/soc/imx/gpc.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/soc/imx/gpc.c +5
-0@@ -339,30 +339,35 @@ static struct imx_pm_domain imx_gpc_domains[] = { };struct imx_gpc_dt_data {int num_domains;bool err009619_present; +bool err006287_present; };static const struct imx_gpc_dt_data imx6q_dt_data = { .num_domains =2 , .err009619_present = false, + .err006287_present = false, };static const struct imx_gpc_dt_data imx6qp_dt_data = { .num_domains =2 , .err009619_present = true, + .err006287_present = false, };static const struct imx_gpc_dt_data imx6sl_dt_data = { .num_domains =3 , .err009619_present = false, + .err006287_present = true, };static const struct imx_gpc_dt_data imx6sx_dt_data = { .num_domains =4 , .err009619_present = false, + .err006287_present = false, };static const struct of_device_id imx_gpc_dt_ids[] = { { .compatible ="fsl,imx6q-gpc" , .data = &imx6q_dt_data },{ .compatible = "fsl,imx6qp-gpc", .data = &imx6qp_dt_data },drivers/soc/imx/gpc.c +0
-0@@ -467,10 +472,15 @@ static int imx_gpc_probe(struct platform_device *pdev)/* Disable PU power down in normal operation if ERR009619 is present */
if (of_id_data->err009619_present) imx_gpc_domains[GPC_PGC_DOMAIN_PU].flags |= PGC_DOMAIN_FLAG_NO_PD;+ /* Disable DISP power down in normal operation if ERR006287
is present */drivers/soc/imx/gpc.c static int imx_gpc_probe(struct platform_device *pdev) · line 481
Quoted 4 lines
drivers/soc/imx/gpc.c +4
-0+if (of_id_data->err006287_present) + imx_gpc_domains[GPC_PGC_DOMAIN_DISPLAY ].flags |= +PGC_DOMAIN_FLAG_NO_PD ; +This looks like a use-case for an always powered on PM domain?
Quoted 3 lines
If that's the case,
GENPD_FLAG_ALWAYS_ONdoes the trick, but more efficient as it enables genpd to take a few shortcuts when trying to power of a PM domain.
GENPD_FLAG_ALWAYS_ON would be a reasonable here.
I searched but I've been unable to find a good reference for scenarios where power gating DISP on 6sl is still supported. I think it should be safe to turn off in suspend but this is only based based on old commits from the imx internal tree.
Right now displays on imx6sl don't work at all because nothing is inside the DISP and it gets powered off. Fixing this in the safest and most uncontroversial way would be worthwhile, yes?
PATCH v2 2/2 ARM: dts: imx6sl: Convert gpc to new bindings
In reply to Leonard CrestezWith old bindings imx_gpc_onecell_data always sets num_domains to 2 so the DISPMIX domain can't actually be referenced. The pd is still defined and pm core shuts it down as "unused" so display can't work.
Fix this by converting to new gpc bindings by adding pgc nodes and referencing the newly-defined &pu_disp domain from &lcdif.
--- arch/arm/boot/dts/imx6sl.dtsi | 36 +++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-)
arch/arm/boot/dts/imx6sl.dtsi +32 -4
@@ -678,14 +678,41 @@ reg = <0x020dc000 0x4000>; interrupt-controller; #interrupt-cells = <3>; interrupts = <0 89 IRQ_TYPE_LEVEL_HIGH>; interrupt-parent = <&intc>; - pu-supply = <®_pu>; - clocks = <&clks IMX6SL_CLK_GPU2D_OVG>, - <&clks IMX6SL_CLK_GPU2D_PODF>; - #power-domain-cells = <1>; + clocks = <&clks IMX6SL_CLK_IPG>; + clock-names = "ipg"; + + pgc { + #address-cells = <1>; + #size-cells = <0>; + + power-domain at 0 { + reg = <0>; + #power-domain-cells = <0>; + }; + + pd_pu: power-domain at 1 { + reg = <1>; + #power-domain-cells = <0>; + power-supply = <®_pu>; + clocks = <&clks IMX6SL_CLK_GPU2D_OVG>, + <&clks IMX6SL_CLK_GPU2D_PODF>; + }; + + pd_disp: power-domain at 2 { + reg = <2>; + #power-domain-cells = <0>; + clocks = <&clks IMX6SL_CLK_IPG>, + <&clks IMX6SL_CLK_LCDIF_AXI>, + <&clks IMX6SL_CLK_LCDIF_PIX>, + <&clks IMX6SL_CLK_EPDC_AXI>, + <&clks IMX6SL_CLK_EPDC_PIX>, + <&clks IMX6SL_CLK_PXP_AXI>; + }; + }; }; gpr: iomuxc-gpr at 20e0000 { compatible = "fsl,imx6sl-iomuxc-gpr", "fsl,imx6q-iomuxc-gpr", "syscon";
@@ -736,10 +763,11 @@ clocks = <&clks IMX6SL_CLK_LCDIF_PIX>, <&clks IMX6SL_CLK_LCDIF_AXI>, <&clks IMX6SL_CLK_DUMMY>; clock-names = "pix", "axi", "disp_axi"; status = "disabled"; + power-domains = <&pd_disp>; }; dcp: dcp at 20fc000 { compatible = "fsl,imx6sl-dcp", "fsl,imx28-dcp"; reg = <0x020fc000 0x4000>;
Signature · 1 line
2.17.1