Skip to content
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

fel: sid: add sid-writel command #206

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gamelaster
Copy link

This pull request introduces the capability to write into SID eFuses. However, it is worth noting that this is a risky operation that could potentially brick the SoC. As a precaution, this code will be disabled by default, and packagers should not ship binaries with this functionality enabled.

Before merging, those stuff needs to be solved:

  • What will be the best way of enabling this feature? Makefile argument? Or uncommenting some define?
  • Currently, only a 32-bit value write command is implemented. Although, for purposes such as writing root private key, writing a file command would be handy, although, this also can easily lead to bricked SoC in case the user uses it wrongly. The idea I had on sunxi-linux IRC was, that every write of file into SID, will print where and how many bytes will be written to SID, and the user will need to confirm to proceed.
    Example: 14 bytes will be written to SID, offset 0x18, thus this range of SID will be burned <0x18, 0x26>. Do you want to continue?

Looking forward for suggestions!

@gamelaster gamelaster marked this pull request as ready for review January 28, 2024 10:18
@gamelaster gamelaster marked this pull request as draft January 28, 2024 10:18
@qianfan-Zhao
Copy link
Contributor

Hi:

I had a idea about this but have not complete it.
We had introduced a subcommand in #189, which can print the sid registers for better human reading. Next is the example:

$ ./sunxi-fel sid-dump
chipid          1300000c 02404700 79350400 5c761e0c
in              00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ssk             00000000 00000000 00000000 00000000
thermal         08320834
ft_zone         00000000 00000000
tvout           010002b0 00f7029b 00f9029f 00fb02a5
rssk            00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
hdcp_hash       00000000 00000000 00000000 00000000
reserved        00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
                00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
                00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
                00000000 00000000 00000000 00000000

We defined the sid maps layout in the code: https://github.com/linux-sunxi/sunxi-tools/blob/master/soc_info.c#L221, we known the section's size and also can define writeable properity in the this section.

So it's better for this command line:

$ sunxi-fel sid-write section-name 'aabbcc'

What's yours idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants