| 1 |
.\" SPDX-License-Identifier: GPL-2.0-only |
| 2 |
.TH CBFSTOOL "8" "November 2024" "" "System Administration Utilities" |
| 3 |
.SH NAME |
| 4 |
cbfstool \- Management utility for CBFS formatted ROM images (coreboot tools) |
| 5 |
.SH SYNOPSIS |
| 6 |
.sp |
| 7 |
.nf |
| 8 |
cbfstool [\-h] |
| 9 |
cbfstool FILE COMMAND [\-v] [PARAMETERS]... |
| 10 |
.SH DESCRIPTION |
| 11 |
Management utility for CBFS formatted ROM images |
| 12 |
.SH "OPTIONS" |
| 13 |
.TP |
| 14 |
\fB\-H\fR header_offset |
| 15 |
.RS 4 |
| 16 |
Do not search for header; use this offset* |
| 17 |
.RE |
| 18 |
.PP |
| 19 |
\fB\-T\fR |
| 20 |
.RS 4 |
| 21 |
Output top\-aligned memory address |
| 22 |
.RE |
| 23 |
.PP |
| 24 |
\fB\-u\fR |
| 25 |
.RS 4 |
| 26 |
Accept short data; fill upward/from bottom |
| 27 |
.RE |
| 28 |
.TP |
| 29 |
\fB\-d\fR |
| 30 |
.RS 4 |
| 31 |
Accept short data; fill downward/from top |
| 32 |
.RE |
| 33 |
.TP |
| 34 |
\fB\-F\fR |
| 35 |
.RS 4 |
| 36 |
Force action |
| 37 |
.RE |
| 38 |
.TP |
| 39 |
\fB\-g\fR |
| 40 |
.RS 4 |
| 41 |
Generate position and alignment arguments |
| 42 |
.RE |
| 43 |
.TP |
| 44 |
\fB\-U\fR |
| 45 |
.RS 4 |
| 46 |
Unprocessed; don't decompress or make ELF |
| 47 |
.RE |
| 48 |
.TP |
| 49 |
\fB\-v\fR |
| 50 |
.RS 4 |
| 51 |
Provide verbose output (\fB\-v\fR=\fI\,INFO\/\fR \fB\-vv\fR=\fI\,DEBUG\/\fR output) |
| 52 |
.RE |
| 53 |
.TP |
| 54 |
\fB\-h\fR |
| 55 |
.RS 4 |
| 56 |
Display this help message |
| 57 |
.RE |
| 58 |
.TP |
| 59 |
\fB\-\-ext\-win\-base\fR |
| 60 |
.RS 4 |
| 61 |
Base of extended decode window in host address space(x86 only) |
| 62 |
.RE |
| 63 |
.TP |
| 64 |
\fB\-\-ext\-win\-size\fR |
| 65 |
.RS 4 |
| 66 |
Size of extended decode window in host address |
| 67 |
space(x86 only) |
| 68 |
.RE |
| 69 |
.SS "COMMANDS" |
| 70 |
.TP |
| 71 |
\fIadd\fR [\-r image,regions] \fB\-f\fR FILE \fB\-n\fR NAME \fB\-t\fR TYPE [\-A hash] |
| 72 |
[\-c compression] [\-b base\-address | \fB\-a\fR alignment] [\-p padding size] |
| 73 |
[\-y|\-\-xip if TYPE is FSP] [\-j topswap\-size] (Intel CPUs only) [\-\-ibb] |
| 74 |
[\-\-ext\-win\-base win\-base \fB\-\-ext\-win\-size\fR win\-size] |
| 75 |
.sp |
| 76 |
Add a component |
| 77 |
.sp |
| 78 |
\fB\-j\fR valid size: 0x10000 0x20000 0x40000 0x80000 0x100000 |
| 79 |
.TP |
| 80 |
\fIadd\-payload\fR [\-r image,regions] \fB\-f\fR FILE \fB\-n\fR NAME [\-A hash] |
| 81 |
[\-c compression] [\-b base\-address] (linux specific: [\-C cmdline] [\-I initrd]) |
| 82 |
.sp |
| 83 |
Add a payload to the ROM |
| 84 |
.TP |
| 85 |
\fIadd\-stage\fR [\-r image,regions] \fB\-f\fR FILE \fB\-n\fR NAME [\-A hash] |
| 86 |
[\-c compression] [\-b base] [\-S comma\-separated\-section(s)\-to\-ignore] |
| 87 |
[\-a alignment] [\-Q|\-\-pow2page] [\-y|\-\-xip] [\-\-ibb] |
| 88 |
[\-\-ext\-win\-base win\-base \fB\-\-ext\-win\-size\fR win\-size] |
| 89 |
.sp |
| 90 |
Add a stage to the ROM |
| 91 |
.TP |
| 92 |
\fIadd\-flat\-binary\fR [\-r image,regions] \fB\-f\fR FILE \fB\-n\fR NAME |
| 93 |
[\-A hash] \fB\-l\fR load\-address \fB\-e\fR entry\-point [\-c compression] [\-b base] |
| 94 |
.sp |
| 95 |
Add a 32bit flat mode binary |
| 96 |
.TP |
| 97 |
\fIadd\-int\fR [\-r image,regions] \fB\-i\fR INTEGER \fB\-n\fR NAME [\-b base] |
| 98 |
.sp |
| 99 |
Add a raw 64\-bit integer value |
| 100 |
.TP |
| 101 |
\fIadd\-master\-header\fR [\-r image,regions] [\-j topswap\-size] (Intel CPUs only) |
| 102 |
.sp |
| 103 |
Add a legacy CBFS master header |
| 104 |
.TP |
| 105 |
\fIremove\fR [\-r image,regions] \fB\-n\fR NAME |
| 106 |
.sp |
| 107 |
Remove a component |
| 108 |
.TP |
| 109 |
\fIcompact\fR \fB\-r\fR image,regions |
| 110 |
.sp |
| 111 |
Defragment CBFS image. |
| 112 |
.TP |
| 113 |
\fIcopy\fR \fB\-r\fR image,regions \fB\-R\fR source\-region |
| 114 |
.sp |
| 115 |
Create a copy (duplicate) cbfs instance in fmap |
| 116 |
.TP |
| 117 |
\fIcreate\fR \fB\-m\fR ARCH \fB\-s\fR size [\-b bootblock offset] |
| 118 |
[\-o CBFS offset] [\-H header offset] [\-B bootblock] |
| 119 |
.sp |
| 120 |
Create a legacy ROM file with CBFS master header* |
| 121 |
.TP |
| 122 |
\fIcreate\fR \fB\-M\fR flashmap [\-r list,of,regions,containing,cbfses] |
| 123 |
.sp |
| 124 |
Create a new\-style partitioned firmware image |
| 125 |
.TP |
| 126 |
\fIlayout\fR [\-w] |
| 127 |
.sp |
| 128 |
List mutable (or, with \fB\-w\fR, readable) image regions |
| 129 |
.TP |
| 130 |
\fIprint\fR [\-r image,regions] [\-k] |
| 131 |
.sp |
| 132 |
Show the contents of the ROM |
| 133 |
.TP |
| 134 |
\fIextract\fR [\-r image,regions] [\-m ARCH] \fB\-n\fR NAME \fB\-f\fR FILE [\-U] |
| 135 |
.sp |
| 136 |
Extracts a file from ROM |
| 137 |
.TP |
| 138 |
\fIwrite\fR [\-F] \fB\-r\fR image,regions \fB\-f\fR file [\-u | \fB\-d]\fR [\-i int] |
| 139 |
.sp |
| 140 |
Write file into same\-size [or larger] raw region |
| 141 |
.TP |
| 142 |
\fIread\fR [\-r fmap\-region] \fB\-f\fR file |
| 143 |
.sp |
| 144 |
Extract raw region contents into binary file |
| 145 |
.TP |
| 146 |
\fItruncate\fR [\-r fmap\-region] |
| 147 |
.sp |
| 148 |
Truncate CBFS and print new size on stdout |
| 149 |
.TP |
| 150 |
\fIexpand\fR [\-r fmap\-region] |
| 151 |
.sp |
| 152 |
Expand CBFS to span entire region |
| 153 |
.SS "OFFSETS" |
| 154 |
.PP |
| 155 |
Numbers accompanying \fB\-b\fR, \fB\-H\fR, and \fB\-o\fR switches* may be provided |
| 156 |
in two possible formats: if their value is greater than |
| 157 |
0x80000000, they are interpreted as a top\-aligned x86 memory |
| 158 |
address; otherwise, they are treated as an offset into flash. |
| 159 |
.SS "ARCHITECTURES" |
| 160 |
.PP |
| 161 |
arm64, arm, mips, ppc64, power8, riscv, x86, unknown |
| 162 |
.SS "TYPES" |
| 163 |
.PP |
| 164 |
bootblock, cbfs header, legacy stage, stage, simple elf, fit_payload, optionrom, bootsplash, |
| 165 |
raw, vsa, mbi, microcode, intel_fit, fsp, mrc, cmos_default, |
| 166 |
cmos_layout, spd, mrc_cache, mma, efi, struct, deleted, null, |
| 167 |
amdfw |
| 168 |
.PP |
| 169 |
\fBNote\fR that these actions and switches are only valid when |
| 170 |
working with legacy images whose structure is described |
| 171 |
primarily by a CBFS master header. New\-style images, in |
| 172 |
contrast, exclusively make use of an FMAP to describe their |
| 173 |
layout: this must minimally contain an 'FMAP' section |
| 174 |
specifying the location of this FMAP itself and a 'COREBOOT' |
| 175 |
section describing the primary CBFS. It should also be noted |
| 176 |
that, when working with such images, the \fB\-F\fR and \fB\-r\fR switches |
| 177 |
default to 'COREBOOT' for convenience, and the \fB\-b\fR switch becomes |
| 178 |
relative to the selected CBFS region's lowest address. |
| 179 |
The one exception to this rule is the top\-aligned address, |
| 180 |
which is always relative to the end of the entire image |
| 181 |
rather than relative to the local region; this is true for |
| 182 |
for both input (sufficiently large) and output (\fB\-T\fR) data. |
| 183 |
.SH "AUTHORS" |
| 184 |
.PP |
| 185 |
.nf |
| 186 |
coresystems GmbH. |
| 187 |
Man page written by Ahmad Khalifa. |