-
Notifications
You must be signed in to change notification settings - Fork 8k
dts: pm: Add wakeup-signal property #96996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
dts: pm: Add wakeup-signal property #96996
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would be the actual usage paradigm of this value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the same question as @decsny . It feels like this is something that probably belongs in interrupts
. The commit message doesn't make the example clear, but if the issue is that the "handler" for the wakeup signal is different than the interrupt controller for the "normal" interrupt in the IP blocks you're looking at, then I think this is probably a use case for interrupts-extended
-- see the DT spec.
This is a new property to specify the wakeup signal number. There are some SoC's where the wakeup signal can be a different signal and not necessarily the interrupt number. This property goes together with wakeup-source. Signed-off-by: Mahesh Mahadevan <[email protected]>
The NXP LPTMR uses the interrupt number or a dedicated wakeup signal to wakeup the platform from low power modes. Signed-off-by: Mahesh Mahadevan <[email protected]>
a1649b6
to
0cdea63
Compare
@mmahadevan108 what hardware is responsible for handling the wakeup event? Is this a cortex M where it eventually has to go through the NVIC? |
|
Hi @mbolivar , But the WUU does support other use-cases that do not involve interrupts. The MCXW71 and other NXP SOC support partial wake-up, where the CPU remains clock gated and an interrupt is not triggered during the wake-up. An example is a UART could receive a byte, trigger a partial wake-up, and activate the DMA. The DMA copies the byte to a buffer and then the SOC returns to the previous low-power mode without interrupting the CPU. After enough iterations, the DMA will trigger an interrupt and wake the CPU. But then the interrupt handler is for the DMA, and unrelated to the WUU wake-up signal or the UART. I'm not sure if this explanation helps with this property discussion. Is there more I can help with? Thanks |
|
||
#if (DT_INST_PROP(0, wakeup_source)) | ||
/* Use wakeup-signal property if specified, else use the irq number */ | ||
NXP_ENABLE_WAKEUP_SIGNAL(DT_INST_PROP_OR(0, wakeup_signal, DT_INST_IRQN(0))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is not enough value proposition being shown here to justify to be adding this property IMO. You are providing this value to a vendor specific macro. If we add this property it will become sticky and if people start using it and it turns out not to be very useful and becomes a technical debt when we decide some other way to do something, I don't want to add it. It's not thought through and seems rushed, and for what goal exactly I don't quite understand, I'm not seeing what it buys us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I can see it being fulfilled more generically and doing away with this vendor macro by my #93838 if you think of it as a one bit multiplexor
@DerekSnell I appreciate the explanation, thanks. From what you have said, my instincts would be to model the WUU as a devicetree interrupt controller, and treat peripherals that are capable of asynchronously signaling the WUU on an event as interrupt-generating devices whose interrupts are handled by the WUU node. If they can also generate interrupts that go to the NVIC, that is a use case for Please see section 2.4 in the devicetree specification if you are unfamiliar with the details on how interrupts work in DT. Of course, see https://docs.zephyrproject.org/latest/kernel/services/interrupts.html for details on the interrupt controller hierarchy in zephyr. See https://github.com/zephyrproject-rtos/zephyr/tree/main/dts/riscv/openisa for some in-tree examples of SoCs that stitch all this together in DT, and you can grep around in the sources to see example drivers that use these multi level IRQ controller nodes in practice. If there is really something missing here in the existing interrupt handling infrastructure that you can articulate after familiarizing yourself with the DT and Zephyr standard way of doing this, please let me know and we can continue discussion. Absent something convincing, though, this PR feels like it's reinventing the wheel. |
I did not know the WUU actually has an interrupt to the NVIC of it's own, so I can see how that leads down the thought path of model it as a multi level interrupt control. But as far as I can tell there is no standardized interrupt interface of zephyr, all the interrupt controller drivers are vendor specific interfaces... But I guess what this would end up being is that instead of us having this |
This is a new property to specify the wakeup signal number. There are some SoC's where the wakeup signal can be a different signal and not necessarily the interrupt number.
This property goes together with wakeup-source.