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 22*83d73c2fSSimon Glass - compress: Compression algorithm to use: 23*83d73c2fSSimon Glass none: No compression 24*83d73c2fSSimon Glass lz4: Use lz4 compression (via 'lz4' command-line utility) 255a5da7ceSSimon Glass 265a5da7ceSSimon GlassThis entry reads data from a file and places it in the entry. The 275a5da7ceSSimon Glassdefault filename is often specified specified by the subclass. See for 285a5da7ceSSimon Glassexample the 'u_boot' entry which provides the filename 'u-boot.bin'. 295a5da7ceSSimon Glass 30*83d73c2fSSimon GlassIf compression is enabled, an extra 'uncomp-size' property is written to 31*83d73c2fSSimon Glassthe node (if enabled with -u) which provides the uncompressed size of the 32*83d73c2fSSimon Glassdata. 33*83d73c2fSSimon Glass 345a5da7ceSSimon Glass 355a5da7ceSSimon Glass 366ed45ba0SSimon GlassEntry: blob-dtb: A blob that holds a device tree 376ed45ba0SSimon Glass------------------------------------------------ 386ed45ba0SSimon Glass 396ed45ba0SSimon GlassThis is a blob containing a device tree. The contents of the blob are 406ed45ba0SSimon Glassobtained from the list of available device-tree files, managed by the 416ed45ba0SSimon Glass'state' module. 426ed45ba0SSimon Glass 436ed45ba0SSimon Glass 446ed45ba0SSimon Glass 45ec127af0SSimon GlassEntry: blob-named-by-arg: A blob entry which gets its filename property from its subclass 46ec127af0SSimon Glass----------------------------------------------------------------------------------------- 47ec127af0SSimon Glass 48ec127af0SSimon GlassProperties / Entry arguments: 49ec127af0SSimon Glass - <xxx>-path: Filename containing the contents of this entry (optional, 50ec127af0SSimon Glass defaults to 0) 51ec127af0SSimon Glass 52ec127af0SSimon Glasswhere <xxx> is the blob_fname argument to the constructor. 53ec127af0SSimon Glass 54ec127af0SSimon GlassThis entry cannot be used directly. Instead, it is used as a parent class 55ec127af0SSimon Glassfor another entry, which defined blob_fname. This parameter is used to 56ec127af0SSimon Glassset the entry-arg or property containing the filename. The entry-arg or 57ec127af0SSimon Glassproperty is in turn used to set the actual filename. 58ec127af0SSimon Glass 59ec127af0SSimon GlassSee cros_ec_rw for an example of this. 60ec127af0SSimon Glass 61ec127af0SSimon Glass 62ec127af0SSimon Glass 63ec127af0SSimon GlassEntry: cros-ec-rw: A blob entry which contains a Chromium OS read-write EC image 64ec127af0SSimon Glass-------------------------------------------------------------------------------- 65ec127af0SSimon Glass 66ec127af0SSimon GlassProperties / Entry arguments: 67ec127af0SSimon Glass - cros-ec-rw-path: Filename containing the EC image 68ec127af0SSimon Glass 69ec127af0SSimon GlassThis entry holds a Chromium OS EC (embedded controller) image, for use in 70ec127af0SSimon Glassupdating the EC on startup via software sync. 71ec127af0SSimon Glass 72ec127af0SSimon Glass 73ec127af0SSimon Glass 743af8e49cSSimon GlassEntry: fill: An entry which is filled to a particular byte value 753af8e49cSSimon Glass---------------------------------------------------------------- 763af8e49cSSimon Glass 773af8e49cSSimon GlassProperties / Entry arguments: 783af8e49cSSimon Glass - fill-byte: Byte to use to fill the entry 793af8e49cSSimon Glass 803af8e49cSSimon GlassNote that the size property must be set since otherwise this entry does not 813af8e49cSSimon Glassknow how large it should be. 823af8e49cSSimon Glass 833af8e49cSSimon GlassYou can often achieve the same effect using the pad-byte property of the 843af8e49cSSimon Glassoverall image, in that the space between entries will then be padded with 853af8e49cSSimon Glassthat byte. But this entry is sometimes useful for explicitly setting the 863af8e49cSSimon Glassbyte value of a region. 873af8e49cSSimon Glass 883af8e49cSSimon Glass 893af8e49cSSimon Glass 9011e36cceSSimon GlassEntry: fmap: An entry which contains an Fmap section 9111e36cceSSimon Glass---------------------------------------------------- 9211e36cceSSimon Glass 9311e36cceSSimon GlassProperties / Entry arguments: 9411e36cceSSimon Glass None 9511e36cceSSimon Glass 9611e36cceSSimon GlassFMAP is a simple format used by flashrom, an open-source utility for 9711e36cceSSimon Glassreading and writing the SPI flash, typically on x86 CPUs. The format 9811e36cceSSimon Glassprovides flashrom with a list of areas, so it knows what it in the flash. 9911e36cceSSimon GlassIt can then read or write just a single area, instead of the whole flash. 10011e36cceSSimon Glass 10111e36cceSSimon GlassThe format is defined by the flashrom project, in the file lib/fmap.h - 10211e36cceSSimon Glasssee www.flashrom.org/Flashrom for more information. 10311e36cceSSimon Glass 10411e36cceSSimon GlassWhen used, this entry will be populated with an FMAP which reflects the 10511e36cceSSimon Glassentries in the current image. Note that any hierarchy is squashed, since 10611e36cceSSimon GlassFMAP does not support this. 10711e36cceSSimon Glass 10811e36cceSSimon Glass 10911e36cceSSimon Glass 1100ef87aa3SSimon GlassEntry: gbb: An entry which contains a Chromium OS Google Binary Block 1110ef87aa3SSimon Glass--------------------------------------------------------------------- 1120ef87aa3SSimon Glass 1130ef87aa3SSimon GlassProperties / Entry arguments: 1140ef87aa3SSimon Glass - hardware-id: Hardware ID to use for this build (a string) 1150ef87aa3SSimon Glass - keydir: Directory containing the public keys to use 1160ef87aa3SSimon Glass - bmpblk: Filename containing images used by recovery 1170ef87aa3SSimon Glass 1180ef87aa3SSimon GlassChromium OS uses a GBB to store various pieces of information, in particular 1190ef87aa3SSimon Glassthe root and recovery keys that are used to verify the boot process. Some 1200ef87aa3SSimon Glassmore details are here: 1210ef87aa3SSimon Glass 1220ef87aa3SSimon Glass https://www.chromium.org/chromium-os/firmware-porting-guide/2-concepts 1230ef87aa3SSimon Glass 1240ef87aa3SSimon Glassbut note that the page dates from 2013 so is quite out of date. See 1250ef87aa3SSimon GlassREADME.chromium for how to obtain the required keys and tools. 1260ef87aa3SSimon Glass 1270ef87aa3SSimon Glass 1280ef87aa3SSimon Glass 1295a5da7ceSSimon GlassEntry: intel-cmc: Entry containing an Intel Chipset Micro Code (CMC) file 1305a5da7ceSSimon Glass------------------------------------------------------------------------- 1315a5da7ceSSimon Glass 1325a5da7ceSSimon GlassProperties / Entry arguments: 1335a5da7ceSSimon Glass - filename: Filename of file to read into entry 1345a5da7ceSSimon Glass 1355a5da7ceSSimon GlassThis file contains microcode for some devices in a special format. An 1365a5da7ceSSimon Glassexample filename is 'Microcode/C0_22211.BIN'. 1375a5da7ceSSimon Glass 1385a5da7ceSSimon GlassSee README.x86 for information about x86 binary blobs. 1395a5da7ceSSimon Glass 1405a5da7ceSSimon Glass 1415a5da7ceSSimon Glass 1425a5da7ceSSimon GlassEntry: intel-descriptor: Intel flash descriptor block (4KB) 1435a5da7ceSSimon Glass----------------------------------------------------------- 1445a5da7ceSSimon Glass 1455a5da7ceSSimon GlassProperties / Entry arguments: 1465a5da7ceSSimon Glass filename: Filename of file containing the descriptor. This is typically 1475a5da7ceSSimon Glass a 4KB binary file, sometimes called 'descriptor.bin' 1485a5da7ceSSimon Glass 1495a5da7ceSSimon GlassThis entry is placed at the start of flash and provides information about 1505a5da7ceSSimon Glassthe SPI flash regions. In particular it provides the base address and 1515a5da7ceSSimon Glasssize of the ME (Management Engine) region, allowing us to place the ME 1525a5da7ceSSimon Glassbinary in the right place. 1535a5da7ceSSimon Glass 1545a5da7ceSSimon GlassWith this entry in your image, the position of the 'intel-me' entry will be 1555a5da7ceSSimon Glassfixed in the image, which avoids you needed to specify an offset for that 1565a5da7ceSSimon Glassregion. This is useful, because it is not possible to change the position 1575a5da7ceSSimon Glassof the ME region without updating the descriptor. 1585a5da7ceSSimon Glass 1595a5da7ceSSimon GlassSee README.x86 for information about x86 binary blobs. 1605a5da7ceSSimon Glass 1615a5da7ceSSimon Glass 1625a5da7ceSSimon Glass 1635a5da7ceSSimon GlassEntry: intel-fsp: Entry containing an Intel Firmware Support Package (FSP) file 1645a5da7ceSSimon Glass------------------------------------------------------------------------------- 1655a5da7ceSSimon Glass 1665a5da7ceSSimon GlassProperties / Entry arguments: 1675a5da7ceSSimon Glass - filename: Filename of file to read into entry 1685a5da7ceSSimon Glass 1695a5da7ceSSimon GlassThis file contains binary blobs which are used on some devices to make the 1705a5da7ceSSimon Glassplatform work. U-Boot executes this code since it is not possible to set up 1715a5da7ceSSimon Glassthe hardware using U-Boot open-source code. Documentation is typically not 1725a5da7ceSSimon Glassavailable in sufficient detail to allow this. 1735a5da7ceSSimon Glass 1745a5da7ceSSimon GlassAn example filename is 'FSP/QUEENSBAY_FSP_GOLD_001_20-DECEMBER-2013.fd' 1755a5da7ceSSimon Glass 1765a5da7ceSSimon GlassSee README.x86 for information about x86 binary blobs. 1775a5da7ceSSimon Glass 1785a5da7ceSSimon Glass 1795a5da7ceSSimon Glass 1805a5da7ceSSimon GlassEntry: intel-me: Entry containing an Intel Management Engine (ME) file 1815a5da7ceSSimon Glass---------------------------------------------------------------------- 1825a5da7ceSSimon Glass 1835a5da7ceSSimon GlassProperties / Entry arguments: 1845a5da7ceSSimon Glass - filename: Filename of file to read into entry 1855a5da7ceSSimon Glass 1865a5da7ceSSimon GlassThis file contains code used by the SoC that is required to make it work. 1875a5da7ceSSimon GlassThe Management Engine is like a background task that runs things that are 1885a5da7ceSSimon Glassnot clearly documented, but may include keyboard, deplay and network 1895a5da7ceSSimon Glassaccess. For platform that use ME it is not possible to disable it. U-Boot 1905a5da7ceSSimon Glassdoes not directly execute code in the ME binary. 1915a5da7ceSSimon Glass 1925a5da7ceSSimon GlassA typical filename is 'me.bin'. 1935a5da7ceSSimon Glass 1945a5da7ceSSimon GlassSee README.x86 for information about x86 binary blobs. 1955a5da7ceSSimon Glass 1965a5da7ceSSimon Glass 1975a5da7ceSSimon Glass 1985a5da7ceSSimon GlassEntry: intel-mrc: Entry containing an Intel Memory Reference Code (MRC) file 1995a5da7ceSSimon Glass---------------------------------------------------------------------------- 2005a5da7ceSSimon Glass 2015a5da7ceSSimon GlassProperties / Entry arguments: 2025a5da7ceSSimon Glass - filename: Filename of file to read into entry 2035a5da7ceSSimon Glass 2045a5da7ceSSimon GlassThis file contains code for setting up the SDRAM on some Intel systems. This 2055a5da7ceSSimon Glassis executed by U-Boot when needed early during startup. A typical filename 2065a5da7ceSSimon Glassis 'mrc.bin'. 2075a5da7ceSSimon Glass 2085a5da7ceSSimon GlassSee README.x86 for information about x86 binary blobs. 2095a5da7ceSSimon Glass 2105a5da7ceSSimon Glass 2115a5da7ceSSimon Glass 2125a5da7ceSSimon GlassEntry: intel-vbt: Entry containing an Intel Video BIOS Table (VBT) file 2135a5da7ceSSimon Glass----------------------------------------------------------------------- 2145a5da7ceSSimon Glass 2155a5da7ceSSimon GlassProperties / Entry arguments: 2165a5da7ceSSimon Glass - filename: Filename of file to read into entry 2175a5da7ceSSimon Glass 2185a5da7ceSSimon GlassThis file contains code that sets up the integrated graphics subsystem on 2195a5da7ceSSimon Glasssome Intel SoCs. U-Boot executes this when the display is started up. 2205a5da7ceSSimon Glass 2215a5da7ceSSimon GlassSee README.x86 for information about Intel binary blobs. 2225a5da7ceSSimon Glass 2235a5da7ceSSimon Glass 2245a5da7ceSSimon Glass 2255a5da7ceSSimon GlassEntry: intel-vga: Entry containing an Intel Video Graphics Adaptor (VGA) file 2265a5da7ceSSimon Glass----------------------------------------------------------------------------- 2275a5da7ceSSimon Glass 2285a5da7ceSSimon GlassProperties / Entry arguments: 2295a5da7ceSSimon Glass - filename: Filename of file to read into entry 2305a5da7ceSSimon Glass 2315a5da7ceSSimon GlassThis file contains code that sets up the integrated graphics subsystem on 2325a5da7ceSSimon Glasssome Intel SoCs. U-Boot executes this when the display is started up. 2335a5da7ceSSimon Glass 2345a5da7ceSSimon GlassThis is similar to the VBT file but in a different format. 2355a5da7ceSSimon Glass 2365a5da7ceSSimon GlassSee README.x86 for information about Intel binary blobs. 2375a5da7ceSSimon Glass 2385a5da7ceSSimon Glass 2395a5da7ceSSimon Glass 2405a5da7ceSSimon GlassEntry: section: Entry that contains other entries 2415a5da7ceSSimon Glass------------------------------------------------- 2425a5da7ceSSimon Glass 2435a5da7ceSSimon GlassProperties / Entry arguments: (see binman README for more information) 2445a5da7ceSSimon Glass - size: Size of section in bytes 2455a5da7ceSSimon Glass - align-size: Align size to a particular power of two 2465a5da7ceSSimon Glass - pad-before: Add padding before the entry 2475a5da7ceSSimon Glass - pad-after: Add padding after the entry 2485a5da7ceSSimon Glass - pad-byte: Pad byte to use when padding 2495a5da7ceSSimon Glass - sort-by-offset: Reorder the entries by offset 2505a5da7ceSSimon Glass - end-at-4gb: Used to build an x86 ROM which ends at 4GB (2^32) 2515a5da7ceSSimon Glass - name-prefix: Adds a prefix to the name of every entry in the section 2525a5da7ceSSimon Glass when writing out the map 2535a5da7ceSSimon Glass 2545a5da7ceSSimon GlassA section is an entry which can contain other entries, thus allowing 2555a5da7ceSSimon Glasshierarchical images to be created. See 'Sections and hierarchical images' 2565a5da7ceSSimon Glassin the binman README for more information. 2575a5da7ceSSimon Glass 2585a5da7ceSSimon Glass 2595a5da7ceSSimon Glass 2605a5da7ceSSimon GlassEntry: text: An entry which contains text 2615a5da7ceSSimon Glass----------------------------------------- 2625a5da7ceSSimon Glass 2635a5da7ceSSimon GlassThe text can be provided either in the node itself or by a command-line 2645a5da7ceSSimon Glassargument. There is a level of indirection to allow multiple text strings 2655a5da7ceSSimon Glassand sharing of text. 2665a5da7ceSSimon Glass 2675a5da7ceSSimon GlassProperties / Entry arguments: 2685a5da7ceSSimon Glass text-label: The value of this string indicates the property / entry-arg 2695a5da7ceSSimon Glass that contains the string to place in the entry 2705a5da7ceSSimon Glass <xxx> (actual name is the value of text-label): contains the string to 2715a5da7ceSSimon Glass place in the entry. 2725a5da7ceSSimon Glass 2735a5da7ceSSimon GlassExample node: 2745a5da7ceSSimon Glass 2755a5da7ceSSimon Glass text { 2765a5da7ceSSimon Glass size = <50>; 2775a5da7ceSSimon Glass text-label = "message"; 2785a5da7ceSSimon Glass }; 2795a5da7ceSSimon Glass 2805a5da7ceSSimon GlassYou can then use: 2815a5da7ceSSimon Glass 2825a5da7ceSSimon Glass binman -amessage="this is my message" 2835a5da7ceSSimon Glass 2845a5da7ceSSimon Glassand binman will insert that string into the entry. 2855a5da7ceSSimon Glass 2865a5da7ceSSimon GlassIt is also possible to put the string directly in the node: 2875a5da7ceSSimon Glass 2885a5da7ceSSimon Glass text { 2895a5da7ceSSimon Glass size = <8>; 2905a5da7ceSSimon Glass text-label = "message"; 2915a5da7ceSSimon Glass message = "a message directly in the node" 2925a5da7ceSSimon Glass }; 2935a5da7ceSSimon Glass 2945a5da7ceSSimon GlassThe text is not itself nul-terminated. This can be achieved, if required, 2955a5da7ceSSimon Glassby setting the size of the entry to something larger than the text. 2965a5da7ceSSimon Glass 2975a5da7ceSSimon Glass 2985a5da7ceSSimon Glass 2995a5da7ceSSimon GlassEntry: u-boot: U-Boot flat binary 3005a5da7ceSSimon Glass--------------------------------- 3015a5da7ceSSimon Glass 3025a5da7ceSSimon GlassProperties / Entry arguments: 3035a5da7ceSSimon Glass - filename: Filename of u-boot.bin (default 'u-boot.bin') 3045a5da7ceSSimon Glass 3055a5da7ceSSimon GlassThis is the U-Boot binary, containing relocation information to allow it 3065a5da7ceSSimon Glassto relocate itself at runtime. The binary typically includes a device tree 3075a5da7ceSSimon Glassblob at the end of it. Use u_boot_nodtb if you want to package the device 3085a5da7ceSSimon Glasstree separately. 3095a5da7ceSSimon Glass 3105a5da7ceSSimon GlassU-Boot can access binman symbols at runtime. See: 3115a5da7ceSSimon Glass 3125a5da7ceSSimon Glass 'Access to binman entry offsets at run time (fdt)' 3135a5da7ceSSimon Glass 3145a5da7ceSSimon Glassin the binman README for more information. 3155a5da7ceSSimon Glass 3165a5da7ceSSimon Glass 3175a5da7ceSSimon Glass 3185a5da7ceSSimon GlassEntry: u-boot-dtb: U-Boot device tree 3195a5da7ceSSimon Glass------------------------------------- 3205a5da7ceSSimon Glass 3215a5da7ceSSimon GlassProperties / Entry arguments: 3225a5da7ceSSimon Glass - filename: Filename of u-boot.dtb (default 'u-boot.dtb') 3235a5da7ceSSimon Glass 3245a5da7ceSSimon GlassThis is the U-Boot device tree, containing configuration information for 3255a5da7ceSSimon GlassU-Boot. U-Boot needs this to know what devices are present and which drivers 3265a5da7ceSSimon Glassto activate. 3275a5da7ceSSimon Glass 3286ed45ba0SSimon GlassNote: This is mostly an internal entry type, used by others. This allows 3296ed45ba0SSimon Glassbinman to know which entries contain a device tree. 3306ed45ba0SSimon Glass 3315a5da7ceSSimon Glass 3325a5da7ceSSimon Glass 3335a5da7ceSSimon GlassEntry: u-boot-dtb-with-ucode: A U-Boot device tree file, with the microcode removed 3345a5da7ceSSimon Glass----------------------------------------------------------------------------------- 3355a5da7ceSSimon Glass 3365a5da7ceSSimon GlassProperties / Entry arguments: 3375a5da7ceSSimon Glass - filename: Filename of u-boot.dtb (default 'u-boot.dtb') 3385a5da7ceSSimon Glass 3395a5da7ceSSimon GlassSee Entry_u_boot_ucode for full details of the three entries involved in 3405a5da7ceSSimon Glassthis process. This entry provides the U-Boot device-tree file, which 3415a5da7ceSSimon Glasscontains the microcode. If the microcode is not being collated into one 3425a5da7ceSSimon Glassplace then the offset and size of the microcode is recorded by this entry, 3435a5da7ceSSimon Glassfor use by u_boot_with_ucode_ptr. If it is being collated, then this 3445a5da7ceSSimon Glassentry deletes the microcode from the device tree (to save space) and makes 3455a5da7ceSSimon Glassit available to u_boot_ucode. 3465a5da7ceSSimon Glass 3475a5da7ceSSimon Glass 3485a5da7ceSSimon Glass 3495a5da7ceSSimon GlassEntry: u-boot-img: U-Boot legacy image 3505a5da7ceSSimon Glass-------------------------------------- 3515a5da7ceSSimon Glass 3525a5da7ceSSimon GlassProperties / Entry arguments: 3535a5da7ceSSimon Glass - filename: Filename of u-boot.img (default 'u-boot.img') 3545a5da7ceSSimon Glass 3555a5da7ceSSimon GlassThis is the U-Boot binary as a packaged image, in legacy format. It has a 3565a5da7ceSSimon Glassheader which allows it to be loaded at the correct address for execution. 3575a5da7ceSSimon Glass 3585a5da7ceSSimon GlassYou should use FIT (Flat Image Tree) instead of the legacy image for new 3595a5da7ceSSimon Glassapplications. 3605a5da7ceSSimon Glass 3615a5da7ceSSimon Glass 3625a5da7ceSSimon Glass 3635a5da7ceSSimon GlassEntry: u-boot-nodtb: U-Boot flat binary without device tree appended 3645a5da7ceSSimon Glass-------------------------------------------------------------------- 3655a5da7ceSSimon Glass 3665a5da7ceSSimon GlassProperties / Entry arguments: 3675a5da7ceSSimon Glass - filename: Filename of u-boot.bin (default 'u-boot-nodtb.bin') 3685a5da7ceSSimon Glass 3695a5da7ceSSimon GlassThis is the U-Boot binary, containing relocation information to allow it 3705a5da7ceSSimon Glassto relocate itself at runtime. It does not include a device tree blob at 3715a5da7ceSSimon Glassthe end of it so normally cannot work without it. You can add a u_boot_dtb 3725a5da7ceSSimon Glassentry after this one, or use a u_boot entry instead (which contains both 3735a5da7ceSSimon GlassU-Boot and the device tree). 3745a5da7ceSSimon Glass 3755a5da7ceSSimon Glass 3765a5da7ceSSimon Glass 3775a5da7ceSSimon GlassEntry: u-boot-spl: U-Boot SPL binary 3785a5da7ceSSimon Glass------------------------------------ 3795a5da7ceSSimon Glass 3805a5da7ceSSimon GlassProperties / Entry arguments: 3815a5da7ceSSimon Glass - filename: Filename of u-boot-spl.bin (default 'spl/u-boot-spl.bin') 3825a5da7ceSSimon Glass 3835a5da7ceSSimon GlassThis is the U-Boot SPL (Secondary Program Loader) binary. This is a small 3845a5da7ceSSimon Glassbinary which loads before U-Boot proper, typically into on-chip SRAM. It is 3855a5da7ceSSimon Glassresponsible for locating, loading and jumping to U-Boot. Note that SPL is 3865a5da7ceSSimon Glassnot relocatable so must be loaded to the correct address in SRAM, or written 387b8ef5b6bSSimon Glassto run from the correct address if direct flash execution is possible (e.g. 3885a5da7ceSSimon Glasson x86 devices). 3895a5da7ceSSimon Glass 3905a5da7ceSSimon GlassSPL can access binman symbols at runtime. See: 3915a5da7ceSSimon Glass 3925a5da7ceSSimon Glass 'Access to binman entry offsets at run time (symbols)' 3935a5da7ceSSimon Glass 3945a5da7ceSSimon Glassin the binman README for more information. 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 symbols to write into the SPL binary. 3985a5da7ceSSimon Glass 3995a5da7ceSSimon Glass 4005a5da7ceSSimon Glass 4015a5da7ceSSimon GlassEntry: u-boot-spl-bss-pad: U-Boot SPL binary padded with a BSS region 4025a5da7ceSSimon Glass--------------------------------------------------------------------- 4035a5da7ceSSimon Glass 4045a5da7ceSSimon GlassProperties / Entry arguments: 4055a5da7ceSSimon Glass None 4065a5da7ceSSimon Glass 4075a5da7ceSSimon GlassThis is similar to u_boot_spl except that padding is added after the SPL 4085a5da7ceSSimon Glassbinary to cover the BSS (Block Started by Symbol) region. This region holds 4095a5da7ceSSimon Glassthe various used by SPL. It is set to 0 by SPL when it starts up. If you 4105a5da7ceSSimon Glasswant to append data to the SPL image (such as a device tree file), you must 4115a5da7ceSSimon Glasspad out the BSS region to avoid the data overlapping with U-Boot variables. 4125a5da7ceSSimon GlassThis entry is useful in that case. It automatically pads out the entry size 4135a5da7ceSSimon Glassto cover both the code, data and BSS. 4145a5da7ceSSimon Glass 4155a5da7ceSSimon GlassThe ELF file 'spl/u-boot-spl' must also be available for this to work, since 4165a5da7ceSSimon Glassbinman uses that to look up the BSS address. 4175a5da7ceSSimon Glass 4185a5da7ceSSimon Glass 4195a5da7ceSSimon Glass 4205a5da7ceSSimon GlassEntry: u-boot-spl-dtb: U-Boot SPL device tree 4215a5da7ceSSimon Glass--------------------------------------------- 4225a5da7ceSSimon Glass 4235a5da7ceSSimon GlassProperties / Entry arguments: 4245a5da7ceSSimon Glass - filename: Filename of u-boot.dtb (default 'spl/u-boot-spl.dtb') 4255a5da7ceSSimon Glass 4265a5da7ceSSimon GlassThis is the SPL device tree, containing configuration information for 4275a5da7ceSSimon GlassSPL. SPL needs this to know what devices are present and which drivers 4285a5da7ceSSimon Glassto activate. 4295a5da7ceSSimon Glass 4305a5da7ceSSimon Glass 4315a5da7ceSSimon Glass 4325a5da7ceSSimon GlassEntry: u-boot-spl-nodtb: SPL binary without device tree appended 4335a5da7ceSSimon Glass---------------------------------------------------------------- 4345a5da7ceSSimon Glass 4355a5da7ceSSimon GlassProperties / Entry arguments: 4365a5da7ceSSimon Glass - filename: Filename of spl/u-boot-spl-nodtb.bin (default 4375a5da7ceSSimon Glass 'spl/u-boot-spl-nodtb.bin') 4385a5da7ceSSimon Glass 4395a5da7ceSSimon GlassThis is the U-Boot SPL binary, It does not include a device tree blob at 4405a5da7ceSSimon Glassthe end of it so may not be able to work without it, assuming SPL needs 4415a5da7ceSSimon Glassa device tree to operation on your platform. You can add a u_boot_spl_dtb 4425a5da7ceSSimon Glassentry after this one, or use a u_boot_spl entry instead (which contains 4435a5da7ceSSimon Glassboth SPL and the device tree). 4445a5da7ceSSimon Glass 4455a5da7ceSSimon Glass 4465a5da7ceSSimon Glass 4475a5da7ceSSimon GlassEntry: u-boot-spl-with-ucode-ptr: U-Boot SPL with embedded microcode pointer 4485a5da7ceSSimon Glass---------------------------------------------------------------------------- 4495a5da7ceSSimon Glass 4505a5da7ceSSimon GlassSee Entry_u_boot_ucode for full details of the entries involved in this 4515a5da7ceSSimon Glassprocess. 4525a5da7ceSSimon Glass 4535a5da7ceSSimon Glass 4545a5da7ceSSimon Glass 455b8ef5b6bSSimon GlassEntry: u-boot-tpl: U-Boot TPL binary 456b8ef5b6bSSimon Glass------------------------------------ 457b8ef5b6bSSimon Glass 458b8ef5b6bSSimon GlassProperties / Entry arguments: 459b8ef5b6bSSimon Glass - filename: Filename of u-boot-tpl.bin (default 'tpl/u-boot-tpl.bin') 460b8ef5b6bSSimon Glass 461b8ef5b6bSSimon GlassThis is the U-Boot TPL (Tertiary Program Loader) binary. This is a small 462b8ef5b6bSSimon Glassbinary which loads before SPL, typically into on-chip SRAM. It is 463b8ef5b6bSSimon Glassresponsible for locating, loading and jumping to SPL, the next-stage 464b8ef5b6bSSimon Glassloader. Note that SPL is not relocatable so must be loaded to the correct 465b8ef5b6bSSimon Glassaddress in SRAM, or written to run from the correct address if direct 466b8ef5b6bSSimon Glassflash execution is possible (e.g. on x86 devices). 467b8ef5b6bSSimon Glass 468b8ef5b6bSSimon GlassSPL can access binman symbols at runtime. See: 469b8ef5b6bSSimon Glass 470b8ef5b6bSSimon Glass 'Access to binman entry offsets at run time (symbols)' 471b8ef5b6bSSimon Glass 472b8ef5b6bSSimon Glassin the binman README for more information. 473b8ef5b6bSSimon Glass 474b8ef5b6bSSimon GlassThe ELF file 'tpl/u-boot-tpl' must also be available for this to work, since 475b8ef5b6bSSimon Glassbinman uses that to look up symbols to write into the TPL binary. 476b8ef5b6bSSimon Glass 477b8ef5b6bSSimon Glass 478b8ef5b6bSSimon Glass 479b8ef5b6bSSimon GlassEntry: u-boot-tpl-dtb: U-Boot TPL device tree 480b8ef5b6bSSimon Glass--------------------------------------------- 481b8ef5b6bSSimon Glass 482b8ef5b6bSSimon GlassProperties / Entry arguments: 483b8ef5b6bSSimon Glass - filename: Filename of u-boot.dtb (default 'tpl/u-boot-tpl.dtb') 484b8ef5b6bSSimon Glass 485b8ef5b6bSSimon GlassThis is the TPL device tree, containing configuration information for 486b8ef5b6bSSimon GlassTPL. TPL needs this to know what devices are present and which drivers 487b8ef5b6bSSimon Glassto activate. 488b8ef5b6bSSimon Glass 489b8ef5b6bSSimon Glass 490b8ef5b6bSSimon Glass 4915a5da7ceSSimon GlassEntry: u-boot-ucode: U-Boot microcode block 4925a5da7ceSSimon Glass------------------------------------------- 4935a5da7ceSSimon Glass 4945a5da7ceSSimon GlassProperties / Entry arguments: 4955a5da7ceSSimon Glass None 4965a5da7ceSSimon Glass 4975a5da7ceSSimon GlassThe contents of this entry are filled in automatically by other entries 4985a5da7ceSSimon Glasswhich must also be in the image. 4995a5da7ceSSimon Glass 5005a5da7ceSSimon GlassU-Boot on x86 needs a single block of microcode. This is collected from 5015a5da7ceSSimon Glassthe various microcode update nodes in the device tree. It is also unable 5025a5da7ceSSimon Glassto read the microcode from the device tree on platforms that use FSP 5035a5da7ceSSimon Glass(Firmware Support Package) binaries, because the API requires that the 5045a5da7ceSSimon Glassmicrocode is supplied before there is any SRAM available to use (i.e. 5055a5da7ceSSimon Glassthe FSP sets up the SRAM / cache-as-RAM but does so in the call that 5065a5da7ceSSimon Glassrequires the microcode!). To keep things simple, all x86 platforms handle 5075a5da7ceSSimon Glassmicrocode the same way in U-Boot (even non-FSP platforms). This is that 5085a5da7ceSSimon Glassa table is placed at _dt_ucode_base_size containing the base address and 5095a5da7ceSSimon Glasssize of the microcode. This is either passed to the FSP (for FSP 5105a5da7ceSSimon Glassplatforms), or used to set up the microcode (for non-FSP platforms). 5115a5da7ceSSimon GlassThis all happens in the build system since it is the only way to get 5125a5da7ceSSimon Glassthe microcode into a single blob and accessible without SRAM. 5135a5da7ceSSimon Glass 5145a5da7ceSSimon GlassThere are two cases to handle. If there is only one microcode blob in 5155a5da7ceSSimon Glassthe device tree, then the ucode pointer it set to point to that. This 5165a5da7ceSSimon Glassentry (u-boot-ucode) is empty. If there is more than one update, then 5175a5da7ceSSimon Glassthis entry holds the concatenation of all updates, and the device tree 5185a5da7ceSSimon Glassentry (u-boot-dtb-with-ucode) is updated to remove the microcode. This 5195a5da7ceSSimon Glasslast step ensures that that the microcode appears in one contiguous 5205a5da7ceSSimon Glassblock in the image and is not unnecessarily duplicated in the device 5215a5da7ceSSimon Glasstree. It is referred to as 'collation' here. 5225a5da7ceSSimon Glass 5235a5da7ceSSimon GlassEntry types that have a part to play in handling microcode: 5245a5da7ceSSimon Glass 5255a5da7ceSSimon Glass Entry_u_boot_with_ucode_ptr: 5265a5da7ceSSimon Glass Contains u-boot-nodtb.bin (i.e. U-Boot without the device tree). 5275a5da7ceSSimon Glass It updates it with the address and size of the microcode so that 5285a5da7ceSSimon Glass U-Boot can find it early on start-up. 5295a5da7ceSSimon Glass Entry_u_boot_dtb_with_ucode: 5305a5da7ceSSimon Glass Contains u-boot.dtb. It stores the microcode in a 5315a5da7ceSSimon Glass 'self.ucode_data' property, which is then read by this class to 5325a5da7ceSSimon Glass obtain the microcode if needed. If collation is performed, it 5335a5da7ceSSimon Glass removes the microcode from the device tree. 5345a5da7ceSSimon Glass Entry_u_boot_ucode: 5355a5da7ceSSimon Glass This class. If collation is enabled it reads the microcode from 5365a5da7ceSSimon Glass the Entry_u_boot_dtb_with_ucode entry, and uses it as the 5375a5da7ceSSimon Glass contents of this entry. 5385a5da7ceSSimon Glass 5395a5da7ceSSimon Glass 5405a5da7ceSSimon Glass 5415a5da7ceSSimon GlassEntry: u-boot-with-ucode-ptr: U-Boot with embedded microcode pointer 5425a5da7ceSSimon Glass-------------------------------------------------------------------- 5435a5da7ceSSimon Glass 5445a5da7ceSSimon GlassProperties / Entry arguments: 5455a5da7ceSSimon Glass - filename: Filename of u-boot-nodtb.dtb (default 'u-boot-nodtb.dtb') 546f0693038SSimon Glass - optional-ucode: boolean property to make microcode optional. If the 547f0693038SSimon Glass u-boot.bin image does not include microcode, no error will 548f0693038SSimon Glass be generated. 5495a5da7ceSSimon Glass 5505a5da7ceSSimon GlassSee Entry_u_boot_ucode for full details of the three entries involved in 5515a5da7ceSSimon Glassthis process. This entry updates U-Boot with the offset and size of the 5525a5da7ceSSimon Glassmicrocode, to allow early x86 boot code to find it without doing anything 5535a5da7ceSSimon Glasscomplicated. Otherwise it is the same as the u_boot entry. 5545a5da7ceSSimon Glass 5555a5da7ceSSimon Glass 5565a5da7ceSSimon Glass 55724d0d3c3SSimon GlassEntry: vblock: An entry which contains a Chromium OS verified boot block 55824d0d3c3SSimon Glass------------------------------------------------------------------------ 55924d0d3c3SSimon Glass 56024d0d3c3SSimon GlassProperties / Entry arguments: 56124d0d3c3SSimon Glass - keydir: Directory containing the public keys to use 56224d0d3c3SSimon Glass - keyblock: Name of the key file to use (inside keydir) 56324d0d3c3SSimon Glass - signprivate: Name of provide key file to use (inside keydir) 56424d0d3c3SSimon Glass - version: Version number of the vblock (typically 1) 56524d0d3c3SSimon Glass - kernelkey: Name of the kernel key to use (inside keydir) 56624d0d3c3SSimon Glass - preamble-flags: Value of the vboot preamble flags (typically 0) 56724d0d3c3SSimon Glass 568a326b495SSimon GlassOutput files: 569a326b495SSimon Glass - input.<unique_name> - input file passed to futility 570a326b495SSimon Glass - vblock.<unique_name> - output file generated by futility (which is 571a326b495SSimon Glass used as the entry contents) 572a326b495SSimon Glass 57324d0d3c3SSimon GlassChromium OS signs the read-write firmware and kernel, writing the signature 57424d0d3c3SSimon Glassin this block. This allows U-Boot to verify that the next firmware stage 57524d0d3c3SSimon Glassand kernel are genuine. 57624d0d3c3SSimon Glass 57724d0d3c3SSimon Glass 57824d0d3c3SSimon Glass 5795a5da7ceSSimon GlassEntry: x86-start16: x86 16-bit start-up code for U-Boot 5805a5da7ceSSimon Glass------------------------------------------------------- 5815a5da7ceSSimon Glass 5825a5da7ceSSimon GlassProperties / Entry arguments: 5835a5da7ceSSimon Glass - filename: Filename of u-boot-x86-16bit.bin (default 5845a5da7ceSSimon Glass 'u-boot-x86-16bit.bin') 5855a5da7ceSSimon Glass 5865a5da7ceSSimon Glassx86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code 5875a5da7ceSSimon Glassmust be placed at a particular address. This entry holds that code. It is 5885a5da7ceSSimon Glasstypically placed at offset CONFIG_SYS_X86_START16. The code is responsible 5895a5da7ceSSimon Glassfor changing to 32-bit mode and jumping to U-Boot's entry point, which 5905a5da7ceSSimon Glassrequires 32-bit mode (for 32-bit U-Boot). 5915a5da7ceSSimon Glass 5925a5da7ceSSimon GlassFor 64-bit U-Boot, the 'x86_start16_spl' entry type is used instead. 5935a5da7ceSSimon Glass 5945a5da7ceSSimon Glass 5955a5da7ceSSimon Glass 5965a5da7ceSSimon GlassEntry: x86-start16-spl: x86 16-bit start-up code for SPL 5975a5da7ceSSimon Glass-------------------------------------------------------- 5985a5da7ceSSimon Glass 5995a5da7ceSSimon GlassProperties / Entry arguments: 6005a5da7ceSSimon Glass - filename: Filename of spl/u-boot-x86-16bit-spl.bin (default 6015a5da7ceSSimon Glass 'spl/u-boot-x86-16bit-spl.bin') 6025a5da7ceSSimon Glass 6035a5da7ceSSimon Glassx86 CPUs start up in 16-bit mode, even if they are 64-bit CPUs. This code 6045a5da7ceSSimon Glassmust be placed at a particular address. This entry holds that code. It is 6055a5da7ceSSimon Glasstypically placed at offset CONFIG_SYS_X86_START16. The code is responsible 6065a5da7ceSSimon Glassfor changing to 32-bit mode and starting SPL, which in turn changes to 6075a5da7ceSSimon Glass64-bit mode and jumps to U-Boot (for 64-bit U-Boot). 6085a5da7ceSSimon Glass 6095a5da7ceSSimon GlassFor 32-bit U-Boot, the 'x86_start16' entry type is used instead. 6105a5da7ceSSimon Glass 6115a5da7ceSSimon Glass 6125a5da7ceSSimon Glass 61335b384cbSSimon GlassEntry: x86-start16-tpl: x86 16-bit start-up code for TPL 61435b384cbSSimon Glass-------------------------------------------------------- 61535b384cbSSimon Glass 61635b384cbSSimon GlassProperties / Entry arguments: 61735b384cbSSimon Glass - filename: Filename of tpl/u-boot-x86-16bit-tpl.bin (default 61835b384cbSSimon Glass 'tpl/u-boot-x86-16bit-tpl.bin') 61935b384cbSSimon Glass 62035b384cbSSimon Glassx86 CPUs start up in 16-bit mode, even if they are 64-bit CPUs. This code 62135b384cbSSimon Glassmust be placed at a particular address. This entry holds that code. It is 62235b384cbSSimon Glasstypically placed at offset CONFIG_SYS_X86_START16. The code is responsible 62335b384cbSSimon Glassfor changing to 32-bit mode and starting TPL, which in turn jumps to SPL. 62435b384cbSSimon Glass 62535b384cbSSimon GlassIf TPL is not being used, the 'x86_start16_spl or 'x86_start16' entry types 62635b384cbSSimon Glassmay be used instead. 62735b384cbSSimon Glass 62835b384cbSSimon Glass 62935b384cbSSimon Glass 630