From: Beleswar Padhi <b-padhi@ti.com>
To: <nm@ti.com>, <kristo@kernel.org>, <ssantosh@kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <afd@ti.com>, <u-kumar1@ti.com>,
<vigneshr@ti.com>, <b-padhi@ti.com>
Subject: [PATCH 6/6] firmware: ti: ti_sci_rm: Add ABI5.0 compliant basic RM APIs
Date: Thu, 1 Oct 2026 01:11:31 +0530 [thread overview]
Message-ID: <20260930194131.117129-7-b-padhi@ti.com> (raw)
In-Reply-To: <20260930194131.117129-1-b-padhi@ti.com>
The previous TI K2G and K3 architectures were tightly coupled systems in
terms of Safety and Security. All the TI-SCI messages from HLOS (Linux)
were sent to a single sec proxy thread terminating at the core running
Safety service (DM). In K2G systems, DM handled both Safety & Security
requests by itself. Whereas in K3 systems, DM serviced the Safety
requests itself, and forwarded the Security requests to core running
Security service (TIFS) on the HLOS's behalf. This posed various
limitations:
a. Increased latency: An extra forwarding hop through DM adds latency
in requests and responses.
b. Freedom From Interference (FFI) concerns: Having Safety service
proxy Security's requests (& vice versa) undermines the isolation
and FFI of the system.
c. Potential Deadlock Scenario: Forwarding messages between Safety
and Security cores can result in a deadlock if there are circular
dependencies.
To eliminate all the above limitations, the TI TDA54 class of SoCs
introduce an architectural change: Isolation of Security and Safety
services. To realize this enhanced isolation in hardware, two
independent sec proxy threads are now provided for HLOS to communicate
separately with the Security and Safety cores respectively. And the
TI-SCI message forwarding has been eliminated in Software. The System
Firmware ABI5.0 version necessitates this improved isolation and FFI
change.
In ABI5.0, the message structure for manage_irq has been updated to
remove the existing ia_id, vint, global_event, vint_status_bit fields as
they are not supported in hardware with TDA54 SoC. Therefore, remove
those fields and flags from the ABI5.0 structure definition and add new
APIs and wrappers to send the manage_irq message with this updated
structure. The TI TDA54 SoC has no Interrupt Aggregator in hardware, so
the event map related ops are invalid in ABI5.0
Signed-off-by: Beleswar Padhi <b-padhi@ti.com>
---
Note:
This patch is dependent on the following 2 series
1. https://lore.kernel.org/all/20260930172948.2901336-1-b-padhi@ti.com/
2. https://lore.kernel.org/all/20260930160607.2674980-1-b-padhi@ti.com/
drivers/firmware/ti/ti_sci.h | 34 +++++++
drivers/firmware/ti/ti_sci_core.c | 4 +
drivers/firmware/ti/ti_sci_rm.c | 148 ++++++++++++++++++++++++++++++
3 files changed, 186 insertions(+)
diff --git a/drivers/firmware/ti/ti_sci.h b/drivers/firmware/ti/ti_sci.h
index 5e0a35b394d19..32276a66bb8b4 100644
--- a/drivers/firmware/ti/ti_sci.h
+++ b/drivers/firmware/ti/ti_sci.h
@@ -1104,6 +1104,39 @@ struct ti_sci_msg_req_manage_irq {
u8 secondary_host;
} __packed;
+/**
+ * struct ti_sci_msg_req_manage_irq_abi5_pdm - Request to configure/release the route
+ * between the dev and the host.
+ * @hdr: Generic Header
+ * @valid_params: Bit fields defining the validity of interrupt source
+ * parameters. If a bit is not set, then corresponding
+ * field is not valid and will not be used for route set.
+ * Bit field definitions:
+ * 0 - Valid bit for @dst_id
+ * 1 - Valid bit for @dst_host_irq
+ * 31 - Valid bit for @secondary_host
+ * @src_id: IRQ source peripheral ID.
+ * @src_index: IRQ source index within the peripheral
+ * @dst_id: IRQ Destination ID. Based on the architecture it can be
+ * IRQ controller or host processor ID.
+ * @dst_host_irq: IRQ number of the destination host IRQ controller
+ * @secondary_host: Host ID of the IRQ destination computing entity. This is
+ * required only when destination host id is different
+ * from ti sci interface host id.
+ *
+ * Request type is TI_SCI_MSG_SET/RELEASE_IRQ.
+ * Response is generic ACK / NACK message.
+ */
+struct ti_sci_msg_req_manage_irq_abi5_pdm {
+ struct ti_sci_msg_hdr hdr;
+ u32 valid_params;
+ u16 src_id;
+ u16 src_index;
+ u16 dst_id;
+ u16 dst_host_irq;
+ u8 secondary_host;
+} __packed;
+
/**
* struct ti_sci_irq - Description of allocated irqs
* @node: Link to hash table
@@ -1879,6 +1912,7 @@ void ti_sci_setup_clock_ops_abi5(struct ti_sci_clk_ops *cops);
void ti_sci_setup_pm_ops(struct ti_sci_pm_ops *pmops);
void ti_sci_setup_rm_core_ops(struct ti_sci_rm_core_ops *rm_core_ops);
void ti_sci_setup_rm_irq_ops(struct ti_sci_rm_irq_ops *iops);
+void ti_sci_setup_rm_irq_ops_abi5(struct ti_sci_rm_irq_ops *iops);
void ti_sci_setup_rm_ringacc_ops(struct ti_sci_rm_ringacc_ops *rops);
void ti_sci_setup_rm_psil_ops(struct ti_sci_rm_psil_ops *psilops);
void ti_sci_setup_rm_udmap_ops(struct ti_sci_rm_udmap_ops *udmap_ops);
diff --git a/drivers/firmware/ti/ti_sci_core.c b/drivers/firmware/ti/ti_sci_core.c
index a8135e611a515..cb83ba99631c6 100644
--- a/drivers/firmware/ti/ti_sci_core.c
+++ b/drivers/firmware/ti/ti_sci_core.c
@@ -716,9 +716,13 @@ static void ti_sci_setup_ops_abi5(struct ti_sci_info *info)
struct ti_sci_ops *ops = &info->handle.ops;
struct ti_sci_dev_ops *dops = &ops->dev_ops;
struct ti_sci_clk_ops *cops = &ops->clk_ops;
+ struct ti_sci_rm_core_ops *rm_core_ops = &ops->rm_core_ops;
+ struct ti_sci_rm_irq_ops *iops = &ops->rm_irq_ops;
ti_sci_setup_device_ops_abi5(dops);
ti_sci_setup_clock_ops_abi5(cops);
+ ti_sci_setup_rm_core_ops(rm_core_ops);
+ ti_sci_setup_rm_irq_ops_abi5(iops);
}
/**
diff --git a/drivers/firmware/ti/ti_sci_rm.c b/drivers/firmware/ti/ti_sci_rm.c
index 87f2ef5785e09..23535cb25f051 100644
--- a/drivers/firmware/ti/ti_sci_rm.c
+++ b/drivers/firmware/ti/ti_sci_rm.c
@@ -155,6 +155,45 @@ int ti_sci_manage_irq(const struct ti_sci_handle *handle,
return 0;
}
+/**
+ * ti_sci_manage_irq_abi5_pdm() - Helper api to configure/release the irq route between
+ * the requested source and destination
+ * @handle: Pointer to TISCI handle.
+ * @valid_params: Bit fields defining the validity of certain params
+ * @src_id: Device ID of the IRQ source
+ * @src_index: IRQ source index within the source device
+ * @dst_id: Device ID of the IRQ destination
+ * @dst_host_irq: IRQ number of the destination device
+ * @s_host: Secondary host ID to which the irq/event is being
+ * requested for.
+ * @type: Request type irq set or release.
+ *
+ * Return: 0 if all went fine, else return appropriate error.
+ */
+static int ti_sci_manage_irq_abi5_pdm(const struct ti_sci_handle *handle,
+ u32 valid_params, u16 src_id, u16 src_index,
+ u16 dst_id, u16 dst_host_irq, u8 s_host, u16 type)
+{
+ struct ti_sci_msg_req_manage_irq_abi5_pdm req;
+ struct ti_sci_msg_hdr resp;
+ int ret = 0;
+
+ req.valid_params = valid_params;
+ req.src_id = src_id;
+ req.src_index = src_index;
+ req.dst_id = dst_id;
+ req.dst_host_irq = dst_host_irq;
+ req.secondary_host = s_host;
+
+ ret = ti_sci_do_xfer(handle, type, TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+ &req, sizeof(req),
+ &resp, sizeof(resp));
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
/**
* ti_sci_irq_hash() - Helper API to compute irq hash for the hash table.
* @irq: irq to hash
@@ -253,6 +292,35 @@ static int ti_sci_set_irq(const struct ti_sci_handle *handle, u32 valid_params,
return ret;
}
+/**
+ * ti_sci_set_irq_abi5_pdm() - Helper api to configure the irq route between the
+ * requested source and destination
+ * @handle: Pointer to TISCI handle.
+ * @valid_params: Bit fields defining the validity of certain params
+ * @src_id: Device ID of the IRQ source
+ * @src_index: IRQ source index within the source device
+ * @dst_id: Device ID of the IRQ destination
+ * @dst_host_irq: IRQ number of the destination device
+ * @s_host: Secondary host ID to which the irq/event is being
+ * requested for.
+ *
+ * Return: 0 if all went fine, else return appropriate error.
+ */
+static int ti_sci_set_irq_abi5_pdm(const struct ti_sci_handle *handle, u32 valid_params,
+ u16 src_id, u16 src_index, u16 dst_id,
+ u16 dst_host_irq, u8 s_host)
+{
+ int ret;
+
+ pr_debug("%s: IRQ set with valid_params = 0x%x from src = %d, index = %d, to dst = %d, irq = %d\n",
+ __func__, valid_params, src_id, src_index, dst_id, dst_host_irq);
+
+ ret = ti_sci_manage_irq_abi5_pdm(handle, valid_params, src_id, src_index,
+ dst_id, dst_host_irq, s_host, TI_SCI_MSG_SET_IRQ);
+
+ return ret;
+}
+
/**
* ti_sci_free_irq() - Helper api to free the irq route between the
* requested source and destination
@@ -325,6 +393,36 @@ static int ti_sci_free_irq(const struct ti_sci_handle *handle, u32 valid_params,
return ret;
}
+/**
+ * ti_sci_free_irq_abi5_pdm() - Helper api to free the irq route between the
+ * requested source and destination
+ * @handle: Pointer to TISCI handle.
+ * @valid_params: Bit fields defining the validity of certain params
+ * @src_id: Device ID of the IRQ source
+ * @src_index: IRQ source index within the source device
+ * @dst_id: Device ID of the IRQ destination
+ * @dst_host_irq: IRQ number of the destination device
+ * @s_host: Secondary host ID to which the irq/event is being
+ * requested for.
+ *
+ * Return: 0 if all went fine, else return appropriate error.
+ */
+static int ti_sci_free_irq_abi5_pdm(const struct ti_sci_handle *handle, u32 valid_params,
+ u16 src_id, u16 src_index, u16 dst_id,
+ u16 dst_host_irq, u8 s_host)
+{
+ int ret;
+
+ pr_debug("%s: IRQ release with valid_params = 0x%x from src = %d, index = %d, to dst = %d, irq = %d\n",
+ __func__, valid_params, src_id, src_index, dst_id, dst_host_irq);
+
+ ret = ti_sci_manage_irq_abi5_pdm(handle, valid_params, src_id, src_index,
+ dst_id, dst_host_irq, s_host,
+ TI_SCI_MSG_FREE_IRQ);
+
+ return ret;
+}
+
/**
* ti_sci_cmd_set_irq() - Configure a host irq route between the requested
* source and destination.
@@ -345,6 +443,26 @@ static int ti_sci_cmd_set_irq(const struct ti_sci_handle *handle, u16 src_id,
dst_host_irq, 0, 0, 0, 0, 0);
}
+/**
+ * ti_sci_cmd_set_irq_abi5_pdm() - Configure a host irq route between the requested
+ * source and destination.
+ * @handle: Pointer to TISCI handle.
+ * @src_id: Device ID of the IRQ source
+ * @src_index: IRQ source index within the source device
+ * @dst_id: Device ID of the IRQ destination
+ * @dst_host_irq: IRQ number of the destination device
+ *
+ * Return: 0 if all went fine, else return appropriate error.
+ */
+static int ti_sci_cmd_set_irq_abi5_pdm(const struct ti_sci_handle *handle, u16 src_id,
+ u16 src_index, u16 dst_id, u16 dst_host_irq)
+{
+ u32 valid_params = MSG_FLAG_DST_ID_VALID | MSG_FLAG_DST_HOST_IRQ_VALID;
+
+ return ti_sci_set_irq_abi5_pdm(handle, valid_params, src_id, src_index, dst_id,
+ dst_host_irq, 0);
+}
+
/**
* ti_sci_cmd_set_event_map() - Configure an event based irq route between the
* requested source and Interrupt Aggregator.
@@ -391,6 +509,26 @@ static int ti_sci_cmd_free_irq(const struct ti_sci_handle *handle, u16 src_id,
dst_host_irq, 0, 0, 0, 0, 0);
}
+/**
+ * ti_sci_cmd_free_irq_abi5_pdm() - Free a host irq route between the requested
+ * source and destination.
+ * @handle: Pointer to TISCI handle.
+ * @src_id: Device ID of the IRQ source
+ * @src_index: IRQ source index within the source device
+ * @dst_id: Device ID of the IRQ destination
+ * @dst_host_irq: IRQ number of the destination device
+ *
+ * Return: 0 if all went fine, else return appropriate error.
+ */
+static int ti_sci_cmd_free_irq_abi5_pdm(const struct ti_sci_handle *handle, u16 src_id,
+ u16 src_index, u16 dst_id, u16 dst_host_irq)
+{
+ u32 valid_params = MSG_FLAG_DST_ID_VALID | MSG_FLAG_DST_HOST_IRQ_VALID;
+
+ return ti_sci_free_irq_abi5_pdm(handle, valid_params, src_id, src_index, dst_id,
+ dst_host_irq, 0);
+}
+
/**
* ti_sci_cmd_free_event_map() - Free an event map between the requested source
* and Interrupt Aggregator.
@@ -879,6 +1017,16 @@ void ti_sci_setup_rm_irq_ops(struct ti_sci_rm_irq_ops *iops)
iops->free_event_map = ti_sci_cmd_free_event_map;
}
+/*
+ * ti_sci_setup_rm_irq_ops_abi5() - Setup the Resource Management IRQ operations structures (ABI5)
+ * @iops: pointer to TISCI rm irq ops structure
+ */
+void ti_sci_setup_rm_irq_ops_abi5(struct ti_sci_rm_irq_ops *iops)
+{
+ iops->set_irq = ti_sci_cmd_set_irq_abi5_pdm;
+ iops->free_irq = ti_sci_cmd_free_irq_abi5_pdm;
+}
+
/*
* ti_sci_setup_rm_ringacc_ops() - Setup the Resource Management RINGACC operations structures
* @rops: pointer to TISCI rm ringacc ops structure
--
2.34.1
prev parent reply other threads:[~2026-09-30 19:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 19:41 [PATCH 0/6] Enhance TI-SCI FFI with ABI5.0 support Beleswar Padhi
2026-09-30 19:41 ` [PATCH 1/6] dt-bindings: arm: keystone: ti,sci: Update nodename pattern Beleswar Padhi
2026-10-02 6:27 ` Krzysztof Kozlowski
2026-10-02 9:56 ` Padhi, Beleswar
2026-10-02 10:00 ` Krzysztof Kozlowski
2026-09-30 19:41 ` [PATCH 2/6] dt-bindings: arm: keystone: ti,sci: Add ti,tda54-sci-pdm compatible Beleswar Padhi
2026-10-02 6:31 ` Krzysztof Kozlowski
2026-10-02 9:30 ` Padhi, Beleswar
2026-10-02 9:39 ` Krzysztof Kozlowski
2026-10-02 10:30 ` Padhi, Beleswar
2026-09-30 19:41 ` [PATCH 3/6] firmware: ti: ti_sci_core: Add ABI5.0 Enhancements and TDA54 PDM SCI support Beleswar Padhi
2026-09-30 19:41 ` [PATCH 4/6] firmware: ti: ti_sci_device: Add ABI5.0 compliant Device and Reset APIs Beleswar Padhi
2026-09-30 19:41 ` [PATCH 5/6] firmware: ti: ti_sci_clock: Add ABI5.0 compliant Clock APIs Beleswar Padhi
2026-09-30 19:41 ` Beleswar Padhi [this message]
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=20260930194131.117129-7-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®