Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cpu/sam0_eth: disable PHY when MAC is sleeping #19689

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

benpicco
Copy link
Contributor

Contribution description

When we put the interface to sleep, also disable the PHY. This saves 75 µA of current on the same54-xpro (value will differ depending on the PHY used)

  • idle 13.88 mA
  • MAC off 11.48 mA
  • MAC+PHY off 10.73 mA

Testing procedure

 # put the interface to sleep
2023-05-31 14:06:56,000 - INFO # > ifconfig 5 set state sleep
2023-05-31 14:06:56,000 - INFO # 
2023-05-31 14:06:56,004 - INFO # success: set state of interface 5 to SLEEP

# wake up the interface again
2023-05-31 14:07:00,049 - INFO # > ifconfig 5 set state idle
2023-05-31 14:07:00,049 - INFO # 
2023-05-31 14:07:00,052 - INFO # success: set state of interface 5 to IDLE

2023-05-31 14:07:03,686 - INFO # > ping 2600::
2023-05-31 14:07:03,687 - INFO # 
2023-05-31 14:07:03,811 - INFO # 12 bytes from 2600::: icmp_seq=0 ttl=50 time=119.139 ms
2023-05-31 14:07:04,811 - INFO # 12 bytes from 2600::: icmp_seq=1 ttl=50 time=119.129 ms
2023-05-31 14:07:05,811 - INFO # 12 bytes from 2600::: icmp_seq=2 ttl=50 time=119.205 ms
2023-05-31 14:07:05,811 - INFO # 
2023-05-31 14:07:05,813 - INFO # --- 2600:: PING statistics ---
2023-05-31 14:07:05,818 - INFO # 3 packets transmitted, 3 packets received, 0% packet loss
2023-05-31 14:07:05,823 - INFO # round-trip min/avg/max = 119.129/119.157/119.205 ms

Issues/PRs references

 - idle         13.88 mA
 - MAC off      11.48 mA
 - MAC+PHY off  10.73 mA
@benpicco benpicco requested review from dylad and keestux as code owners May 31, 2023 12:11
@benpicco benpicco added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 31, 2023
@github-actions github-actions bot added Area: cpu Area: CPU/MCU ports Platform: ARM Platform: This PR/issue effects ARM-based platforms labels May 31, 2023
@benpicco benpicco added the Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer label May 31, 2023
Copy link
Member

@dylad dylad left a comment

Choose a reason for hiding this comment

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

ACK.

@aabadie
Copy link
Contributor

aabadie commented May 31, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented May 31, 2023

🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@riot-ci
Copy link

riot-ci commented May 31, 2023

Murdock results

✔️ PASSED

385d260 cpu/sam0_eth: disable PHY when MAC is sleeping

Success Failures Total Runtime
6933 0 6933 12m:22s

Artifacts

bors bot added a commit that referenced this pull request May 31, 2023
19689: cpu/sam0_eth: disable PHY when MAC is sleeping r=aabadie a=benpicco





19690: drivers/shtcx: fix assertion and shtcx_saul_info idx r=maribu a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
@bors
Copy link
Contributor

bors bot commented May 31, 2023

Build failed (retrying...):

bors bot added a commit that referenced this pull request May 31, 2023
19689: cpu/sam0_eth: disable PHY when MAC is sleeping r=aabadie a=benpicco





Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
@bors
Copy link
Contributor

bors bot commented May 31, 2023

Build failed:

@dylad
Copy link
Member

dylad commented Jun 1, 2023

bors merge

bors bot added a commit that referenced this pull request Jun 1, 2023
18156: pkg/opendsme: add initial support for IEEE 802.15.4 DSME time-slotted MAC r=miri64 a=jia200x



19689: cpu/sam0_eth: disable PHY when MAC is sleeping r=dylad a=benpicco





Co-authored-by: Jose Alamos <jose@alamos.cc>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
@bors
Copy link
Contributor

bors bot commented Jun 1, 2023

Build failed (retrying...):

bors bot added a commit that referenced this pull request Jun 1, 2023
19689: cpu/sam0_eth: disable PHY when MAC is sleeping r=dylad a=benpicco





Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
@bors
Copy link
Contributor

bors bot commented Jun 1, 2023

Build failed:

@maribu
Copy link
Member

maribu commented Jun 1, 2023

bors merge

bors bot added a commit that referenced this pull request Jun 1, 2023
19689: cpu/sam0_eth: disable PHY when MAC is sleeping r=maribu a=benpicco





Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
@bors
Copy link
Contributor

bors bot commented Jun 1, 2023

Build failed:

@maribu
Copy link
Member

maribu commented Jun 2, 2023

bors merge

bors bot added a commit that referenced this pull request Jun 2, 2023
19689: cpu/sam0_eth: disable PHY when MAC is sleeping r=maribu a=benpicco





Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
@bors
Copy link
Contributor

bors bot commented Jun 2, 2023

Build failed:

@maribu
Copy link
Member

maribu commented Jun 2, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented Jun 2, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 0dce63b into RIOT-OS:master Jun 2, 2023
@benpicco benpicco deleted the cpu/sam0_eth-phy_sleep branch June 2, 2023 15:48
@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants