Skip to content

drivers: firmware: TISCI driver support#90053

Merged
fabiobaltieri merged 4 commits into
zephyrproject-rtos:mainfrom
Kronosblaster:tisciLayer
Jun 23, 2025
Merged

drivers: firmware: TISCI driver support#90053
fabiobaltieri merged 4 commits into
zephyrproject-rtos:mainfrom
Kronosblaster:tisciLayer

Conversation

@Kronosblaster
Copy link
Copy Markdown
Contributor

@Kronosblaster Kronosblaster commented May 16, 2025

Fixed bugs in secureproxy mailbox driver
Added TISCI driver for supported devices using the binding ti,k2g-sci.
Added TISCI AM2434 EVM
Added TISCI test sample

API test:
The test sample is present at /tests/drivers/tisci

Test Sequence

  1. Version Information

    • Retrieves TISCI firmware version and ABI compatibility info
    • Validates protocol communication basics
    • Reports ABI versions and firmware description
  2. Clock Management

    • Tests clock ID 152 (main UART 1 clock)
    • Sequence:
      1. Reads initial frequency
      2. Sets frequency to 96MHz (min/target/max all set to 96MHz)
      3. Verifies frequency change by reading back
  3. Power Domain Control

    • Tests device ID 0 (ADC)
    • Operations:
      1. Power-on sequence using tisci_cmd_get_device
      2. Reads device state (clock count, resets, power/clock states)
      3. Power-off sequence using tisci_cmd_put_device
      4. Verifies state transition

TISCI documentation of messages is given here

@Kronosblaster Kronosblaster force-pushed the tisciLayer branch 11 times, most recently from 57339a6 to cf7f4fb Compare May 19, 2025 08:07
@Kronosblaster Kronosblaster marked this pull request as ready for review May 19, 2025 08:08
@vaishnavachath
Copy link
Copy Markdown
Member

@Kronosblaster Please provide proper commit message/details to help a reviewer to understand what this is.

@vaishnavachath vaishnavachath added the DNM This PR should not be merged (Do Not Merge) label May 19, 2025
Comment thread drivers/firmware/ti_sci/Kconfig Outdated
Comment thread drivers/firmware/Kconfig Outdated
Comment thread drivers/firmware/ti_sci/Kconfig Outdated
@Kronosblaster Kronosblaster force-pushed the tisciLayer branch 2 times, most recently from 11a1071 to 8202cff Compare May 19, 2025 09:32
Comment thread drivers/firmware/ti_sci/ti_sci.h Outdated
@Kronosblaster Kronosblaster force-pushed the tisciLayer branch 2 times, most recently from 2b4ddf5 to 176711d Compare May 20, 2025 06:14
Comment thread drivers/firmware/ti_sci/ti_sci.h
Comment thread drivers/firmware/ti_sci/ti_sci.c Outdated
Comment thread drivers/firmware/ti_sci/ti_sci.c Outdated
Comment thread drivers/firmware/ti_sci/ti_sci.c Outdated
Comment thread drivers/firmware/ti_sci/ti_sci.c Outdated
Comment thread drivers/firmware/ti_sci/ti_sci.c Outdated
Comment thread drivers/firmware/ti_sci/ti_sci.c Outdated
Comment thread drivers/firmware/ti_sci/ti_sci.c Outdated
Comment thread drivers/firmware/ti_sci/ti_sci.c Outdated
@github-actions github-actions Bot added the platform: TI SimpleLink Texas Instruments SimpleLink MCU label May 20, 2025
@github-actions github-actions Bot requested a review from vanti May 20, 2025 09:43
Comment thread drivers/firmware/tisci/tisci.c
Comment thread drivers/firmware/tisci/tisci.c
Comment thread include/zephyr/drivers/firmware/tisci/tisci_protocol.h Outdated
Comment thread include/zephyr/drivers/firmware/tisci/tisci_protocol.h Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
Comment thread include/zephyr/drivers/firmware/tisci/tisci.h Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
Comment thread drivers/firmware/tisci/tisci.h Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
Comment thread drivers/firmware/tisci/tisci.c Outdated
@vaishnavachath
Copy link
Copy Markdown
Member

@Kronosblaster can we have a test added for different TISCI APIs? so that the client can be verified/tested before integrating to higher level frameworks (power,clock_control .etc)?

@vaishnavachath Since there is no upstream support for platforms supporting the TISCI driver a test cannot be made as of now for this purpose. A sample application and its output are added to the PR.

Now that the platform support is upstream, can a proper test and the DT changes for tisci node be made part of this PR?

Comment thread dts/arm/ti/am64x_main.dtsi Outdated
Comment thread dts/arm/ti/am64x_main.dtsi
Copy link
Copy Markdown
Contributor

@glneo glneo left a comment

Choose a reason for hiding this comment

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

There are some minor things I'd still like to cleanup here, but they can be handled in later PRs, this one has had enough nitpicking from me :).

For now this all looks good enough to start.

Comment thread drivers/firmware/tisci/tisci.c
Comment thread boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0.dts Outdated

dmsc: system-controller@44043000 {
compatible = "ti,k2g-sci";
ti,host-id = <36>;
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.

Linux says 12 for in k3-am64x-main.dtsi

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 host IDs
Linux runs on A53 cores. This is for the R5 core 0 context 1.

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 this changes for each core, then why is this in the common DTSI file? This number should go in the R5 core 0 specific files. Same for secure_proxy_main mboxes and IRQs.

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 @glneo - this value should not be in this file as it can be used by the A53 and R5. Totally fine to change that later.

Comment thread dts/arm/ti/am64x_main.dtsi
This change modifies the secure proxy mailbox driver to pass user data
to the interrupt service routine (ISR) callback. This allows the ISR
to access the specific context or data associated with the mailbox
message being processed.

Signed-off-by: Dave Joseph <d-joseph@ti.com>
Added TISCI driver for supported devices using the binding ti,k2g-sci.
This is used to communicate via the secury proxy channel for clock,
resource and power domain management.
Refer: https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/general/TISCI_header.html

Signed-off-by: Dave Joseph <d-joseph@ti.com>
Device tree edits to add DMSC system controller support for
AM2434 EVM. This includes the addition system-controller and
secure-proxy mailbox nodes in arm46x_main.dtsi.

Signed-off-by: Dave Joseph <d-joseph@ti.com>
TISCI driver test added to validate the TISCI API
functionality in Zephyr. This test is for the target
am243x_evm/am2434/r5f0_0.

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

Copy link
Copy Markdown
Contributor

@dnltz dnltz left a comment

Choose a reason for hiding this comment

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

Please move R5 specific information from am64_main to am64_r5 device-trees, after this PR got merged.

{
struct tisci_data *data = dev->data;

k_sem_take(&data->data_sem, K_FOREVER);
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 there is no response requested or an error occurs then this semaphore needs to be released

It might be a good idea to reset the response sem here too (k_sem_reset()). It could help recover if a previous request fails or times out

Comment thread drivers/firmware/tisci/tisci.c
Comment thread drivers/firmware/tisci/tisci.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mbox platform: TI K3 Texas Instruments Keystone 3 Processors platform: TI SimpleLink Texas Instruments SimpleLink MCU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants