remoteproc: imx_rproc: Move common structure to header file
authorShengjiu Wang <shengjiu.wang@nxp.com>
Mon, 11 Oct 2021 09:20:12 +0000 (17:20 +0800)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 12 Oct 2021 15:15:57 +0000 (09:15 -0600)
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 <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1633944015-789-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/imx_rproc.c
drivers/remoteproc/imx_rproc.h [new file with mode: 0644]

index 4ae416ba50807e6c0134b3c23602d4218b085185..ff8170dbbc3c3e2ca2c5ed17cd682c2c87a98836 100644 (file)
@@ -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
@@ -73,33 +74,6 @@ struct imx_rproc_mem {
 #define ATT_OWN                BIT(1)
 #define ATT_IOMEM      BIT(2)
 
-/* 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 (file)
index 0000000..23d8e80
--- /dev/null
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2017 Pengutronix, Oleksij Rempel <kernel@pengutronix.de>
+ * 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 */