2017-05-08 16:17:28 +00:00
|
|
|
How to update U-Boot on pico-imx7d board
|
|
|
|
----------------------------------------
|
|
|
|
|
|
|
|
Required software on the host PC:
|
|
|
|
|
|
|
|
- imx_usb_loader: https://github.com/boundarydevices/imx_usb_loader
|
|
|
|
|
|
|
|
Build U-Boot for pico:
|
|
|
|
|
|
|
|
$ make mrproper
|
|
|
|
$ make pico-imx7d_defconfig
|
|
|
|
$ make
|
|
|
|
|
2019-04-26 12:36:23 +00:00
|
|
|
This generates the SPL and u-boot-dtb.img binaries.
|
2018-09-04 13:23:12 +00:00
|
|
|
|
|
|
|
1. Loading U-Boot via USB Serial Download Protocol
|
|
|
|
|
|
|
|
Note: This method is convenient for development purposes.
|
|
|
|
If the eMMC has already a U-Boot flashed with DFU support then
|
|
|
|
the user can go to step 2 below in order to update U-Boot.
|
2017-05-08 16:17:28 +00:00
|
|
|
|
|
|
|
Put pico board in USB download mode (refer to the PICO-iMX7D Quick Start Guide
|
|
|
|
page 3)
|
|
|
|
|
|
|
|
Connect a USB to serial adapter between the host PC and pico.
|
|
|
|
|
|
|
|
Connect a USB cable between the OTG pico port and the host PC.
|
|
|
|
|
2019-03-27 23:03:39 +00:00
|
|
|
Note: Some computers may be a bit strict with USB current draw and will
|
|
|
|
shut down their ports if the draw is too high. The solution for that is
|
|
|
|
to use an externally powered USB hub between the board and the host computer.
|
|
|
|
|
2017-05-08 16:17:28 +00:00
|
|
|
Open a terminal program such as minicom.
|
|
|
|
|
2019-04-26 12:36:23 +00:00
|
|
|
Copy SPL and u-boot-dtb.img to the imx_usb_loader folder.
|
2018-09-04 13:23:12 +00:00
|
|
|
|
|
|
|
Load the SPL binary via USB:
|
2017-05-08 16:17:28 +00:00
|
|
|
|
2018-09-04 13:23:12 +00:00
|
|
|
$ sudo ./imx_usb SPL
|
2017-05-08 16:17:28 +00:00
|
|
|
|
2019-04-26 12:36:23 +00:00
|
|
|
Load the u-boot-dtb.img binary via USB:
|
2018-09-04 13:23:12 +00:00
|
|
|
|
2019-04-26 12:36:23 +00:00
|
|
|
$ sudo ./imx_usb u-boot-dtb.img
|
2017-05-08 16:17:28 +00:00
|
|
|
|
|
|
|
Then U-Boot starts and its messages appear in the console program.
|
|
|
|
|
|
|
|
Use the default environment variables:
|
|
|
|
|
|
|
|
=> env default -f -a
|
|
|
|
=> saveenv
|
|
|
|
|
2018-09-04 13:23:12 +00:00
|
|
|
2. Flashing U-Boot into the eMMC
|
|
|
|
|
2018-06-29 18:19:19 +00:00
|
|
|
Run the DFU agent so we can flash the new images using dfu-util tool:
|
2017-05-08 16:17:28 +00:00
|
|
|
|
2018-06-29 18:19:19 +00:00
|
|
|
=> dfu 0 mmc 0
|
2017-05-08 16:17:28 +00:00
|
|
|
|
2019-04-26 12:36:23 +00:00
|
|
|
Flash SPL and u-boot-dtb.img into the eMMC running the following commands on a PC:
|
2018-06-29 18:19:19 +00:00
|
|
|
|
|
|
|
$ sudo dfu-util -D SPL -a spl
|
|
|
|
|
2019-04-26 12:36:23 +00:00
|
|
|
$ sudo dfu-util -D u-boot-dtb.img -a u-boot
|
2017-05-08 16:17:28 +00:00
|
|
|
|
|
|
|
Remove power from the pico board.
|
|
|
|
|
|
|
|
Put pico board into normal boot mode.
|
|
|
|
|
|
|
|
Power up the board and the new updated U-Boot should boot from eMMC.
|
2019-09-11 17:29:52 +00:00
|
|
|
|
|
|
|
Booting in Falcon mode
|
|
|
|
======================
|
|
|
|
|
|
|
|
Generate a uImage kernel:
|
|
|
|
|
|
|
|
$ make imx_v6_v7_defconfig (Using the default imx_v6_v7_defconfig configuration
|
|
|
|
just for an example. In order to boot faster the user should customize the
|
|
|
|
defconfig by only enabling the minimal required drivers).
|
|
|
|
|
|
|
|
$ make -j4 uImage LOADADDR=0x80008000
|
|
|
|
|
|
|
|
$ cp arch/arm/boot/uImage /tftpboot
|
|
|
|
$ cp arch/arm/boot/dts/imx7d-pico-pi.dtb /tftpboot
|
|
|
|
|
|
|
|
In the U-Boot prompt:
|
|
|
|
|
|
|
|
Setup the server and board IP addresses:
|
|
|
|
=> setenv serverip 192.168.0.10
|
|
|
|
=> setenv ipaddr 192.168.0.11
|
|
|
|
|
|
|
|
Get the dtb file:
|
|
|
|
=> tftp ${fdt_addr} imx7d-pico-pi.dtb
|
|
|
|
|
|
|
|
Get the kernel:
|
|
|
|
=> tftp ${loadaddr} uImage
|
|
|
|
|
|
|
|
Write the kernel at 2MB offset:
|
|
|
|
=> mmc write ${loadaddr} 0x1000 0x5000
|
|
|
|
|
|
|
|
Setup the bootargs:
|
|
|
|
=> setenv bootargs 'console=ttymxc4,115200 root=/dev/mmcblk2p1 rootfstype=ext4 rootwait rw'
|
|
|
|
|
|
|
|
Prepare args:
|
|
|
|
=> spl export fdt ${loadaddr} - ${fdt_addr}
|
|
|
|
## Booting kernel from Legacy Image at 80800000 ...
|
|
|
|
Image Name: Linux-5.2.14
|
|
|
|
Image Type: ARM Linux Kernel Image (uncompressed)
|
|
|
|
Data Size: 9077544 Bytes = 8.7 MiB
|
|
|
|
Load Address: 80008000
|
|
|
|
Entry Point: 80008000
|
|
|
|
Verifying Checksum ... OK
|
|
|
|
## Flattened Device Tree blob at 83000000
|
|
|
|
Booting using the fdt blob at 0x83000000
|
|
|
|
Loading Kernel Image
|
|
|
|
Using Device Tree in place at 83000000, end 8300b615
|
|
|
|
subcommand not supported
|
|
|
|
subcommand not supported
|
|
|
|
Using Device Tree in place at 83000000, end 8300e615
|
|
|
|
Argument image is now in RAM: 0x83000000
|
|
|
|
=>
|
|
|
|
|
|
|
|
Write 1MB of args data (0x800 sectors) to 1MB offset (0x800 sectors):
|
|
|
|
|
|
|
|
=> mmc write ${fdt_addr} 0x800 0x800
|
|
|
|
|
|
|
|
In order to boot with Falcon mode, activate the CONFIG_SPL_OS_BOOT
|
|
|
|
option in the defconfig
|
|
|
|
|
|
|
|
--- a/configs/pico-imx7d_defconfig
|
|
|
|
+++ b/configs/pico-imx7d_defconfig
|
|
|
|
@@ -67,3 +67,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
|
|
|
|
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
|
|
|
|
CONFIG_CI_UDC=y
|
|
|
|
CONFIG_VIDEO=y
|
|
|
|
+CONFIG_SPL_OS_BOOT=y
|
|
|
|
|
|
|
|
Then rebuild U-Boot:
|
|
|
|
|
|
|
|
$ make pico-imx7d_defconfig
|
|
|
|
$ make -j4
|
|
|
|
|
|
|
|
Launch UMS:
|
|
|
|
=> ums 0 mmc 0
|
|
|
|
|
|
|
|
Flash the new binaries:
|
|
|
|
|
|
|
|
$ sudo dd if=SPL of=/dev/sdX bs=1k seek=1; sync
|
|
|
|
$ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1k seek=69; sync
|
|
|
|
|
|
|
|
And then SPL binary will load and jump directly to the kernel:
|
|
|
|
|
|
|
|
U-Boot SPL 2019.10-rc3-00284-g001c8ea94a-dirty (Sep 10 2019 - 12:46:01 -0300)
|
|
|
|
Trying to boot from MMC1
|
|
|
|
[ 0.000000] Booting Linux on physical CPU 0x0
|
|
|
|
[ 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
|
|
|
|
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
|
|
|
|
[ 0.000000] CPU: div instructions available: patching division code
|
|
|
|
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
|
|
|
|
[ 0.000000] OF: fdt: Machine model: TechNexion PICO-IMX7D Board and PI baseboard
|
|
|
|
...
|