File tree Expand file tree Collapse file tree 5 files changed +19
-15
lines changed
ip_templates/otp_ctrl/util
top_darjeeling/ip_autogen/otp_ctrl/util
top_earlgrey/ip_autogen/otp_ctrl/util
sw/device/silicon_creator Expand file tree Collapse file tree 5 files changed +19
-15
lines changed Original file line number Diff line number Diff 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,8 @@ 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 " +
86+ "this partition." ,
8687 )
8788 self ._otp_partition_info_struct .add_field (
8889 name = self .OTP_PARTITION_INFO_STRUCT_ALIGN_MASK_FIELD_NAME ,
Original file line number Diff line number Diff 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,8 @@ 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 " +
86+ "this partition." ,
8687 )
8788 self ._otp_partition_info_struct .add_field (
8889 name = self .OTP_PARTITION_INFO_STRUCT_ALIGN_MASK_FIELD_NAME ,
Original file line number Diff line number Diff 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,8 @@ 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 " +
86+ "this partition." ,
8687 )
8788 self ._otp_partition_info_struct .add_field (
8889 name = self .OTP_PARTITION_INFO_STRUCT_ALIGN_MASK_FIELD_NAME ,
Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ dt_otp_partition_info_t otp_readable_partition_info(otp_partition_t partition) {
5656
5757uint64_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 () +
60+ otp_readable_partition_info (partition ).digest_reg_offset ;
6061 uint64_t value = sec_mmio_read32 (reg_offset + sizeof (uint32_t ));
6162 value <<= 32 ;
6263 value |= sec_mmio_read32 (reg_offset );
Original file line number Diff line number Diff line change @@ -43,17 +43,17 @@ bool test_main(void) {
4343 // - the digest of the CreatorSwCfg partition,
4444 // - the digest of the OwnerSwCfg partition,
4545 // - the SHA256 integrity hash of the first stage boot keys.
46- otp_dai_read (
47- kOtpPartitionCreatorSwCfg ,
48- /*relative_address=*/
49- otp_readable_partition_info ( kOtpPartitionCreatorSwCfg ). digest_addr -
50- OTP_CTRL_PARAM_CREATOR_SW_CFG_OFFSET ,
51- otp_state ,
52- /*num_words=*/ 2 );
46+ otp_dai_read (kOtpPartitionCreatorSwCfg ,
47+ /*relative_address=*/
48+ otp_readable_partition_info ( kOtpPartitionCreatorSwCfg )
49+ . digest_reg_offset -
50+ OTP_CTRL_PARAM_CREATOR_SW_CFG_OFFSET ,
51+ otp_state ,
52+ /*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 );
You can’t perform that action at this time.
0 commit comments