Skip to content

drivers: firmware: tisci: Add secure path support#101338

Merged
aescolar merged 4 commits intozephyrproject-rtos:mainfrom
Kronosblaster:tisci_fix
Feb 19, 2026
Merged

drivers: firmware: tisci: Add secure path support#101338
aescolar merged 4 commits intozephyrproject-rtos:mainfrom
Kronosblaster:tisci_fix

Conversation

@Kronosblaster
Copy link
Copy Markdown
Contributor

@Kronosblaster Kronosblaster commented Dec 19, 2025

Summary
Add support for secure TISCI communication paths to enable usage of secure threads for communication.

Changes:

  • Add is_secure flag to tisci_config for secure/non-secure path selection
  • Implement tisci_msg_requires_secure_path() to identify messages requiring secure path
  • Add secure header wrapping for outbound messages on secure path
  • Add secure header parsing for inbound messages on secure path
  • Improve error handling with proper semaphore cleanup in error paths
  • Add ti,is-secure device tree property to indicate secure host entities

Testing
Change the host-id and thread ids in the core specific dt file and run the /tests/drivers/tisci

Comment thread drivers/firmware/tisci/tisci.c Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
struct tisci_data *data = dev->data;
const struct tisci_config *config = dev->config;

if (!config->is_secure && tisci_msg_requires_secure_path(msg_type)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we having a block here, not to send a message on a non-secure path, its job of server to nack it. isn't it? Client driver should be dumb enough to send the message, if that so, then all the messages should go as its is there shouldn't be a need to differentiate secure and non-secure messages. If we are differentiating we are building a intelligence, that can be added to support both secure and non-secure pathways on the same driver. Isn't it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolving this comment, from a host perspective it can be either secure or non-secure, if non-secure we should not have secure messages sent out. The block seems okay in that perspective

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with your original assessment, a host can either be secure or non-secure. If secure then all messages go over the secure channel, non-secure -> all over non-secure. The TI-SCI client should not have to know details about which messages are "secure" messages, if they are and the host is not, then TI-SCI firmware will simply reject the message and we will return the appropriate error.

Suggest removing patch 2 from this series.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TISCI firmware doesnt reject the message. It silently drops it. This might lead to confusion if not blocked at send

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TISCI firmware not responding will result in a timeout waiting for the result which is treated as an error the same as a reject message.

@Kronosblaster Kronosblaster force-pushed the tisci_fix branch 2 times, most recently from c7c2809 to af7060b Compare December 22, 2025 08:37
@Kronosblaster Kronosblaster marked this pull request as ready for review December 22, 2025 08:57
@zephyrbot zephyrbot added the area: Devicetree Binding PR modifies or adds a Device Tree binding label Jan 8, 2026
@zephyrbot zephyrbot requested a review from JarmouniA January 8, 2026 08:44
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jan 8, 2026

@Kronosblaster Kronosblaster requested a review from glneo January 15, 2026 06:08
Comment thread drivers/firmware/tisci/tisci.h Outdated
#define TISCI_MSG_ENTER_SLEEP 0x0301

/* Clock requests */
/* Security Messages */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these message ID's put up here, why not down below with other high numbered messages (0x9000 messages should go almost at the bottom of the list)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are still all out of order, why keep updating this series without first addressing my simple request to keep the definitions in numerical order?

Comment thread drivers/firmware/tisci/tisci.c Outdated
case TISCI_MSG_READ_KEYCNT_KEYREV:
case TISCI_MSG_KEY_WRITER:
case TISCI_MSG_WRITE_KEYREV:
case TISCI_MSG_ENTER_SLEEP:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a message is secure the core should not have any reason to use that message to begin with. This list is info that shouldn't need to be stored over here in applications using TI-SCI. I'd suggest just dropping this check for now as it is holding up this series that otherwise would almost ready.

@LaurentiuM1234
Copy link
Copy Markdown
Contributor

LaurentiuM1234 commented Feb 11, 2026

FYI got my eyes on this one but would like to see an ACK from TI before giving my +1 as everything here is TI-specific

Comment thread drivers/firmware/tisci/tisci.c
Comment thread drivers/firmware/tisci/tisci.c Outdated
/* Skip secure header (if present) and copy tisci_msg_hdr + payload */
memcpy(xfer->rx_message.buf,
(uint8_t *)data->rx_message.buf + rx_offset,
xfer->rx_message.size);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just do this data move/shift up inside the if (config->is_secure) block, then you don't need to keep track of rx_offset. You could also just subtract out the secure header bytes from the xfer->rx_message.size at that point too so you can keep the old size check as it was (less churn).

@Kronosblaster Kronosblaster force-pushed the tisci_fix branch 2 times, most recently from 6fb7ff4 to 8b9057f Compare February 16, 2026 10:10
@Kronosblaster Kronosblaster requested a review from glneo February 16, 2026 10:10
- Add missing TISCI message type macros in tisci.h
- Clean macro organisation
- Add Secure indicator for message that require secure thread

Signed-off-by: Dave Joseph <d-joseph@ti.com>
- Add ti,is-secure device tree property to indicate secure host entities
- Add is_secure field in device config

Signed-off-by: Dave Joseph <d-joseph@ti.com>
Add support for secure TISCI communication paths to enable
message exchange with secure contexts on TI SoCs.
- Add secure header wrapping for outbound messages on secure path
- Add secure header parsing for inbound messages on secure path

Signed-off-by: Dave Joseph <d-joseph@ti.com>
- Add proper semaphore cleanup in error paths where it was missing

Signed-off-by: Dave Joseph <d-joseph@ti.com>
@sonarqubecloud
Copy link
Copy Markdown

@aescolar aescolar merged commit 2f3af50 into zephyrproject-rtos:main Feb 19, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants