Difference between revisions of "Rockusb"
(8 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
Rockusb is a vendor specific USB class from Rockchip, which is for firmware dowmload for Rockchip SoCs. | Rockusb is a vendor specific USB class from Rockchip, which is for firmware dowmload for Rockchip SoCs. | ||
+ | | ||
= Get into Rockusb = | = Get into Rockusb = | ||
− | There are | + | There are a few cases for Rockchip SoCs to get into Rockusb. |
*maskrom mode, no firmware found on chip, target run maskrom rockusb driver; | *maskrom mode, no firmware found on chip, target run maskrom rockusb driver; | ||
+ | *usbplug mode, | ||
*miniLoader rockusb mode, target run miniloader rockusb driver. | *miniLoader rockusb mode, target run miniloader rockusb driver. | ||
− | *uboot rockusb mode | + | *uboot rockusb mode. |
| | ||
Line 23: | Line 25: | ||
If firmware is at somewhere of the board, in order to get into this mode, we can do something to prevent cpu read the firmware successful: | If firmware is at somewhere of the board, in order to get into this mode, we can do something to prevent cpu read the firmware successful: | ||
− | *for | + | *for SD-card, unplug the SD-card; |
*for eMMC, short the eMMC clock to GND; | *for eMMC, short the eMMC clock to GND; | ||
*for NAND, short the data line or clock line; | *for NAND, short the data line or clock line; | ||
Line 32: | Line 34: | ||
In Maskrom mode, the DRAM is not available, so the download size is limit by the internal memory size. | In Maskrom mode, the DRAM is not available, so the download size is limit by the internal memory size. | ||
− | + | Available command in this mode: | |
− | | + | 'db' command: system init the DRAM and run into usbplug(with rockusb driver) mode which have no size limitation in download size. |
+ | |||
+ | 'ul' command: 'db' command and download idbloader into eMMC 0x40; | ||
+ | |||
+ | 'uf' command: 'db' command and download image in update.img into eMMC; | ||
+ | |||
+ | all the other commands need to access DRAM should be after 'db' command. | ||
+ | |||
+ | == Usbplug mode == | ||
+ | The usbplug is a firmware used for USB download with rkdeveloptool db command, with rockusb driver inside, the DRAM already initialized in this mode. | ||
== Miniloader Rockusb mode == | == Miniloader Rockusb mode == | ||
− | + | Rockchip legacy image(with U-Boot 2014.10) using miniloader as default USB firmware upgrade path, enter this mode with: | |
+ | |||
+ | - Press 'recovery' or 'volumn +' key pressed when power up; | ||
- there is no next stage firmware found. | - there is no next stage firmware found. | ||
− | erase | + | For example, erase bootable data in U-Boot: |
<pre style="margin-left: 40px;">mmc erase 0x4000 0x2000</pre> | <pre style="margin-left: 40px;">mmc erase 0x4000 0x2000</pre> | ||
- run "reboot loader" command in kernel. | - run "reboot loader" command in kernel. | ||
− | NOTE: In this miniloader rockusb, the offset for | + | NOTE: In this miniloader rockusb, the offset for rkdeveloptool is not the physical address, |
− | the | + | the physical offset 0~0x2000 is no able to write by wl command; |
− | '''The | + | '''The physical address of offset in ''wl'' command is the offset plus 0x2000''', eg: |
"rkdeveloptool wl 0x2000 uboot.img" will write uboot.img to emmc 0x4000 address. | "rkdeveloptool wl 0x2000 uboot.img" will write uboot.img to emmc 0x4000 address. | ||
− | + | == U-Boot Rockusb mode == | |
− | + | enter this mode with: | |
+ | |||
+ | - Press 'recovery' or 'volumn +' key pressed when power up; | ||
+ | |||
+ | - Run "reboot loader" command in kernel; | ||
+ | |||
+ | - Start with cmd in U-Boot shell | ||
+ | <pre>rockusb 0 mmc 0</pre> | ||
− | + | | |
− | = USB | + | = USB VID/PID for rockusb = |
Rockchip Vendor ID is 0x2207, and the product ID for different SoCs are different. | Rockchip Vendor ID is 0x2207, and the product ID for different SoCs are different. | ||
Line 73: | Line 93: | ||
Please use ''lsusb ''command in Linux PC to check if there is a Rockusb device connect. | Please use ''lsusb ''command in Linux PC to check if there is a Rockusb device connect. | ||
+ | |||
+ | | ||
= Firmware download = | = Firmware download = | ||
− | [[Rkdeveloptool|rkdeveloptool]] is the tool to do the firmware upgrade for Rockchip SoCs which is using Rockusb protocol via USB. | + | [[Rkdeveloptool|rkdeveloptool]] and [[Upgradetool|upgrade_tool]] is the tool to do the firmware upgrade for Rockchip SoCs which is using Rockusb protocol via USB. |
Please follow the steps for boot from eMMC for how to use the tool. | Please follow the steps for boot from eMMC for how to use the tool. |
Latest revision as of 00:46, 30 June 2020
Contents
Introduce
Rockusb is a vendor specific USB class from Rockchip, which is for firmware dowmload for Rockchip SoCs.
Get into Rockusb
There are a few cases for Rockchip SoCs to get into Rockusb.
- maskrom mode, no firmware found on chip, target run maskrom rockusb driver;
- usbplug mode,
- miniLoader rockusb mode, target run miniloader rockusb driver.
- uboot rockusb mode.
Maskrom mode
If there is no bootable firmware found on board, the SoC will run Rockusb driver automatically, we call it Bootrom mode or Maskrom mode.
If firmware is at somewhere of the board, in order to get into this mode, we can do something to prevent cpu read the firmware successful:
- for SD-card, unplug the SD-card;
- for eMMC, short the eMMC clock to GND;
- for NAND, short the data line or clock line;
- for SPI, short the spi signal to GND;
- By "reboot bootrom" command in U-Boot and Kernel, WIP.
- erase bootable region with non-bootable data in eMMC or other media devices
In Maskrom mode, the DRAM is not available, so the download size is limit by the internal memory size.
Available command in this mode:
'db' command: system init the DRAM and run into usbplug(with rockusb driver) mode which have no size limitation in download size.
'ul' command: 'db' command and download idbloader into eMMC 0x40;
'uf' command: 'db' command and download image in update.img into eMMC;
all the other commands need to access DRAM should be after 'db' command.
Usbplug mode
The usbplug is a firmware used for USB download with rkdeveloptool db command, with rockusb driver inside, the DRAM already initialized in this mode.
Miniloader Rockusb mode
Rockchip legacy image(with U-Boot 2014.10) using miniloader as default USB firmware upgrade path, enter this mode with:
- Press 'recovery' or 'volumn +' key pressed when power up;
- there is no next stage firmware found.
For example, erase bootable data in U-Boot:
mmc erase 0x4000 0x2000
- run "reboot loader" command in kernel.
NOTE: In this miniloader rockusb, the offset for rkdeveloptool is not the physical address,
the physical offset 0~0x2000 is no able to write by wl command;
The physical address of offset in wl command is the offset plus 0x2000, eg:
"rkdeveloptool wl 0x2000 uboot.img" will write uboot.img to emmc 0x4000 address.
U-Boot Rockusb mode
enter this mode with:
- Press 'recovery' or 'volumn +' key pressed when power up;
- Run "reboot loader" command in kernel;
- Start with cmd in U-Boot shell
rockusb 0 mmc 0
USB VID/PID for rockusb
Rockchip Vendor ID is 0x2207, and the product ID for different SoCs are different.
Rockusb product ID:
- RK3288: 0x320a
- RK3328: 0x320c
- RK3399: 0x330c
Please use lsusb command in Linux PC to check if there is a Rockusb device connect.
Firmware download
rkdeveloptool and upgrade_tool is the tool to do the firmware upgrade for Rockchip SoCs which is using Rockusb protocol via USB.
Please follow the steps for boot from eMMC for how to use the tool.