xref: /OK3568_Linux_fs/u-boot/doc/uImage.FIT/command_syntax_extensions.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunCommand syntax extensions for the new uImage format
2*4882a593Smuzhiyun===================================================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunAuthor: Bartlomiej Sieka <tur@semihalf.com>
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunWith the introduction of the new uImage format, bootm command (and other
7*4882a593Smuzhiyuncommands as well) have to understand new syntax of the arguments. This is
8*4882a593Smuzhiyunnecessary in order to specify objects contained in the new uImage, on which
9*4882a593Smuzhiyunbootm has to operate. This note attempts to first summarize bootm usage
10*4882a593Smuzhiyunscenarios, and then introduces new argument syntax.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun
13*4882a593Smuzhiyunbootm usage scenarios
14*4882a593Smuzhiyun---------------------
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunBelow is a summary of bootm usage scenarios, focused on booting a PowerPC
17*4882a593SmuzhiyunLinux kernel. The purpose of the following list is to document a complete list
18*4882a593Smuzhiyunof supported bootm usages.
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunNote: U-Boot supports two methods of booting a PowerPC Linux kernel: old way,
21*4882a593Smuzhiyuni.e., without passing the Flattened Device Tree (FDT), and new way, where the
22*4882a593Smuzhiyunkernel is passed a pointer to the FDT. The boot method is indicated for each
23*4882a593Smuzhiyunscenario.
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun1.  bootm		boot image at the current address, equivalent to 2,3,8
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunOld uImage:
29*4882a593Smuzhiyun2.  bootm <addr1>		    /* single image at <addr1> */
30*4882a593Smuzhiyun3.  bootm <addr1>		    /* multi-image at <addr1>  */
31*4882a593Smuzhiyun4.  bootm <addr1> -		    /* multi-image at <addr1>  */
32*4882a593Smuzhiyun5.  bootm <addr1> <addr2>	    /* single image at <addr1> */
33*4882a593Smuzhiyun6.  bootm <addr1> <addr2> <addr3>   /* single image at <addr1> */
34*4882a593Smuzhiyun7.  bootm <addr1> -	  <addr3>   /* single image at <addr1> */
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunNew uImage:
37*4882a593Smuzhiyun8.  bootm <addr1>
38*4882a593Smuzhiyun9.  bootm [<addr1>]:<subimg1>
39*4882a593Smuzhiyun10. bootm [<addr1>]#<conf>[#<extra-conf[#...]]
40*4882a593Smuzhiyun11. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2>
41*4882a593Smuzhiyun12. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> [<addr3>]:<subimg3>
42*4882a593Smuzhiyun13. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> <addr3>
43*4882a593Smuzhiyun14. bootm [<addr1>]:<subimg1> -			  [<addr3>]:<subimg3>
44*4882a593Smuzhiyun15. bootm [<addr1>]:<subimg1> -			  <addr3>
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun
47*4882a593SmuzhiyunAd. 1. This is equivalent to cases 2,3,8, depending on the type of image at
48*4882a593Smuzhiyunthe current image address.
49*4882a593Smuzhiyun- boot method: see cases 2,3,8
50*4882a593Smuzhiyun
51*4882a593SmuzhiyunAd. 2. Boot kernel image located at <addr1>.
52*4882a593Smuzhiyun- boot method: non-FDT
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunAd. 3. First and second components of the image at <addr1> are assumed to be a
55*4882a593Smuzhiyunkernel and a ramdisk, respectively. The kernel is booted with initrd loaded
56*4882a593Smuzhiyunwith the ramdisk from the image.
57*4882a593Smuzhiyun- boot method: depends on the number of components at <addr1>, and on whether
58*4882a593Smuzhiyun  U-Boot is compiled with OF support:
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun		    |	       2 components |	       3 components |
61*4882a593Smuzhiyun		    |	   (kernel, initrd) | (kernel, initrd, fdt) |
62*4882a593Smuzhiyun---------------------------------------------------------------------
63*4882a593Smuzhiyun#ifdef CONFIG_OF_*  |		    non-FDT |			FDT |
64*4882a593Smuzhiyun#ifndef CONFIG_OF_* |		    non-FDT |		    non-FDT |
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunAd. 4. Similar to case 3, but the kernel is booted without initrd.  Second
67*4882a593Smuzhiyuncomponent of the multi-image is irrelevant (it can be a dummy, 1-byte file).
68*4882a593Smuzhiyun- boot method: see case 3
69*4882a593Smuzhiyun
70*4882a593SmuzhiyunAd. 5. Boot kernel image located at <addr1> with initrd loaded with ramdisk
71*4882a593Smuzhiyunfrom the image at <addr2>.
72*4882a593Smuzhiyun- boot method: non-FDT
73*4882a593Smuzhiyun
74*4882a593SmuzhiyunAd. 6. <addr1> is the address of a kernel image, <addr2> is the address of a
75*4882a593Smuzhiyunramdisk image, and <addr3> is the address of a FDT binary blob.  Kernel is
76*4882a593Smuzhiyunbooted with initrd loaded with ramdisk from the image at <addr2>.
77*4882a593Smuzhiyun- boot method: FDT
78*4882a593Smuzhiyun
79*4882a593SmuzhiyunAd. 7. <addr1> is the address of a kernel image and <addr3> is the address of
80*4882a593Smuzhiyuna FDT binary blob. Kernel is booted without initrd.
81*4882a593Smuzhiyun- boot method: FDT
82*4882a593Smuzhiyun
83*4882a593SmuzhiyunAd. 8. Image at <addr1> is assumed to contain a default configuration, which
84*4882a593Smuzhiyunis booted.
85*4882a593Smuzhiyun- boot method: FDT or non-FDT, depending on whether the default configuration
86*4882a593Smuzhiyun  defines FDT
87*4882a593Smuzhiyun
88*4882a593SmuzhiyunAd. 9. Similar to case 2: boot kernel stored in <subimg1> from the image at
89*4882a593Smuzhiyunaddress <addr1>.
90*4882a593Smuzhiyun- boot method: non-FDT
91*4882a593Smuzhiyun
92*4882a593SmuzhiyunAd. 10. Boot configuration <conf> from the image at <addr1>.
93*4882a593Smuzhiyun- boot method: FDT or non-FDT, depending on whether the configuration given
94*4882a593Smuzhiyun  defines FDT
95*4882a593Smuzhiyun
96*4882a593SmuzhiyunAd. 11. Equivalent to case 5: boot kernel stored in <subimg1> from the image
97*4882a593Smuzhiyunat <addr1> with initrd loaded with ramdisk <subimg2> from the image at
98*4882a593Smuzhiyun<addr2>.
99*4882a593Smuzhiyun- boot method: non-FDT
100*4882a593Smuzhiyun
101*4882a593SmuzhiyunAd. 12. Equivalent to case 6: boot kernel stored in <subimg1> from the image
102*4882a593Smuzhiyunat <addr1> with initrd loaded with ramdisk <subimg2> from the image at
103*4882a593Smuzhiyun<addr2>, and pass FDT blob <subimg3> from the image at <addr3>.
104*4882a593Smuzhiyun- boot method: FDT
105*4882a593Smuzhiyun
106*4882a593SmuzhiyunAd. 13. Similar to case 12, the difference being that <addr3> is the address
107*4882a593Smuzhiyunof FDT binary blob that is to be passed to the kernel.
108*4882a593Smuzhiyun- boot method: FDT
109*4882a593Smuzhiyun
110*4882a593SmuzhiyunAd. 14. Equivalent to case 7: boot kernel stored in <subimg1> from the image
111*4882a593Smuzhiyunat <addr1>, without initrd, and pass FDT blob <subimg3> from the image at
112*4882a593Smuzhiyun<addr3>.
113*4882a593Smuzhiyun- boot method: FDT
114*4882a593Smuzhiyun
115*4882a593SmuzhiyunAd. 15. Similar to case 14, the difference being that <addr3> is the address
116*4882a593Smuzhiyunof the FDT binary blob that is to be passed to the kernel.
117*4882a593Smuzhiyun- boot method: FDT
118*4882a593Smuzhiyun
119*4882a593Smuzhiyun
120*4882a593SmuzhiyunNew uImage argument syntax
121*4882a593Smuzhiyun--------------------------
122*4882a593Smuzhiyun
123*4882a593SmuzhiyunNew uImage support introduces two new forms for bootm arguments, with the
124*4882a593Smuzhiyunfollowing syntax:
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun- new uImage sub-image specification
127*4882a593Smuzhiyun<addr>:<sub-image unit_name>
128*4882a593Smuzhiyun
129*4882a593Smuzhiyun- new uImage configuration specification
130*4882a593Smuzhiyun<addr>#<configuration unit_name>
131*4882a593Smuzhiyun
132*4882a593Smuzhiyun- new uImage configuration specification with extra configuration components
133*4882a593Smuzhiyun<addr>#<configuration unit_name>[#<extra configuration unit_name>[#..]]
134*4882a593Smuzhiyun
135*4882a593SmuzhiyunThe extra configuration currently is supported only for additional device tree
136*4882a593Smuzhiyunoverlays to apply on the base device tree supplied by the first configuration
137*4882a593Smuzhiyununit.
138*4882a593Smuzhiyun
139*4882a593SmuzhiyunExamples:
140*4882a593Smuzhiyun
141*4882a593Smuzhiyun- boot kernel "kernel@1" stored in a new uImage located at 200000:
142*4882a593Smuzhiyunbootm 200000:kernel@1
143*4882a593Smuzhiyun
144*4882a593Smuzhiyun- boot configuration "cfg@1" from a new uImage located at 200000:
145*4882a593Smuzhiyunbootm 200000#cfg@1
146*4882a593Smuzhiyun
147*4882a593Smuzhiyun- boot configuration "cfg@1" with extra "cfg@2" from a new uImage located
148*4882a593Smuzhiyun  at 200000:
149*4882a593Smuzhiyunbootm 200000#cfg@1#cfg@2
150*4882a593Smuzhiyun
151*4882a593Smuzhiyun- boot "kernel@1" from a new uImage at 200000 with initrd "ramdisk@2" found in
152*4882a593Smuzhiyun  some other new uImage stored at address 800000:
153*4882a593Smuzhiyunbootm 200000:kernel@1 800000:ramdisk@2
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun- boot "kernel@2" from a new uImage at 200000, with initrd "ramdisk@1" and FDT
156*4882a593Smuzhiyun  "fdt@1", both stored in some other new uImage located at 800000:
157*4882a593Smuzhiyunbootm 200000:kernel@1 800000:ramdisk@1 800000:fdt@1
158*4882a593Smuzhiyun
159*4882a593Smuzhiyun- boot kernel "kernel@2" with initrd "ramdisk@2", both stored in a new uImage
160*4882a593Smuzhiyun  at address 200000, with a raw FDT blob stored at address 600000:
161*4882a593Smuzhiyunbootm 200000:kernel@2 200000:ramdisk@2 600000
162*4882a593Smuzhiyun
163*4882a593Smuzhiyun- boot kernel "kernel@2" from new uImage at 200000 with FDT "fdt@1" from the
164*4882a593Smuzhiyun  same new uImage:
165*4882a593Smuzhiyunbootm 200000:kernel@2 - 200000:fdt@1
166*4882a593Smuzhiyun
167*4882a593Smuzhiyun
168*4882a593SmuzhiyunNote on current image address
169*4882a593Smuzhiyun-----------------------------
170*4882a593Smuzhiyun
171*4882a593SmuzhiyunWhen bootm is called without arguments, the image at current image address is
172*4882a593Smuzhiyunbooted. The current image address is the address set most recently by a load
173*4882a593Smuzhiyuncommand, etc, and is by default equal to CONFIG_SYS_LOAD_ADDR. For example, consider
174*4882a593Smuzhiyunthe following commands:
175*4882a593Smuzhiyun
176*4882a593Smuzhiyuntftp 200000 /tftpboot/kernel
177*4882a593Smuzhiyunbootm
178*4882a593SmuzhiyunLast command is equivalent to:
179*4882a593Smuzhiyunbootm 200000
180*4882a593Smuzhiyun
181*4882a593SmuzhiyunIn case of the new uImage argument syntax, the address portion of any argument
182*4882a593Smuzhiyuncan be omitted. If <addr3> is omitted, then it is assumed that image at
183*4882a593Smuzhiyun<addr2> should be used. Similarly, when <addr2> is omitted, it is assumed that
184*4882a593Smuzhiyunimage at <addr1> should be used. If <addr1> is omitted, it is assumed that the
185*4882a593Smuzhiyuncurrent image address is to be used. For example, consider the following
186*4882a593Smuzhiyuncommands:
187*4882a593Smuzhiyun
188*4882a593Smuzhiyuntftp 200000 /tftpboot/uImage
189*4882a593Smuzhiyunbootm :kernel@1
190*4882a593SmuzhiyunLast command is equivalent to:
191*4882a593Smuzhiyunbootm 200000:kernel@1
192*4882a593Smuzhiyun
193*4882a593Smuzhiyuntftp 200000 /tftpboot/uImage
194*4882a593Smuzhiyunbootm 400000:kernel@1 :ramdisk@1
195*4882a593SmuzhiyunLast command is equivalent to:
196*4882a593Smuzhiyunbootm 400000:kernel@1 400000:ramdisk@1
197*4882a593Smuzhiyun
198*4882a593Smuzhiyuntftp 200000 /tftpboot/uImage
199*4882a593Smuzhiyunbootm :kernel@1 400000:ramdisk@1 :fdt@1
200*4882a593SmuzhiyunLast command is equivalent to:
201*4882a593Smuzhiyunbootm 200000:kernel@1 400000:ramdisk@1 400000:fdt@1
202