From: Michal Simek <michal.simek@amd.com>
To: <u-boot@lists.denx.de>, <git@amd.com>
Cc: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Jonathan Humphreys <j-humphreys@ti.com>,
Shantur Rathore <i@shantur.com>, Simon Glass <sjg@chromium.org>,
Sughosh Ganu <sughosh.ganu@linaro.org>,
"Tom Rini" <trini@konsulko.com>,
"Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org>
Subject: [PATCH v6 0/3] efi_vars: Implement SPI Flash storage for EFI
Date: Tue, 3 Feb 2026 08:57:52 +0100 [thread overview]
Message-ID: <cover.1770105470.git.michal.simek@amd.com> (raw)
This is updated series based on v3 version sent here
https://lore.kernel.org/all/20231126220836.374956-1-i@shantur.com/
that's why I am continuing on v4 instead of starting from scratch.
Tested on kv260 with saving variables to location where User MTD partition
is.
CONFIG_EFI_VARIABLE_SF_STORE=y
CONFIG_EFI_RT_VOLATILE_STORE=y
CONFIG_EFI_VARIABLE_SF_OFFSET=0x22a0000
In Linux:
root@som:~# mount | grep efivars
none on /sys/firmware/efi/efivars type efivarfs (rw,relatime)
root@som:~# printf '\x07\x00\x00\x00Hello' \
| sudo tee /sys/firmware/efi/efivars/TestVar-12345678-1234-1234-1234-123456789abc
Helloroot@som:~#
root@som:~# dd if=/sys/firmware/efi/efivars/VarToFile-b2ac5fc9-92b7-4acd-aeac-11e818c3130c \
of=/tmp/vars skip=4 bs=1
1352+0 records in
1352+0 records out
1352 bytes (1.4 kB, 1.3 KiB) copied, 0.380992 s, 3.5 kB/s
root@som:~# flashcp /tmp/vars /dev/mtd16
root@som:~# reboot
Reboot and then in U-Boot:
ZynqMP> pri -e
...
TestVar:
12345678-1234-1234-1234-123456789abc (12345678-1234-1234-1234-123456789abc)
NV|BS|RT, DataSize = 0x5
00000000: 48 65 6c 6c 6f Hello
...
Thanks,
Michal
Changes in v6:
- Return EFI_SUCCESS in efi_set_variable_int() when
CONFIG_EFI_VARIABLE_NO_STORE is enabled
- sed -i 's/efi_var_read/efi_var_from/g'
- sed -i 's/efi_var_write/efi_var_to_storage/g'
- sed -i 's/efi_var_read/efi_var_from/g'
- sed -i 's/efi_var_write/efi_var_to_storage/g'
Changes in v5:
- Invert logic in efi_variable.c and avoid #if
Changes in v4:
- New patch based on review comments from v3
- Extend Kconfig description
- Extend commit message and describe efivar missing part
- use unify methods for reading/writing variable
Changes in v3:
- Fixed compiler warnings.
Changes in v2:
- Refactored efi_var_file to move common parts out as requested
- Changed ifdefs to use CONFIG_IS_DEFINED
- Fixed typos
Michal Simek (1):
efi_var: Unify read/write access helper function
Shantur Rathore (2):
efi_var_file: refactor to move buffer functions
efi_vars: Implement SPI Flash store
include/efi_variable.h | 18 +++----
lib/efi_loader/Kconfig | 34 +++++++++++-
lib/efi_loader/Makefile | 3 +-
lib/efi_loader/efi_var_common.c | 42 +++++++++++++++
lib/efi_loader/efi_var_file.c | 65 ++---------------------
lib/efi_loader/efi_var_sf.c | 92 +++++++++++++++++++++++++++++++++
lib/efi_loader/efi_variable.c | 19 ++++---
7 files changed, 195 insertions(+), 78 deletions(-)
create mode 100644 lib/efi_loader/efi_var_sf.c
--
2.43.0
base-commit: e206e3ab2ad266935b81f5e9d3af2ed47b866826
next reply other threads:[~2026-02-03 7:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 7:57 Michal Simek [this message]
2026-02-03 7:57 ` [PATCH v6 1/3] efi_var_file: refactor to move buffer functions Michal Simek
2026-02-03 7:57 ` [PATCH v6 2/3] efi_var: Unify read/write access helper function Michal Simek
2026-02-03 9:44 ` Maarten Brock
2026-02-03 10:10 ` Michal Simek
2026-02-03 11:29 ` Maarten Brock
2026-02-03 11:45 ` Michal Simek
2026-02-04 12:07 ` Ilias Apalodimas
2026-02-04 12:10 ` Michal Simek
2026-02-03 7:57 ` [PATCH v6 3/3] efi_vars: Implement SPI Flash store Michal Simek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1770105470.git.michal.simek@amd.com \
--to=michal.simek@amd.com \
--cc=gabriel.dalimonte@gmail.com \
--cc=git@amd.com \
--cc=i@shantur.com \
--cc=ilias.apalodimas@linaro.org \
--cc=j-humphreys@ti.com \
--cc=paul.liu@linaro.org \
--cc=sjg@chromium.org \
--cc=sughosh.ganu@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.