1How to Update U-Boot on Pico-imx6ul board
2-----------------------------------------
3
4Required software on the host PC:
5
6- imx_usb_loader: https://github.com/boundarydevices/imx_usb_loader
7
8- dfu-util: http://dfu-util.sourceforge.net/releases/
9
10Build U-Boot for Pico:
11
12$ make mrproper
13$ make pico-imx6ul_defconfig
14$ make
15
16This generates the SPL and u-boot-dtb.img binaries.
17
181. Loading U-Boot via USB Serial Download Protocol
19
20Note: This method is convenient for development purposes.
21If the eMMC has already a U-Boot flashed with DFU support then
22the user can go to step 2 below in order to update U-Boot.
23
24Put pico board in USB download mode (refer to the document
25http://www.wandboard.org/images/hobbit/hobbitboard-imx6ul-reva1.pdf
26page 15).
27
28Connect a USB to serial adapter between the host PC and pico.
29
30Connect a USB cable between the OTG pico port and the host PC.
31
32Open a terminal program such as minicom.
33
34Copy SPL and u-boot-dtb.img to the imx_usb_loader folder.
35
36Load the SPL binary via USB:
37
38$ sudo ./imx_usb SPL
39
40Load the u-boot-dtb.img binary via USB:
41
42$ sudo ./imx_usb u-boot-dtb.img
43
44Then U-Boot starts and its messages appear in the console program.
45
46Use the default environment variables:
47
48=> env default -f -a
49=> saveenv
50
512. Flashing U-Boot into the eMMC
52
53Run the DFU agent so we can flash the new images using dfu-util tool:
54
55=> dfu 0 mmc 0
56
57Flash SPL and u-boot-dtb.img into the eMMC running the following commands on a PC:
58
59$ sudo dfu-util -D SPL -a spl
60
61$ sudo dfu-util -D u-boot-dtb.img -a u-boot
62
63Remove power from the pico board.
64
65Put pico board into normal boot mode.
66
67Power up the board and the new updated U-Boot should boot from eMMC.
68
69Booting in Falcon mode
70======================
71
72Generate a uImage kernel:
73
74$ make imx_v6_v7_defconfig (Using the default imx_v6_v7_defconfig configuration
75just for an example. In order to boot faster the user should customize the
76defconfig by only enabling the minimal required drivers).
77
78$ make -j4 uImage LOADADDR=0x80800000
79
80$ cp arch/arm/boot/uImage /tftpboot
81$ cp arch/arm/boot/dts/imx6ul-pico-hobbit.dtb /tftpboot
82
83In the U-Boot prompt:
84
85Setup the server and board IP addresses:
86=> setenv serverip 192.168.0.10
87=> setenv ipaddr 192.168.0.11
88
89Get the dtb file:
90=> tftp ${fdt_addr} imx6ul-pico-hobbit.dtb
91
92Get the kernel:
93=> tftp ${loadaddr} uImage
94
95Write the kernel at 2MB offset:
96=> mmc write ${loadaddr} 0x1000 0x4000
97
98Setup the bootargs:
99=> setenv bootargs 'console=ttymxc5,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rw'
100
101Prepare args:
102=> spl export fdt ${loadaddr} - ${fdt_addr}
103## Booting kernel from Legacy Image at 82000000 ...
104   Image Name:   Linux-4.19.0-rc2-next-20180905-0
105   Image Type:   ARM Linux Kernel Image (uncompressed)
106   Data Size:    8365608 Bytes = 8 MiB
107   Load Address: 80800000
108   Entry Point:  80800000
109   Verifying Checksum ... OK
110## Flattened Device Tree blob at 83000000
111   Booting using the fdt blob at 0x83000000
112   Loading Kernel Image ... OK
113   Using Device Tree in place at 83000000, end 83009c63
114subcommand not supported
115subcommand not supported
116   Using Device Tree in place at 83000000, end 8300cc63
117Argument image is now in RAM: 0x83000000
118
119Write 1MB of args data (0x800 sectors) to 1MB offset (0x800 sectors):
120
121=> mmc write ${fdt_addr} 0x800 0x800
122
123In order to boot with Falcon mode, activate the CONFIG_SPL_OS_BOOT
124option in the defconfig
125
126--- a/configs/pico-hobbit-imx6ul_defconfig
127+++ b/configs/pico-hobbit-imx6ul_defconfig
128@@ -53,3 +53,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
129 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
130 CONFIG_CI_UDC=y
131 CONFIG_OF_LIBFDT=y
132+CONFIG_SPL_OS_BOOT=y
133
134Then rebuild U-Boot:
135
136$ make pico-hobbit-imx6ul_defconfig
137$ make -j4
138
139Launch UMS:
140=> ums 0 mmc 0
141
142Flash the new binaries:
143
144$ sudo dd if=SPL of=/dev/sdX bs=1k seek=1; sync
145$ sudo dd if=u-boot-dtb.img  of=/dev/sdX bs=1k seek=69; sync
146
147And then SPL binary will load and jump directly to the kernel:
148
149U-Boot SPL 2018.09-rc2-00156-g8c46f15-dirty (Sep 05 2018 - 16:24:05 -0300)
150Trying to boot from MMC1
151[    0.000000] Booting Linux on physical CPU 0x0
152[    0.000000] Linux version 4.19.0-rc2-next-20180905-00001-gb805e2d (fabio@fabio-Latitude-E5450) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)) #533 SMP Wed Sep 5 16:21:03 -03 2018
153[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
154[    0.000000] CPU: div instructions available: patching division code
155[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
156[    0.000000] OF: fdt: Machine model: Technexion Pico i.MX6UL Board
157[    0.000000] Memory policy: Data cache writealloc
158[    0.000000] cma: Reserved 64 MiB at 0x8c000000
159...
160