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

Add USB loaders for sunxi, tegra, samsung #1482

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sjg20
Copy link
Contributor

@sjg20 sjg20 commented Aug 22, 2024

This adds USB loaders for three different SoCs. The Tegra loader is fairly straightfoward and similar to iMX, so it can use the same protocol.

For Allwinner (sunxi) and Samsung, the loading happens in 2-3 phases, so a new 'phase' parameter is added to the protocol. This allows USB loading to work correctly on these boards, sending an initial BL1 image (in the case of Samsung), then U-Boot SPL and U-Boot proper.

This has been tested on:

  • snow (exynos5250)

  • Linksprite_pcDuino3 (sunxi)

  • nyan-big (Tegra124-based Chromebook)

  • Documentation for the feature

  • Tests for the feature

  • The arguments and description in doc/configuration.rst have been updated

  • PR has been tested

Some SoCs need multiple USB-loading steps to function. For example,
Samsung devices require BL1, then SPL then U-Boot.

Add a new parameter to the protocol to support this.

Signed-off-by: Simon Glass <[email protected]>
doc/configuration.rst Outdated Show resolved Hide resolved
doc/configuration.rst Show resolved Hide resolved
- loadaddr (int): address to use when loading U-Boot. This depends on the
SoC being used. The easiest way to find this value is to check the
*CONFIG_TEXT_BASE* value in U-Boot
- bct (str): path to the BCT (configuration file)
Copy link
Member

Choose a reason for hiding this comment

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

Similar to the image argument, this should refer to a key in the images: part of the target config in the environment. See IMXUSBDriver, RKUSBDriver or UUUDriver.

This also applies to the actual image key here (where it's actually supported in the code).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually different for each board, so we cannot have a single bct file.

labgrid/driver/usbloader.py Outdated Show resolved Hide resolved
labgrid/resource/udev.py Outdated Show resolved Hide resolved
labgrid/driver/usbloader.py Outdated Show resolved Hide resolved
labgrid/driver/usbloader.py Outdated Show resolved Hide resolved
doc/configuration.rst Outdated Show resolved Hide resolved
Comment on lines +372 to +378
if filename is None and phase == 'bl1':
filename = self.bl1
if filename is None and self.image is not None:
filename = self.target.env.config.get_image_path(self.image)
mf = ManagedFile(filename, self.loader)
mf.sync_to_resource()
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't bl1, spl and the main image be handle consistently, so with get_image_path() for defaults and a way to select the image key name in the driver arguments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This information is provided by the caller, since it differs depending on the board being used

labgrid/driver/usbloader.py Outdated Show resolved Hide resolved
Add a USB loader for sunxi, supporting SPL and U-Boot.

Signed-off-by: Simon Glass <[email protected]>
Add a USB loader for tegra, supporting BCT and U-Boot.

Signed-off-by: Simon Glass <[email protected]>
Add a USB loader for samsung, supporting BL1, SPL and U-Boot.

Signed-off-by: Simon Glass <[email protected]>
Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 50.31447% with 79 lines in your changes missing coverage. Please review.

Project coverage is 56.6%. Comparing base (5e4ab58) to head (17e6ed5).
Report is 41 commits behind head on master.

Files with missing lines Patch % Lines
labgrid/driver/usbloader.py 48.1% 55 Missing ⚠️
labgrid/resource/udev.py 50.0% 12 Missing ⚠️
labgrid/resource/remote.py 66.6% 6 Missing ⚠️
labgrid/remote/client.py 0.0% 3 Missing ⚠️
labgrid/resource/suggest.py 0.0% 3 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (5e4ab58) and HEAD (17e6ed5). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (5e4ab58) HEAD (17e6ed5)
5 1
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1482     +/-   ##
========================================
- Coverage    61.8%   56.6%   -5.2%     
========================================
  Files         166     168      +2     
  Lines       12305   13129    +824     
========================================
- Hits         7605    7440    -165     
- Misses       4700    5689    +989     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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