2021-09-08 09:41:02

by Shengjiu Wang

[permalink] [raw]
Subject: [PATCH v4 1/4] remoteproc: imx_rproc: Move common structure to header file

Move common structure imx_rproc_att, imx_rproc_method
and imx_rproc_dcfg to header file which can be shared with
imx_dsp_rproc driver.

Signed-off-by: Shengjiu Wang <[email protected]>
---
drivers/remoteproc/imx_rproc.c | 28 +------------------------
drivers/remoteproc/imx_rproc.h | 37 ++++++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+), 27 deletions(-)
create mode 100644 drivers/remoteproc/imx_rproc.h

diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index d88f76f5305e..b0da0130c3b6 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -19,6 +19,7 @@
#include <linux/remoteproc.h>
#include <linux/workqueue.h>

+#include "imx_rproc.h"
#include "remoteproc_internal.h"

#define IMX7D_SRC_SCR 0x0C
@@ -72,33 +73,6 @@ struct imx_rproc_mem {
/* M4 own area. Can be mapped at probe */
#define ATT_OWN BIT(1)

-/* address translation table */
-struct imx_rproc_att {
- u32 da; /* device address (From Cortex M4 view)*/
- u32 sa; /* system bus address */
- u32 size; /* size of reg range */
- int flags;
-};
-
-/* Remote core start/stop method */
-enum imx_rproc_method {
- IMX_RPROC_NONE,
- /* Through syscon regmap */
- IMX_RPROC_MMIO,
- /* Through ARM SMCCC */
- IMX_RPROC_SMC,
-};
-
-struct imx_rproc_dcfg {
- u32 src_reg;
- u32 src_mask;
- u32 src_start;
- u32 src_stop;
- const struct imx_rproc_att *att;
- size_t att_size;
- enum imx_rproc_method method;
-};
-
struct imx_rproc {
struct device *dev;
struct regmap *regmap;
diff --git a/drivers/remoteproc/imx_rproc.h b/drivers/remoteproc/imx_rproc.h
new file mode 100644
index 000000000000..23d8e808d27f
--- /dev/null
+++ b/drivers/remoteproc/imx_rproc.h
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2017 Pengutronix, Oleksij Rempel <[email protected]>
+ * Copyright 2021 NXP
+ */
+
+#ifndef _IMX_RPROC_H
+#define _IMX_RPROC_H
+
+/* address translation table */
+struct imx_rproc_att {
+ u32 da; /* device address (From Cortex M4 view)*/
+ u32 sa; /* system bus address */
+ u32 size; /* size of reg range */
+ int flags;
+};
+
+/* Remote core start/stop method */
+enum imx_rproc_method {
+ IMX_RPROC_NONE,
+ /* Through syscon regmap */
+ IMX_RPROC_MMIO,
+ /* Through ARM SMCCC */
+ IMX_RPROC_SMC,
+};
+
+struct imx_rproc_dcfg {
+ u32 src_reg;
+ u32 src_mask;
+ u32 src_start;
+ u32 src_stop;
+ const struct imx_rproc_att *att;
+ size_t att_size;
+ enum imx_rproc_method method;
+};
+
+#endif /* _IMX_RPROC_H */
--
2.17.1


2021-09-14 17:49:25

by Mathieu Poirier

[permalink] [raw]
Subject: Re: [PATCH v4 1/4] remoteproc: imx_rproc: Move common structure to header file

On Wed, Sep 08, 2021 at 05:10:52PM +0800, Shengjiu Wang wrote:
> Move common structure imx_rproc_att, imx_rproc_method
> and imx_rproc_dcfg to header file which can be shared with
> imx_dsp_rproc driver.
>
> Signed-off-by: Shengjiu Wang <[email protected]>
> ---
> drivers/remoteproc/imx_rproc.c | 28 +------------------------
> drivers/remoteproc/imx_rproc.h | 37 ++++++++++++++++++++++++++++++++++
> 2 files changed, 38 insertions(+), 27 deletions(-)
> create mode 100644 drivers/remoteproc/imx_rproc.h
>

Reviewed-by: Mathieu Poirier <[email protected]>

> diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
> index d88f76f5305e..b0da0130c3b6 100644
> --- a/drivers/remoteproc/imx_rproc.c
> +++ b/drivers/remoteproc/imx_rproc.c
> @@ -19,6 +19,7 @@
> #include <linux/remoteproc.h>
> #include <linux/workqueue.h>
>
> +#include "imx_rproc.h"
> #include "remoteproc_internal.h"
>
> #define IMX7D_SRC_SCR 0x0C
> @@ -72,33 +73,6 @@ struct imx_rproc_mem {
> /* M4 own area. Can be mapped at probe */
> #define ATT_OWN BIT(1)
>
> -/* address translation table */
> -struct imx_rproc_att {
> - u32 da; /* device address (From Cortex M4 view)*/
> - u32 sa; /* system bus address */
> - u32 size; /* size of reg range */
> - int flags;
> -};
> -
> -/* Remote core start/stop method */
> -enum imx_rproc_method {
> - IMX_RPROC_NONE,
> - /* Through syscon regmap */
> - IMX_RPROC_MMIO,
> - /* Through ARM SMCCC */
> - IMX_RPROC_SMC,
> -};
> -
> -struct imx_rproc_dcfg {
> - u32 src_reg;
> - u32 src_mask;
> - u32 src_start;
> - u32 src_stop;
> - const struct imx_rproc_att *att;
> - size_t att_size;
> - enum imx_rproc_method method;
> -};
> -
> struct imx_rproc {
> struct device *dev;
> struct regmap *regmap;
> diff --git a/drivers/remoteproc/imx_rproc.h b/drivers/remoteproc/imx_rproc.h
> new file mode 100644
> index 000000000000..23d8e808d27f
> --- /dev/null
> +++ b/drivers/remoteproc/imx_rproc.h
> @@ -0,0 +1,37 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) 2017 Pengutronix, Oleksij Rempel <[email protected]>
> + * Copyright 2021 NXP
> + */
> +
> +#ifndef _IMX_RPROC_H
> +#define _IMX_RPROC_H
> +
> +/* address translation table */
> +struct imx_rproc_att {
> + u32 da; /* device address (From Cortex M4 view)*/
> + u32 sa; /* system bus address */
> + u32 size; /* size of reg range */
> + int flags;
> +};
> +
> +/* Remote core start/stop method */
> +enum imx_rproc_method {
> + IMX_RPROC_NONE,
> + /* Through syscon regmap */
> + IMX_RPROC_MMIO,
> + /* Through ARM SMCCC */
> + IMX_RPROC_SMC,
> +};
> +
> +struct imx_rproc_dcfg {
> + u32 src_reg;
> + u32 src_mask;
> + u32 src_start;
> + u32 src_stop;
> + const struct imx_rproc_att *att;
> + size_t att_size;
> + enum imx_rproc_method method;
> +};
> +
> +#endif /* _IMX_RPROC_H */
> --
> 2.17.1
>