blob: e58640c55ec79747b5b3c676003db654fdf2dbe8 [file] [log] [blame]
Vanessa Maegima96bd20e2016-06-15 12:48:15 -03001How 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
Fabio Estevam0fe7c852019-02-14 10:01:51 -020016This generates the SPL and u-boot-dtb.img binaries.
Fabio Estevamc45978b2018-09-04 10:23:13 -030017
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.
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030023
24Put pico board in USB download mode (refer to the document
Fabio Estevam115cabe2020-06-21 21:32:26 -030025https://www.nxp.com/files-static/32bit/doc/quick_start_guide/PICO-IMX6UL-QSG.pdf
26Figure 6a at page 7).
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030027
Otavio Salvador145c5362018-09-04 10:23:17 -030028Connect a USB to serial adapter between the host PC and pico.
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030029
Otavio Salvador145c5362018-09-04 10:23:17 -030030Connect a USB cable between the OTG pico port and the host PC.
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030031
Otavio Salvador145c5362018-09-04 10:23:17 -030032Open a terminal program such as minicom.
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030033
Fabio Estevam0fe7c852019-02-14 10:01:51 -020034Copy SPL and u-boot-dtb.img to the imx_usb_loader folder.
Fabio Estevamc45978b2018-09-04 10:23:13 -030035
36Load the SPL binary via USB:
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030037
Fabio Estevamc45978b2018-09-04 10:23:13 -030038$ sudo ./imx_usb SPL
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030039
Fabio Estevam0fe7c852019-02-14 10:01:51 -020040Load the u-boot-dtb.img binary via USB:
Fabio Estevamc45978b2018-09-04 10:23:13 -030041
Fabio Estevam0fe7c852019-02-14 10:01:51 -020042$ sudo ./imx_usb u-boot-dtb.img
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030043
Otavio Salvador145c5362018-09-04 10:23:17 -030044Then U-Boot starts and its messages appear in the console program.
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030045
46Use the default environment variables:
47
48=> env default -f -a
49=> saveenv
50
Fabio Estevamc45978b2018-09-04 10:23:13 -0300512. Flashing U-Boot into the eMMC
52
Otavio Salvador145c5362018-09-04 10:23:17 -030053Run the DFU agent so we can flash the new images using dfu-util tool:
54
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030055=> dfu 0 mmc 0
56
Fabio Estevam0fe7c852019-02-14 10:01:51 -020057Flash SPL and u-boot-dtb.img into the eMMC running the following commands on a PC:
Fabio Estevamc45978b2018-09-04 10:23:13 -030058
59$ sudo dfu-util -D SPL -a spl
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030060
Fabio Estevam0fe7c852019-02-14 10:01:51 -020061$ sudo dfu-util -D u-boot-dtb.img -a u-boot
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030062
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030063Remove power from the pico board.
64
Otavio Salvador145c5362018-09-04 10:23:17 -030065Put pico board into normal boot mode.
Vanessa Maegima96bd20e2016-06-15 12:48:15 -030066
67Power up the board and the new updated U-Boot should boot from eMMC.
Fabio Estevam561c2212018-09-13 16:57:06 -030068
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
Fabio Estevamde2bde42019-09-11 14:32:29 -030078$ make -j4 uImage LOADADDR=0x80008000
Fabio Estevam561c2212018-09-13 16:57:06 -030079
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:
Fabio Estevamde2bde42019-09-11 14:32:29 -030096=> mmc write ${loadaddr} 0x1000 0x5000
Fabio Estevam561c2212018-09-13 16:57:06 -030097
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
Fabio Estevamde2bde42019-09-11 14:32:29 -0300107 Load Address: 80008000
108 Entry Point: 80008000
Fabio Estevam561c2212018-09-13 16:57:06 -0300109 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
Fabio Estevam0fe7c852019-02-14 10:01:51 -0200145$ sudo dd if=u-boot-dtb.img of=/dev/sdX bs=1k seek=69; sync
Fabio Estevam561c2212018-09-13 16:57:06 -0300146
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...