On 4/11/25 14:03, Jan Kiszka wrote:
From: Jan Kiszka <[email protected]>

The Replay Protected Memory Block (RPMB) is available since eMMC 4.4
which has been obsoleted by 4.41. Therefore lift the provided
EXT_CSD_REV to 5 (4.41) and provide the basic logic to implement basic
support for it. This allows to set the authentication key, read the
write counter and authenticated perform data read and write requests.
Those aren't actually authenticated yet, support for that will be added
later.

The RPMB image needs to be added to backing block images after potential
boot partitions and before the user data. It's size is controlled by
the rpmb-partition-size property.

Also missing in this version (and actually not only for RPMB bits) is
persistence of registers that are supposed to survive power cycles. Most
prominent are the write counters or the authentication key. This feature
can be added later, e.g. by append a state structure to the backing
block image.

Signed-off-by: Jan Kiszka <[email protected]>
---
  hw/sd/sd.c             | 217 +++++++++++++++++++++++++++++++++++++++--
  hw/sd/sdmmc-internal.h |  22 +++++
  hw/sd/trace-events     |   2 +
  3 files changed, 233 insertions(+), 8 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

Thanks a lot for the ld/st API changes, very much appreciated :)

Reply via email to