@@ -12,7 +12,6 @@
#include <linux/container_of.h>
#include <linux/delay.h>
#include <linux/device.h>
-#include <linux/firmware/samsung/exynos-acpm-protocol.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/mailbox/exynos-message.h>
@@ -27,7 +26,7 @@
#include <linux/slab.h>
#include <linux/types.h>
-#include "exynos-acpm-xfer.h"
+#include "exynos-acpm.h"
#include "exynos-acpm-pmic.h"
#define ACPM_PROTOCOL_SEQNUM GENMASK(21, 16)
@@ -38,20 +37,6 @@
#define ACPM_GS101_INITDATA_BASE 0xa000
-/**
- * struct acpm_shmem - shared memory configuration information.
- * @reserved: unused fields.
- * @chans: offset to array of struct acpm_chan_shmem.
- * @reserved1: unused fields.
- * @num_chans: number of channels.
- */
-struct acpm_shmem {
- u32 reserved[2];
- u32 chans;
- u32 reserved1[3];
- u32 num_chans;
-};
-
/**
* struct acpm_chan_shmem - descriptor of a shared memory channel.
*
@@ -85,19 +70,6 @@ struct acpm_chan_shmem {
u32 poll_completion;
};
-/**
- * struct acpm_queue - exynos acpm queue.
- *
- * @rear: rear address of the queue.
- * @front: front address of the queue.
- * @base: base address of the queue.
- */
-struct acpm_queue {
- void __iomem *rear;
- void __iomem *front;
- void __iomem *base;
-};
-
/**
* struct acpm_rx_data - RX queue data.
*
@@ -155,24 +127,6 @@ struct acpm_chan {
struct acpm_rx_data rx_data[ACPM_SEQNUM_MAX];
};
-/**
- * struct acpm_info - driver's private data.
- * @shmem: pointer to the SRAM configuration data.
- * @sram_base: base address of SRAM.
- * @chans: pointer to the ACPM channel parameters retrieved from SRAM.
- * @dev: pointer to the exynos-acpm device.
- * @handle: instance of acpm_handle to send to clients.
- * @num_chans: number of channels available for this controller.
- */
-struct acpm_info {
- struct acpm_shmem __iomem *shmem;
- void __iomem *sram_base;
- struct acpm_chan *chans;
- struct device *dev;
- struct acpm_handle handle;
- u32 num_chans;
-};
-
/**
* struct acpm_match_data - of_device_id data.
* @initdata_base: offset in SRAM where the channels configuration resides.
new file mode 100644
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright 2020 Samsung Electronics Co., Ltd.
+ * Copyright 2020 Google LLC.
+ * Copyright 2024 Linaro Ltd.
+ */
+#ifndef __EXYNOS_ACPM_H__
+#define __EXYNOS_ACPM_H__
+
+#include <linux/debugfs.h>
+#include <linux/firmware/samsung/exynos-acpm-protocol.h>
+#include <linux/types.h>
+
+#include "exynos-acpm-xfer.h"
+
+/**
+ * struct acpm_shmem - shared memory configuration information.
+ * @reserved: unused fields.
+ * @chans: offset to array of struct acpm_chan_shmem.
+ * @reserved1: unused fields.
+ * @num_chans: number of channels.
+ */
+struct acpm_shmem {
+ u32 reserved[2];
+ u32 chans;
+ u32 reserved1[3];
+ u32 num_chans;
+};
+
+/**
+ * struct acpm_queue - exynos acpm queue.
+ * @rear: rear address of the queue.
+ * @front: front address of the queue.
+ * @base: base address of the queue.
+ */
+struct acpm_queue {
+ void __iomem *rear;
+ void __iomem *front;
+ void __iomem *base;
+};
+
+struct device;
+struct acpm_chan;
+
+/**
+ * struct acpm_info - driver's private data.
+ * @shmem: pointer to the SRAM configuration data.
+ * @sram_base: base address of SRAM.
+ * @chans: pointer to the ACPM channel parameters retrieved from SRAM.
+ * @dev: pointer to the exynos-acpm device.
+ * @handle: instance of acpm_handle to send to clients.
+ * @num_chans: number of channels available for this controller.
+ */
+struct acpm_info {
+ struct acpm_shmem __iomem *shmem;
+ void __iomem *sram_base;
+ struct acpm_chan *chans;
+ struct device *dev;
+ struct acpm_handle handle;
+ u32 num_chans;
+};
+
+#endif /* __EXYNOS_ACPM_H__ */
Prepare for the ACPM logging feature addition. ACPM is capable of logging things to SRAM. The logging feature needs access to struct acpm_info in order to get the sram_base, to the configuration data from SRAM, and to the struct acpm_queue internal driver representation of a queue. Move these structs to a common exynos-acpm.h. Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org> --- drivers/firmware/samsung/exynos-acpm.c | 48 +------------------------- drivers/firmware/samsung/exynos-acpm.h | 63 ++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 47 deletions(-)