From: Tudor Ambarus <tudor.ambarus@linaro.org>
To: Krzysztof Kozlowski <krzk@kernel.org>,
Alim Akhtar <alim.akhtar@samsung.com>
Cc: andre.draszik@linaro.org, peter.griffin@linaro.org,
willmcvicker@google.com, kernel-team@android.com,
linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Tudor Ambarus <tudor.ambarus@linaro.org>
Subject: [PATCH 2/3] firmware: exynos-acpm: move common structures to exynos-acpm.h
Date: Mon, 24 Feb 2025 08:01:23 +0000 [thread overview]
Message-ID: <20250224-acpm-debugfs-v1-2-2418a3ea1b17@linaro.org> (raw)
In-Reply-To: <20250224-acpm-debugfs-v1-0-2418a3ea1b17@linaro.org>
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(-)
diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/samsung/exynos-acpm.c
index 3c14afc89fd7..8d83841f1d62 100644
--- a/drivers/firmware/samsung/exynos-acpm.c
+++ b/drivers/firmware/samsung/exynos-acpm.c
@@ -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.
diff --git a/drivers/firmware/samsung/exynos-acpm.h b/drivers/firmware/samsung/exynos-acpm.h
new file mode 100644
index 000000000000..c212fe28758a
--- /dev/null
+++ b/drivers/firmware/samsung/exynos-acpm.h
@@ -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__ */
--
2.48.1.601.g30ceb7b040-goog
next prev parent reply other threads:[~2025-02-24 8:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 8:01 [PATCH 0/3] firmware: samsung: add ACPM debugfs support Tudor Ambarus
2025-02-24 8:01 ` [PATCH 1/3] firmware: exynos-acpm: rename exynos-acpm.h to exynos-acpm-xfer.h Tudor Ambarus
2025-02-24 8:01 ` Tudor Ambarus [this message]
2025-02-24 8:01 ` [PATCH 3/3] firmware: samsung: add ACPM debugfs support Tudor Ambarus
2025-03-05 19:37 ` Krzysztof Kozlowski
2025-03-12 7:11 ` Tudor Ambarus
2025-03-17 14:23 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250224-acpm-debugfs-v1-2-2418a3ea1b17@linaro.org \
--to=tudor.ambarus@linaro.org \
--cc=alim.akhtar@samsung.com \
--cc=andre.draszik@linaro.org \
--cc=kernel-team@android.com \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=peter.griffin@linaro.org \
--cc=willmcvicker@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).