Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Rock/U-Boot"

(Created page with "== U-Boot == source code of U-Boot for Rockchip is [https://groups.google.com/d/msg/radxa/B85j7OOjcwI/dWMPD_ybzm8J available], but more work need to be done to make it usable...")
 
(External links)
 
(23 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== U-Boot ==
+
{{rock_header}}
 +
{{Languages|rock/U-Boot}}
  
source code of U-Boot for Rockchip is [https://groups.google.com/d/msg/radxa/B85j7OOjcwI/dWMPD_ybzm8J available], but more work need to be done to make it usable for Radxa Rock.
+
== Features ==
  
== Build ==
+
* both Rockchip proprietary USB protocol and fastboot USB protocol are supported (Rockchip USB tools works)
 +
* format of partitions (images) are compatible to Rockchip proprietary bootloader (rkcrc, mkbootimg works)
 +
* (need more investigation...)
  
 +
== For NAND flash ==
 +
 +
=== Build ===
 +
Refer [[Rock/install_toolchain | install toolchain]] if you don't have arm-eabi-  on your system. Other toolchain(Linaro arm-linux-gnueabihf-gcc 4.9) may cause data abort errors.
 +
git clone -b u-boot-rk3188 https://github.com/radxa/u-boot-rockchip.git
 +
cd u-boot-rockchip
 
  make rk30xx
 
  make rk30xx
  
RK3188Loader_uboot.bin will be created. '''DON'T FLASH IT.'''
+
The binary we need for nand flash are '''RK3188Loader_miniall.bin''' and '''uboot.img'''.
 +
 
 +
=== Flash ===
 +
refer [[rock/flash_the_image| flash image page]]
 +
 
 +
use the new u-boot to erase the old loader
 +
    sudo upgrade_tool ef RK3188Loader_miniall.bin
 +
 
 +
flash new loader
 +
    sudo upgrade_tool ul RK3188Loader_miniall.bin
 +
 
 +
format NAND (first time only)
 +
    sudo upgrade_tool lf
 +
 
 +
flash parameter
 +
    upgrade_tool di -p parameter
 +
 
 +
paramter file
 +
    FIRMWARE_VER:4.2.2
 +
    MACHINE_MODEL:radxa_rock
 +
    MACHINE_ID:007
 +
    MANUFACTURER:RADXA
 +
    MAGIC: 0x5041524B
 +
    ATAG: 0x60000800
 +
    MACHINE: 3066
 +
    CHECK_MASK: 0x80
 +
    KERNEL_IMG: 0x60408000
 +
    CMDLINE:console=ttyFIQ0,115200 console=tty0 root=/dev/block/mtd/by-name/linuxroot rw rootfstype=ext4 init=/sbin/init mac_addr=de:ad:de:ad:be:ef initrd=0x62000000,0x00800000  mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00008000@0x00004000(boot),-@0x000c0000(linuxroot)
 +
 
 +
flash U-Boot
 +
    sudo upgrade_tool wl 0x2000 uboot.img
 +
    sudo upgrade_tool rd
 +
 
 +
flash kernel + ramdisk
 +
    upgrade_tool di -b boot-linux.img
 +
 
 +
flash root fs
 +
    upgrade_tool di linuxroot rootfs.img
 +
 
 +
Booting log can be found at: http://paste.ubuntu.com/9623598/
 +
 
 +
== For SD card ==
 +
=== Build ===
 +
Refer [[Rock/install_toolchain | install toolchain]] if you don't have arm-eabi-  on your system. Other toolchain(Linaro arm-linux-gnueabihf-gcc 4.9) may cause data abort errors.
 +
git clone -b u-boot-rk3188-sdcard https://github.com/radxa/u-boot-rockchip.git
 +
cd u-boot-rockchip
 +
make rk30xx
 +
./pack-sd.sh
 +
 
 +
The binary we need for sdcard is '''u-boot-sd.img'''.
 +
 
 +
=== Flash ===
 +
 
 +
sudo dd if=u-boot-sd.img of=/dev/sdx seek=64
 +
 
 +
Insert the uSD card to rock pro, it will boot from u-boot on uSD card.
 +
 
 +
== Develop ==
 +
 
 +
Some important files and directories related to the Rockchip platform:
 +
 
 +
  * [https://github.com/radxa/u-boot-rockchip/blob/master/UserManual '''UserManual'''] - documentation
 +
  * [https://github.com/radxa/u-boot-rockchip/blob/master/include/configs/rk30xx.h '''include/configs/rk30xx.h'''] - configuration file
 +
  * [https://github.com/radxa/u-boot-rockchip/tree/master/tools/rk_tools '''tools/rk_tools''']
 +
 
 +
  * [https://github.com/radxa/u-boot-rockchip/tree/master/board/rockchip '''board/rockchip''']
 +
    ├── [https://github.com/radxa/u-boot-rockchip/tree/master/board/rockchip/common '''common''']
 +
    │   ├── [https://github.com/radxa/u-boot-rockchip/tree/master/board/rockchip/common/armlinux '''armlinux''']
 +
    │   ├── [https://github.com/radxa/u-boot-rockchip/tree/master/board/rockchip/common/common '''common''']
 +
    │   │   ├── A8MMU
 +
    │   │   ├── crc
 +
    │   │   ├── emmc
 +
    │   │   ├── fat
 +
    │   │   ├── rc4
 +
    │   │   ├── rockusb
 +
    │   │   ├── serial_p9
 +
    │   │   └── SPI
 +
    │   └── [https://github.com/radxa/u-boot-rockchip/tree/master/board/rockchip/common/platform '''platform''']
 +
    │      ├── rk2928
 +
    │      └── rk30
 +
    └── [https://github.com/radxa/u-boot-rockchip/tree/master/board/rockchip/rk30xx '''rk30xx''']
 +
 
 +
  * [https://github.com/radxa/u-boot-rockchip/tree/master/arch/arm/cpu/armv7/rk30xx '''arch/arm/cpu/armv7/rk30xx''']
 +
  * [https://github.com/radxa/u-boot-rockchip/blob/master/arch/arm/include/asm/arch-rk30xx/ '''arch/arm/include/asm/arch-rk30xx''']
  
 
== Unbrick ==
 
== Unbrick ==
  
read [[rock/unbrick | Unbrick Rock]]
+
If something goes wrong and your device doesn't boot anymore, read [[rock/unbrick | Unbrick Rock]].
  
 
== External links ==
 
== External links ==
  
* https://github.com/neo-technologies/rockchip_u-boot
+
 
 +
* https://github.com/linux-rockchip/u-boot-rockchip (some improvement)

Latest revision as of 01:49, 19 November 2020

Features

  • both Rockchip proprietary USB protocol and fastboot USB protocol are supported (Rockchip USB tools works)
  • format of partitions (images) are compatible to Rockchip proprietary bootloader (rkcrc, mkbootimg works)
  • (need more investigation...)

For NAND flash

Build

Refer install toolchain if you don't have arm-eabi- on your system. Other toolchain(Linaro arm-linux-gnueabihf-gcc 4.9) may cause data abort errors.

git clone -b u-boot-rk3188 https://github.com/radxa/u-boot-rockchip.git
cd u-boot-rockchip
make rk30xx

The binary we need for nand flash are RK3188Loader_miniall.bin and uboot.img.

Flash

refer flash image page

use the new u-boot to erase the old loader

   sudo upgrade_tool ef RK3188Loader_miniall.bin

flash new loader

   sudo upgrade_tool ul RK3188Loader_miniall.bin

format NAND (first time only)

   sudo upgrade_tool lf

flash parameter

   upgrade_tool di -p parameter

paramter file

   FIRMWARE_VER:4.2.2
   MACHINE_MODEL:radxa_rock
   MACHINE_ID:007
   MANUFACTURER:RADXA
   MAGIC: 0x5041524B
   ATAG: 0x60000800
   MACHINE: 3066
   CHECK_MASK: 0x80
   KERNEL_IMG: 0x60408000
   CMDLINE:console=ttyFIQ0,115200 console=tty0 root=/dev/block/mtd/by-name/linuxroot rw rootfstype=ext4 init=/sbin/init mac_addr=de:ad:de:ad:be:ef initrd=0x62000000,0x00800000  mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00008000@0x00004000(boot),-@0x000c0000(linuxroot)

flash U-Boot

   sudo upgrade_tool wl 0x2000 uboot.img
   sudo upgrade_tool rd

flash kernel + ramdisk

   upgrade_tool di -b boot-linux.img

flash root fs

   upgrade_tool di linuxroot rootfs.img

Booting log can be found at: http://paste.ubuntu.com/9623598/

For SD card

Build

Refer install toolchain if you don't have arm-eabi- on your system. Other toolchain(Linaro arm-linux-gnueabihf-gcc 4.9) may cause data abort errors.

git clone -b u-boot-rk3188-sdcard https://github.com/radxa/u-boot-rockchip.git
cd u-boot-rockchip
make rk30xx
./pack-sd.sh

The binary we need for sdcard is u-boot-sd.img.

Flash

sudo dd if=u-boot-sd.img of=/dev/sdx seek=64

Insert the uSD card to rock pro, it will boot from u-boot on uSD card.

Develop

Some important files and directories related to the Rockchip platform:

 * UserManual - documentation
 * include/configs/rk30xx.h - configuration file
 * tools/rk_tools
 * board/rockchip
    ├── common
    │   ├── armlinux
    │   ├── common
    │   │   ├── A8MMU
    │   │   ├── crc
    │   │   ├── emmc
    │   │   ├── fat
    │   │   ├── rc4
    │   │   ├── rockusb
    │   │   ├── serial_p9
    │   │   └── SPI
    │   └── platform
    │       ├── rk2928
    │       └── rk30
    └── rk30xx
 * arch/arm/cpu/armv7/rk30xx
 * arch/arm/include/asm/arch-rk30xx

Unbrick

If something goes wrong and your device doesn't boot anymore, read Unbrick Rock.

External links