Skip to content

Commit 87e1287

Browse files
committed
Merge tag 'imx-drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/drivers
i.MX drivers update for 5.17: - A number of patches from Adam Ford to update gpcv2 and blk-ctrl driver to keep i.MX8MM VPU-H1 and i.MX8MN GPUMIX bus clocks active, and add i.MX8MN display related domain support. - Add optional continuous burst clock support for imx-weim bus driver. - Call pm_runtime_put_sync_suspend() instead of pm_runtime_put() in gpcv2 driver to prevent a sequence issue seen with i.MX8MM GPU and MIX domain. * tag 'imx-drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx: imx8m-blk-ctrl: add i.MX8MN DISP blk-ctrl dt-bindings: power: imx8mn: add defines for DISP blk-ctrl domains soc: imx: gpcv2: Add dispmix and mipi domains to imx8mn soc: imx: gpcv2: keep i.MX8MN gpumix bus clock enabled bus: imx-weim: optionally enable continuous burst clock soc: imx: gpcv2: keep i.MX8MM VPU-H1 bus clock active soc: imx: gpcv2: Synchronously suspend MIX domains Link: https://lore.kernel.org/r/20211218071427.26745-1-shawnguo@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents a904c5f + 7f511d5 commit 87e1287

4 files changed

Lines changed: 125 additions & 4 deletions

File tree

drivers/bus/imx-weim.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct imx_weim_devtype {
2121
unsigned int cs_stride;
2222
unsigned int wcr_offset;
2323
unsigned int wcr_bcm;
24+
unsigned int wcr_cont_bclk;
2425
};
2526

2627
static const struct imx_weim_devtype imx1_weim_devtype = {
@@ -41,6 +42,7 @@ static const struct imx_weim_devtype imx50_weim_devtype = {
4142
.cs_stride = 0x18,
4243
.wcr_offset = 0x90,
4344
.wcr_bcm = BIT(0),
45+
.wcr_cont_bclk = BIT(3),
4446
};
4547

4648
static const struct imx_weim_devtype imx51_weim_devtype = {
@@ -206,8 +208,20 @@ static int weim_parse_dt(struct platform_device *pdev, void __iomem *base)
206208
if (of_property_read_bool(pdev->dev.of_node, "fsl,burst-clk-enable")) {
207209
if (devtype->wcr_bcm) {
208210
reg = readl(base + devtype->wcr_offset);
209-
writel(reg | devtype->wcr_bcm,
210-
base + devtype->wcr_offset);
211+
reg |= devtype->wcr_bcm;
212+
213+
if (of_property_read_bool(pdev->dev.of_node,
214+
"fsl,continuous-burst-clk")) {
215+
if (devtype->wcr_cont_bclk) {
216+
reg |= devtype->wcr_cont_bclk;
217+
} else {
218+
dev_err(&pdev->dev,
219+
"continuous burst clk not supported.\n");
220+
return -EINVAL;
221+
}
222+
}
223+
224+
writel(reg, base + devtype->wcr_offset);
211225
} else {
212226
dev_err(&pdev->dev, "burst clk mode not supported.\n");
213227
return -EINVAL;

drivers/soc/imx/gpcv2.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ static int imx_pgc_power_down(struct generic_pm_domain *genpd)
377377
}
378378
}
379379

380-
pm_runtime_put(domain->dev);
380+
pm_runtime_put_sync_suspend(domain->dev);
381381

382382
return 0;
383383

@@ -734,6 +734,7 @@ static const struct imx_pgc_domain imx8mm_pgc_domains[] = {
734734
.map = IMX8MM_VPUH1_A53_DOMAIN,
735735
},
736736
.pgc = BIT(IMX8MM_PGC_VPUH1),
737+
.keep_clocks = true,
737738
},
738739

739740
[IMX8MM_POWER_DOMAIN_DISPMIX] = {
@@ -840,6 +841,32 @@ static const struct imx_pgc_domain imx8mn_pgc_domains[] = {
840841
.hskack = IMX8MN_GPUMIX_HSK_PWRDNACKN,
841842
},
842843
.pgc = BIT(IMX8MN_PGC_GPUMIX),
844+
.keep_clocks = true,
845+
},
846+
847+
[IMX8MN_POWER_DOMAIN_DISPMIX] = {
848+
.genpd = {
849+
.name = "dispmix",
850+
},
851+
.bits = {
852+
.pxx = IMX8MN_DISPMIX_SW_Pxx_REQ,
853+
.map = IMX8MN_DISPMIX_A53_DOMAIN,
854+
.hskreq = IMX8MN_DISPMIX_HSK_PWRDNREQN,
855+
.hskack = IMX8MN_DISPMIX_HSK_PWRDNACKN,
856+
},
857+
.pgc = BIT(IMX8MN_PGC_DISPMIX),
858+
.keep_clocks = true,
859+
},
860+
861+
[IMX8MN_POWER_DOMAIN_MIPI] = {
862+
.genpd = {
863+
.name = "mipi",
864+
},
865+
.bits = {
866+
.pxx = IMX8MN_MIPI_SW_Pxx_REQ,
867+
.map = IMX8MN_MIPI_A53_DOMAIN,
868+
},
869+
.pgc = BIT(IMX8MN_PGC_MIPI),
843870
},
844871
};
845872

drivers/soc/imx/imx8m-blk-ctrl.c

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/clk.h>
1515

1616
#include <dt-bindings/power/imx8mm-power.h>
17+
#include <dt-bindings/power/imx8mn-power.h>
1718

1819
#define BLK_SFT_RSTN 0x0
1920
#define BLK_CLK_EN 0x4
@@ -498,14 +499,88 @@ static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = {
498499
.num_domains = ARRAY_SIZE(imx8mm_disp_blk_ctl_domain_data),
499500
};
500501

502+
503+
static int imx8mn_disp_power_notifier(struct notifier_block *nb,
504+
unsigned long action, void *data)
505+
{
506+
struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl,
507+
power_nb);
508+
509+
if (action != GENPD_NOTIFY_ON && action != GENPD_NOTIFY_PRE_OFF)
510+
return NOTIFY_OK;
511+
512+
/* Enable bus clock and deassert bus reset */
513+
regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8));
514+
regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8));
515+
516+
/*
517+
* On power up we have no software backchannel to the GPC to
518+
* wait for the ADB handshake to happen, so we just delay for a
519+
* bit. On power down the GPC driver waits for the handshake.
520+
*/
521+
if (action == GENPD_NOTIFY_ON)
522+
udelay(5);
523+
524+
525+
return NOTIFY_OK;
526+
}
527+
528+
static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = {
529+
[IMX8MN_DISPBLK_PD_MIPI_DSI] = {
530+
.name = "dispblk-mipi-dsi",
531+
.clk_names = (const char *[]){ "dsi-pclk", "dsi-ref", },
532+
.num_clks = 2,
533+
.gpc_name = "mipi-dsi",
534+
.rst_mask = BIT(0) | BIT(1),
535+
.clk_mask = BIT(0) | BIT(1),
536+
.mipi_phy_rst_mask = BIT(17),
537+
},
538+
[IMX8MN_DISPBLK_PD_MIPI_CSI] = {
539+
.name = "dispblk-mipi-csi",
540+
.clk_names = (const char *[]){ "csi-aclk", "csi-pclk" },
541+
.num_clks = 2,
542+
.gpc_name = "mipi-csi",
543+
.rst_mask = BIT(2) | BIT(3),
544+
.clk_mask = BIT(2) | BIT(3),
545+
.mipi_phy_rst_mask = BIT(16),
546+
},
547+
[IMX8MN_DISPBLK_PD_LCDIF] = {
548+
.name = "dispblk-lcdif",
549+
.clk_names = (const char *[]){ "lcdif-axi", "lcdif-apb", "lcdif-pix", },
550+
.num_clks = 3,
551+
.gpc_name = "lcdif",
552+
.rst_mask = BIT(4) | BIT(5),
553+
.clk_mask = BIT(4) | BIT(5),
554+
},
555+
[IMX8MN_DISPBLK_PD_ISI] = {
556+
.name = "dispblk-isi",
557+
.clk_names = (const char *[]){ "disp_axi", "disp_apb", "disp_axi_root",
558+
"disp_apb_root"},
559+
.num_clks = 4,
560+
.gpc_name = "isi",
561+
.rst_mask = BIT(6) | BIT(7),
562+
.clk_mask = BIT(6) | BIT(7),
563+
},
564+
};
565+
566+
static const struct imx8m_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = {
567+
.max_reg = 0x84,
568+
.power_notifier_fn = imx8mn_disp_power_notifier,
569+
.domains = imx8mn_disp_blk_ctl_domain_data,
570+
.num_domains = ARRAY_SIZE(imx8mn_disp_blk_ctl_domain_data),
571+
};
572+
501573
static const struct of_device_id imx8m_blk_ctrl_of_match[] = {
502574
{
503575
.compatible = "fsl,imx8mm-vpu-blk-ctrl",
504576
.data = &imx8mm_vpu_blk_ctl_dev_data
505577
}, {
506578
.compatible = "fsl,imx8mm-disp-blk-ctrl",
507579
.data = &imx8mm_disp_blk_ctl_dev_data
508-
} ,{
580+
}, {
581+
.compatible = "fsl,imx8mn-disp-blk-ctrl",
582+
.data = &imx8mn_disp_blk_ctl_dev_data
583+
}, {
509584
/* Sentinel */
510585
}
511586
};

include/dt-bindings/power/imx8mn-power.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@
1212
#define IMX8MN_POWER_DOMAIN_DISPMIX 3
1313
#define IMX8MN_POWER_DOMAIN_MIPI 4
1414

15+
#define IMX8MN_DISPBLK_PD_MIPI_DSI 0
16+
#define IMX8MN_DISPBLK_PD_MIPI_CSI 1
17+
#define IMX8MN_DISPBLK_PD_LCDIF 2
18+
#define IMX8MN_DISPBLK_PD_ISI 3
19+
1520
#endif

0 commit comments

Comments
 (0)