From e0d9251c1a36ed4eb14dfca90f50930dd3b3cfc4 Mon Sep 17 00:00:00 2001 From: Richard Zhu Date: Thu, 21 Sep 2017 16:46:26 +0800 Subject: MLK-16530-3 rpmsg: imx: init mu and limit the pingpong cycles - Init mu power and clk. - Change the cycles of the pingpong demot refer to the limitation of M4 side. When the received data larger than 100, the pingpong of M4 side would be finished. BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0 Signed-off-by: Richard Zhu --- drivers/rpmsg/imx_rpmsg.c | 29 +++++++++-------------------- drivers/rpmsg/imx_rpmsg_pingpong.c | 2 +- 2 files changed, 10 insertions(+), 21 deletions(-) (limited to 'drivers/rpmsg') diff --git a/drivers/rpmsg/imx_rpmsg.c b/drivers/rpmsg/imx_rpmsg.c index 951d7029a333..3a63cf974e87 100644 --- a/drivers/rpmsg/imx_rpmsg.c +++ b/drivers/rpmsg/imx_rpmsg.c @@ -467,7 +467,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev) return ret; } - if (variant == IMX7D) { + if (variant == IMX7D || variant == IMX8QXP) { clk = of_clk_get(np_mu, 0); if (IS_ERR(clk)) { pr_err("mu clock source missing or invalid\n"); @@ -481,27 +481,16 @@ static int imx_rpmsg_probe(struct platform_device *pdev) } INIT_DELAYED_WORK(&rpmsg_work, rpmsg_work_handler); - if (variant == IMX8QXP) { - /* - * MU0_A0 of M4 side is used as RPMSG MU. - * And it would be initialized by M4 before - * A cores are booted up. - */ - MU_Init(mu_base); + /* + * bit26 is used by rpmsg channels. + * bit0 of MX7ULP_MU_CR used to let m4 to know MU is ready now + */ + MU_Init(mu_base); + if (variant == IMX7ULP) { MU_EnableRxFullInt(mu_base, 1); - pr_info("MU has been initalized by M4!\n"); + MU_SetFn(mu_base, 1); } else { - /* - * bit26 is used by rpmsg channels. - * bit0 of MX7ULP_MU_CR used to let m4 to know MU is ready now - */ - MU_Init(mu_base); - if (variant == IMX7ULP) { - MU_EnableRxFullInt(mu_base, 1); - MU_SetFn(mu_base, 1); - } else { - MU_EnableRxFullInt(mu_base, 1); - } + MU_EnableRxFullInt(mu_base, 1); } BLOCKING_INIT_NOTIFIER_HEAD(&(mu_rpmsg_box.notifier)); diff --git a/drivers/rpmsg/imx_rpmsg_pingpong.c b/drivers/rpmsg/imx_rpmsg_pingpong.c index 341cd7eb8f53..aeaee17c8e7f 100644 --- a/drivers/rpmsg/imx_rpmsg_pingpong.c +++ b/drivers/rpmsg/imx_rpmsg_pingpong.c @@ -18,7 +18,7 @@ #include #define MSG "hello world!" -#define MSG_LIMIT 100000 +#define MSG_LIMIT 51 static unsigned int rpmsg_pingpong; static int rx_count; -- cgit v1.2.3