-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
drivers: power: sam: Introduce Atmel SAM SUPC, wakeup sources and poweroff implementation #63961
drivers: power: sam: Introduce Atmel SAM SUPC, wakeup sources and poweroff implementation #63961
Conversation
1c65aca
to
2ea4b77
Compare
2ea4b77
to
8b6af25
Compare
8b6af25
to
0a46e98
Compare
0a46e98
to
b15d771
Compare
b15d771
to
43dea8b
Compare
3f1b294
to
5944121
Compare
Hi @bjarki-trackunit ,
Let's use
The below seems to be the correct way to enable the wake-up source.
|
I might be misunderstanding something. This is a concrete example of using the wakeup-souce-id cell: .dtsi
.dts
I don't understand why we would call the |
5944121
to
d10fce2
Compare
18231b6
to
228cfe8
Compare
Hi @bjarki-trackunit , You are right in your approach defining the #wakeup-source-id-cells at supc. Let's use it. |
|
||
zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_SAM4L soc_sam4l_pm.c) | ||
zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_SAM4L soc_sam4l_gpio.c) | ||
zephyr_library_sources_ifndef(CONFIG_SOC_SERIES_SAM4L soc_poweroff.c) |
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.
you mean
-zephyr_library_sources_ifndef(CONFIG_SOC_SERIES_SAM4L soc_poweroff.c)
+zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_SAM4L soc_sam4l_poweroff.c)
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.
fixed
soc/arm/atmel_sam/common/soc_supc.h
Outdated
#define _ATMEL_SAM_SOC_SUPC_H_ | ||
|
||
#include <zephyr/types.h> | ||
#include <soc.h> |
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.
This include is not necessary.
-#include <soc.h>
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.
removed
228cfe8
to
848b549
Compare
The failing test will succeed once the hal is updated :) |
The supply controller manages wakeup sources and core voltages and | ||
regulators. |
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.
The supply controller manages the voltage reference, power supply and supply
monitoring of the device. It have a special feature that it can wake-up the
device from a low-power state using special peripherals as wake-up sources.
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.
Replaced with your suggestion
To specify the wakeup source channel used by a peripheral, the custom | ||
property wakeup-source-channel needs to be used, e.g. for the RTC | ||
device: |
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.
The dedicated peripherals that can wake-up the core supply domain are: RTC,
RTT, Supply Monitor and GPIOs. In the first three peripherals it is necessary
inform the wakeup-source-id
property on their respective nodes.
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.
Replaced with your suggestion
The device drivers will then use the provided channel to enable its wakeup | ||
if they have been designated as wakeup sources using the standard | ||
wakeup-source property, e.g. |
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.
The special peripheral will wake-up the device only when the standard property
wakeup-source
is defined, e.g.:
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.
Replaced with your suggestion
|
||
rtc: rtc@xxx { | ||
... | ||
wakeup-source-id = <&supc SUPC_WAKEUP_SOURCE_RTT>; |
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.
- wakeup-source-id = <&supc SUPC_WAKEUP_SOURCE_RTT>;
+ wakeup-source-id = <&supc SUPC_WAKEUP_SOURCE_RTC>;
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.
Replaced with your suggestion
Hi @bjarki-trackunit , I was wondering if you can update this PR to us check if is already passing CI. |
This commit adds a driver and dts model for the ATMEL SAM SUPC component. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
This commit adds the new SUPC devicetree instance to the soc dtsi files. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
This commit adds an implementation of poweroff, which first uses SUPC to enable all defined wakeup sources (except for sam4l), followed by entering backup mode. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
848b549
to
d83f367
Compare
@nandojve In progress :) |
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.
LGTM!
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.
ok to poweroff changes
This PR adds two features required for power off of the atmel sam series chips