The low level tools for rockchip SOC with maskrom and loader mode support.
Go to file
2024-09-10 22:33:31 +08:00
.gitignore [xrock]update some code 2021-08-04 11:33:41 +08:00
99-xrock.rules [rules]fix 99-xrock.rules 2024-08-23 11:28:29 +08:00
crc16.c [xrock]first commit 2021-08-03 16:34:01 +08:00
crc16.h [xrock]first commit 2021-08-03 16:34:01 +08:00
crc32.c [crc32]add crc32 library 2021-08-05 19:53:20 +08:00
crc32.h [crc32]add crc32 library 2021-08-05 19:53:20 +08:00
LICENSE [xrock]update LICENSE 2022-01-25 15:21:46 +08:00
loader.c [xrock]add some endian inline function 2024-09-04 16:30:21 +08:00
loader.h [xrock]add some endian inline function 2024-09-04 16:30:21 +08:00
main.c [xrock]bump version to v1.0.9 2024-09-06 12:03:50 +08:00
Makefile [Makefile]update makefile 2024-09-05 14:14:40 +08:00
Makefile.win [Makefile]update makefile 2024-09-05 14:14:40 +08:00
misc.c [xrock]update some command 2024-09-06 10:42:51 +08:00
misc.h [misc]add misc code 2024-08-24 11:03:03 +08:00
progress.c [progress]update progress.c 2021-10-28 10:29:40 +08:00
progress.h [progress]update progress 2021-08-06 11:17:36 +08:00
rc4.c [xrock]first commit 2021-08-03 16:34:01 +08:00
rc4.h [xrock]first commit 2021-08-03 16:34:01 +08:00
README.md [readme]add readme for patch u-boot 2024-09-10 22:33:31 +08:00
rock.c [vs]add rock_vs_write function 2024-09-05 21:25:13 +08:00
rock.h [vs]add rock_vs_write function 2024-09-05 21:25:13 +08:00
x.h [xrock]update some command 2024-09-06 10:42:51 +08:00


XROCK

The low level tools for rockchip SOC with maskrom and loader mode support.

How to build

Linux platform

The xrock tools depends on the libusb-1.0 library, you need to install libusb-1.0-0-dev before compile, for example in ubuntu:

sudo apt install libusb-1.0-0-dev

Then just type make at the root directory, you will see a binary program.

cd xrock
make
sudo make install

Window platform

Install some build tools

sudo apt install mingw-w64
sudo apt install autoconf
sudo apt install libtool-bin

Download and install libusb

git clone https://github.com/libusb/libusb.git
cd libusb
./autogen.sh
./configure --host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32/
make
sudo make install

Build xrock source code

cd xrock
CROSS=x86_64-w64-mingw32- make -f Makefile.win

For 32-bits windows, you can using i686-w64-mingw32- instead of x86_64-w64-mingw32 above.

Usage

usage:
    xrock maskrom <ddr> <usbplug> [--rc4-off]    - Initial chip using ddr and usbplug in maskrom mode
    xrock download <loader>                      - Initial chip using loader in maskrom mode
    xrock ready                                  - Show chip ready or not
    xrock version                                - Show chip version
    xrock capability                             - Show capability information
    xrock reset [maskrom]                        - Reset chip to normal or maskrom mode
    xrock dump <address> <length>                - Dump memory region in hex format
    xrock read <address> <length> <file>         - Read memory to file
    xrock write <address> <file>                 - Write file to memory
    xrock exec <address> [dtb]                   - Call function address
    xrock otp <length>                           - Dump otp memory in hex format
    xrock sn                                     - Read serial number
    xrock sn <string>                            - Write serial number
    xrock vs dump <index> <length> [type]        - Dump vendor storage in hex format
    xrock vs read <index> <length> <file> [type] - Read vendor storage
    xrock vs write <index> <file> [type]         - Write vendor storage
    xrock storage                                - Read storage media list
    xrock storage <index>                        - Switch storage media and show list
    xrock flash                                  - Detect flash and show information
    xrock flash erase <sector> <count>           - Erase flash sector
    xrock flash read <sector> <count> <file>     - Read flash sector to file
    xrock flash write <sector> <file>            - Write file to flash sector
extra:
    xrock extra maskrom --rc4 <on|off> [--sram <file> --delay <ms>] [--dram <file> --delay <ms>] [...]

Tips

  • The maskrom command can only used in maskrom mode, Before executing other commands, you must first execute the maskrom command

  • The memory base address from 0, NOT sdram's physical address.

  • In some u-boot rockusb driver, The flash dump operation be limited to the start of 32MB, you can patch u-boot's macro RKUSB_READ_LIMIT_ADDR.

RV1106

sudo xrock maskrom rv1106_ddr_924MHz_v1.09.bin rv1106_usbplug_v1.06.bin --rc4-off
sudo xrock version

RK1808

sudo xrock maskrom rk1808_ddr_933MHz_v1.05.bin rk1808_usbplug_v1.05.bin
sudo xrock version

RK3128

sudo xrock maskrom rk3128_ddr_300MHz_v2.12.bin rk3128_usbplug_v2.63.bin
sudo xrock version

RK3288

sudo xrock maskrom rk3288_ddr_400MHz_v1.11.bin rk3288_usbplug_v2.63.bin
sudo xrock version

RK3399

sudo xrock maskrom rk3399_ddr_800MHz_v1.25.bin rk3399_usbplug_v1.26.bin
sudo xrock version

RK3399PRO

sudo xrock maskrom rk3399pro_ddr_666MHz_v1.25.bin rk3399pro_usbplug_v1.26.bin
sudo xrock version

PX30

sudo xrock maskrom px30_ddr_333MHz_v1.16.bin px30_usbplug_v1.31.bin
sudo xrock version

RK3308

sudo xrock maskrom rk3308_ddr_589MHz_uart2_m1_v1.31.bin rk3308_usbplug_v1.27.bin
sudo xrock version

RK3566

sudo xrock maskrom rk3566_ddr_1056MHz_v1.11.bin rk356x_usbplug_v1.13.bin --rc4-off
sudo xrock version

RK3568

sudo xrock maskrom rk3568_ddr_1560MHz_v1.11.bin rk356x_usbplug_v1.13.bin --rc4-off
sudo xrock version

RK3588

sudo xrock maskrom rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.05.bin rk3588_usbplug_v1.07.bin --rc4-off
sudo xrock version

RK3562

sudo xrock maskrom rk3562_ddr_1332MHz_v1.05.bin rk3562_usbplug_v1.04.bin --rc4-off
sudo xrock version

RK3576

sudo xrock maskrom rk3576_ddr_lp4_2112MHz_lp5_2736MHz_v1.05.bin  rk3576_usbplug_v1.02.bin --rc4-off
sudo xrock version

License

This library is free software; you can redistribute it and or modify it under the terms of the MIT license. See MIT License for details.