mirrexagon / nixpkgs

Nix Packages collection
MIT License
0 stars 0 forks source link

Rockchip U-Boot notes #1

Open mirrexagon opened 2 years ago

mirrexagon commented 2 years ago
mirrexagon commented 2 years ago

Tow-Boot sets some config items for SPI boot: https://github.com/Tow-Boot/Tow-Boot/blob/released/support/builders/rockchip-rk3399/default.nix#L76

Also explicitly sets CONFIG_SYS_SPI_U_BOOT_OFFS to 0x80000 and patches RK3399 U-Boot device trees to the same: https://github.com/Tow-Boot/Tow-Boot/blob/released/boards/pine64/0001-rockpro64-rk3399-Configure-SPI-flash-boot-offset.patch#L19

TODO: Find out why

mirrexagon commented 2 years ago

Various ways to set offset to U-Boot Proper in media where U-Boot resides:

Device tree overrides config, doc/device-tree-bindings/config.txt:

u-boot,spl-payload-offset (int) If present (and SPL is controlled by the device-tree), this allows to override the CONFIG_SYS_SPI_U_BOOT_OFFS setting using a value from the device-tree.

mirrexagon commented 2 years ago

binman:

mirrexagon commented 2 years ago

There is a CONFIG_ROCKCHIP_SPI_IMAGE in U-Boot, but maybe only implemented for some boards: https://source.denx.de/u-boot/u-boot/-/commit/c4cea2bbf995764f325a907061c22ecd6768cf7b

mirrexagon commented 2 years ago

It seems like ideally we would:

Considerations and other notes:


There is a note when building that this board uses CONFIG_SPL_FIT_GENERATOR and it should use binman instead. I think this is about building u-boot.itb, using BL31, etc. That is orthogonal to TPL+SPL, and could be a next step after all the TPL+SPL stuff using binman is working.

mirrexagon commented 2 years ago

Some info on INPUTS-y: https://lists.denx.de/pipermail/u-boot/2020-July/419536.html

mirrexagon commented 2 years ago

Commit showing use of binman to produce u-boot.itb: https://source.denx.de/u-boot/u-boot/-/commit/a32dd071485b17137b6d6088d26cee8011c5b9fc

mirrexagon commented 2 years ago

The binman FIT entry type example in fit.py has a type = "rkspi" field. Do I use that instead of what I changed in the mkimage entry type (colon-separated data, passing type and name args)?

mirrexagon commented 2 years ago

Wat

The RK3328 boots rksd format images from SPI, not rkspi, from my testing. More investigation on what exactly the differences are are required - maybe the image header is actually different between them, not just the 2K block spreading thing.