1 Copyright (c) 2016 Xilinx Inc.
3 This work is licensed under the terms of the GNU GPL, version 2 or later. See
4 the COPYING file in the top-level directory.
7 The 'loader' device allows the user to load multiple images or values into
10 Loading Data into Memory Values
12 The loader device allows memory values to be set from the command line. This
13 can be done by following the syntax below:
15 -device loader,addr=<addr>,data=<data>,data-len=<data-len>
16 [,data-be=<data-be>][,cpu-num=<cpu-num>]
18 <addr> - The address to store the data in.
19 <data> - The value to be written to the address. The maximum size of
21 <data-len> - The length of the data in bytes. This argument must be
22 included if the data argument is.
23 <data-be> - Set to true if the data to be stored on the guest should be
24 written as big endian data. The default is to write little
26 <cpu-num> - The number of the CPU's address space where the data should
27 be loaded. If not specified the address space of the first
30 All values are parsed using the standard QemuOps parsing. This allows the user
31 to specify any values in any format supported. By default the values
32 will be parsed as decimal. To use hex values the user should prefix the number
35 An example of loading value 0x8000000e to address 0xfd1a0104 is:
36 -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4
38 Setting a CPU's Program Counter
40 The loader device allows the CPU's PC to be set from the command line. This
41 can be done by following the syntax below:
43 -device loader,addr=<addr>,cpu-num=<cpu-num>
45 <addr> - The value to use as the CPU's PC.
46 <cpu-num> - The number of the CPU whose PC should be set to the
49 All values are parsed using the standard QemuOps parsing. This allows the user
50 to specify any values in any format supported. By default the values
51 will be parsed as decimal. To use hex values the user should prefix the number
54 An example of setting CPU 0's PC to 0x8000 is:
55 -device loader,addr=0x8000,cpu-num=0
59 The loader device also allows files to be loaded into memory. This can be done
60 similarly to setting memory values. The syntax is shown below:
62 -device loader,file=<file>[,addr=<addr>][,cpu-num=<cpu-num>][,force-raw=<raw>]
64 <file> - A file to be loaded into memory
65 <addr> - The addr in memory that the file should be loaded. This is
66 ignored if you are using an ELF (unless force-raw is true).
67 This is required if you aren't loading an ELF.
68 <cpu-num> - This specifies the CPU that should be used. This is an
69 optional argument and will cause the CPU's PC to be set to
70 where the image is stored or in the case of an ELF file to
71 the value in the header. This option should only be used
73 This will also cause the image to be written to the specified
74 CPU's address space. If not specified, the default is CPU 0.
75 <force-raw> - Forces the file to be treated as a raw image. This can be
76 used to specify the load address of ELF files.
78 All values are parsed using the standard QemuOps parsing. This allows the user
79 to specify any values in any format supported. By default the values
80 will be parsed as decimal. To use hex values the user should prefix the number
83 An example of loading an ELF file which CPU0 will boot is shown below:
84 -device loader,file=./images/boot.elf,cpu-num=0