-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Implement device wipe using the hardware button on Green #3523
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sairon
changed the title
Green button wipe
Implement device wipe using the hardware button on Green
Aug 13, 2024
agners
reviewed
Aug 14, 2024
Port Stefan's patch from Linux patchset to U-Boot.
Unlike Yellow, Green doesn't have a way to easily wipe the device, e.g. if the user forgets the password - in that case the only option is to use a microSD card and reflash the system. Fortunately, Green has a hardware button wired to the PMIC chip which exposes the button state in one of the registers. Read this value in U-Boot and decide if cmdline flag for device wipe should be set - same as we do on Yellow. Also enable LED driver and command in U-Boot. In the current implementation, if the button is held for ~5 seconds when plugging in the device (this time includes DDR training, SPL, etc.), the yellow LED turns solid to indicate wipe is about the start. When the Linux kernel starts, the kernel LED driver takes over and starts blinking in heartbeat pattern. Because it takes a while to load the kernel, the LED stays solid for 2-3 seconds, which should be enough to recognize it was acknowledged.
sairon
force-pushed
the
green-button-wipe
branch
from
August 15, 2024 14:37
513808c
to
3fe2909
Compare
sairon
force-pushed
the
green-button-wipe
branch
from
August 15, 2024 14:38
3fe2909
to
4e8a1cd
Compare
agners
approved these changes
Aug 16, 2024
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.
Nice feature, thanks! 💪
sairon
added a commit
that referenced
this pull request
Aug 16, 2024
With #3523 as inspiration, it might be useful to wait for buttons to be released, e.g. in case when they become stuck. Also indicate the button operation (wipe, boot files removal, UMS) has been handled by turning on the yellow LED.
sairon
added a commit
that referenced
this pull request
Aug 16, 2024
With #3523 as inspiration, it might be useful to wait for buttons to be released, e.g. in case when they become stuck. Also indicate the button operation (wipe, boot files removal, UMS) has been handled by turning on the yellow LED.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unlike Yellow, Green doesn't have a way to easily wipe the device, e.g. if the user forgets the password - in that case the only option is to use a microSD card and reflash the system. Fortunately, Green has a hardware button wired to the PMIC chip which exposes the button state in one of the registers. Read this value in U-Boot and decide if cmdline flag for device wipe should be set - same as we do on Yellow.
Also enable LED driver and command in U-Boot. In the current implementation, if the button is held for ~5 seconds when plugging in the device (this time includes DDR training, SPL, etc.), the yellow LED turns solid to indicate wipe is about the start. When the Linux kernel starts, the kernel LED driver takes over and starts blinking in heartbeat pattern. Because it takes a while to load the kernel, the LED stays solid for 2-3 seconds, which should be enough to recognize it was acknowledged.