Skip to content

Commit b68a064

Browse files
committed
[dt,otp] Rename misleadingly name field and its documentation
The documentation was probably copy-paste: the digest is not actually an OTP address but a CSR. Rename the field to make it clearer. Signed-off-by: Amaury Pouly <[email protected]>
1 parent e8fccdb commit b68a064

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

hw/ip_templates/otp_ctrl/util/dt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class OtpCtrlExt(Extension):
5252

5353
OTP_PARTITION_INFO_STRUCT_START_ADDR_FIELD_NAME = Name(["start", "addr"])
5454
OTP_PARTITION_INFO_STRUCT_SIZE_FIELD_NAME = Name(["size"])
55-
OTP_PARTITION_INFO_STRUCT_DIGEST_ADDR_FIELD_NAME = Name(["digest", "addr"])
55+
OTP_PARTITION_INFO_STRUCT_DIGEST_ADDR_FIELD_NAME = Name(["digest", "reg", "offset"])
5656
OTP_PARTITION_INFO_STRUCT_ALIGN_MASK_FIELD_NAME = Name(["align", "mask"])
5757
OTP_PARTITION_INFO_STRUCT_NAME = Name.from_snake_case("dt_otp_partition_info")
5858

@@ -82,7 +82,7 @@ def __init__(self, ip_helper: IpHelper):
8282
self._otp_partition_info_struct.add_field(
8383
name = self.OTP_PARTITION_INFO_STRUCT_DIGEST_ADDR_FIELD_NAME,
8484
field_type = ScalarType("uint32_t"),
85-
docstring = "The absolute OTP address at which this partition's digest starts",
85+
docstring = "The OTP digest CSR (where the digest is buffered) offset for this partition.",
8686
)
8787
self._otp_partition_info_struct.add_field(
8888
name = self.OTP_PARTITION_INFO_STRUCT_ALIGN_MASK_FIELD_NAME,

hw/top_darjeeling/ip_autogen/otp_ctrl/util/dt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class OtpCtrlExt(Extension):
5252

5353
OTP_PARTITION_INFO_STRUCT_START_ADDR_FIELD_NAME = Name(["start", "addr"])
5454
OTP_PARTITION_INFO_STRUCT_SIZE_FIELD_NAME = Name(["size"])
55-
OTP_PARTITION_INFO_STRUCT_DIGEST_ADDR_FIELD_NAME = Name(["digest", "addr"])
55+
OTP_PARTITION_INFO_STRUCT_DIGEST_ADDR_FIELD_NAME = Name(["digest", "reg", "offset"])
5656
OTP_PARTITION_INFO_STRUCT_ALIGN_MASK_FIELD_NAME = Name(["align", "mask"])
5757
OTP_PARTITION_INFO_STRUCT_NAME = Name.from_snake_case("dt_otp_partition_info")
5858

@@ -82,7 +82,7 @@ def __init__(self, ip_helper: IpHelper):
8282
self._otp_partition_info_struct.add_field(
8383
name = self.OTP_PARTITION_INFO_STRUCT_DIGEST_ADDR_FIELD_NAME,
8484
field_type = ScalarType("uint32_t"),
85-
docstring = "The absolute OTP address at which this partition's digest starts",
85+
docstring = "The OTP digest CSR (where the digest is buffered) offset for this partition.",
8686
)
8787
self._otp_partition_info_struct.add_field(
8888
name = self.OTP_PARTITION_INFO_STRUCT_ALIGN_MASK_FIELD_NAME,

hw/top_earlgrey/ip_autogen/otp_ctrl/util/dt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class OtpCtrlExt(Extension):
5252

5353
OTP_PARTITION_INFO_STRUCT_START_ADDR_FIELD_NAME = Name(["start", "addr"])
5454
OTP_PARTITION_INFO_STRUCT_SIZE_FIELD_NAME = Name(["size"])
55-
OTP_PARTITION_INFO_STRUCT_DIGEST_ADDR_FIELD_NAME = Name(["digest", "addr"])
55+
OTP_PARTITION_INFO_STRUCT_DIGEST_ADDR_FIELD_NAME = Name(["digest", "reg", "offset"])
5656
OTP_PARTITION_INFO_STRUCT_ALIGN_MASK_FIELD_NAME = Name(["align", "mask"])
5757
OTP_PARTITION_INFO_STRUCT_NAME = Name.from_snake_case("dt_otp_partition_info")
5858

@@ -82,7 +82,7 @@ def __init__(self, ip_helper: IpHelper):
8282
self._otp_partition_info_struct.add_field(
8383
name = self.OTP_PARTITION_INFO_STRUCT_DIGEST_ADDR_FIELD_NAME,
8484
field_type = ScalarType("uint32_t"),
85-
docstring = "The absolute OTP address at which this partition's digest starts",
85+
docstring = "The OTP digest CSR (where the digest is buffered) offset for this partition.",
8686
)
8787
self._otp_partition_info_struct.add_field(
8888
name = self.OTP_PARTITION_INFO_STRUCT_ALIGN_MASK_FIELD_NAME,

sw/device/silicon_creator/lib/drivers/otp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dt_otp_partition_info_t otp_readable_partition_info(otp_partition_t partition) {
5656

5757
uint64_t otp_partition_digest_read(otp_partition_t partition) {
5858
uint32_t reg_offset =
59-
otp_ctrl_base() + otp_readable_partition_info(partition).digest_addr;
59+
otp_ctrl_base() + otp_readable_partition_info(partition).digest_reg_offset;
6060
uint64_t value = sec_mmio_read32(reg_offset + sizeof(uint32_t));
6161
value <<= 32;
6262
value |= sec_mmio_read32(reg_offset);

sw/device/silicon_creator/rom/e2e/keymgr/rom_e2e_keymgr_init_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ bool test_main(void) {
4646
otp_dai_read(
4747
kOtpPartitionCreatorSwCfg,
4848
/*relative_address=*/
49-
otp_readable_partition_info(kOtpPartitionCreatorSwCfg).digest_addr -
49+
otp_readable_partition_info(kOtpPartitionCreatorSwCfg).digest_reg_offset -
5050
OTP_CTRL_PARAM_CREATOR_SW_CFG_OFFSET,
5151
otp_state,
5252
/*num_words=*/2);
5353
otp_dai_read(
5454
kOtpPartitionOwnerSwCfg,
5555
/*relative_address=*/
56-
otp_readable_partition_info(kOtpPartitionOwnerSwCfg).digest_addr -
56+
otp_readable_partition_info(kOtpPartitionOwnerSwCfg).digest_reg_offset -
5757
OTP_CTRL_PARAM_OWNER_SW_CFG_OFFSET,
5858
&otp_state[2],
5959
/*num_words=*/2);

0 commit comments

Comments
 (0)