Add USB loaders for sunxi, tegra, samsung - #1482
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1482 +/- ##
========================================
+ Coverage 61.0% 61.2% +0.2%
========================================
Files 182 182
Lines 14898 15053 +155
========================================
+ Hits 9096 9224 +128
- Misses 5802 5829 +27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
3ad4762 to
c4d4266
Compare
09a2981 to
aa8991b
Compare
Add driver and strategy to flash sunxi SoCs using FEL code implemented by their BROM code. For now the following has been implemented/tested: - Allwinner D1 SoC (MangoPi MQPro board) - xfel tool at https://github.com/xboot/xfel SunxiFELDriver and SunxiFELStrategy configuration example: : SunxiFELDriver: : flasher: 'xfel' : dram_type: 'd1' : dram_prompt: 'DRAM simple test OK.' : exec: '0x20000' : images: { : 'jumper' : '0x20000', : 'opensbi': '0x40000000', : 'dtb' : '0x44200000', : 'kernel' : '0x40200000', : } : : SunxiFELStrategy: {} Suggested implementation deliberatly avoids to modify Labgrid itself. Better approach (though not covring full FEL use-case) is still on review in Labrid project, see - labgrid-project/labgrid#1482 Another good option supporting FEL is sunxi-tool: - https://github.com/linux-sunxi/sunxi-tools However: - sunxi-tools does not yet support D1 - xfel does not allow to select from multiple connected FEL devices Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
Cover the drivers, scripts, pytest and the Gitlab information. Note: This PR exists just so others can replicate my lab. I have created separate PRs for features and will dribble those in as they get reviewed: labgrid-project#1482 labgrid-project#1483 labgrid-project#1484 labgrid-project#1571 Cover-letter: U-Boot integration END Changes in v9: - Rebase on upstream - Add ~/.lgrc support for site-wide labgrid defaults - Add automatic file logging via LG_LOG_DIR for both client and pytest - Add timestamps and CI_JOB_ID to auto-log filenames - Make log directories world-writable for multi-user sharing - Enable automatic labgrid-client logging in lg-env - Wait for USB resources instead of using a fixed sleep - Extract _prepare_for_send() from _reset_for_send() - Add get_send_driver_name() for USB resource discovery - Reopen console when power-cycling for send - Increase USB resource timeout and add power_off_delay - Add support for the Badgerd SDWire mux - Add QEMU disk-image and writer-arguments support for EFI - Use snapshot mode for the QEMU EFI root disk - Add check_lab.py for board reliability checking Changes in v8: - Fairly minor expansions to deal with new use cases Changes in v6: - Fix reference to crossbar in _ub-bisect-try and ub-smoke - Add -x option to specify the extra board directory - Add comments to the example lg-env - Define USE_LABGRID to tell u-boot-hooks to use labgrid hooks - Add a few more comments to ub-pyt - Show the build path with ub-pyt -v - Add --allow-unmatched to ub-smoke to avoid QEMU error - Add a new section on compatibility - Add a new section on script usage Changes in v5: - Rebase on latest grpc branch - Fix pylint errors and warnings Changes in v4: - Support for Beagleplay, which needs files from two separate U-Boot builds - Support for a 'recovery' button needed to boot the image - Tidy up the internal-console support - Fix pytest behaviour with an unpatched U-Boot (that doesn't have lab mode) Changes in v3: - Rebase on top of grpc branch - Don't mess with terminal setting unless stdin is a terminal - Don't show an error if there are no resources when auto-acquiring - Support QEMU in UBootWriter Some changes in v2: - Rationalise the flags for the U-Boot scripts - Support tracing with em100 - Support an internal terminal instead of microcom - Add a -D flag for debugging - Support send-only boards - Add a way to build the U-Boot config - Add a control for buildman's process-limit - allow the build-dir to be specified in a variable - add documentation about U-Boot-pytest integration - add source_dir and config_file to UBootProviderDriver - add an internal terminal - expand the U-Boot scripts - significantly improve the U-Boot-pytest integration The approximate diffstat is: contrib/sync-places.py | 23 +- contrib/u-boot/.gitignore | 1 + contrib/u-boot/_ub-bisect-try | 47 ++ contrib/u-boot/conftest.py | 21 + contrib/u-boot/get_args.sh | 128 +++++ contrib/u-boot/index.rst | 232 +++++++++ contrib/u-boot/lg-client | 11 + contrib/u-boot/lg-env | 10 + contrib/u-boot/test_smoke.py | 3 + contrib/u-boot/ub-bisect | 44 ++ contrib/u-boot/ub-cli | 39 ++ contrib/u-boot/ub-int | 41 ++ contrib/u-boot/ub-pyt | 69 +++ contrib/u-boot/ub-smoke | 48 ++ doc/configuration.rst | 611 ++++++++++++++++++++++- doc/usage.rst | 288 +++++++++++ labgrid/driver/__init__.py | 10 +- labgrid/driver/common.py | 11 + labgrid/driver/consoleexpectmixin.py | 7 + labgrid/driver/powerdriver.py | 29 ++ labgrid/driver/qemudriver.py | 84 ++-- labgrid/driver/recoverydriver.py | 25 + labgrid/driver/resetdriver.py | 7 + labgrid/driver/servodriver.py | 157 ++++++ labgrid/driver/sfemulatordriver.py | 102 ++++ labgrid/driver/ubootdriver.py | 27 +- labgrid/driver/ubootproviderdriver.py | 323 ++++++++++++ labgrid/driver/ubootwriterdriver.py | 160 ++++++ labgrid/driver/usbhidrelay.py | 7 +- labgrid/driver/usbloader.py | 170 ++++++- labgrid/driver/usbstoragedriver.py | 18 +- labgrid/factory.py | 4 +- labgrid/protocol/__init__.py | 1 + labgrid/protocol/bootstrapprotocol.py | 8 +- labgrid/protocol/recoveryprotocol.py | 14 + labgrid/protocol/resetprotocol.py | 12 + labgrid/pytestplugin/fixtures.py | 21 +- labgrid/pytestplugin/hooks.py | 8 + labgrid/remote/client.py | 351 ++++++++----- labgrid/remote/config.py | 7 +- labgrid/remote/exporter.py | 122 ++++- labgrid/resource/__init__.py | 6 + labgrid/resource/remote.py | 24 + labgrid/resource/servo.py | 485 ++++++++++++++++++ labgrid/resource/sfemulator.py | 33 ++ labgrid/resource/suggest.py | 6 + labgrid/resource/udev.py | 33 ++ labgrid/strategy/ubootstrategy.py | 151 +++++- labgrid/target.py | 120 ++++- labgrid/util/helper.py | 220 ++++---- labgrid/util/ssh.py | 3 +- labgrid/util/term.py | 184 +++++++ labgrid/var_dict.py | 8 + man/labgrid-client.1 | 6 + man/labgrid-client.rst | 4 + man/labgrid-device-config.5 | 4 + 56 files changed, 4267 insertions(+), 321 deletions(-) [1] https://github.com/labgrid-project/labgrid/issues/created_by/sjg20 Signed-off-by: Simon Glass <sjg@chromium.org>
Cover the drivers, scripts, pytest and the Gitlab information. Note: This PR exists just so others can replicate my lab. I have created separate PRs for features and will dribble those in as they get reviewed: labgrid-project#1482 labgrid-project#1483 labgrid-project#1484 labgrid-project#1571 Cover-letter: U-Boot integration END Changes in v9: - Rebase on upstream - Add ~/.lgrc support for site-wide labgrid defaults - Add automatic file logging via LG_LOG_DIR for both client and pytest - Add timestamps and CI_JOB_ID to auto-log filenames - Make log directories world-writable for multi-user sharing - Enable automatic labgrid-client logging in lg-env - Wait for USB resources instead of using a fixed sleep - Extract _prepare_for_send() from _reset_for_send() - Add get_send_driver_name() for USB resource discovery - Reopen console when power-cycling for send - Increase USB resource timeout and add power_off_delay - Add support for the Badgerd SDWire mux - Add QEMU disk-image and writer-arguments support for EFI - Use snapshot mode for the QEMU EFI root disk - Add check_lab.py for board reliability checking Changes in v8: - Fairly minor expansions to deal with new use cases Changes in v6: - Fix reference to crossbar in _ub-bisect-try and ub-smoke - Add -x option to specify the extra board directory - Add comments to the example lg-env - Define USE_LABGRID to tell u-boot-hooks to use labgrid hooks - Add a few more comments to ub-pyt - Show the build path with ub-pyt -v - Add --allow-unmatched to ub-smoke to avoid QEMU error - Add a new section on compatibility - Add a new section on script usage Changes in v5: - Rebase on latest grpc branch - Fix pylint errors and warnings Changes in v4: - Support for Beagleplay, which needs files from two separate U-Boot builds - Support for a 'recovery' button needed to boot the image - Tidy up the internal-console support - Fix pytest behaviour with an unpatched U-Boot (that doesn't have lab mode) Changes in v3: - Rebase on top of grpc branch - Don't mess with terminal setting unless stdin is a terminal - Don't show an error if there are no resources when auto-acquiring - Support QEMU in UBootWriter Some changes in v2: - Rationalise the flags for the U-Boot scripts - Support tracing with em100 - Support an internal terminal instead of microcom - Add a -D flag for debugging - Support send-only boards - Add a way to build the U-Boot config - Add a control for buildman's process-limit - allow the build-dir to be specified in a variable - add documentation about U-Boot-pytest integration - add source_dir and config_file to UBootProviderDriver - add an internal terminal - expand the U-Boot scripts - significantly improve the U-Boot-pytest integration The approximate diffstat is: contrib/sync-places.py | 23 +- contrib/u-boot/.gitignore | 1 + contrib/u-boot/_ub-bisect-try | 47 ++ contrib/u-boot/conftest.py | 21 + contrib/u-boot/get_args.sh | 128 +++++ contrib/u-boot/index.rst | 232 +++++++++ contrib/u-boot/lg-client | 11 + contrib/u-boot/lg-env | 10 + contrib/u-boot/test_smoke.py | 3 + contrib/u-boot/ub-bisect | 44 ++ contrib/u-boot/ub-cli | 39 ++ contrib/u-boot/ub-int | 41 ++ contrib/u-boot/ub-pyt | 69 +++ contrib/u-boot/ub-smoke | 48 ++ doc/configuration.rst | 611 ++++++++++++++++++++++- doc/usage.rst | 288 +++++++++++ labgrid/driver/__init__.py | 10 +- labgrid/driver/common.py | 11 + labgrid/driver/consoleexpectmixin.py | 7 + labgrid/driver/powerdriver.py | 29 ++ labgrid/driver/qemudriver.py | 84 ++-- labgrid/driver/recoverydriver.py | 25 + labgrid/driver/resetdriver.py | 7 + labgrid/driver/servodriver.py | 157 ++++++ labgrid/driver/sfemulatordriver.py | 102 ++++ labgrid/driver/ubootdriver.py | 27 +- labgrid/driver/ubootproviderdriver.py | 323 ++++++++++++ labgrid/driver/ubootwriterdriver.py | 160 ++++++ labgrid/driver/usbhidrelay.py | 7 +- labgrid/driver/usbloader.py | 170 ++++++- labgrid/driver/usbstoragedriver.py | 18 +- labgrid/factory.py | 4 +- labgrid/protocol/__init__.py | 1 + labgrid/protocol/bootstrapprotocol.py | 8 +- labgrid/protocol/recoveryprotocol.py | 14 + labgrid/protocol/resetprotocol.py | 12 + labgrid/pytestplugin/fixtures.py | 21 +- labgrid/pytestplugin/hooks.py | 8 + labgrid/remote/client.py | 351 ++++++++----- labgrid/remote/config.py | 7 +- labgrid/remote/exporter.py | 122 ++++- labgrid/resource/__init__.py | 6 + labgrid/resource/remote.py | 24 + labgrid/resource/servo.py | 485 ++++++++++++++++++ labgrid/resource/sfemulator.py | 33 ++ labgrid/resource/suggest.py | 6 + labgrid/resource/udev.py | 33 ++ labgrid/strategy/ubootstrategy.py | 151 +++++- labgrid/target.py | 120 ++++- labgrid/util/helper.py | 220 ++++---- labgrid/util/ssh.py | 3 +- labgrid/util/term.py | 184 +++++++ labgrid/var_dict.py | 8 + man/labgrid-client.1 | 6 + man/labgrid-client.rst | 4 + man/labgrid-device-config.5 | 4 + 56 files changed, 4267 insertions(+), 321 deletions(-) [1] https://github.com/labgrid-project/labgrid/issues/created_by/sjg20 Signed-off-by: Simon Glass <sjg@chromium.org>
85e0def to
20cf29f
Compare
|
I pushed a rework of this series: each board now uses its own env file, and the firmware filenames ( |
|
There still seem to be open comments on this PR (lab specific comments in the examples, not using |
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 <sjg@chromium.org>
Add a USB loader for sunxi, supporting SPL and U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
Add a USB loader for tegra, supporting BCT and U-Boot. Series-changes: 7 - Support Jetson Nano as well Signed-off-by: Simon Glass <sjg@chromium.org>
Add a USB loader for samsung, supporting BL1, SPL and U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
|
All the review comments should be addressed now: the driver uses self.loader.path (usb_path is gone), the bct is pushed with ManagedFile, the lab-specific comments and the unrelated change are dropped, and the docs describe bct/image as images: keys. The branch is also rebased on current master and CI is green. |
Ah yes, done now. |
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