Hi Jan,
On 4/11/25 14:03, Jan Kiszka wrote:
Jan Kiszka (6):
hw/sd/sdcard: Fix size check for backing block image
hw/sd/sdcard: Allow user-instantiated eMMC
hw/sd/sdcard: Add basic support for RPMB partition
hw/sd/sdcard: Handle RPMB MAC field
scripts: Add helper script to generate eMMC block device images
docs: Add eMMC device model description
Series queued with the following squashed to please checkpatch:
-- >8 --
diff --git a/docs/system/devices/emmc.rst b/docs/system/devices/emmc.rst
index 7e15b622706..8fcb47e25b2 100644
--- a/docs/system/devices/emmc.rst
+++ b/docs/system/devices/emmc.rst
@@ -0,0 +1,2 @@
+.. SPDX-License-Identifier: GPL-2.0-or-later
+
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 61754bf1083..9c86c016cc9 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1166,2 +1166 @@ static bool rpmb_calc_hmac(SDState *sd, const
RPMBDataFrame *frame,
- offset = lduw_be_p(&frame->address) * RPMB_DATA_LEN +
- sd_part_offset(sd);
+ offset = lduw_be_p(&frame->address) * RPMB_DATA_LEN +
sd_part_offset(sd);
@@ -1207,2 +1206,2 @@ static void emmc_rpmb_blk_read(SDState *sd,
uint64_t addr, uint32_t len)
- curr_block += lduw_be_p(&sd->rpmb.result.block_count) -
- sd->multi_blk_cnt;
+ curr_block += lduw_be_p(&sd->rpmb.result.block_count);
+ curr_block -= sd->multi_blk_cnt;
@@ -1211 +1210,2 @@ static void emmc_rpmb_blk_read(SDState *sd, uint64_t
addr, uint32_t len)
- if (blk_pread(sd->blk, addr, RPMB_DATA_LEN,
sd->rpmb.result.data, 0) < 0) {
+ if (blk_pread(sd->blk, addr, RPMB_DATA_LEN,
+ sd->rpmb.result.data, 0) < 0) {
@@ -1215,2 +1215,2 @@ static void emmc_rpmb_blk_read(SDState *sd,
uint64_t addr, uint32_t len)
- RPMB_RESULT_READ_FAILURE |
- (result & RPMB_RESULT_COUTER_EXPIRED));
+ RPMB_RESULT_READ_FAILURE
+ | (result & RPMB_RESULT_COUTER_EXPIRED));
@@ -1308,2 +1308 @@ exit:
- lduw_be_p(&sd->rpmb.result.result) |
- RPMB_RESULT_COUTER_EXPIRED);
+ lduw_be_p(&sd->rpmb.result.result) |
RPMB_RESULT_COUTER_EXPIRED);
diff --git a/scripts/mkemmc.sh b/scripts/mkemmc.sh
index 45dc3f08fa5..429388213c6 100755
--- a/scripts/mkemmc.sh
+++ b/scripts/mkemmc.sh
@@ -11,3 +10,0 @@
-# This work is licensed under the terms of the GNU GPL version 2.
-# See the COPYING file in the top-level directory.
-#
---
I apologize it took me so long to review, I needed to study the spec.
Thanks for this high quality contribution!
Phil.