Skip to content

TISCI clock and power initialization, changes and bugfixes#101280

Closed
natto1784 wants to merge 12 commits intozephyrproject-rtos:mainfrom
natto1784:tisci-clock-and-power
Closed

TISCI clock and power initialization, changes and bugfixes#101280
natto1784 wants to merge 12 commits intozephyrproject-rtos:mainfrom
natto1784:tisci-clock-and-power

Conversation

@natto1784
Copy link
Copy Markdown
Contributor

@natto1784 natto1784 commented Dec 18, 2025

Dependency: #100642

Supersedes: #91914

Changes

drivers: firmware:

Restricted the TISCI driver to a single instance within the device tree.

drivers: mbox:

Introduced a vendor-specific polling API for ti_secproxy to support blocking RX message retrieval during PRE_KERNEL.

drivers: firmware

Modified TISCI to use polling instead of semaphores during PRE_KERNEL stages to allow early mailbox communication.

drivers: power_domain

Optimized TISCI PD initialization to only target PDs used by "okay" nodes.

soc/ti/k3/am6x

  • Implemented runtime TISCI clock frequency configuration via SYS_INIT and added early UART console initialization.
  • Added runtime power domain support using SYS_INIT hooks for both general peripherals and the early UART console.

dts

Added TISCI clock controller nodes and peripheral clock/power properties for TI AM64x variants.

am243x_evm

Enabled TISCI, clock, and power management Kconfig options for R5FSS0_0 and cleaned up peripheral status in DT.

@natto1784 natto1784 force-pushed the tisci-clock-and-power branch from 4ce7da4 to 69861b6 Compare December 18, 2025 14:08
Fix secproxy mailbox driver to correctly handle thread
verification and error states.
- Update secproxy_verify_thread to return error codes instead of logging
- Update secproxy_verify_thread to remove busy wait
- Remove unecessary count checks and which is handled
within secproxy_verify_thread

Signed-off-by: Dave Joseph <d-joseph@ti.com>
Update secure proxy mailbox driver to support per-channel
interrupts instead of a single shared interrupt.
- Add per-channel interrupt array and ISR handlers
- Update ISR to handle specific channels directly
- Move device tree configuration to core-specific files
- Add interrupt-names requirement to device tree binding

Signed-off-by: Dave Joseph <d-joseph@ti.com>
Add function to flush/drain pending messages from RX thread when
enabling a mailbox channel to ensure clean state.
- Add secproxy_mailbox_flush_thread() to drain pending messages
- Call flush function when enabling channel in set_enabled()
- Read from last data register to consume messages until queue empty

Signed-off-by: Dave Joseph <d-joseph@ti.com>
Add SPDX-License-Identifier to comply with license requirements.

Signed-off-by: Dave Joseph <d-joseph@ti.com>
@natto1784 natto1784 force-pushed the tisci-clock-and-power branch from 69861b6 to 6b31ac0 Compare December 18, 2025 14:16
Allow only a single instance for the TISCI driver in the device tree.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
TISCI uses ti_secproxy as the mailbox for communicating with the DM for
things as power management, clock management and more. We currently use a
semaphore as a notification for the received reply/message from the DM
after we send a message. However, since kernel services are not initialized
during PRE_KERNEL stages, we cannot rely on this.

To overcome this, add a polling API that first sends a message on a
specified tx_channel and then poll for a reply on a specified rx_channel.
This is similar to how SCMI waits for replies during PRE_KERNEL and is also
similarly, a blocking call. This is a vendor-specific API and hence
requires its own public header.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
TISCI uses ti_secproxy as the mailbox for communicating with the DM for
things as power management, clock management and more. We currently use a
semaphore as a notification for the received reply/message from the DM
after we send a message. However, since kernel services are not initialized
during PRE_KERNEL stages, we cannot rely on this.

To solve this, use the new vendor-specific API that polls the specified RX
channel for a reply, but only if TISCI uses TI secure proxy as the mailbox.
Note that this blocks the thread.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
TISCI power domains are usually tied to one peripheral each, and hence we
maintain a massive list of power domains with status set as "okay" for all
of them. Although, this is not an issue PM_DEVICE_ACTION_TURN_ON is empty,
it still calls a ton of "empty" (in purpose) tisci_pd_init calls. Hence, go
over the entire devicetree and look for all nodes with status "okay" then only
set up PDs associated with these nodes.

While we are at it, also add following improvements:
- Remove the redundant check for DMSC during init and instead just let
  compilation fail if there is no DMSC node.
- Add TISCI as a Kconfig dependency for the driver.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
Use SYS_INIT hook to turn power domains for all nodes with status okay at
runtime, at the POST_KERNEL stage with the priority set to 0.

Additionally, also use a separate SYS_INIT hook for the chosen UART console
to initialize for prints during PRE_KERNEL. Make sure this is executed
before the UART is initialized.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
Use SYS_INIT hook to set clock frequencies for all nodes that use TISCI
clock controller and contan clock-frequency DT property. This happens at
runtime, at the POST_KERNEL stage with the priority set to 1 which ensures
this happens after power domain initialization.

Additionally, also use a separate SYS_INIT hook for the chosen UART console
to initialize for prints during PRE_KERNEL. Make sure this is executed
during the UART driver initialization so we can get console support as
early as possible.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
Add the clock controller node for TISCI and also add power-domains and
clocks properties for supported general peripherals in the files.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
Enable Kconfig options for TISCI, clock control, power domains and power
management for the R5FSS0_0 core.

While at it make the following changes:
- Remove redundant power-domains property in the board DT
- Remove status "okay" from peripherals to prevent their power
  domains from turning on at runtime. These can be set as "okay" in
  application overlays.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
@natto1784 natto1784 force-pushed the tisci-clock-and-power branch from 6b31ac0 to 58aeef5 Compare December 18, 2025 14:23
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions Bot added the Stale label Feb 17, 2026
@natto1784
Copy link
Copy Markdown
Contributor Author

not stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants