* [PATCH v2 0/7] Enable UFS RPMB-backed OP-TEE secure storage on Genio 720
@ 2026-11-16 20:45 Carlo Caione
2026-11-16 20:45 ` [PATCH v2 1/7] ufs: rpmb: validate requests before issuing commands Carlo Caione
` (6 more replies)
0 siblings, 7 replies; 9+ messages in thread
From: Carlo Caione @ 2026-11-16 20:45 UTC (permalink / raw)
To: Neil Armstrong, Jorge Ramirez-Ortiz, u-boot,
GSS_MTK_Uboot_upstream
Cc: Bhupesh Sharma, Neha Malcom Francis, Tom Rini, Carlo Caione,
Jens Wiklander, Ilias Apalodimas, Jan Kiszka, James Hilliard,
Jerome Forissier, Johan Jonker, Ryder Lee, Weijie Gao,
Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
Macpaul Lin, Heinrich Schuchardt, Marek Vasut, Quentin Schulz
This series enables UFS RPMB-backed OP-TEE secure storage on Genio 720.
The goal is to support pre-OS services such as EFI variable storage with
the same RPMB device identity used under Linux.
The platform also needs the OP-TEE UFS read fixes [1] and MT8391
platform and hardware-key support [2].
[1] https://github.com/OP-TEE/optee_os/pull/8238
[2] https://github.com/OP-TEE/optee_os/pull/8242
---
Changes in v2:
- Replace the extra defconfig with an optional UFS RPMB fragment that
also enables EFI variable storage and the OP-TEE RPMB command.
- Enable the OP-TEE client in the common G520/G720 configuration and
select the UFS device tree through DEVICE_TREE.
- Use generic UFS RPMB terminology in the configuration patch.
- Explain the failure cases addressed by the discovery-state patch.
- Add Ilias's Reviewed-by to the EFI variable documentation patch.
- Link to v1: https://patch.msgid.link/20261111-genio720-ufs-rpmb-minimal-v1-0-701a62dfa034@baylibre.com
---
Carlo Caione (6):
ufs: rpmb: validate requests before issuing commands
ufs: rpmb: stop the model string at its NUL terminator
tee: optee: keep UFS RPMB discovery state consistent
tee: optee: enumerate UFS RPMB services when consumers exist
configs: mediatek: add a UFS RPMB fragment
doc: uefi: mention UFS RPMB for OP-TEE variable storage
Macpaul Lin (1):
cmd: allow the OP-TEE RPMB command with UFS storage
board/mediatek/MAINTAINERS | 1 +
board/mediatek/mtk-ufs-rpmb.config | 3 +++
cmd/Kconfig | 4 ++--
configs/mt8189.config | 2 ++
doc/develop/uefi/uefi.rst | 5 +++--
drivers/tee/optee/core.c | 8 +++++++-
drivers/tee/optee/optee_private.h | 9 ++++++++-
drivers/tee/optee/rpmb_ufs.c | 18 ++++++++++++++++--
drivers/ufs/ufs-rpmb.c | 22 +++++++++++++++-------
9 files changed, 57 insertions(+), 15 deletions(-)
---
base-commit: 934995f642a21ca7f35fa9aed5f061394fcba243
change-id: 20261111-genio720-ufs-rpmb-minimal-41e476364217
Best regards,
--
Carlo Caione <ccaione@baylibre.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/7] ufs: rpmb: validate requests before issuing commands
2026-11-16 20:45 [PATCH v2 0/7] Enable UFS RPMB-backed OP-TEE secure storage on Genio 720 Carlo Caione
@ 2026-11-16 20:45 ` Carlo Caione
2026-11-16 20:45 ` [PATCH v2 2/7] ufs: rpmb: stop the model string at its NUL terminator Carlo Caione
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Carlo Caione @ 2026-11-16 20:45 UTC (permalink / raw)
To: Neil Armstrong, Jorge Ramirez-Ortiz, u-boot,
GSS_MTK_Uboot_upstream
Cc: Bhupesh Sharma, Neha Malcom Francis, Tom Rini, Carlo Caione,
Jens Wiklander, Ilias Apalodimas, Jan Kiszka, James Hilliard,
Jerome Forissier, Johan Jonker, Ryder Lee, Weijie Gao,
Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
Macpaul Lin, Heinrich Schuchardt, Marek Vasut, Quentin Schulz
Check frame counts and response space before issuing any commands. A
malformed request must not program a key or write data and then fail on
response validation. Use Linux's request shapes so surplus frames cannot
be sent or silently discarded.
Fixes: b3cd7ddbbdd5 ("ufs: add RPMB transport over SCSI SECURITY PROTOCOL")
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
drivers/ufs/ufs-rpmb.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/ufs/ufs-rpmb.c b/drivers/ufs/ufs-rpmb.c
index d9d35a06439..508eb74d976 100644
--- a/drivers/ufs/ufs-rpmb.c
+++ b/drivers/ufs/ufs-rpmb.c
@@ -157,16 +157,25 @@ int ufs_rpmb_route_frames(struct udevice *scsi_dev, unsigned int region,
int ret;
if (!scsi_dev || reqlen % RPMB_FRAME_SIZE ||
- rsplen % RPMB_FRAME_SIZE || !n_req)
+ rsplen % RPMB_FRAME_SIZE || !n_req || !n_rsp)
return -EINVAL;
request = get_unaligned_be16((u8 *)req + RPMB_FRAME_REQ_OFFSET);
+ /*
+ * Enforce Linux's frame counts before any I/O: a key-programming
+ * request and a write counter read are a single frame answered by a
+ * single frame, a data write may span several frames but returns one
+ * result, and a data read is one request returning several frames.
+ */
switch (request) {
case RPMB_REQ_KEY:
case RPMB_REQ_WRITE_DATA: {
u8 status_frame[RPMB_FRAME_SIZE];
+ if (n_rsp != 1 || (request == RPMB_REQ_KEY && n_req != 1))
+ return -EINVAL;
+
ret = ufs_rpmb_send(scsi_dev, region, req, n_req);
if (ret)
return ret;
@@ -178,20 +187,17 @@ int ufs_rpmb_route_frames(struct udevice *scsi_dev, unsigned int region,
if (ret)
return ret;
- if (n_rsp < 1)
- return -EINVAL;
-
return ufs_rpmb_recv(scsi_dev, region, rsp, 1);
}
case RPMB_REQ_WCOUNTER:
case RPMB_REQ_READ_DATA:
+ if (n_req != 1 || (request == RPMB_REQ_WCOUNTER && n_rsp != 1))
+ return -EINVAL;
+
ret = ufs_rpmb_send(scsi_dev, region, req, 1);
if (ret)
return ret;
- if (n_rsp < 1)
- return -EINVAL;
-
return ufs_rpmb_recv(scsi_dev, region, rsp, n_rsp);
default:
debug("ufs-rpmb: unsupported request 0x%x\n", request);
--
2.56.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/7] ufs: rpmb: stop the model string at its NUL terminator
2026-11-16 20:45 [PATCH v2 0/7] Enable UFS RPMB-backed OP-TEE secure storage on Genio 720 Carlo Caione
2026-11-16 20:45 ` [PATCH v2 1/7] ufs: rpmb: validate requests before issuing commands Carlo Caione
@ 2026-11-16 20:45 ` Carlo Caione
2026-11-16 20:45 ` [PATCH v2 3/7] tee: optee: keep UFS RPMB discovery state consistent Carlo Caione
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Carlo Caione @ 2026-11-16 20:45 UTC (permalink / raw)
To: Neil Armstrong, Jorge Ramirez-Ortiz, u-boot,
GSS_MTK_Uboot_upstream
Cc: Bhupesh Sharma, Neha Malcom Francis, Tom Rini, Carlo Caione,
Jens Wiklander, Ilias Apalodimas, Jan Kiszka, James Hilliard,
Jerome Forissier, Johan Jonker, Ryder Lee, Weijie Gao,
Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
Macpaul Lin, Heinrich Schuchardt, Marek Vasut, Quentin Schulz
Some UFS model descriptors contain trailing UTF-16 NULs. Converting them
to spaces changes the RPMB identity, whereas Linux stops at the first
NUL. OP-TEE then derives different keys for the same region in the two
boot stages. Stop at the terminator to preserve a common identity.
Fixes: 87094d8062bd ("ufs: derive the per-region RPMB CID and size for OP-TEE")
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
drivers/ufs/ufs-rpmb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/ufs/ufs-rpmb.c b/drivers/ufs/ufs-rpmb.c
index 508eb74d976..8b61760f071 100644
--- a/drivers/ufs/ufs-rpmb.c
+++ b/drivers/ufs/ufs-rpmb.c
@@ -270,6 +270,8 @@ static void ufs_rpmb_string_to_ascii(const u8 *raw, char *out, size_t outsz)
for (i = 0; i < nchars && n < (int)outsz - 1; i++) {
u16 c = get_unaligned_be16(raw + QUERY_DESC_HDR_SIZE + i * 2);
+ if (!c)
+ break;
out[n++] = (c >= 0x20 && c <= 0x7e) ? (char)c : ' ';
}
out[n] = '\0';
--
2.56.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 3/7] tee: optee: keep UFS RPMB discovery state consistent
2026-11-16 20:45 [PATCH v2 0/7] Enable UFS RPMB-backed OP-TEE secure storage on Genio 720 Carlo Caione
2026-11-16 20:45 ` [PATCH v2 1/7] ufs: rpmb: validate requests before issuing commands Carlo Caione
2026-11-16 20:45 ` [PATCH v2 2/7] ufs: rpmb: stop the model string at its NUL terminator Carlo Caione
@ 2026-11-16 20:45 ` Carlo Caione
2026-11-16 20:45 ` [PATCH v2 4/7] tee: optee: enumerate UFS RPMB services when consumers exist Carlo Caione
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Carlo Caione @ 2026-11-16 20:45 UTC (permalink / raw)
To: Neil Armstrong, Jorge Ramirez-Ortiz, u-boot,
GSS_MTK_Uboot_upstream
Cc: Bhupesh Sharma, Neha Malcom Francis, Tom Rini, Carlo Caione,
Jens Wiklander, Ilias Apalodimas, Jan Kiszka, James Hilliard,
Jerome Forissier, Johan Jonker, Ryder Lee, Weijie Gao,
Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
Macpaul Lin, Heinrich Schuchardt, Marek Vasut, Quentin Schulz
RPMB_FRAMES relies on discovery to select its target. The initial and
reset state currently select region 0, while a failed PROBE_NEXT leaves
the previous region active. An out-of-order frame request can therefore
reach a region that was not successfully selected.
Require a successful probe before accepting frames. Keep the discovery
cursor on metadata errors so retrying a failed probe does not skip a
potentially usable region.
Fixes: 3b39df3bc540 ("optee: implement the RPMB subsystem interface for UFS")
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
drivers/tee/optee/core.c | 2 ++
drivers/tee/optee/optee_private.h | 9 ++++++++-
drivers/tee/optee/rpmb_ufs.c | 18 ++++++++++++++++--
3 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c
index a47c76811cd..2abdfd99e5d 100644
--- a/drivers/tee/optee/core.c
+++ b/drivers/tee/optee/core.c
@@ -829,6 +829,8 @@ static int optee_probe(struct udevice *dev)
u32 sec_caps;
int ret;
+ optee_suppl_rpmb_init(dev);
+
if (!is_optee_api(pdata->invoke_fn)) {
dev_err(dev, "OP-TEE api uid mismatch\n");
return -ENOENT;
diff --git a/drivers/tee/optee/optee_private.h b/drivers/tee/optee/optee_private.h
index 5c72b280058..3f9fea532e4 100644
--- a/drivers/tee/optee/optee_private.h
+++ b/drivers/tee/optee/optee_private.h
@@ -34,7 +34,8 @@
/**
* struct optee_private - OP-TEE driver private data
* @rpmb_next_region: next UFS RPMB region to report on PROBE_NEXT
- * @rpmb_cur_region: UFS RPMB region selected by the last PROBE_NEXT
+ * @rpmb_cur_region: UFS RPMB region selected by the last PROBE_NEXT, or
+ * UFS_RPMB_NUM_REGIONS while no region is selected
*/
struct optee_private {
unsigned int rpmb_next_region;
@@ -97,6 +98,8 @@ static inline void optee_suppl_rpmb_release(struct udevice *dev)
#endif
#ifdef CONFIG_SUPPORT_UFS_RPMB
+void optee_suppl_rpmb_init(struct udevice *dev);
+
void optee_suppl_cmd_rpmb_probe_reset(struct udevice *dev,
struct optee_msg_arg *arg);
@@ -106,6 +109,10 @@ void optee_suppl_cmd_rpmb_probe_next(struct udevice *dev,
void optee_suppl_cmd_rpmb_frames(struct udevice *dev,
struct optee_msg_arg *arg);
#else
+static inline void optee_suppl_rpmb_init(struct udevice *dev)
+{
+}
+
static inline void optee_suppl_cmd_rpmb_probe_reset(struct udevice *dev,
struct optee_msg_arg *arg)
{
diff --git a/drivers/tee/optee/rpmb_ufs.c b/drivers/tee/optee/rpmb_ufs.c
index 0c820e9595d..fbb56305609 100644
--- a/drivers/tee/optee/rpmb_ufs.c
+++ b/drivers/tee/optee/rpmb_ufs.c
@@ -8,6 +8,13 @@
#include "optee_msg_supplicant.h"
#include "optee_private.h"
+void optee_suppl_rpmb_init(struct udevice *dev)
+{
+ struct optee_private *priv = dev_get_priv(dev);
+
+ priv->rpmb_cur_region = UFS_RPMB_NUM_REGIONS;
+}
+
static int optee_rpmb_get_dev(struct udevice **scsi_devp)
{
struct udevice *ufs_dev, *scsi_dev;
@@ -32,6 +39,7 @@ void optee_suppl_cmd_rpmb_probe_reset(struct udevice *dev,
{
struct optee_private *priv = dev_get_priv(dev);
+ priv->rpmb_cur_region = UFS_RPMB_NUM_REGIONS;
if (arg->num_params != 1 ||
arg->params[0].attr != OPTEE_MSG_ATTR_TYPE_VALUE_OUTPUT) {
arg->ret = TEE_ERROR_BAD_PARAMETERS;
@@ -39,7 +47,6 @@ void optee_suppl_cmd_rpmb_probe_reset(struct udevice *dev,
}
priv->rpmb_next_region = 0;
- priv->rpmb_cur_region = 0;
arg->params[0].u.value.a = OPTEE_MSG_RPC_SHM_TYPE_APPL;
arg->ret = TEE_SUCCESS;
@@ -57,6 +64,7 @@ void optee_suppl_cmd_rpmb_probe_next(struct udevice *dev,
ulong cid_size;
int ret;
+ priv->rpmb_cur_region = UFS_RPMB_NUM_REGIONS;
if (arg->num_params != 2 ||
arg->params[0].attr != OPTEE_MSG_ATTR_TYPE_VALUE_OUTPUT ||
arg->params[1].attr != OPTEE_MSG_ATTR_TYPE_RMEM_OUTPUT) {
@@ -78,7 +86,7 @@ void optee_suppl_cmd_rpmb_probe_next(struct udevice *dev,
}
while (priv->rpmb_next_region < UFS_RPMB_NUM_REGIONS) {
- unsigned int region = priv->rpmb_next_region++;
+ unsigned int region = priv->rpmb_next_region;
ret = ufs_rpmb_get_region_info(scsi_dev, region, &size_mult,
&rel_wr, cid_buf);
@@ -86,6 +94,7 @@ void optee_suppl_cmd_rpmb_probe_next(struct udevice *dev,
arg->ret = TEE_ERROR_GENERIC;
return;
}
+ priv->rpmb_next_region++;
if (!ret)
continue;
@@ -120,6 +129,11 @@ void optee_suppl_cmd_rpmb_frames(struct udevice *dev,
return;
}
+ if (priv->rpmb_cur_region >= UFS_RPMB_NUM_REGIONS) {
+ arg->ret = TEE_ERROR_ITEM_NOT_FOUND;
+ return;
+ }
+
if (optee_rpmb_get_dev(&scsi_dev)) {
arg->ret = TEE_ERROR_ITEM_NOT_FOUND;
return;
--
2.56.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 4/7] tee: optee: enumerate UFS RPMB services when consumers exist
2026-11-16 20:45 [PATCH v2 0/7] Enable UFS RPMB-backed OP-TEE secure storage on Genio 720 Carlo Caione
` (2 preceding siblings ...)
2026-11-16 20:45 ` [PATCH v2 3/7] tee: optee: keep UFS RPMB discovery state consistent Carlo Caione
@ 2026-11-16 20:45 ` Carlo Caione
2026-11-16 20:45 ` [PATCH v2 5/7] cmd: allow the OP-TEE RPMB command with UFS storage Carlo Caione
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Carlo Caione @ 2026-11-16 20:45 UTC (permalink / raw)
To: Neil Armstrong, Jorge Ramirez-Ortiz, u-boot,
GSS_MTK_Uboot_upstream
Cc: Bhupesh Sharma, Neha Malcom Francis, Tom Rini, Carlo Caione,
Jens Wiklander, Ilias Apalodimas, Jan Kiszka, James Hilliard,
Jerome Forissier, Johan Jonker, Ryder Lee, Weijie Gao,
Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
Macpaul Lin, Heinrich Schuchardt, Marek Vasut, Quentin Schulz
RPMB-backed service discovery currently runs only with eMMC. With UFS
enabled, services advertised only by PTA_CMD_GET_DEVICES_RPMB are never
bound. Allow the query with either transport.
Skip enumeration when no service drivers are registered, so enabling
UFS support alone does not initialize storage unnecessarily.
Fixes: 3b39df3bc540 ("optee: implement the RPMB subsystem interface for UFS")
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
drivers/tee/optee/core.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c
index 2abdfd99e5d..53806670b6a 100644
--- a/drivers/tee/optee/core.c
+++ b/drivers/tee/optee/core.c
@@ -194,13 +194,17 @@ static int bind_service_drivers(struct udevice *dev)
int ret, ret2, ret3 = 0;
u32 tee_sess;
+ if (!ll_entry_count(struct optee_service, optee_service))
+ return 0;
+
ret = optee_open_enum_session(dev, &tee_sess);
if (ret)
return ret;
ret = optee_bind_services(dev, tee_sess, PTA_CMD_GET_DEVICES);
ret2 = optee_bind_services(dev, tee_sess, PTA_CMD_GET_DEVICES_SUPP);
- if (CONFIG_IS_ENABLED(SUPPORT_EMMC_RPMB))
+ if (CONFIG_IS_ENABLED(SUPPORT_EMMC_RPMB) ||
+ CONFIG_IS_ENABLED(SUPPORT_UFS_RPMB))
ret3 = optee_bind_services(dev, tee_sess,
PTA_CMD_GET_DEVICES_RPMB);
--
2.56.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 5/7] cmd: allow the OP-TEE RPMB command with UFS storage
2026-11-16 20:45 [PATCH v2 0/7] Enable UFS RPMB-backed OP-TEE secure storage on Genio 720 Carlo Caione
` (3 preceding siblings ...)
2026-11-16 20:45 ` [PATCH v2 4/7] tee: optee: enumerate UFS RPMB services when consumers exist Carlo Caione
@ 2026-11-16 20:45 ` Carlo Caione
2026-11-16 20:45 ` [PATCH v2 6/7] configs: mediatek: add a UFS RPMB fragment Carlo Caione
2026-11-16 20:45 ` [PATCH v2 7/7] doc: uefi: mention UFS RPMB for OP-TEE variable storage Carlo Caione
6 siblings, 0 replies; 9+ messages in thread
From: Carlo Caione @ 2026-11-16 20:45 UTC (permalink / raw)
To: Neil Armstrong, Jorge Ramirez-Ortiz, u-boot,
GSS_MTK_Uboot_upstream
Cc: Bhupesh Sharma, Neha Malcom Francis, Tom Rini, Carlo Caione,
Jens Wiklander, Ilias Apalodimas, Jan Kiszka, James Hilliard,
Jerome Forissier, Johan Jonker, Ryder Lee, Weijie Gao,
Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
Macpaul Lin, Heinrich Schuchardt, Marek Vasut, Quentin Schulz
From: Macpaul Lin <macpaul.lin@mediatek.com>
CMD_OPTEE_RPMB is restricted to the eMMC transport even though the OP-
TEE persistent-object interface is independent of the storage medium.
Allow it with the UFS RPMB subsystem transport as well, preserving the
existing sandbox path and default.
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
cmd/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmd/Kconfig b/cmd/Kconfig
index ace0b2e9c80..6f07eccf16b 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1554,12 +1554,12 @@ config CMD_CLONE
config CMD_OPTEE_RPMB
bool "Enable read/write support on RPMB via OPTEE"
- depends on (SUPPORT_EMMC_RPMB && OPTEE) || SANDBOX_TEE
+ depends on ((SUPPORT_EMMC_RPMB || SUPPORT_UFS_RPMB) && OPTEE) || SANDBOX_TEE
default y if SANDBOX_TEE
select OPTEE_TA_AVB if SANDBOX_TEE
help
Enable the commands for reading, writing persistent named values
- in the Replay Protection Memory Block partition in eMMC by
+ in the Replay Protection Memory Block partition in eMMC or UFS by
using Persistent Objects in OPTEE
config CMD_OPTEE
--
2.56.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 6/7] configs: mediatek: add a UFS RPMB fragment
2026-11-16 20:45 [PATCH v2 0/7] Enable UFS RPMB-backed OP-TEE secure storage on Genio 720 Carlo Caione
` (4 preceding siblings ...)
2026-11-16 20:45 ` [PATCH v2 5/7] cmd: allow the OP-TEE RPMB command with UFS storage Carlo Caione
@ 2026-11-16 20:45 ` Carlo Caione
2026-11-19 23:51 ` David Lechner
2026-11-16 20:45 ` [PATCH v2 7/7] doc: uefi: mention UFS RPMB for OP-TEE variable storage Carlo Caione
6 siblings, 1 reply; 9+ messages in thread
From: Carlo Caione @ 2026-11-16 20:45 UTC (permalink / raw)
To: Neil Armstrong, Jorge Ramirez-Ortiz, u-boot,
GSS_MTK_Uboot_upstream
Cc: Bhupesh Sharma, Neha Malcom Francis, Tom Rini, Carlo Caione,
Jens Wiklander, Ilias Apalodimas, Jan Kiszka, James Hilliard,
Jerome Forissier, Johan Jonker, Ryder Lee, Weijie Gao,
Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
Macpaul Lin, Heinrich Schuchardt, Marek Vasut, Quentin Schulz
RPMB-backed services need provisioned storage and matching secure
firmware. Keep them optional so the Genio 520 and 720 can use their
existing defconfigs for both eMMC and UFS. Share the OP-TEE client
configuration and select the UFS device tree with DEVICE_TREE.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
board/mediatek/MAINTAINERS | 1 +
board/mediatek/mtk-ufs-rpmb.config | 3 +++
configs/mt8189.config | 2 ++
3 files changed, 6 insertions(+)
diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
index eaf645086f6..8159cdbaf5f 100644
--- a/board/mediatek/MAINTAINERS
+++ b/board/mediatek/MAINTAINERS
@@ -4,6 +4,7 @@ S: Maintained
F: arch/arm/dts/mt8189*
F: arch/arm/dts/mt8371-genio-*
F: arch/arm/dts/mt8391-genio-*
+F: board/mediatek/mtk-ufs-rpmb.config
F: configs/mt8189.config
F: configs/mt8371_genio_*
F: configs/mt8391_genio_*
diff --git a/board/mediatek/mtk-ufs-rpmb.config b/board/mediatek/mtk-ufs-rpmb.config
new file mode 100644
index 00000000000..dcb59e6ce18
--- /dev/null
+++ b/board/mediatek/mtk-ufs-rpmb.config
@@ -0,0 +1,3 @@
+CONFIG_CMD_OPTEE_RPMB=y
+CONFIG_SUPPORT_UFS_RPMB=y
+CONFIG_EFI_MM_COMM_TEE=y
diff --git a/configs/mt8189.config b/configs/mt8189.config
index a60f67bd7cb..54de8d94861 100644
--- a/configs/mt8189.config
+++ b/configs/mt8189.config
@@ -51,6 +51,8 @@ CONFIG_MTK_SERIAL=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_MTK_SNOR=y
+CONFIG_TEE=y
+CONFIG_OPTEE=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_MTK=y
--
2.56.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 7/7] doc: uefi: mention UFS RPMB for OP-TEE variable storage
2026-11-16 20:45 [PATCH v2 0/7] Enable UFS RPMB-backed OP-TEE secure storage on Genio 720 Carlo Caione
` (5 preceding siblings ...)
2026-11-16 20:45 ` [PATCH v2 6/7] configs: mediatek: add a UFS RPMB fragment Carlo Caione
@ 2026-11-16 20:45 ` Carlo Caione
6 siblings, 0 replies; 9+ messages in thread
From: Carlo Caione @ 2026-11-16 20:45 UTC (permalink / raw)
To: Neil Armstrong, Jorge Ramirez-Ortiz, u-boot,
GSS_MTK_Uboot_upstream
Cc: Bhupesh Sharma, Neha Malcom Francis, Tom Rini, Carlo Caione,
Jens Wiklander, Ilias Apalodimas, Jan Kiszka, James Hilliard,
Jerome Forissier, Johan Jonker, Ryder Lee, Weijie Gao,
Chunfeng Yun, Igor Belwon, David Lechner, Julien Stephan,
Macpaul Lin, Heinrich Schuchardt, Marek Vasut, Quentin Schulz
U-Boot's OP-TEE supplicant can relay RPMB requests to a UFS device when
CONFIG_SUPPORT_UFS_RPMB is enabled, but the UEFI documentation still
names only the eMMC transport for OP-TEE-backed variables. Mention both
options.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
doc/develop/uefi/uefi.rst | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst
index 94ddf690440..5dddfba32ca 100644
--- a/doc/develop/uefi/uefi.rst
+++ b/doc/develop/uefi/uefi.rst
@@ -214,10 +214,11 @@ CONFIG_EFI_MM_COMM_TEE=y.
Tianocore EDK II's standalone management mode driver for variables can
be linked to OP-TEE for this purpose. This module uses the Replay
-Protected Memory Block (RPMB) of an eMMC device for persisting
+Protected Memory Block (RPMB) of an eMMC or UFS device for persisting
non-volatile variables. When calling the variable services via the
OP-TEE API U-Boot's OP-TEE supplicant relays calls to the RPMB driver
-which has to be enabled via CONFIG_SUPPORT_EMMC_RPMB=y.
+which has to be enabled via CONFIG_SUPPORT_EMMC_RPMB=y for eMMC or
+CONFIG_SUPPORT_UFS_RPMB=y for UFS.
EDK2 Build instructions
***********************
--
2.56.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 6/7] configs: mediatek: add a UFS RPMB fragment
2026-11-16 20:45 ` [PATCH v2 6/7] configs: mediatek: add a UFS RPMB fragment Carlo Caione
@ 2026-11-19 23:51 ` David Lechner
0 siblings, 0 replies; 9+ messages in thread
From: David Lechner @ 2026-11-19 23:51 UTC (permalink / raw)
To: Carlo Caione, Neil Armstrong, Jorge Ramirez-Ortiz, u-boot,
GSS_MTK_Uboot_upstream
Cc: Bhupesh Sharma, Neha Malcom Francis, Tom Rini, Jens Wiklander,
Ilias Apalodimas, Jan Kiszka, James Hilliard, Jerome Forissier,
Johan Jonker, Ryder Lee, Weijie Gao, Chunfeng Yun, Igor Belwon,
Julien Stephan, Macpaul Lin, Heinrich Schuchardt, Marek Vasut,
Quentin Schulz
On 11/16/26 2:45 PM, Carlo Caione wrote:
> RPMB-backed services need provisioned storage and matching secure
> firmware. Keep them optional so the Genio 520 and 720 can use their
> existing defconfigs for both eMMC and UFS. Share the OP-TEE client
> configuration and select the UFS device tree with DEVICE_TREE.
>
> Signed-off-by: Carlo Caione <ccaione@baylibre.com>
> ---
> board/mediatek/MAINTAINERS | 1 +
> board/mediatek/mtk-ufs-rpmb.config | 3 +++
> configs/mt8189.config | 2 ++
> 3 files changed, 6 insertions(+)
>
> diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
> index eaf645086f6..8159cdbaf5f 100644
> --- a/board/mediatek/MAINTAINERS
> +++ b/board/mediatek/MAINTAINERS
> @@ -4,6 +4,7 @@ S: Maintained
> F: arch/arm/dts/mt8189*
> F: arch/arm/dts/mt8371-genio-*
> F: arch/arm/dts/mt8391-genio-*
> +F: board/mediatek/mtk-ufs-rpmb.config
> F: configs/mt8189.config
> F: configs/mt8371_genio_*
> F: configs/mt8391_genio_*
> diff --git a/board/mediatek/mtk-ufs-rpmb.config b/board/mediatek/mtk-ufs-rpmb.config
> new file mode 100644
> index 00000000000..dcb59e6ce18
> --- /dev/null
> +++ b/board/mediatek/mtk-ufs-rpmb.config
> @@ -0,0 +1,3 @@
> +CONFIG_CMD_OPTEE_RPMB=y
> +CONFIG_SUPPORT_UFS_RPMB=y
> +CONFIG_EFI_MM_COMM_TEE=y
> diff --git a/configs/mt8189.config b/configs/mt8189.config
> index a60f67bd7cb..54de8d94861 100644
> --- a/configs/mt8189.config
> +++ b/configs/mt8189.config
> @@ -51,6 +51,8 @@ CONFIG_MTK_SERIAL=y
> CONFIG_SPI=y
> CONFIG_DM_SPI=y
> CONFIG_MTK_SNOR=y
> +CONFIG_TEE=y
> +CONFIG_OPTEE=y
> CONFIG_USB=y
> CONFIG_USB_XHCI_HCD=y
> CONFIG_USB_XHCI_MTK=y
>
FYI, we have some other changes in-flight that might cause merge conflict
with this. So I can take this patch through the Mediatek tree after the
rest of it lands if we want.
Otherwise,
Reviewed-by: David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-11-19 23:51 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 20:45 [PATCH v2 0/7] Enable UFS RPMB-backed OP-TEE secure storage on Genio 720 Carlo Caione
2026-11-16 20:45 ` [PATCH v2 1/7] ufs: rpmb: validate requests before issuing commands Carlo Caione
2026-11-16 20:45 ` [PATCH v2 2/7] ufs: rpmb: stop the model string at its NUL terminator Carlo Caione
2026-11-16 20:45 ` [PATCH v2 3/7] tee: optee: keep UFS RPMB discovery state consistent Carlo Caione
2026-11-16 20:45 ` [PATCH v2 4/7] tee: optee: enumerate UFS RPMB services when consumers exist Carlo Caione
2026-11-16 20:45 ` [PATCH v2 5/7] cmd: allow the OP-TEE RPMB command with UFS storage Carlo Caione
2026-11-16 20:45 ` [PATCH v2 6/7] configs: mediatek: add a UFS RPMB fragment Carlo Caione
2026-11-19 23:51 ` David Lechner
2026-11-16 20:45 ` [PATCH v2 7/7] doc: uefi: mention UFS RPMB for OP-TEE variable storage Carlo Caione
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.