README 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. Contents
  2. ========
  3. 1. Introduction
  4. 2. Get the Source and prebuild binary
  5. 3. Compile the U-Boot
  6. 4. Compile the rkdeveloptool
  7. 5. Package the image
  8. 5.1. Package the image for U-Boot SPL(option 1)
  9. 5.2. Package the image for Rockchip miniloader(option 2)
  10. 6. Bootloader storage options
  11. 7. Flash the image to eMMC
  12. 7.1. Flash the image with U-Boot SPL(option 1)
  13. 7.2. Flash the image with Rockchip miniloader(option 2)
  14. 8. Create a bootable SD/MMC
  15. 9. And that is it
  16. Introduction
  17. ============
  18. Rock960 board family consists of Rock960 (Consumer Edition) and
  19. Ficus (Enterprise Edition) 96Boards featuring Rockchip RK3399 SoC.
  20. Common features implemented on both boards:
  21. * CPU: ARMv8 64bit Big-Little architecture,
  22. * Big: dual-core Cortex-A72
  23. * Little: quad-core Cortex-A53
  24. * IRAM: 200KB
  25. * eMMC: 16/32GB eMMC 5.1
  26. * PMU: RK808
  27. * SD/MMC
  28. * Display: HDMI/DP/MIPI
  29. * Low Speed Expansion Connector
  30. * High Speed Expansion Connector
  31. Additional features of Rock960:
  32. * DRAM: 2GB/4GB LPDDR3 @ 1866MHz
  33. * 1x USB 3.0 type A, 1x USB 2.0 type A (host mode only),
  34. 1x USB 3.0 type C OTG
  35. Additional features of Ficus:
  36. * DRAM: 2GB/4GB DDR3 @ 1600MHz
  37. * Ethernet
  38. * 2x USB 3.0 type A, 2x USB 2.0 type A (host mode only),
  39. 1x USB 3.0 type C OTG
  40. Here is the step-by-step to boot to U-Boot on Rock960 boards.
  41. Get the Source and prebuild binary
  42. ==================================
  43. > git clone https://github.com/96rocks/rkbin.git
  44. > git clone https://github.com/rockchip-linux/rkdeveloptool.git
  45. Compile the U-Boot
  46. ==================
  47. > cd ../u-boot
  48. > cp ../rkbin/rk33/rk3399_bl31_v1.00.elf ./bl31.elf
  49. > export CROSS_COMPILE=aarch64-linux-gnu-
  50. > make rock960-rk3399_defconfig
  51. > make
  52. Compile the rkdeveloptool
  53. =========================
  54. Follow instructions in latest README
  55. > cd ../rkdeveloptool
  56. > autoreconf -i
  57. > ./configure
  58. > make
  59. > sudo make install
  60. Package the image
  61. =================
  62. Package the image for U-Boot SPL(option 1)
  63. --------------------------------
  64. > cd ..
  65. > tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin idbspl.img
  66. Get idbspl.img in this step.
  67. Package the image for Rockchip miniloader(option 2)
  68. ------------------------------------------
  69. > cd ../rkbin
  70. > ./tools/loaderimage --pack --uboot u-boot/u-boot-dtb.bin uboot.img 0x200000
  71. > ../u-boot/tools/mkimage -n rk3399 -T rksd -d rk3399_ddr_933MHz_v1.08.bin idbloader.img
  72. > cat ./rk33/rk3399_miniloader_v1.06.bin >> idbloader.img
  73. Get uboot.img and idbloader.img in this step.
  74. Bootloader storage options
  75. ==========================
  76. There are a few different storage options for the bootloader.
  77. This document explores two of these: eMMC and removable SD/MMC.
  78. Flash the image to eMMC
  79. =======================
  80. Flash the image with U-Boot SPL(option 1)
  81. -------------------------------
  82. Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
  83. > rkdeveloptool db rkbin/rk33/rk3399_loader_v1.08.106.bin
  84. > rkdeveloptool wl 64 u-boot/idbspl.img
  85. > rkdeveloptool wl 0x4000 u-boot/u-boot.itb
  86. > rkdeveloptool rd
  87. Flash the image with Rockchip miniloader(option 2)
  88. ----------------------------------------
  89. Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
  90. > rkdeveloptool db rkbin/rk33/rk3399_loader_v1.08.106.bin
  91. > rkdeveloptool wl 0x40 idbloader.img
  92. > rkdeveloptool wl 0x4000 uboot.img
  93. > rkdeveloptool wl 0x6000 ./img/rk3399/trust.img
  94. > rkdeveloptool rd
  95. Create a bootable SD/MMC
  96. ========================
  97. The idbspl.img contains the first stage, and the u-boot.img the second stage.
  98. As explained in the Rockchip partition table reference [1], the first stage
  99. (aka loader1) start sector is 64, and the second stage start sector is 16384.
  100. Each sector is 512 bytes, which means the first stage offset is 32 KiB,
  101. and the second stage offset is 8 MiB.
  102. Note: the second stage location is actually not as per the spec,
  103. but defined by the SPL. Mainline SPL defines an 8 MiB offset for the second
  104. stage.
  105. Assuming the SD card is exposed by device /dev/mmcblk0, the commands
  106. to write the two stages are:
  107. > dd if=idbspl.img of=/dev/mmcblk0 bs=1k seek=32
  108. > dd if=u-boot.itb of=/dev/mmcblk0 bs=1k seek=8192
  109. Setting up the kernel and rootfs is beyond the scope of this document.
  110. And that is it
  111. ==============
  112. You should be able to get U-Boot log in console/UART2(baurdrate 1500000)
  113. For more detail, please reference [2].
  114. [1] http://opensource.rock-chips.com/wiki_Partitions
  115. [2] http://opensource.rock-chips.com/wiki_Boot_option