-
Notifications
You must be signed in to change notification settings - Fork 41
Rockchip SoC support #56
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
base: main
Are you sure you want to change the base?
Changes from all commits
5e74917
bf62819
8fcddbc
5b21cdd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -289,3 +289,100 @@ extract the FSBL and PMUFW from the complete boot image. | |
configuration: | ||
* path | ||
|
||
## For Rockchip devices | ||
|
||
While it is possible to use the DDR init files and SPL files from Rockchip, | ||
it is easier to use the files generated by u-boot as support for the | ||
Rokchip USB protocol is not implemented. | ||
Nevertheless, this means that to boot u-boot proper, u-boot has to be | ||
patched to get support for: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should be clear here: using the prebuilt Rockchip SPL images doesn't work with Snagrecover. People have to patch U-Boot and build the images themselves. |
||
|
||
- boot from RAM, | ||
- boot from SPL DFU | ||
|
||
The patches have been sent to the u-boot mailing list by their authors | ||
and not yet merged. The patches can all be found inside this | ||
[merge request](https://gitlab.collabora.com/hardware-enablement/rockchip-3588/u-boot/-/merge_requests/5). | ||
|
||
|
||
|
||
### Using binary generated by Rockchip's ``boot_merger`` | ||
|
||
[example](../src/snagrecover/templates/rockchip-merger.yaml) | ||
|
||
Snagboot can upload the ``CODE471_OPTION`` and ``CODE472_OPTION`` of a binary | ||
generated with the ``boot_merger`` tool and configuration files from | ||
[Rockchip rkbin](https://github.com/radxa/rkbin/tree/develop-v2024.03/). | ||
|
||
In case of u-boot, this would mean to upload the TPL, SPL and then use SPL DFU | ||
to boot u-boot proper (see later section for SPL DFU). | ||
|
||
An example configuration for rk3399 would be: | ||
``` | ||
[CHIP_NAME] | ||
NAME=RK330C | ||
[VERSION] | ||
MAJOR=1 | ||
MINOR=123 | ||
[CODE471_OPTION] | ||
NUM=1 | ||
Path1=tpl/u-boot-tpl-dtb.bin | ||
Sleep=1 | ||
[CODE472_OPTION] | ||
NUM=1 | ||
Path1=spl/u-boot-spl-dtb.bin | ||
Sleep=3000 | ||
[LOADER_OPTION] | ||
NUM=2 | ||
LOADER1=FlashData | ||
LOADER2=FlashBoot | ||
FlashData=spl/u-boot-spl-dtb.bin | ||
FlashBoot=u-boot.itb | ||
[OUTPUT] | ||
PATH=rk3399_uboot.bin | ||
[FLAG] | ||
471_RC4_OFF=false | ||
``` | ||
|
||
The ``tpl/u-boot-tpl-dtb.bin``, ``spl/u-boot-spl-dtb.bin``, ``u-boot.itb`` | ||
files are generated during u-boot's build. Please note has the ``LOADER_OPTION`` | ||
is not handled by snagboot. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please also include a specification of snagrecover firmware names and parameters in the same format as for the other SoC families in this documentation. I think it's especially important to describe the "delay" parameter. |
||
|
||
### Boot from Ram | ||
|
||
[example](../src/snagrecover/templates/rockchip-ramboot.yaml) | ||
|
||
When building u-boot with the previously mentioned patches, u-boot will generate two files: | ||
|
||
- ``u-boot-rockchip-usb471.bin`` | ||
- ``u-boot-rockchip-usb472.bin`` | ||
|
||
These are the files needed to boot from RAM. | ||
On platforms like rk3588 using the TPL from rockchip, some issues will arrive | ||
when booting. It's due to the ``u-boot-rockchip-usb472.bin`` binary overwriting | ||
the ATAGS provided by the TPL. A possible fix would be to patch u-boot with | ||
https://github.com/u-boot/u-boot/commit/a6e85a35b50ade7df5f32092c1cc05ade303a22a. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
||
### Boot from SPL DFU | ||
|
||
[example](../src/snagrecover/templates/rockchip-spl-dfu.yaml) | ||
|
||
To enable u-boot with SPL DFU support in the u-boot configuration, ensure that the | ||
following options are enabled: | ||
|
||
``` | ||
CONFIG_SPL_DM_USB_GADGET=y | ||
CONFIG_SPL_USB_GADGET=y | ||
CONFIG_SPL_DFU=y | ||
``` | ||
|
||
The (SPL) USB gadget driver needs to be enabled too. | ||
|
||
At the end of the build, the following files will be needed: | ||
|
||
- ``mkimage-in-simple-bin.mkimage-u-boot-tpl`` or ``mkimage-in-simple-bin.mkimage-rockchip-tpl`` | ||
- ``mkimage-in-simple-bin.mkimage-u-boot-spl`` | ||
- ``u-boot.itb`` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
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.
is it really possible to use snagrecover with the prebuilt SPL images from Rockchip? I don't think that's true in the general case, since they don't have DFU support.