README 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. How to update U-Boot on pico-imx7d board
  2. ----------------------------------------
  3. Required software on the host PC:
  4. - imx_usb_loader: https://github.com/boundarydevices/imx_usb_loader
  5. Build U-Boot for pico:
  6. $ make mrproper
  7. $ make pico-imx7d_defconfig
  8. $ make
  9. This generates the SPL and u-boot-dtb.img binaries.
  10. 1. Loading U-Boot via USB Serial Download Protocol
  11. Note: This method is convenient for development purposes.
  12. If the eMMC has already a U-Boot flashed with DFU support then
  13. the user can go to step 2 below in order to update U-Boot.
  14. Put pico board in USB download mode (refer to the PICO-iMX7D Quick Start Guide
  15. page 3)
  16. Connect a USB to serial adapter between the host PC and pico.
  17. Connect a USB cable between the OTG pico port and the host PC.
  18. Note: Some computers may be a bit strict with USB current draw and will
  19. shut down their ports if the draw is too high. The solution for that is
  20. to use an externally powered USB hub between the board and the host computer.
  21. Open a terminal program such as minicom.
  22. Copy SPL and u-boot-dtb.img to the imx_usb_loader folder.
  23. Load the SPL binary via USB:
  24. $ sudo ./imx_usb SPL
  25. Load the u-boot-dtb.img binary via USB:
  26. $ sudo ./imx_usb u-boot-dtb.img
  27. Then U-Boot starts and its messages appear in the console program.
  28. Use the default environment variables:
  29. => env default -f -a
  30. => saveenv
  31. 2. Flashing U-Boot into the eMMC
  32. Run the DFU agent so we can flash the new images using dfu-util tool:
  33. => dfu 0 mmc 0
  34. Flash SPL and u-boot-dtb.img into the eMMC running the following commands on a PC:
  35. $ sudo dfu-util -D SPL -a spl
  36. $ sudo dfu-util -D u-boot-dtb.img -a u-boot
  37. Remove power from the pico board.
  38. Put pico board into normal boot mode.
  39. Power up the board and the new updated U-Boot should boot from eMMC.
  40. Booting in Falcon mode
  41. ======================
  42. Generate a uImage kernel:
  43. $ make imx_v6_v7_defconfig (Using the default imx_v6_v7_defconfig configuration
  44. just for an example. In order to boot faster the user should customize the
  45. defconfig by only enabling the minimal required drivers).
  46. $ make -j4 uImage LOADADDR=0x80008000
  47. $ cp arch/arm/boot/uImage /tftpboot
  48. $ cp arch/arm/boot/dts/imx7d-pico-pi.dtb /tftpboot
  49. In the U-Boot prompt:
  50. Setup the server and board IP addresses:
  51. => setenv serverip 192.168.0.10
  52. => setenv ipaddr 192.168.0.11
  53. Get the dtb file:
  54. => tftp ${fdt_addr} imx7d-pico-pi.dtb
  55. Get the kernel:
  56. => tftp ${loadaddr} uImage
  57. Write the kernel at 2MB offset:
  58. => mmc write ${loadaddr} 0x1000 0x5000
  59. Setup the bootargs:
  60. => setenv bootargs 'console=ttymxc4,115200 root=/dev/mmcblk2p1 rootfstype=ext4 rootwait rw'
  61. Prepare args:
  62. => spl export fdt ${loadaddr} - ${fdt_addr}
  63. ## Booting kernel from Legacy Image at 80800000 ...
  64. Image Name: Linux-5.2.14
  65. Image Type: ARM Linux Kernel Image (uncompressed)
  66. Data Size: 9077544 Bytes = 8.7 MiB
  67. Load Address: 80008000
  68. Entry Point: 80008000
  69. Verifying Checksum ... OK
  70. ## Flattened Device Tree blob at 83000000
  71. Booting using the fdt blob at 0x83000000
  72. Loading Kernel Image
  73. Using Device Tree in place at 83000000, end 8300b615
  74. subcommand not supported
  75. subcommand not supported
  76. Using Device Tree in place at 83000000, end 8300e615
  77. Argument image is now in RAM: 0x83000000
  78. =>
  79. Write 1MB of args data (0x800 sectors) to 1MB offset (0x800 sectors):
  80. => mmc write ${fdt_addr} 0x800 0x800
  81. In order to boot with Falcon mode, activate the CONFIG_SPL_OS_BOOT
  82. option in the defconfig
  83. --- a/configs/pico-imx7d_defconfig
  84. +++ b/configs/pico-imx7d_defconfig
  85. @@ -67,3 +67,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
  86. CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
  87. CONFIG_CI_UDC=y
  88. CONFIG_VIDEO=y
  89. +CONFIG_SPL_OS_BOOT=y
  90. Then rebuild U-Boot:
  91. $ make pico-imx7d_defconfig
  92. $ make -j4
  93. Launch UMS:
  94. => ums 0 mmc 0
  95. Flash the new binaries:
  96. $ sudo dd if=SPL of=/dev/sdX bs=1k seek=1; sync
  97. $ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1k seek=69; sync
  98. And then SPL binary will load and jump directly to the kernel:
  99. U-Boot SPL 2019.10-rc3-00284-g001c8ea94a-dirty (Sep 10 2019 - 12:46:01 -0300)
  100. Trying to boot from MMC1
  101. [ 0.000000] Booting Linux on physical CPU 0x0
  102. [ 0.000000] Linux version 5.2.14 (fabio@fabio-OptiPlex-7010) (gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)) #30 SMP Wed Sep 10 12:36:27 -03 2019
  103. [ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
  104. [ 0.000000] CPU: div instructions available: patching division code
  105. [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
  106. [ 0.000000] OF: fdt: Machine model: TechNexion PICO-IMX7D Board and PI baseboard
  107. ...