xref: /openbmc/u-boot/tools/binman/README.entries (revision 0ef87aa332e024c94d07a897c9f595be37077de8)
15a5da7ceSSimon GlassBinman Entry Documentation
25a5da7ceSSimon Glass===========================
35a5da7ceSSimon Glass
45a5da7ceSSimon GlassThis file describes the entry types supported by binman. These entry types can
55a5da7ceSSimon Glassbe placed in an image one by one to build up a final firmware image. It is
65a5da7ceSSimon Glassfairly easy to create new entry types. Just add a new file to the 'etype'
75a5da7ceSSimon Glassdirectory. You can use the existing entries as examples.
85a5da7ceSSimon Glass
95a5da7ceSSimon GlassNote that some entries are subclasses of others, using and extending their
105a5da7ceSSimon Glassfeatures to produce new behaviours.
115a5da7ceSSimon Glass
125a5da7ceSSimon Glass
135a5da7ceSSimon Glass
145a5da7ceSSimon GlassEntry: blob: Entry containing an arbitrary binary blob
155a5da7ceSSimon Glass------------------------------------------------------
165a5da7ceSSimon Glass
175a5da7ceSSimon GlassNote: This should not be used by itself. It is normally used as a parent
185a5da7ceSSimon Glassclass by other entry types.
195a5da7ceSSimon Glass
205a5da7ceSSimon GlassProperties / Entry arguments:
215a5da7ceSSimon Glass    - filename: Filename of file to read into entry
225a5da7ceSSimon Glass
235a5da7ceSSimon GlassThis entry reads data from a file and places it in the entry. The
245a5da7ceSSimon Glassdefault filename is often specified specified by the subclass. See for
255a5da7ceSSimon Glassexample the 'u_boot' entry which provides the filename 'u-boot.bin'.
265a5da7ceSSimon Glass
275a5da7ceSSimon Glass
285a5da7ceSSimon Glass
29ec127af0SSimon GlassEntry: blob-named-by-arg: A blob entry which gets its filename property from its subclass
30ec127af0SSimon Glass-----------------------------------------------------------------------------------------
31ec127af0SSimon Glass
32ec127af0SSimon GlassProperties / Entry arguments:
33ec127af0SSimon Glass    - <xxx>-path: Filename containing the contents of this entry (optional,
34ec127af0SSimon Glass        defaults to 0)
35ec127af0SSimon Glass
36ec127af0SSimon Glasswhere <xxx> is the blob_fname argument to the constructor.
37ec127af0SSimon Glass
38ec127af0SSimon GlassThis entry cannot be used directly. Instead, it is used as a parent class
39ec127af0SSimon Glassfor another entry, which defined blob_fname. This parameter is used to
40ec127af0SSimon Glassset the entry-arg or property containing the filename. The entry-arg or
41ec127af0SSimon Glassproperty is in turn used to set the actual filename.
42ec127af0SSimon Glass
43ec127af0SSimon GlassSee cros_ec_rw for an example of this.
44ec127af0SSimon Glass
45ec127af0SSimon Glass
46ec127af0SSimon Glass
47ec127af0SSimon GlassEntry: cros-ec-rw: A blob entry which contains a Chromium OS read-write EC image
48ec127af0SSimon Glass--------------------------------------------------------------------------------
49ec127af0SSimon Glass
50ec127af0SSimon GlassProperties / Entry arguments:
51ec127af0SSimon Glass    - cros-ec-rw-path: Filename containing the EC image
52ec127af0SSimon Glass
53ec127af0SSimon GlassThis entry holds a Chromium OS EC (embedded controller) image, for use in
54ec127af0SSimon Glassupdating the EC on startup via software sync.
55ec127af0SSimon Glass
56ec127af0SSimon Glass
57ec127af0SSimon Glass
583af8e49cSSimon GlassEntry: fill: An entry which is filled to a particular byte value
593af8e49cSSimon Glass----------------------------------------------------------------
603af8e49cSSimon Glass
613af8e49cSSimon GlassProperties / Entry arguments:
623af8e49cSSimon Glass    - fill-byte: Byte to use to fill the entry
633af8e49cSSimon Glass
643af8e49cSSimon GlassNote that the size property must be set since otherwise this entry does not
653af8e49cSSimon Glassknow how large it should be.
663af8e49cSSimon Glass
673af8e49cSSimon GlassYou can often achieve the same effect using the pad-byte property of the
683af8e49cSSimon Glassoverall image, in that the space between entries will then be padded with
693af8e49cSSimon Glassthat byte. But this entry is sometimes useful for explicitly setting the
703af8e49cSSimon Glassbyte value of a region.
713af8e49cSSimon Glass
723af8e49cSSimon Glass
733af8e49cSSimon Glass
7411e36cceSSimon GlassEntry: fmap: An entry which contains an Fmap section
7511e36cceSSimon Glass----------------------------------------------------
7611e36cceSSimon Glass
7711e36cceSSimon GlassProperties / Entry arguments:
7811e36cceSSimon Glass    None
7911e36cceSSimon Glass
8011e36cceSSimon GlassFMAP is a simple format used by flashrom, an open-source utility for
8111e36cceSSimon Glassreading and writing the SPI flash, typically on x86 CPUs. The format
8211e36cceSSimon Glassprovides flashrom with a list of areas, so it knows what it in the flash.
8311e36cceSSimon GlassIt can then read or write just a single area, instead of the whole flash.
8411e36cceSSimon Glass
8511e36cceSSimon GlassThe format is defined by the flashrom project, in the file lib/fmap.h -
8611e36cceSSimon Glasssee www.flashrom.org/Flashrom for more information.
8711e36cceSSimon Glass
8811e36cceSSimon GlassWhen used, this entry will be populated with an FMAP which reflects the
8911e36cceSSimon Glassentries in the current image. Note that any hierarchy is squashed, since
9011e36cceSSimon GlassFMAP does not support this.
9111e36cceSSimon Glass
9211e36cceSSimon Glass
9311e36cceSSimon Glass
94*0ef87aa3SSimon GlassEntry: gbb: An entry which contains a Chromium OS Google Binary Block
95*0ef87aa3SSimon Glass---------------------------------------------------------------------
96*0ef87aa3SSimon Glass
97*0ef87aa3SSimon GlassProperties / Entry arguments:
98*0ef87aa3SSimon Glass    - hardware-id: Hardware ID to use for this build (a string)
99*0ef87aa3SSimon Glass    - keydir: Directory containing the public keys to use
100*0ef87aa3SSimon Glass    - bmpblk: Filename containing images used by recovery
101*0ef87aa3SSimon Glass
102*0ef87aa3SSimon GlassChromium OS uses a GBB to store various pieces of information, in particular
103*0ef87aa3SSimon Glassthe root and recovery keys that are used to verify the boot process. Some
104*0ef87aa3SSimon Glassmore details are here:
105*0ef87aa3SSimon Glass
106*0ef87aa3SSimon Glass    https://www.chromium.org/chromium-os/firmware-porting-guide/2-concepts
107*0ef87aa3SSimon Glass
108*0ef87aa3SSimon Glassbut note that the page dates from 2013 so is quite out of date. See
109*0ef87aa3SSimon GlassREADME.chromium for how to obtain the required keys and tools.
110*0ef87aa3SSimon Glass
111*0ef87aa3SSimon Glass
112*0ef87aa3SSimon Glass
1135a5da7ceSSimon GlassEntry: intel-cmc: Entry containing an Intel Chipset Micro Code (CMC) file
1145a5da7ceSSimon Glass-------------------------------------------------------------------------
1155a5da7ceSSimon Glass
1165a5da7ceSSimon GlassProperties / Entry arguments:
1175a5da7ceSSimon Glass    - filename: Filename of file to read into entry
1185a5da7ceSSimon Glass
1195a5da7ceSSimon GlassThis file contains microcode for some devices in a special format. An
1205a5da7ceSSimon Glassexample filename is 'Microcode/C0_22211.BIN'.
1215a5da7ceSSimon Glass
1225a5da7ceSSimon GlassSee README.x86 for information about x86 binary blobs.
1235a5da7ceSSimon Glass
1245a5da7ceSSimon Glass
1255a5da7ceSSimon Glass
1265a5da7ceSSimon GlassEntry: intel-descriptor: Intel flash descriptor block (4KB)
1275a5da7ceSSimon Glass-----------------------------------------------------------
1285a5da7ceSSimon Glass
1295a5da7ceSSimon GlassProperties / Entry arguments:
1305a5da7ceSSimon Glass    filename: Filename of file containing the descriptor. This is typically
1315a5da7ceSSimon Glass        a 4KB binary file, sometimes called 'descriptor.bin'
1325a5da7ceSSimon Glass
1335a5da7ceSSimon GlassThis entry is placed at the start of flash and provides information about
1345a5da7ceSSimon Glassthe SPI flash regions. In particular it provides the base address and
1355a5da7ceSSimon Glasssize of the ME (Management Engine) region, allowing us to place the ME
1365a5da7ceSSimon Glassbinary in the right place.
1375a5da7ceSSimon Glass
1385a5da7ceSSimon GlassWith this entry in your image, the position of the 'intel-me' entry will be
1395a5da7ceSSimon Glassfixed in the image, which avoids you needed to specify an offset for that
1405a5da7ceSSimon Glassregion. This is useful, because it is not possible to change the position
1415a5da7ceSSimon Glassof the ME region without updating the descriptor.
1425a5da7ceSSimon Glass
1435a5da7ceSSimon GlassSee README.x86 for information about x86 binary blobs.
1445a5da7ceSSimon Glass
1455a5da7ceSSimon Glass
1465a5da7ceSSimon Glass
1475a5da7ceSSimon GlassEntry: intel-fsp: Entry containing an Intel Firmware Support Package (FSP) file
1485a5da7ceSSimon Glass-------------------------------------------------------------------------------
1495a5da7ceSSimon Glass
1505a5da7ceSSimon GlassProperties / Entry arguments:
1515a5da7ceSSimon Glass    - filename: Filename of file to read into entry
1525a5da7ceSSimon Glass
1535a5da7ceSSimon GlassThis file contains binary blobs which are used on some devices to make the
1545a5da7ceSSimon Glassplatform work. U-Boot executes this code since it is not possible to set up
1555a5da7ceSSimon Glassthe hardware using U-Boot open-source code. Documentation is typically not
1565a5da7ceSSimon Glassavailable in sufficient detail to allow this.
1575a5da7ceSSimon Glass
1585a5da7ceSSimon GlassAn example filename is 'FSP/QUEENSBAY_FSP_GOLD_001_20-DECEMBER-2013.fd'
1595a5da7ceSSimon Glass
1605a5da7ceSSimon GlassSee README.x86 for information about x86 binary blobs.
1615a5da7ceSSimon Glass
1625a5da7ceSSimon Glass
1635a5da7ceSSimon Glass
1645a5da7ceSSimon GlassEntry: intel-me: Entry containing an Intel Management Engine (ME) file
1655a5da7ceSSimon Glass----------------------------------------------------------------------
1665a5da7ceSSimon Glass
1675a5da7ceSSimon GlassProperties / Entry arguments:
1685a5da7ceSSimon Glass    - filename: Filename of file to read into entry
1695a5da7ceSSimon Glass
1705a5da7ceSSimon GlassThis file contains code used by the SoC that is required to make it work.
1715a5da7ceSSimon GlassThe Management Engine is like a background task that runs things that are
1725a5da7ceSSimon Glassnot clearly documented, but may include keyboard, deplay and network
1735a5da7ceSSimon Glassaccess. For platform that use ME it is not possible to disable it. U-Boot
1745a5da7ceSSimon Glassdoes not directly execute code in the ME binary.
1755a5da7ceSSimon Glass
1765a5da7ceSSimon GlassA typical filename is 'me.bin'.
1775a5da7ceSSimon Glass
1785a5da7ceSSimon GlassSee README.x86 for information about x86 binary blobs.
1795a5da7ceSSimon Glass
1805a5da7ceSSimon Glass
1815a5da7ceSSimon Glass
1825a5da7ceSSimon GlassEntry: intel-mrc: Entry containing an Intel Memory Reference Code (MRC) file
1835a5da7ceSSimon Glass----------------------------------------------------------------------------
1845a5da7ceSSimon Glass
1855a5da7ceSSimon GlassProperties / Entry arguments:
1865a5da7ceSSimon Glass    - filename: Filename of file to read into entry
1875a5da7ceSSimon Glass
1885a5da7ceSSimon GlassThis file contains code for setting up the SDRAM on some Intel systems. This
1895a5da7ceSSimon Glassis executed by U-Boot when needed early during startup. A typical filename
1905a5da7ceSSimon Glassis 'mrc.bin'.
1915a5da7ceSSimon Glass
1925a5da7ceSSimon GlassSee README.x86 for information about x86 binary blobs.
1935a5da7ceSSimon Glass
1945a5da7ceSSimon Glass
1955a5da7ceSSimon Glass
1965a5da7ceSSimon GlassEntry: intel-vbt: Entry containing an Intel Video BIOS Table (VBT) file
1975a5da7ceSSimon Glass-----------------------------------------------------------------------
1985a5da7ceSSimon Glass
1995a5da7ceSSimon GlassProperties / Entry arguments:
2005a5da7ceSSimon Glass    - filename: Filename of file to read into entry
2015a5da7ceSSimon Glass
2025a5da7ceSSimon GlassThis file contains code that sets up the integrated graphics subsystem on
2035a5da7ceSSimon Glasssome Intel SoCs. U-Boot executes this when the display is started up.
2045a5da7ceSSimon Glass
2055a5da7ceSSimon GlassSee README.x86 for information about Intel binary blobs.
2065a5da7ceSSimon Glass
2075a5da7ceSSimon Glass
2085a5da7ceSSimon Glass
2095a5da7ceSSimon GlassEntry: intel-vga: Entry containing an Intel Video Graphics Adaptor (VGA) file
2105a5da7ceSSimon Glass-----------------------------------------------------------------------------
2115a5da7ceSSimon Glass
2125a5da7ceSSimon GlassProperties / Entry arguments:
2135a5da7ceSSimon Glass    - filename: Filename of file to read into entry
2145a5da7ceSSimon Glass
2155a5da7ceSSimon GlassThis file contains code that sets up the integrated graphics subsystem on
2165a5da7ceSSimon Glasssome Intel SoCs. U-Boot executes this when the display is started up.
2175a5da7ceSSimon Glass
2185a5da7ceSSimon GlassThis is similar to the VBT file but in a different format.
2195a5da7ceSSimon Glass
2205a5da7ceSSimon GlassSee README.x86 for information about Intel binary blobs.
2215a5da7ceSSimon Glass
2225a5da7ceSSimon Glass
2235a5da7ceSSimon Glass
2245a5da7ceSSimon GlassEntry: section: Entry that contains other entries
2255a5da7ceSSimon Glass-------------------------------------------------
2265a5da7ceSSimon Glass
2275a5da7ceSSimon GlassProperties / Entry arguments: (see binman README for more information)
2285a5da7ceSSimon Glass    - size: Size of section in bytes
2295a5da7ceSSimon Glass    - align-size: Align size to a particular power of two
2305a5da7ceSSimon Glass    - pad-before: Add padding before the entry
2315a5da7ceSSimon Glass    - pad-after: Add padding after the entry
2325a5da7ceSSimon Glass    - pad-byte: Pad byte to use when padding
2335a5da7ceSSimon Glass    - sort-by-offset: Reorder the entries by offset
2345a5da7ceSSimon Glass    - end-at-4gb: Used to build an x86 ROM which ends at 4GB (2^32)
2355a5da7ceSSimon Glass    - name-prefix: Adds a prefix to the name of every entry in the section
2365a5da7ceSSimon Glass        when writing out the map
2375a5da7ceSSimon Glass
2385a5da7ceSSimon GlassA section is an entry which can contain other entries, thus allowing
2395a5da7ceSSimon Glasshierarchical images to be created. See 'Sections and hierarchical images'
2405a5da7ceSSimon Glassin the binman README for more information.
2415a5da7ceSSimon Glass
2425a5da7ceSSimon Glass
2435a5da7ceSSimon Glass
2445a5da7ceSSimon GlassEntry: text: An entry which contains text
2455a5da7ceSSimon Glass-----------------------------------------
2465a5da7ceSSimon Glass
2475a5da7ceSSimon GlassThe text can be provided either in the node itself or by a command-line
2485a5da7ceSSimon Glassargument. There is a level of indirection to allow multiple text strings
2495a5da7ceSSimon Glassand sharing of text.
2505a5da7ceSSimon Glass
2515a5da7ceSSimon GlassProperties / Entry arguments:
2525a5da7ceSSimon Glass    text-label: The value of this string indicates the property / entry-arg
2535a5da7ceSSimon Glass        that contains the string to place in the entry
2545a5da7ceSSimon Glass    <xxx> (actual name is the value of text-label): contains the string to
2555a5da7ceSSimon Glass        place in the entry.
2565a5da7ceSSimon Glass
2575a5da7ceSSimon GlassExample node:
2585a5da7ceSSimon Glass
2595a5da7ceSSimon Glass    text {
2605a5da7ceSSimon Glass        size = <50>;
2615a5da7ceSSimon Glass        text-label = "message";
2625a5da7ceSSimon Glass    };
2635a5da7ceSSimon Glass
2645a5da7ceSSimon GlassYou can then use:
2655a5da7ceSSimon Glass
2665a5da7ceSSimon Glass    binman -amessage="this is my message"
2675a5da7ceSSimon Glass
2685a5da7ceSSimon Glassand binman will insert that string into the entry.
2695a5da7ceSSimon Glass
2705a5da7ceSSimon GlassIt is also possible to put the string directly in the node:
2715a5da7ceSSimon Glass
2725a5da7ceSSimon Glass    text {
2735a5da7ceSSimon Glass        size = <8>;
2745a5da7ceSSimon Glass        text-label = "message";
2755a5da7ceSSimon Glass        message = "a message directly in the node"
2765a5da7ceSSimon Glass    };
2775a5da7ceSSimon Glass
2785a5da7ceSSimon GlassThe text is not itself nul-terminated. This can be achieved, if required,
2795a5da7ceSSimon Glassby setting the size of the entry to something larger than the text.
2805a5da7ceSSimon Glass
2815a5da7ceSSimon Glass
2825a5da7ceSSimon Glass
2835a5da7ceSSimon GlassEntry: u-boot: U-Boot flat binary
2845a5da7ceSSimon Glass---------------------------------
2855a5da7ceSSimon Glass
2865a5da7ceSSimon GlassProperties / Entry arguments:
2875a5da7ceSSimon Glass    - filename: Filename of u-boot.bin (default 'u-boot.bin')
2885a5da7ceSSimon Glass
2895a5da7ceSSimon GlassThis is the U-Boot binary, containing relocation information to allow it
2905a5da7ceSSimon Glassto relocate itself at runtime. The binary typically includes a device tree
2915a5da7ceSSimon Glassblob at the end of it. Use u_boot_nodtb if you want to package the device
2925a5da7ceSSimon Glasstree separately.
2935a5da7ceSSimon Glass
2945a5da7ceSSimon GlassU-Boot can access binman symbols at runtime. See:
2955a5da7ceSSimon Glass
2965a5da7ceSSimon Glass    'Access to binman entry offsets at run time (fdt)'
2975a5da7ceSSimon Glass
2985a5da7ceSSimon Glassin the binman README for more information.
2995a5da7ceSSimon Glass
3005a5da7ceSSimon Glass
3015a5da7ceSSimon Glass
3025a5da7ceSSimon GlassEntry: u-boot-dtb: U-Boot device tree
3035a5da7ceSSimon Glass-------------------------------------
3045a5da7ceSSimon Glass
3055a5da7ceSSimon GlassProperties / Entry arguments:
3065a5da7ceSSimon Glass    - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
3075a5da7ceSSimon Glass
3085a5da7ceSSimon GlassThis is the U-Boot device tree, containing configuration information for
3095a5da7ceSSimon GlassU-Boot. U-Boot needs this to know what devices are present and which drivers
3105a5da7ceSSimon Glassto activate.
3115a5da7ceSSimon Glass
3125a5da7ceSSimon Glass
3135a5da7ceSSimon Glass
3145a5da7ceSSimon GlassEntry: u-boot-dtb-with-ucode: A U-Boot device tree file, with the microcode removed
3155a5da7ceSSimon Glass-----------------------------------------------------------------------------------
3165a5da7ceSSimon Glass
3175a5da7ceSSimon GlassProperties / Entry arguments:
3185a5da7ceSSimon Glass    - filename: Filename of u-boot.dtb (default 'u-boot.dtb')
3195a5da7ceSSimon Glass
3205a5da7ceSSimon GlassSee Entry_u_boot_ucode for full details of the three entries involved in
3215a5da7ceSSimon Glassthis process. This entry provides the U-Boot device-tree file, which
3225a5da7ceSSimon Glasscontains the microcode. If the microcode is not being collated into one
3235a5da7ceSSimon Glassplace then the offset and size of the microcode is recorded by this entry,
3245a5da7ceSSimon Glassfor use by u_boot_with_ucode_ptr. If it is being collated, then this
3255a5da7ceSSimon Glassentry deletes the microcode from the device tree (to save space) and makes
3265a5da7ceSSimon Glassit available to u_boot_ucode.
3275a5da7ceSSimon Glass
3285a5da7ceSSimon Glass
3295a5da7ceSSimon Glass
3305a5da7ceSSimon GlassEntry: u-boot-img: U-Boot legacy image
3315a5da7ceSSimon Glass--------------------------------------
3325a5da7ceSSimon Glass
3335a5da7ceSSimon GlassProperties / Entry arguments:
3345a5da7ceSSimon Glass    - filename: Filename of u-boot.img (default 'u-boot.img')
3355a5da7ceSSimon Glass
3365a5da7ceSSimon GlassThis is the U-Boot binary as a packaged image, in legacy format. It has a
3375a5da7ceSSimon Glassheader which allows it to be loaded at the correct address for execution.
3385a5da7ceSSimon Glass
3395a5da7ceSSimon GlassYou should use FIT (Flat Image Tree) instead of the legacy image for new
3405a5da7ceSSimon Glassapplications.
3415a5da7ceSSimon Glass
3425a5da7ceSSimon Glass
3435a5da7ceSSimon Glass
3445a5da7ceSSimon GlassEntry: u-boot-nodtb: U-Boot flat binary without device tree appended
3455a5da7ceSSimon Glass--------------------------------------------------------------------
3465a5da7ceSSimon Glass
3475a5da7ceSSimon GlassProperties / Entry arguments:
3485a5da7ceSSimon Glass    - filename: Filename of u-boot.bin (default 'u-boot-nodtb.bin')
3495a5da7ceSSimon Glass
3505a5da7ceSSimon GlassThis is the U-Boot binary, containing relocation information to allow it
3515a5da7ceSSimon Glassto relocate itself at runtime. It does not include a device tree blob at
3525a5da7ceSSimon Glassthe end of it so normally cannot work without it. You can add a u_boot_dtb
3535a5da7ceSSimon Glassentry after this one, or use a u_boot entry instead (which contains both
3545a5da7ceSSimon GlassU-Boot and the device tree).
3555a5da7ceSSimon Glass
3565a5da7ceSSimon Glass
3575a5da7ceSSimon Glass
3585a5da7ceSSimon GlassEntry: u-boot-spl: U-Boot SPL binary
3595a5da7ceSSimon Glass------------------------------------
3605a5da7ceSSimon Glass
3615a5da7ceSSimon GlassProperties / Entry arguments:
3625a5da7ceSSimon Glass    - filename: Filename of u-boot-spl.bin (default 'spl/u-boot-spl.bin')
3635a5da7ceSSimon Glass
3645a5da7ceSSimon GlassThis is the U-Boot SPL (Secondary Program Loader) binary. This is a small
3655a5da7ceSSimon Glassbinary which loads before U-Boot proper, typically into on-chip SRAM. It is
3665a5da7ceSSimon Glassresponsible for locating, loading and jumping to U-Boot. Note that SPL is
3675a5da7ceSSimon Glassnot relocatable so must be loaded to the correct address in SRAM, or written
3685a5da7ceSSimon Glassto run from the correct address is direct flash execution is possible (e.g.
3695a5da7ceSSimon Glasson x86 devices).
3705a5da7ceSSimon Glass
3715a5da7ceSSimon GlassSPL can access binman symbols at runtime. See:
3725a5da7ceSSimon Glass
3735a5da7ceSSimon Glass    'Access to binman entry offsets at run time (symbols)'
3745a5da7ceSSimon Glass
3755a5da7ceSSimon Glassin the binman README for more information.
3765a5da7ceSSimon Glass
3775a5da7ceSSimon GlassThe ELF file 'spl/u-boot-spl' must also be available for this to work, since
3785a5da7ceSSimon Glassbinman uses that to look up symbols to write into the SPL binary.
3795a5da7ceSSimon Glass
3805a5da7ceSSimon Glass
3815a5da7ceSSimon Glass
3825a5da7ceSSimon GlassEntry: u-boot-spl-bss-pad: U-Boot SPL binary padded with a BSS region
3835a5da7ceSSimon Glass---------------------------------------------------------------------
3845a5da7ceSSimon Glass
3855a5da7ceSSimon GlassProperties / Entry arguments:
3865a5da7ceSSimon Glass    None
3875a5da7ceSSimon Glass
3885a5da7ceSSimon GlassThis is similar to u_boot_spl except that padding is added after the SPL
3895a5da7ceSSimon Glassbinary to cover the BSS (Block Started by Symbol) region. This region holds
3905a5da7ceSSimon Glassthe various used by SPL. It is set to 0 by SPL when it starts up. If you
3915a5da7ceSSimon Glasswant to append data to the SPL image (such as a device tree file), you must
3925a5da7ceSSimon Glasspad out the BSS region to avoid the data overlapping with U-Boot variables.
3935a5da7ceSSimon GlassThis entry is useful in that case. It automatically pads out the entry size
3945a5da7ceSSimon Glassto cover both the code, data and BSS.
3955a5da7ceSSimon Glass
3965a5da7ceSSimon GlassThe ELF file 'spl/u-boot-spl' must also be available for this to work, since
3975a5da7ceSSimon Glassbinman uses that to look up the BSS address.
3985a5da7ceSSimon Glass
3995a5da7ceSSimon Glass
4005a5da7ceSSimon Glass
4015a5da7ceSSimon GlassEntry: u-boot-spl-dtb: U-Boot SPL device tree
4025a5da7ceSSimon Glass---------------------------------------------
4035a5da7ceSSimon Glass
4045a5da7ceSSimon GlassProperties / Entry arguments:
4055a5da7ceSSimon Glass    - filename: Filename of u-boot.dtb (default 'spl/u-boot-spl.dtb')
4065a5da7ceSSimon Glass
4075a5da7ceSSimon GlassThis is the SPL device tree, containing configuration information for
4085a5da7ceSSimon GlassSPL. SPL needs this to know what devices are present and which drivers
4095a5da7ceSSimon Glassto activate.
4105a5da7ceSSimon Glass
4115a5da7ceSSimon Glass
4125a5da7ceSSimon Glass
4135a5da7ceSSimon GlassEntry: u-boot-spl-nodtb: SPL binary without device tree appended
4145a5da7ceSSimon Glass----------------------------------------------------------------
4155a5da7ceSSimon Glass
4165a5da7ceSSimon GlassProperties / Entry arguments:
4175a5da7ceSSimon Glass    - filename: Filename of spl/u-boot-spl-nodtb.bin (default
4185a5da7ceSSimon Glass        'spl/u-boot-spl-nodtb.bin')
4195a5da7ceSSimon Glass
4205a5da7ceSSimon GlassThis is the U-Boot SPL binary, It does not include a device tree blob at
4215a5da7ceSSimon Glassthe end of it so may not be able to work without it, assuming SPL needs
4225a5da7ceSSimon Glassa device tree to operation on your platform. You can add a u_boot_spl_dtb
4235a5da7ceSSimon Glassentry after this one, or use a u_boot_spl entry instead (which contains
4245a5da7ceSSimon Glassboth SPL and the device tree).
4255a5da7ceSSimon Glass
4265a5da7ceSSimon Glass
4275a5da7ceSSimon Glass
4285a5da7ceSSimon GlassEntry: u-boot-spl-with-ucode-ptr: U-Boot SPL with embedded microcode pointer
4295a5da7ceSSimon Glass----------------------------------------------------------------------------
4305a5da7ceSSimon Glass
4315a5da7ceSSimon GlassSee Entry_u_boot_ucode for full details of the entries involved in this
4325a5da7ceSSimon Glassprocess.
4335a5da7ceSSimon Glass
4345a5da7ceSSimon Glass
4355a5da7ceSSimon Glass
4365a5da7ceSSimon GlassEntry: u-boot-ucode: U-Boot microcode block
4375a5da7ceSSimon Glass-------------------------------------------
4385a5da7ceSSimon Glass
4395a5da7ceSSimon GlassProperties / Entry arguments:
4405a5da7ceSSimon Glass    None
4415a5da7ceSSimon Glass
4425a5da7ceSSimon GlassThe contents of this entry are filled in automatically by other entries
4435a5da7ceSSimon Glasswhich must also be in the image.
4445a5da7ceSSimon Glass
4455a5da7ceSSimon GlassU-Boot on x86 needs a single block of microcode. This is collected from
4465a5da7ceSSimon Glassthe various microcode update nodes in the device tree. It is also unable
4475a5da7ceSSimon Glassto read the microcode from the device tree on platforms that use FSP
4485a5da7ceSSimon Glass(Firmware Support Package) binaries, because the API requires that the
4495a5da7ceSSimon Glassmicrocode is supplied before there is any SRAM available to use (i.e.
4505a5da7ceSSimon Glassthe FSP sets up the SRAM / cache-as-RAM but does so in the call that
4515a5da7ceSSimon Glassrequires the microcode!). To keep things simple, all x86 platforms handle
4525a5da7ceSSimon Glassmicrocode the same way in U-Boot (even non-FSP platforms). This is that
4535a5da7ceSSimon Glassa table is placed at _dt_ucode_base_size containing the base address and
4545a5da7ceSSimon Glasssize of the microcode. This is either passed to the FSP (for FSP
4555a5da7ceSSimon Glassplatforms), or used to set up the microcode (for non-FSP platforms).
4565a5da7ceSSimon GlassThis all happens in the build system since it is the only way to get
4575a5da7ceSSimon Glassthe microcode into a single blob and accessible without SRAM.
4585a5da7ceSSimon Glass
4595a5da7ceSSimon GlassThere are two cases to handle. If there is only one microcode blob in
4605a5da7ceSSimon Glassthe device tree, then the ucode pointer it set to point to that. This
4615a5da7ceSSimon Glassentry (u-boot-ucode) is empty. If there is more than one update, then
4625a5da7ceSSimon Glassthis entry holds the concatenation of all updates, and the device tree
4635a5da7ceSSimon Glassentry (u-boot-dtb-with-ucode) is updated to remove the microcode. This
4645a5da7ceSSimon Glasslast step ensures that that the microcode appears in one contiguous
4655a5da7ceSSimon Glassblock in the image and is not unnecessarily duplicated in the device
4665a5da7ceSSimon Glasstree. It is referred to as 'collation' here.
4675a5da7ceSSimon Glass
4685a5da7ceSSimon GlassEntry types that have a part to play in handling microcode:
4695a5da7ceSSimon Glass
4705a5da7ceSSimon Glass    Entry_u_boot_with_ucode_ptr:
4715a5da7ceSSimon Glass        Contains u-boot-nodtb.bin (i.e. U-Boot without the device tree).
4725a5da7ceSSimon Glass        It updates it with the address and size of the microcode so that
4735a5da7ceSSimon Glass        U-Boot can find it early on start-up.
4745a5da7ceSSimon Glass    Entry_u_boot_dtb_with_ucode:
4755a5da7ceSSimon Glass        Contains u-boot.dtb. It stores the microcode in a
4765a5da7ceSSimon Glass        'self.ucode_data' property, which is then read by this class to
4775a5da7ceSSimon Glass        obtain the microcode if needed. If collation is performed, it
4785a5da7ceSSimon Glass        removes the microcode from the device tree.
4795a5da7ceSSimon Glass    Entry_u_boot_ucode:
4805a5da7ceSSimon Glass        This class. If collation is enabled it reads the microcode from
4815a5da7ceSSimon Glass        the Entry_u_boot_dtb_with_ucode entry, and uses it as the
4825a5da7ceSSimon Glass        contents of this entry.
4835a5da7ceSSimon Glass
4845a5da7ceSSimon Glass
4855a5da7ceSSimon Glass
4865a5da7ceSSimon GlassEntry: u-boot-with-ucode-ptr: U-Boot with embedded microcode pointer
4875a5da7ceSSimon Glass--------------------------------------------------------------------
4885a5da7ceSSimon Glass
4895a5da7ceSSimon GlassProperties / Entry arguments:
4905a5da7ceSSimon Glass    - filename: Filename of u-boot-nodtb.dtb (default 'u-boot-nodtb.dtb')
4915a5da7ceSSimon Glass
4925a5da7ceSSimon GlassSee Entry_u_boot_ucode for full details of the three entries involved in
4935a5da7ceSSimon Glassthis process. This entry updates U-Boot with the offset and size of the
4945a5da7ceSSimon Glassmicrocode, to allow early x86 boot code to find it without doing anything
4955a5da7ceSSimon Glasscomplicated. Otherwise it is the same as the u_boot entry.
4965a5da7ceSSimon Glass
4975a5da7ceSSimon Glass
4985a5da7ceSSimon Glass
4995a5da7ceSSimon GlassEntry: x86-start16: x86 16-bit start-up code for U-Boot
5005a5da7ceSSimon Glass-------------------------------------------------------
5015a5da7ceSSimon Glass
5025a5da7ceSSimon GlassProperties / Entry arguments:
5035a5da7ceSSimon Glass    - filename: Filename of u-boot-x86-16bit.bin (default
5045a5da7ceSSimon Glass        'u-boot-x86-16bit.bin')
5055a5da7ceSSimon Glass
5065a5da7ceSSimon Glassx86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code
5075a5da7ceSSimon Glassmust be placed at a particular address. This entry holds that code. It is
5085a5da7ceSSimon Glasstypically placed at offset CONFIG_SYS_X86_START16. The code is responsible
5095a5da7ceSSimon Glassfor changing to 32-bit mode and jumping to U-Boot's entry point, which
5105a5da7ceSSimon Glassrequires 32-bit mode (for 32-bit U-Boot).
5115a5da7ceSSimon Glass
5125a5da7ceSSimon GlassFor 64-bit U-Boot, the 'x86_start16_spl' entry type is used instead.
5135a5da7ceSSimon Glass
5145a5da7ceSSimon Glass
5155a5da7ceSSimon Glass
5165a5da7ceSSimon GlassEntry: x86-start16-spl: x86 16-bit start-up code for SPL
5175a5da7ceSSimon Glass--------------------------------------------------------
5185a5da7ceSSimon Glass
5195a5da7ceSSimon GlassProperties / Entry arguments:
5205a5da7ceSSimon Glass    - filename: Filename of spl/u-boot-x86-16bit-spl.bin (default
5215a5da7ceSSimon Glass        'spl/u-boot-x86-16bit-spl.bin')
5225a5da7ceSSimon Glass
5235a5da7ceSSimon Glassx86 CPUs start up in 16-bit mode, even if they are 64-bit CPUs. This code
5245a5da7ceSSimon Glassmust be placed at a particular address. This entry holds that code. It is
5255a5da7ceSSimon Glasstypically placed at offset CONFIG_SYS_X86_START16. The code is responsible
5265a5da7ceSSimon Glassfor changing to 32-bit mode and starting SPL, which in turn changes to
5275a5da7ceSSimon Glass64-bit mode and jumps to U-Boot (for 64-bit U-Boot).
5285a5da7ceSSimon Glass
5295a5da7ceSSimon GlassFor 32-bit U-Boot, the 'x86_start16' entry type is used instead.
5305a5da7ceSSimon Glass
5315a5da7ceSSimon Glass
5325a5da7ceSSimon Glass
533