From: Beleswar Padhi <b-padhi@ti.com>
To: <nm@ti.com>, <kristo@kernel.org>, <ssantosh@kernel.org>,
<afd@ti.com>, <vigneshr@ti.com>, <u-kumar1@ti.com>
Cc: <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <b-padhi@ti.com>
Subject: [PATCH 22/22] firmware: ti: ti_sci_proc: Move processor ops into its own file
Date: Wed, 30 Sep 2026 01:47:46 +0530 [thread overview]
Message-ID: <20260929201746.4078803-23-b-padhi@ti.com> (raw)
In-Reply-To: <20260929201746.4078803-1-b-padhi@ti.com>
Extract the processor operations related functions and services from
ti_sci_core.c into its own file. This breaks down the single large
file into smaller logical files for better readability and maintenance.
Signed-off-by: Beleswar Padhi <b-padhi@ti.com>
---
drivers/firmware/ti/Makefile | 1 +
drivers/firmware/ti/ti_sci.h | 1 +
drivers/firmware/ti/ti_sci_core.c | 197 +--------------------------
drivers/firmware/ti/ti_sci_proc.c | 214 ++++++++++++++++++++++++++++++
4 files changed, 217 insertions(+), 196 deletions(-)
create mode 100644 drivers/firmware/ti/ti_sci_proc.c
diff --git a/drivers/firmware/ti/Makefile b/drivers/firmware/ti/Makefile
index 7d9c2a73bf5a6..8a32cb65b6fa5 100644
--- a/drivers/firmware/ti/Makefile
+++ b/drivers/firmware/ti/Makefile
@@ -4,5 +4,6 @@ ti_sci-y := ti_sci_core.o
ti_sci-y += ti_sci_clock.o
ti_sci-y += ti_sci_device.o
ti_sci-y += ti_sci_pm.o
+ti_sci-y += ti_sci_proc.o
ti_sci-y += ti_sci_rm.o
obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o
diff --git a/drivers/firmware/ti/ti_sci.h b/drivers/firmware/ti/ti_sci.h
index e8d6589eec0e9..8f9f0b1aa767d 100644
--- a/drivers/firmware/ti/ti_sci.h
+++ b/drivers/firmware/ti/ti_sci.h
@@ -1687,5 +1687,6 @@ int ti_sci_manage_irq(const struct ti_sci_handle *handle, u32 valid_params,
u16 src_id, u16 src_index, u16 dst_id, u16 dst_host_irq,
u16 ia_id, u16 vint, u16 global_event, u8 vint_status_bit,
u8 s_host, u16 type);
+void ti_sci_setup_proc_ops(struct ti_sci_proc_ops *pops);
#endif /* __TI_SCI_H */
diff --git a/drivers/firmware/ti/ti_sci_core.c b/drivers/firmware/ti/ti_sci_core.c
index b1345e06341db..1f7484b118375 100644
--- a/drivers/firmware/ti/ti_sci_core.c
+++ b/drivers/firmware/ti/ti_sci_core.c
@@ -620,195 +620,6 @@ static int ti_sci_cmd_core_reboot(const struct ti_sci_handle *handle)
return 0;
}
-/**
- * ti_sci_cmd_proc_request() - Command to request a physical processor control
- * @handle: Pointer to TI SCI handle
- * @proc_id: Processor ID this request is for
- *
- * Return: 0 if all went well, else returns appropriate error value.
- */
-static int ti_sci_cmd_proc_request(const struct ti_sci_handle *handle,
- u8 proc_id)
-{
- struct ti_sci_msg_req_proc_request req;
- struct ti_sci_msg_hdr resp;
- int ret = 0;
-
- req.processor_id = proc_id;
-
- ret = ti_sci_do_xfer(handle, TI_SCI_MSG_PROC_REQUEST,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
- &req, sizeof(req),
- &resp, sizeof(resp));
- if (ret)
- return ret;
-
- return 0;
-}
-
-/**
- * ti_sci_cmd_proc_release() - Command to release a physical processor control
- * @handle: Pointer to TI SCI handle
- * @proc_id: Processor ID this request is for
- *
- * Return: 0 if all went well, else returns appropriate error value.
- */
-static int ti_sci_cmd_proc_release(const struct ti_sci_handle *handle,
- u8 proc_id)
-{
- struct ti_sci_msg_req_proc_release req;
- struct ti_sci_msg_hdr resp;
- int ret = 0;
-
- req.processor_id = proc_id;
-
- ret = ti_sci_do_xfer(handle, TI_SCI_MSG_PROC_RELEASE,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
- &req, sizeof(req),
- &resp, sizeof(resp));
- if (ret)
- return ret;
-
- return 0;
-}
-
-/**
- * ti_sci_cmd_proc_handover() - Command to handover a physical processor
- * control to a host in the processor's access
- * control list.
- * @handle: Pointer to TI SCI handle
- * @proc_id: Processor ID this request is for
- * @host_id: Host ID to get the control of the processor
- *
- * Return: 0 if all went well, else returns appropriate error value.
- */
-static int ti_sci_cmd_proc_handover(const struct ti_sci_handle *handle,
- u8 proc_id, u8 host_id)
-{
- struct ti_sci_msg_req_proc_handover req;
- struct ti_sci_msg_hdr resp;
- int ret = 0;
-
- req.processor_id = proc_id;
- req.host_id = host_id;
-
- ret = ti_sci_do_xfer(handle, TI_SCI_MSG_PROC_HANDOVER,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
- &req, sizeof(req),
- &resp, sizeof(resp));
- if (ret)
- return ret;
-
- return 0;
-}
-
-/**
- * ti_sci_cmd_proc_set_config() - Command to set the processor boot
- * configuration flags
- * @handle: Pointer to TI SCI handle
- * @proc_id: Processor ID this request is for
- * @bootvector: Processor Boot vector (start address)
- * @config_flags_set: Configuration flags to be set
- * @config_flags_clear: Configuration flags to be cleared.
- *
- * Return: 0 if all went well, else returns appropriate error value.
- */
-static int ti_sci_cmd_proc_set_config(const struct ti_sci_handle *handle,
- u8 proc_id, u64 bootvector,
- u32 config_flags_set,
- u32 config_flags_clear)
-{
- struct ti_sci_msg_req_set_config req;
- struct ti_sci_msg_hdr resp;
- int ret = 0;
-
- req.processor_id = proc_id;
- req.bootvector_low = bootvector & TI_SCI_ADDR_LOW_MASK;
- req.bootvector_high = (bootvector & TI_SCI_ADDR_HIGH_MASK) >>
- TI_SCI_ADDR_HIGH_SHIFT;
- req.config_flags_set = config_flags_set;
- req.config_flags_clear = config_flags_clear;
-
- ret = ti_sci_do_xfer(handle, TI_SCI_MSG_SET_CONFIG,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
- &req, sizeof(req),
- &resp, sizeof(resp));
- if (ret)
- return ret;
-
- return 0;
-}
-
-/**
- * ti_sci_cmd_proc_set_control() - Command to set the processor boot
- * control flags
- * @handle: Pointer to TI SCI handle
- * @proc_id: Processor ID this request is for
- * @control_flags_set: Control flags to be set
- * @control_flags_clear: Control flags to be cleared
- *
- * Return: 0 if all went well, else returns appropriate error value.
- */
-static int ti_sci_cmd_proc_set_control(const struct ti_sci_handle *handle,
- u8 proc_id, u32 control_flags_set,
- u32 control_flags_clear)
-{
- struct ti_sci_msg_req_set_ctrl req;
- struct ti_sci_msg_hdr resp;
- int ret = 0;
-
- req.processor_id = proc_id;
- req.control_flags_set = control_flags_set;
- req.control_flags_clear = control_flags_clear;
-
- ret = ti_sci_do_xfer(handle, TI_SCI_MSG_SET_CTRL,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
- &req, sizeof(req),
- &resp, sizeof(resp));
- if (ret)
- return ret;
-
- return 0;
-}
-
-/**
- * ti_sci_cmd_proc_get_status() - Command to get the processor boot status
- * @handle: Pointer to TI SCI handle
- * @proc_id: Processor ID this request is for
- * @bv: Processor Boot vector (start address)
- * @cfg_flags: Processor specific configuration flags
- * @ctrl_flags: Processor specific control flags
- * @sts_flags: Processor specific status flags
- *
- * Return: 0 if all went well, else returns appropriate error value.
- */
-static int ti_sci_cmd_proc_get_status(const struct ti_sci_handle *handle,
- u8 proc_id, u64 *bv, u32 *cfg_flags,
- u32 *ctrl_flags, u32 *sts_flags)
-{
- struct ti_sci_msg_resp_get_status resp;
- struct ti_sci_msg_req_get_status req;
- int ret = 0;
-
- req.processor_id = proc_id;
-
- ret = ti_sci_do_xfer(handle, TI_SCI_MSG_GET_STATUS,
- TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
- &req, sizeof(req),
- &resp, sizeof(resp));
- if (ret)
- return ret;
-
- *bv = (resp.bootvector_low & TI_SCI_ADDR_LOW_MASK) |
- (((u64)resp.bootvector_high << TI_SCI_ADDR_HIGH_SHIFT) &
- TI_SCI_ADDR_HIGH_MASK);
- *cfg_flags = resp.config_flags;
- *ctrl_flags = resp.control_flags;
- *sts_flags = resp.status_flags;
-
- return 0;
-}
-
/*
* ti_sci_setup_ops() - Setup the operations structures
* @info: pointer to TISCI pointer
@@ -839,13 +650,7 @@ static void ti_sci_setup_ops(struct ti_sci_info *info)
ti_sci_setup_rm_ringacc_ops(rops);
ti_sci_setup_rm_psil_ops(psilops);
ti_sci_setup_rm_udmap_ops(udmap_ops);
-
- pops->request = ti_sci_cmd_proc_request;
- pops->release = ti_sci_cmd_proc_release;
- pops->handover = ti_sci_cmd_proc_handover;
- pops->set_config = ti_sci_cmd_proc_set_config;
- pops->set_control = ti_sci_cmd_proc_set_control;
- pops->get_status = ti_sci_cmd_proc_get_status;
+ ti_sci_setup_proc_ops(pops);
}
/**
diff --git a/drivers/firmware/ti/ti_sci_proc.c b/drivers/firmware/ti/ti_sci_proc.c
new file mode 100644
index 0000000000000..6c0430f7b444a
--- /dev/null
+++ b/drivers/firmware/ti/ti_sci_proc.c
@@ -0,0 +1,214 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Texas Instruments System Control Interface Protocol Driver
+ *
+ * Copyright (C) 2015-2026 Texas Instruments Incorporated - https://www.ti.com/
+ * Nishanth Menon
+ */
+
+#include <linux/soc/ti/ti_sci_protocol.h>
+
+#include "ti_sci.h"
+
+/**
+ * ti_sci_cmd_proc_request() - Command to request a physical processor control
+ * @handle: Pointer to TI SCI handle
+ * @proc_id: Processor ID this request is for
+ *
+ * Return: 0 if all went well, else returns appropriate error value.
+ */
+static int ti_sci_cmd_proc_request(const struct ti_sci_handle *handle,
+ u8 proc_id)
+{
+ struct ti_sci_msg_req_proc_request req;
+ struct ti_sci_msg_hdr resp;
+ int ret = 0;
+
+ req.processor_id = proc_id;
+
+ ret = ti_sci_do_xfer(handle, TI_SCI_MSG_PROC_REQUEST,
+ TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ &req, sizeof(req),
+ &resp, sizeof(resp));
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+/**
+ * ti_sci_cmd_proc_release() - Command to release a physical processor control
+ * @handle: Pointer to TI SCI handle
+ * @proc_id: Processor ID this request is for
+ *
+ * Return: 0 if all went well, else returns appropriate error value.
+ */
+static int ti_sci_cmd_proc_release(const struct ti_sci_handle *handle,
+ u8 proc_id)
+{
+ struct ti_sci_msg_req_proc_release req;
+ struct ti_sci_msg_hdr resp;
+ int ret = 0;
+
+ req.processor_id = proc_id;
+
+ ret = ti_sci_do_xfer(handle, TI_SCI_MSG_PROC_RELEASE,
+ TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ &req, sizeof(req),
+ &resp, sizeof(resp));
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+/**
+ * ti_sci_cmd_proc_handover() - Command to handover a physical processor
+ * control to a host in the processor's access
+ * control list.
+ * @handle: Pointer to TI SCI handle
+ * @proc_id: Processor ID this request is for
+ * @host_id: Host ID to get the control of the processor
+ *
+ * Return: 0 if all went well, else returns appropriate error value.
+ */
+static int ti_sci_cmd_proc_handover(const struct ti_sci_handle *handle,
+ u8 proc_id, u8 host_id)
+{
+ struct ti_sci_msg_req_proc_handover req;
+ struct ti_sci_msg_hdr resp;
+ int ret = 0;
+
+ req.processor_id = proc_id;
+ req.host_id = host_id;
+
+ ret = ti_sci_do_xfer(handle, TI_SCI_MSG_PROC_HANDOVER,
+ TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ &req, sizeof(req),
+ &resp, sizeof(resp));
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+/**
+ * ti_sci_cmd_proc_set_config() - Command to set the processor boot
+ * configuration flags
+ * @handle: Pointer to TI SCI handle
+ * @proc_id: Processor ID this request is for
+ * @bootvector: Processor Boot vector (start address)
+ * @config_flags_set: Configuration flags to be set
+ * @config_flags_clear: Configuration flags to be cleared.
+ *
+ * Return: 0 if all went well, else returns appropriate error value.
+ */
+static int ti_sci_cmd_proc_set_config(const struct ti_sci_handle *handle,
+ u8 proc_id, u64 bootvector,
+ u32 config_flags_set,
+ u32 config_flags_clear)
+{
+ struct ti_sci_msg_req_set_config req;
+ struct ti_sci_msg_hdr resp;
+ int ret = 0;
+
+ req.processor_id = proc_id;
+ req.bootvector_low = bootvector & TI_SCI_ADDR_LOW_MASK;
+ req.bootvector_high = (bootvector & TI_SCI_ADDR_HIGH_MASK) >>
+ TI_SCI_ADDR_HIGH_SHIFT;
+ req.config_flags_set = config_flags_set;
+ req.config_flags_clear = config_flags_clear;
+
+ ret = ti_sci_do_xfer(handle, TI_SCI_MSG_SET_CONFIG,
+ TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ &req, sizeof(req),
+ &resp, sizeof(resp));
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+/**
+ * ti_sci_cmd_proc_set_control() - Command to set the processor boot
+ * control flags
+ * @handle: Pointer to TI SCI handle
+ * @proc_id: Processor ID this request is for
+ * @control_flags_set: Control flags to be set
+ * @control_flags_clear: Control flags to be cleared
+ *
+ * Return: 0 if all went well, else returns appropriate error value.
+ */
+static int ti_sci_cmd_proc_set_control(const struct ti_sci_handle *handle,
+ u8 proc_id, u32 control_flags_set,
+ u32 control_flags_clear)
+{
+ struct ti_sci_msg_req_set_ctrl req;
+ struct ti_sci_msg_hdr resp;
+ int ret = 0;
+
+ req.processor_id = proc_id;
+ req.control_flags_set = control_flags_set;
+ req.control_flags_clear = control_flags_clear;
+
+ ret = ti_sci_do_xfer(handle, TI_SCI_MSG_SET_CTRL,
+ TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ &req, sizeof(req),
+ &resp, sizeof(resp));
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+/**
+ * ti_sci_cmd_proc_get_status() - Command to get the processor boot status
+ * @handle: Pointer to TI SCI handle
+ * @proc_id: Processor ID this request is for
+ * @bv: Processor Boot vector (start address)
+ * @cfg_flags: Processor specific configuration flags
+ * @ctrl_flags: Processor specific control flags
+ * @sts_flags: Processor specific status flags
+ *
+ * Return: 0 if all went well, else returns appropriate error value.
+ */
+static int ti_sci_cmd_proc_get_status(const struct ti_sci_handle *handle,
+ u8 proc_id, u64 *bv, u32 *cfg_flags,
+ u32 *ctrl_flags, u32 *sts_flags)
+{
+ struct ti_sci_msg_resp_get_status resp;
+ struct ti_sci_msg_req_get_status req;
+ int ret = 0;
+
+ req.processor_id = proc_id;
+
+ ret = ti_sci_do_xfer(handle, TI_SCI_MSG_GET_STATUS,
+ TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ &req, sizeof(req),
+ &resp, sizeof(resp));
+ if (ret)
+ return ret;
+
+ *bv = (resp.bootvector_low & TI_SCI_ADDR_LOW_MASK) |
+ (((u64)resp.bootvector_high << TI_SCI_ADDR_HIGH_SHIFT) &
+ TI_SCI_ADDR_HIGH_MASK);
+ *cfg_flags = resp.config_flags;
+ *ctrl_flags = resp.control_flags;
+ *sts_flags = resp.status_flags;
+
+ return 0;
+}
+
+/*
+ * ti_sci_setup_proc_ops() - Setup the processor operations structures
+ * @pops: pointer to TISCI processor ops structure
+ */
+void ti_sci_setup_proc_ops(struct ti_sci_proc_ops *pops)
+{
+ pops->request = ti_sci_cmd_proc_request;
+ pops->release = ti_sci_cmd_proc_release;
+ pops->handover = ti_sci_cmd_proc_handover;
+ pops->set_config = ti_sci_cmd_proc_set_config;
+ pops->set_control = ti_sci_cmd_proc_set_control;
+ pops->get_status = ti_sci_cmd_proc_get_status;
+}
--
2.34.1
next prev parent reply other threads:[~2026-09-29 20:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 20:17 [PATCH 00/22] Cleanup and Refactor TI-SCI driver Beleswar Padhi
2026-09-29 20:17 ` [PATCH 01/22] firmware: ti_sci: Move error message handling into ti_sci_get_one_xfer() Beleswar Padhi
2026-09-29 20:17 ` [PATCH 02/22] firmware: ti_sci: Move error message handling into ti_sci_do_xfer() Beleswar Padhi
2026-09-29 20:17 ` [PATCH 03/22] firmware: ti_sci: Move check for ACK " Beleswar Padhi
2026-09-29 20:17 ` [PATCH 04/22] firmware: ti_sci: Remove out of place RM debug messages Beleswar Padhi
2026-09-29 20:17 ` [PATCH 05/22] firmware: ti_sci: Name response variable resp for consistency Beleswar Padhi
2026-09-29 20:17 ` [PATCH 06/22] firmware: ti_sci: Handle xfer cleanup inside ti_sci_do_xfer() Beleswar Padhi
2026-09-29 20:17 ` [PATCH 07/22] firmware: ti_sci: Pass request struct into ti_sci_do_xfer() Beleswar Padhi
2026-09-29 20:17 ` [PATCH 08/22] firmware: ti_sci: Combine xfer allocation and transfer functions Beleswar Padhi
2026-09-29 20:17 ` [PATCH 09/22] firmware: ti_sci: Fetch info struct from handle inside ti_sci_do_xfer() Beleswar Padhi
2026-09-29 20:17 ` [PATCH 10/22] firmware: ti_sci: Use tx_message as message buffer directly Beleswar Padhi
2026-09-29 20:17 ` [PATCH 11/22] firmware: ti_sci: Use rx_message as message receive buffer Beleswar Padhi
2026-09-29 20:17 ` [PATCH 12/22] firmware: ti_sci: Fix some kernel-doc references in structs Beleswar Padhi
2026-09-29 20:17 ` [PATCH 13/22] soc: ti: ti_sci_protocol.h: Add missing documentation for structs Beleswar Padhi
2026-09-29 20:17 ` [PATCH 14/22] firmware: ti_sci: Do not export reboot control Beleswar Padhi
2026-09-29 20:17 ` [PATCH 15/22] firmware: ti_sci: Use pmops fxn pointers in suspend/resume hooks Beleswar Padhi
2026-09-29 20:17 ` [PATCH 16/22] firmware: ti_sci: Move the huge ti_sci file into its own directory Beleswar Padhi
2026-09-29 20:17 ` [PATCH 17/22] firmware: ti: ti_sci: Add missing includes for self-contained headers Beleswar Padhi
2026-09-29 20:17 ` [PATCH 18/22] firmware: ti: ti_sci_device: Move device ops into its own file Beleswar Padhi
2026-09-29 20:17 ` [PATCH 19/22] firmware: ti: ti_sci_clock: Move clock " Beleswar Padhi
2026-09-29 20:17 ` [PATCH 20/22] firmware: ti: ti_sci_pm: Move pm " Beleswar Padhi
2026-09-29 20:17 ` [PATCH 21/22] firmware: ti: ti_sci_rm: Move rm " Beleswar Padhi
2026-09-29 20:17 ` Beleswar Padhi [this message]
2026-09-30 5:38 ` [PATCH 00/22] Cleanup and Refactor TI-SCI driver Nishanth Menon
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=20260929201746.4078803-23-b-padhi@ti.com \
--to=b-padhi@ti.com \
--cc=afd@ti.com \
--cc=kristo@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nm@ti.com \
--cc=ssantosh@kernel.org \
--cc=u-kumar1@ti.com \
--cc=vigneshr@ti.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
all inboxes | Powered by JetHome®