Skip to content

Instantly share code, notes, and snippets.

@riaancillie
Created September 13, 2019 19:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riaancillie/c97af871a4ba6556e7d8558da6c88da6 to your computer and use it in GitHub Desktop.
Save riaancillie/c97af871a4ba6556e7d8558da6c88da6 to your computer and use it in GitHub Desktop.
Khadas u-boot logo change
Khadas/Rockchip stores the logo to be displayed after power on in a partition called "resource" which is located at 0x0000 a000
The file system in proprierty but can be generated using a a tool provided by rockchip. There appears to be a limit on the bitmap
that can be displayed. 1000x1000px works fine, but 2048x1536 causes a interleaved effect when starting up although correcting
itself after a few seconds.
Note that the partition is only 16mb in size.
To create a new logo.img file, use resource_tool, either from rkbin in fenix/build/rkbin____/tools folder or by cloning repo
https://github.com/linux-rockchip/u-boot-rockchip/blob/u-boot-rk3288/tools/resource_tool/resource_tool.c which also provides
source code.
Create a logo bitmap and name it logo.bmp. It must be 24-bit and saved in Windows format.
To create the .img file place the bitmap in a folder and with that folder as the working directory run
resource_loader --pack logo.bmp
A file will be created called resource.img
If the script is run from a different folder be sure to include the 'root' argument otherwise the .img filesystem
will show logo.bmp in a subfolder (open the .img with a hex editor and look)
/home/riaan/fenix/build/rkbin-b8bbafdd87a3f6c92a7b23e3e3f991b8fba97c23/tools/resource_tool --root=/tmp/unpacked/out --pack /tmp/unpacked/out/logo.bmp
To include this file in the fenix build script when creating an image, rename resource.img to logo.img and place it
fenix/archives/logo/Rockchip/logo.img
When building the full firmware (make all) it will include this at the correct offset.
To apply the new logo image afterwards use the RKDevTool/AndroidTool which is used to flash new firmware. On the first tab (Download Image)
uncheck everything and create a new row at 0x0000A000/RiaanLogo/path_to_logo/img.
Check the new row, place the Khadas in loader mode (hold function after reset), and click run.
The image can also be applied directly from the khadas, but running
sudo dd if=logo.img of=/dev/mmcblk1p5 (verify the partition number by checking for 16mb in lsblk)
@Enuzo
Copy link

Enuzo commented Dec 25, 2019

So I followed the instruction until I got here:
./resource_loader --pack logo.bmp
But this is what seems to work:
./resource_tool --pack logo.bmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment