summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorSergii Dmytruk <sergii.dmytruk@3mdeb.com>2024-03-02 17:02:00 +0200
committerMartin L Roth <gaumless@gmail.com>2024-03-09 23:26:41 +0000
commit89e056bdf19f2d9b6090bd78d2d66fef9e9e77a1 (patch)
treef5d2f6dd1d406de4d3cad0d19b91e3835f1e3e63 /Documentation
parent04bd9651435843ce4b03c9717f2965fe344fe5cc (diff)
util/smmstoretool: support processing ROMs
Input file is parsed for FMAP and SMMSTORE region which is used if found. Otherwise, the whole file is assumed to be the region. Passing an image with FMAP that lacks SMMSTORER is an error. Change-Id: Ieab555d7bbcfa4dadf6a5070d1297acd737440fb Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80903 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/util/smmstoretool/index.md24
1 files changed, 18 insertions, 6 deletions
diff --git a/Documentation/util/smmstoretool/index.md b/Documentation/util/smmstoretool/index.md
index f7af60579d..5be6ffc79b 100644
--- a/Documentation/util/smmstoretool/index.md
+++ b/Documentation/util/smmstoretool/index.md
@@ -4,13 +4,20 @@ Offline SMMSTORE variable modification tool.
## Operation
+### File formats
+
+To discover SMMSTORE, the tool first looks for FMAP header and, if found, for
+SMMSTORE region. If FMAP is found but it has no SMMSTORE region, that's an
+error. If there is no FMAP, the whole file is assumed to be SMMSTORE
+region (e.g., extracted via `cbfstool`).
+
### Storage initialization
If SMMSTORE presence isn't detected and an update operation is requested, the
-store spanning the whole file is created automatically. Size of the store file
-must be a multiple of 64 KiB (block size in version 2 of SMMSTORE protocol),
-the variable storage itself will be 64 KiB in size. That's the way EDK2 makes
-use of it.
+store spanning the whole region is created automatically. Size of the store
+region must be a multiple of 64 KiB (block size in version 2 of SMMSTORE
+protocol), the variable storage itself will be 64 KiB in size. That's the way
+EDK2 makes use of it.
Unlike online editing which mostly appends new variable entries each storage
update with this tool drops all deleted or incomplete entries.
@@ -28,7 +35,7 @@ Start with:
```
$ smmstoretool -h
-Usage: smmstoretool smm-store-file sub-command
+Usage: smmstoretool smm-store-file|rom sub-command
smmstoretool -h|--help
Sub-commands:
@@ -58,7 +65,8 @@ to typical configuration values are supported:
## Examples
-`SMMSTORE` is the name of a file containing SMMSTORE data.
+`SMMSTORE` is the name of a file containing SMMSTORE data or a full ROM image
+with FMAP that includes SMMSTORE region.
### Variable listing
@@ -111,9 +119,13 @@ $ smmstoretool SMMSTORE remove -g dasharo -n NetworkBoot
If one edits a newly generated Dasharo `coreboot.rom`:
```bash
+# editing exported storage
cbfstool coreboot.rom read -r SMMSTORE -f SMMSTORE
smmstoretool SMMSTORE set -g dasharo -n NetworkBoot -t bool -v true
cbfstool coreboot.rom write -r SMMSTORE -f SMMSTORE
+
+# editing in-place storage
+smmstoretool coreboot.rom set -g dasharo -n NetworkBoot -t bool -v true
```
On the first boot, "Network Boot" setting will already be enabled.