Skip to content

Commit 7242252

Browse files
MrVanUlf Hansson
authored andcommitted
pmdomain: imx: Fix i.MX8MP power notifier
Using imx8mm_vpu_power_notifier() for i.MX8MP is wrong, as it ungates the VPU clocks to provide the ADB clock, which is necessary on i.MX8MM, but on i.MX8MP there is a separate gate (bit 3) for the NoC. So add imx8mp_vpu_power_notifier() for i.MX8MP. Fixes: a1a5f15 ("soc: imx: imx8m-blk-ctrl: add i.MX8MP VPU blk ctrl") Cc: stable@vger.kernel.org Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Ulf Hansson <ulfh@kernel.org>
1 parent 9961123 commit 7242252

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,34 @@ static const struct imx8m_blk_ctrl_domain_data imx8mp_vpu_blk_ctl_domain_data[]
514514
},
515515
};
516516

517+
static int imx8mp_vpu_power_notifier(struct notifier_block *nb,
518+
unsigned long action, void *data)
519+
{
520+
struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl,
521+
power_nb);
522+
523+
if (action == GENPD_NOTIFY_ON) {
524+
/*
525+
* On power up we have no software backchannel to the GPC to
526+
* wait for the ADB handshake to happen, so we just delay for a
527+
* bit. On power down the GPC driver waits for the handshake.
528+
*/
529+
530+
udelay(5);
531+
532+
/* set "fuse" bits to enable the VPUs */
533+
regmap_set_bits(bc->regmap, 0x8, 0xffffffff);
534+
regmap_set_bits(bc->regmap, 0xc, 0xffffffff);
535+
regmap_set_bits(bc->regmap, 0x10, 0xffffffff);
536+
regmap_set_bits(bc->regmap, 0x14, 0xffffffff);
537+
}
538+
539+
return NOTIFY_OK;
540+
}
541+
517542
static const struct imx8m_blk_ctrl_data imx8mp_vpu_blk_ctl_dev_data = {
518543
.max_reg = 0x18,
519-
.power_notifier_fn = imx8mm_vpu_power_notifier,
544+
.power_notifier_fn = imx8mp_vpu_power_notifier,
520545
.domains = imx8mp_vpu_blk_ctl_domain_data,
521546
.num_domains = ARRAY_SIZE(imx8mp_vpu_blk_ctl_domain_data),
522547
};

0 commit comments

Comments
 (0)