README 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. Introduction
  2. ============
  3. RK3399 key features we might use in U-Boot:
  4. * CPU: ARMv8 64bit Big-Little architecture,
  5. * Big: dual-core Cortex-A72
  6. * Little: quad-core Cortex-A53
  7. * IRAM: 200KB
  8. * DRAM: 4GB-128MB dual-channel
  9. * eMMC: support eMMC 5.0/5.1, suport HS400, HS200, DDR50
  10. * SD/MMC: support SD 3.0, MMC 4.51
  11. * USB: USB3.0 typc-C port *2 with dwc3 controller
  12. * USB2.0 EHCI host port *2
  13. * Display: RGB/HDMI/DP/MIPI/EDP
  14. evb key features:
  15. * regulator: pwm regulator for CPU B/L
  16. * PMIC: rk808
  17. * debug console: UART2
  18. In order to support Arm Trust Firmware(ATF), we can use either SPL or
  19. miniloader from rockchip to do:
  20. * do DRAM init
  21. * load and verify ATF image
  22. * load and verify U-Boot image
  23. Here is the step-by-step to boot to U-Boot on rk3399.
  24. Get the Source and prebuild binary
  25. ==================================
  26. > mkdir ~/evb_rk3399
  27. > cd ~/evb_rk3399
  28. > git clone https://github.com/ARM-software/arm-trusted-firmware.git
  29. > git clone https://github.com/rockchip-linux/rkbin.git
  30. > git clone https://github.com/rockchip-linux/rkdeveloptool.git
  31. Compile the ATF
  32. ===============
  33. > cd arm-trusted-firmware
  34. > make realclean
  35. > make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
  36. Or you can get the bl31.elf directly from Rockchip:
  37. cp rkbin/rk33/rk3399_bl31_v1.00.elf ../u-boot/bl31.elf
  38. Get bl31.elf in this step, copy it to U-Boot root dir:
  39. > cp bl31.elf ../u-boot/
  40. Compile the U-Boot
  41. ==================
  42. > cd ../u-boot
  43. > export ARCH=arm64
  44. > export CROSS_COMPILE=aarch64-linux-gnu-
  45. > make evb-rk3399_defconfig
  46. for firefly-rk3399, use below instead:
  47. > make firefly-rk3399_defconfig
  48. > make
  49. > make u-boot.itb
  50. Get spl/u-boot-spl.bin and u-boot.itb in this step.
  51. Compile the rkdeveloptool
  52. =======================
  53. Follow instructions in latest README
  54. > cd ../rkflashtool
  55. > autoreconf -i
  56. > ./configure
  57. > make
  58. > sudo make install
  59. Get rkdeveloptool in you Host in this step.
  60. Both origin binaries and Tool are ready now, choose either option 1 or
  61. option 2 to deploy U-Boot.
  62. Package the image
  63. =================
  64. Package the image for U-Boot SPL(option 1)
  65. --------------------------------
  66. > cd ..
  67. > tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin idbspl.img
  68. Get idbspl.img in this step.
  69. Package the image for Rockchip miniloader(option 2)
  70. ------------------------------------------
  71. > cd ..
  72. > cp arm-trusted-firmware/build/rk3399/release/bl31.elf rkbin/rk33
  73. > ./rkbin/tools/trust_merger rkbin/tools/RK3399TRUST.ini
  74. > ./rkbin/tools/loaderimage --pack --uboot u-boot/u-boot-dtb.bin uboot.img
  75. Get trust.img and uboot.img in this step.
  76. Flash the image to eMMC
  77. =======================
  78. Flash the image with U-Boot SPL(option 1)
  79. -------------------------------
  80. Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
  81. > rkdeveloptool db rkbin/rk33/rk3399_loader_v1.08.106.bin
  82. > rkdeveloptool wl 64 u-boot/idbspl.img
  83. > rkdeveloptool wl 0x4000 u-boot/u-boot.itb
  84. > rkdeveloptool rd
  85. Flash the image with Rockchip miniloader(option 2)
  86. ----------------------------------------
  87. Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
  88. > rkdeveloptool db rkbin/rk33/rk3399_loader_v1.08.106.bin
  89. > rkdeveloptool ul rkbin/rk33/rk3399_loader_v1.08.106.bin
  90. > rkdeveloptool wl 0x4000 u-boot/uboot.img
  91. > rkdeveloptool wl 0x6000 u-boot/trust.img
  92. > rkdeveloptool rd
  93. You should be able to get U-Boot log in console/UART2(baurdrate 1500000)
  94. For more detail, please reference to:
  95. http://opensource.rock-chips.com/wiki_Boot_option