Skip to content

Conversation

smalae
Copy link
Contributor

@smalae smalae commented Aug 22, 2025

  1. Added power domain node in siwg917.dtsi.
  2. Updated UART device nodes to reference the newly added power domain.
  3. Implemented the pm_action function to manage power domain transitions for the SoC.
  4. Enable the pm device runtime driver support for the uart_ns16550 driver (only for devices that have an associated power domain enabled).

Copy link

github-actions bot commented Aug 22, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_silabs zephyrproject-rtos/hal_silabs@5bbf64e zephyrproject-rtos/hal_silabs@edbd418 (main) zephyrproject-rtos/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-hal_silabs DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Aug 22, 2025
@smalae smalae force-pushed the device-runtime-support-for-uart_ns16550-and-power-domain-support-for-siwx91x-soc branch 4 times, most recently from 2163c44 to 9f199b7 Compare August 25, 2025 06:04
@smalae smalae marked this pull request as ready for review August 25, 2025 06:18
@zephyrbot zephyrbot added platform: Silabs Silicon Labs area: UART Universal Asynchronous Receiver-Transmitter labels Aug 25, 2025
@smalae
Copy link
Contributor Author

smalae commented Aug 25, 2025

@bjarki-andreasen @fabiobaltieri, this PR addresses key challenges identified in the #94375 PR by introducing a power domain for the siwx91x SoC. It implements both turn_on and turn_off scenarios, ensuring that only devices associated with a power domain reconfigure their drivers upon wakeup. This aligns with the intended use case. Please provide your feedback.

@smalae smalae force-pushed the device-runtime-support-for-uart_ns16550-and-power-domain-support-for-siwx91x-soc branch from 9f199b7 to 9614fbf Compare August 25, 2025 07:04
Copy link
Contributor

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

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

Nice progress!

};

siwx91x_soc_pd: siwx91x_soc_pd {
compatible = "power-domain";
Copy link
Contributor

Choose a reason for hiding this comment

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

PM DEVICE RUNTIME is required for power domain power management, so the zephyr,pm-device-runtime-auto should be added to the the uart and power domain :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"I'm encountering unexpected behavior after enabling CONFIG_PM_DEVICE_RUNTIME and adding zephyr,pm-device-runtime-auto to the UART node. The device isn't transitioning into low power mode as expected, and it appears to be stuck at the k_msleep() call. I'm currently investigating the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This issue is resolved now.

case PM_DEVICE_ACTION_TURN_OFF:
break;
default:
ret = -ENOTSUP;
Copy link
Member

Choose a reason for hiding this comment

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

return -ENOTSUP; here, return 0; at the end and drop ret

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

@rettichschnidi rettichschnidi removed their request for review September 10, 2025 07:06
@smalae smalae force-pushed the device-runtime-support-for-uart_ns16550-and-power-domain-support-for-siwx91x-soc branch 2 times, most recently from 24a91cf to a160b0c Compare September 16, 2025 15:33
@smalae
Copy link
Contributor Author

smalae commented Sep 18, 2025

Hey, this needs a rebase.

Done

@smalae smalae added DNM (manifest) This PR should not be merged (controlled by action-manifest) Binary Blobs Added and removed DNM (manifest) This PR should not be merged (controlled by action-manifest) Binary Blobs Added labels Sep 18, 2025
case PM_DEVICE_ACTION_TURN_ON:
return uart_ns16550_configure(dev, uart_cfg);
case PM_DEVICE_ACTION_TURN_OFF:
ret = clock_control_off(dev_cfg->clock_dev, dev_cfg->clock_subsys);
Copy link
Contributor

@jerome-pouiller jerome-pouiller Sep 18, 2025

Choose a reason for hiding this comment

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

I assume we have to consider the case where clock_dev == NULL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that case, we should not perform any operations in 'PM_DEVICE_ACTION_TURN_OFF'. I've already handled that in my latest changes. But let me know if that can be handled differently.

@jhedberg
Copy link
Member

jhedberg commented Sep 18, 2025

@smalae rebase needed again (due to west.yml conflict). Could you also put some more content to the third commit message? It would be useful for it to contain an explanation for "why?" rather than just enumerating the answer to "what?" (which is less useful, since that can also be determined by looking at the diff).

@smalae smalae force-pushed the device-runtime-support-for-uart_ns16550-and-power-domain-support-for-siwx91x-soc branch from 6ebd6e2 to 2cb5f60 Compare September 19, 2025 06:15
@github-actions github-actions bot removed DNM (manifest) This PR should not be merged (controlled by action-manifest) Binary Blobs Added labels Sep 19, 2025
@jhedberg
Copy link
Member

@bjarki-andreasen @dcpleung could you have another look? Thanks.

1. Added siwx91x power domain node in siwg917.dtsi
2. Updated UART device nodes to reference the newly added power domain.
3. Implemented power domain driver to manage power domain transitions
   for the SoC.

Signed-off-by: Sai Santhosh Malae <[email protected]>
This commit enables the pm device runtime driver support
for the uart_ns16550 driver (only for devices that have an
associated power domain enabled).

Signed-off-by: Sai Santhosh Malae <[email protected]>
Removed CMSIS references from wiseconnect CMakeLists
as they are no longer required with UART device runtime
PM. Keeping them adds unnecessary compilation overhead.

Signed-off-by: Sai Santhosh Malae <[email protected]>
Update hal_silabs version to latest commit:
edbd418670ad8c7cad629a09df2ceee0bc23cf6d

Signed-off-by: Sai Santhosh Malae <[email protected]>
@smalae smalae force-pushed the device-runtime-support-for-uart_ns16550-and-power-domain-support-for-siwx91x-soc branch from 2cb5f60 to a490bcb Compare September 19, 2025 10:46
Copy link

@smalae smalae requested a review from asmellby September 19, 2025 10:51
Copy link
Member

@fabiobaltieri fabiobaltieri left a comment

Choose a reason for hiding this comment

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

Cool, tested in in a couple platforms using this driver (it82002aw and rts5912) and they still work. Thanks.

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.

8 participants