-
Notifications
You must be signed in to change notification settings - Fork 27
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
Introduce USB burning tool #20
base: master
Are you sure you want to change the base?
Conversation
list.append(x) returns None Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
Unpack for int requires a buffer of 4 bytes Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
The function tplStat() is used to obtain the status of the completion of the last TPL command (tplCommand()). Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
Support for the byte type for the password, and the password length check has been removed as the length of the password depends on the SoC. Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
Save legacy format. Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
The functions readMedia() and writeMedia() are used for reading/writing data from/to the disk. Before calling these functions, you need to send a Bulk upload/download command. Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
This parameter is needed for the user to be able to define their own functions for communication over the USB protocol. Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
@m-kurbanov Hi sorry for the delay, the code looks real good and I don't have any comments so far, except about Documentation. |
if enc_chip1 == chipid: | ||
encrypt_reg = self._platform.enc_reg1 | ||
elif enc_chip2 == chipid: | ||
encrypt_reg = self._platform.enc_reg2 |
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 could be a match-case
setup instead, would look cleaner
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.
A match-case
is supported starting from version 3.10. We would prefer not to increase the minimum supported version of Python.
optimus.py
Outdated
STAGE_MINOR_SPL = 8 # Secondary Program Loader | ||
STAGE_MINOR_TPL = 16 # Tertiary Program Loader | ||
|
||
def __init__(self, socid): |
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.
To avoid confusion I'd probably rename the socid
parameter to rawData
or data
or something similar, just like the local field _raw
.
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.
Thanks @fonix232. Done
optimus.py
Outdated
self.major = ord(socid[0]) | ||
self.minor = ord(socid[1]) | ||
self.stage_major = ord(socid[2]) | ||
self.stage_minor = ord(socid[3]) | ||
if len(socid) > 4: | ||
self.need_password = bool(ord(socid[4])) | ||
self.password_ok = bool(ord(socid[5])) |
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.
Instead of directly assigning on creation, why not create getter properties for these values?
Something like this:
class SocId:
@property
def major(self):
return ord(self._raw[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.
Thank you @fonix232. Done
This patch support for parsing the Amlogic image format (aml_upgrade_package.img). Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
This module helps to flash a device using the Optimus protocol. Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
This module helps to flash a device using the ADNL protocol. Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
This tool supports burning devices using the ADNL and Optimus protocols. To use ADNL protocol no specific argument is required: if firmware image contains item 'usb_flow', then ADNL protocol will be used. Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
83be9bc
to
261fe1d
Compare
Done |
This tool supports burning devices using the ADNL and Optimus protocols.