new RKBootstrapDriver, use rk-usb-loader to bootstrap Rockchip SoCs#1898
new RKBootstrapDriver, use rk-usb-loader to bootstrap Rockchip SoCs#1898saschahauer wants to merge 2 commits into
Conversation
Several drivers resolved their host tool paths with an identical, copy-pasted block guarded by a "FIXME make sure we always have an environment or config" comment: look up the tool via the environment's config when present, otherwise fall back to the bare tool name so it can be found via $PATH. Add a Target.get_tool() helper that encapsulates this fallback (mirroring the existing Target.interact()) and convert the drivers to use it, so that a potential fix of this issue can be done in a single place. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Assisted-by: Claude Opus 4.8
The existing RKUSBDriver uses rkdeveloptool's 'db' and 'wl' commands to load a first-stage loader into RAM and then write a bootloader to the target's storage. It does not load and execute a bootloader in RAM. Add an RKBootstrapDriver which uses barebox's rk-usb-loader tool to upload a combined barebox image into a Rockchip SoC in MaskROM mode and execute it from RAM, i.e. a true USB bootstrap. Both drivers bind the existing RKUSBLoader resource. As the rk-usb-loader name now correctly refers to the barebox tool used by the new driver, the rkdeveloptool binary used by RKUSBDriver moves to a dedicated 'rkdeveloptool' tools key. The previous (misnamed) 'rk-usb-loader' key is still honored for backward compatibility, emitting a DeprecationWarning. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Assisted-by: Claude Opus 4.8
|
This PR seem to be missing the Also please take a look at #1721 that implement Rockchip bootstrap support of IDBlock v2 images (supported by |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1898 +/- ##
======================================
Coverage 45.9% 46.0%
======================================
Files 180 180
Lines 14496 14514 +18
======================================
+ Hits 6666 6681 +15
- Misses 7830 7833 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Ups, yes. Updated now.
I wasn't aware of #1721 when I wrote this. I'll happily abandon my PR when #1721 is the way forward. I'd appreciate a word from the labgrid maintainers @jluebbe given that this is brewing for 10 months now |
Labgrid currently has a
RKUSBDriverwhich usesrkdeveloptoolto write a bootloader image to a SD/MMC card connected to a Rockchip SoC. There currently is no driver to just upload and start a bootloader image without modifying the device storage. This PR adds exactly that. As the obvious name for this driver is already used by the existing driver, the driver is namedRKBootstrapDriver.Some confusion exists in the
rk-usb-loadertool. The documentation wrongly states that this should point to equally namedrk-usb-loadertool from barebox when it really expects arkdeveloptoolin that key. This is cleaned up in a way that the existingRKUSBDrivernow expects arkdevelopkey to find therkdeveloptooland the newRKBootstrapDrivernow expects a bareboxrk-usb-loadertool under therk-usb-loaderkey (as the documentation already states). For compatibilityRKBootstrapDriverstill falls back to therk-usb-loaderkey, but a warning is printed when it's actually used.Description
Checklist