[PATCH 0/6] remoteproc: imx_proc: Simplify driver by removing the switch-case

Peng Fan posted 6 patches 1 day, 8 hours ago
drivers/remoteproc/imx_rproc.c | 448 +++++++++++++++++++++++------------------
drivers/remoteproc/imx_rproc.h |   7 +
2 files changed, 264 insertions(+), 191 deletions(-)
[PATCH 0/6] remoteproc: imx_proc: Simplify driver by removing the switch-case
Posted by Peng Fan 1 day, 8 hours ago
This patchset serves as a preparing patchset for i.MX95 support.

The current code logic is complicated, with mix the usage of switch-case
and if-else.

To simplify the code logic:
 Introduce struct imx_rproc_plat_ops to wrap platform start,stop,detect_mode.
 Each imx_rproc_dcfg data structure is assigned a ops pointer.
 The common imx_rproc_{start,stop}() directly invokes the plat ops, no
 need the switch-case.
 mmio/smc/scu_api ops are included.
 No functional changes.

Thanks to Daniel and Frank for the help.

Test on i.MX8MM for MMIO ops, i.MX8MP for SMC ops. For SCU-API ops,
I currently not have a setup at hand, I will give a setup and test
later, but everything should be fine, no functional changes.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Peng Fan (6):
      remoteproc: imx_rproc: Introduce start/stop/detect_mode ops for imx_rproc_dcfg
      remoteproc: imx_rproc: Move imx_rproc_dcfg closer to imx_rproc_of_match
      remoteproc: imx_rproc: Simplify IMX_RPROC_MMIO switch case
      remoteproc: imx_rproc: Simplify IMX_RPROC_SCU_API switch case
      remoteproc: imx_rproc: Simplify IMX_RPROC_SMC switch case
      remoteproc: imx_rproc: Clean up after ops introduction

 drivers/remoteproc/imx_rproc.c | 448 +++++++++++++++++++++++------------------
 drivers/remoteproc/imx_rproc.h |   7 +
 2 files changed, 264 insertions(+), 191 deletions(-)
---
base-commit: 3e8e5822146bc396d2a7e5fbb7be13271665522a
change-id: 20250908-imx-rproc-cleanup-6f3b546b9fdf

Best regards,
-- 
Peng Fan <peng.fan@nxp.com>
Re: [PATCH 0/6] remoteproc: imx_proc: Simplify driver by removing the switch-case
Posted by Peng Fan 17 hours ago
On Mon, Sep 08, 2025 at 09:07:33PM +0800, Peng Fan wrote:
>This patchset serves as a preparing patchset for i.MX95 support.
>
>The current code logic is complicated, with mix the usage of switch-case
>and if-else.
>
>To simplify the code logic:
> Introduce struct imx_rproc_plat_ops to wrap platform start,stop,detect_mode.
> Each imx_rproc_dcfg data structure is assigned a ops pointer.
> The common imx_rproc_{start,stop}() directly invokes the plat ops, no
> need the switch-case.
> mmio/smc/scu_api ops are included.
> No functional changes.
>
>Thanks to Daniel and Frank for the help.
>
>Test on i.MX8MM for MMIO ops, i.MX8MP for SMC ops. For SCU-API ops,
>I currently not have a setup at hand, I will give a setup and test
>later, but everything should be fine, no functional changes.

Update: tested on i.MX8QM-MEK with SCU-API ops.

Thanks,
Peng
Re: [PATCH 0/6] remoteproc: imx_proc: Simplify driver by removing the switch-case
Posted by Daniel Baluta 9 hours ago
On Mon, Sep 8, 2025 at 4:08 PM Peng Fan <peng.fan@nxp.com> wrote:
>
> This patchset serves as a preparing patchset for i.MX95 support.
>
> The current code logic is complicated, with mix the usage of switch-case
> and if-else.
>
> To simplify the code logic:
>  Introduce struct imx_rproc_plat_ops to wrap platform start,stop,detect_mode.
>  Each imx_rproc_dcfg data structure is assigned a ops pointer.
>  The common imx_rproc_{start,stop}() directly invokes the plat ops, no
>  need the switch-case.
>  mmio/smc/scu_api ops are included.
>  No functional changes.
>
> Thanks to Daniel and Frank for the help.
>
> Test on i.MX8MM for MMIO ops, i.MX8MP for SMC ops. For SCU-API ops,
> I currently not have a setup at hand, I will give a setup and test
> later, but everything should be fine, no functional changes.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>


Thanks a lot Peng. Entire series looks good to me.

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>