OSDN Git Service

soc: imx: imx8m-blk-ctrl: add i.MX8MP VPU blk ctrl
authorPeng Fan <peng.fan@nxp.com>
Mon, 22 Aug 2022 06:45:34 +0000 (14:45 +0800)
committerShawn Guo <shawnguo@kernel.org>
Sat, 17 Sep 2022 08:30:53 +0000 (16:30 +0800)
i.MX8MP has a VPU blk ctrl module that could supply clk and reset to
VPU, so add support for it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/soc/imx/imx8m-blk-ctrl.c

index 9b0f81d..871a387 100644 (file)
@@ -484,6 +484,46 @@ static const struct imx8m_blk_ctrl_data imx8mm_vpu_blk_ctl_dev_data = {
        .num_domains = ARRAY_SIZE(imx8mm_vpu_blk_ctl_domain_data),
 };
 
+static const struct imx8m_blk_ctrl_domain_data imx8mp_vpu_blk_ctl_domain_data[] = {
+       [IMX8MP_VPUBLK_PD_G1] = {
+               .name = "vpublk-g1",
+               .clk_names = (const char *[]){ "g1", },
+               .num_clks = 1,
+               .gpc_name = "g1",
+               .rst_mask = BIT(1),
+               .clk_mask = BIT(1),
+               .path_names = (const char *[]){"g1"},
+               .num_paths = 1,
+       },
+       [IMX8MP_VPUBLK_PD_G2] = {
+               .name = "vpublk-g2",
+               .clk_names = (const char *[]){ "g2", },
+               .num_clks = 1,
+               .gpc_name = "g2",
+               .rst_mask = BIT(0),
+               .clk_mask = BIT(0),
+               .path_names = (const char *[]){"g2"},
+               .num_paths = 1,
+       },
+       [IMX8MP_VPUBLK_PD_VC8000E] = {
+               .name = "vpublk-vc8000e",
+               .clk_names = (const char *[]){ "vc8000e", },
+               .num_clks = 1,
+               .gpc_name = "vc8000e",
+               .rst_mask = BIT(2),
+               .clk_mask = BIT(2),
+               .path_names = (const char *[]){"vc8000e"},
+               .num_paths = 1,
+       },
+};
+
+static const struct imx8m_blk_ctrl_data imx8mp_vpu_blk_ctl_dev_data = {
+       .max_reg = 0x18,
+       .power_notifier_fn = imx8mm_vpu_power_notifier,
+       .domains = imx8mp_vpu_blk_ctl_domain_data,
+       .num_domains = ARRAY_SIZE(imx8mp_vpu_blk_ctl_domain_data),
+};
+
 static int imx8mm_disp_power_notifier(struct notifier_block *nb,
                                      unsigned long action, void *data)
 {
@@ -828,6 +868,9 @@ static const struct of_device_id imx8m_blk_ctrl_of_match[] = {
                .compatible = "fsl,imx8mq-vpu-blk-ctrl",
                .data = &imx8mq_vpu_blk_ctl_dev_data
        }, {
+               .compatible = "fsl,imx8mp-vpu-blk-ctrl",
+               .data = &imx8mp_vpu_blk_ctl_dev_data
+       }, {
                /* Sentinel */
        }
 };