@@ -699,7 +699,6 @@ struct OtOTPEgState {
699699
700700 OtOTPStorage * otp ;
701701 OtOTPHWCfg * hw_cfg ;
702- OtOTPEntropyCfg * entropy_cfg ;
703702 OtOTPTokens * tokens ;
704703 char * hexstr ;
705704
@@ -2803,14 +2802,7 @@ static const OtOTPHWCfg *ot_otp_eg_get_hw_cfg(const OtOTPState *s)
28032802{
28042803 const OtOTPEgState * es = OT_OTP_EG (s );
28052804
2806- return es -> hw_cfg ;
2807- }
2808-
2809- static const OtOTPEntropyCfg * ot_otp_eg_get_entropy_cfg (const OtOTPState * s )
2810- {
2811- const OtOTPEgState * es = OT_OTP_EG (s );
2812-
2813- return es -> entropy_cfg ;
2805+ return (const OtOTPHWCfg * )es -> hw_cfg ;
28142806}
28152807
28162808static void ot_otp_eg_request_entropy_bh (void * opaque )
@@ -3425,7 +3417,6 @@ static void ot_otp_eg_pwr_load_hw_cfg(OtOTPEgState *s)
34253417{
34263418 OtOTPStorage * otp = s -> otp ;
34273419 OtOTPHWCfg * hw_cfg = s -> hw_cfg ;
3428- OtOTPEntropyCfg * entropy_cfg = s -> entropy_cfg ;
34293420
34303421 memcpy (hw_cfg -> device_id , & otp -> data [R_HW_CFG0_DEVICE_ID ],
34313422 sizeof (hw_cfg -> device_id ));
@@ -3436,7 +3427,7 @@ static void ot_otp_eg_pwr_load_hw_cfg(OtOTPEgState *s)
34363427 s -> blk ? (uint8_t )otp -> data [R_HW_CFG1_EN_SRAM_IFETCH ] :
34373428 OT_MULTIBITBOOL8_TRUE ;
34383429 /* do not prevent CSRNG app reads if no OTP configuration is loaded */
3439- entropy_cfg -> en_csrng_sw_app_read =
3430+ hw_cfg -> en_csrng_sw_app_read =
34403431 s -> blk ? (uint8_t )otp -> data [R_HW_CFG1_EN_CSRNG_SW_APP_READ ] :
34413432 OT_MULTIBITBOOL8_TRUE ;
34423433}
@@ -3944,7 +3935,7 @@ static void ot_otp_eg_reset_enter(Object *obj, ResetType type)
39443935 *
39453936 * File back-end storage (loading) is processed from
39463937 * the ot_otp_eg_pwr_otp_bh handler, to ensure data is reloaded from the
3947- * backend on each reset, prior to this very reset fuction . This reset
3938+ * backend on each reset, prior to this very reset function . This reset
39483939 * function should not alter the storage content.
39493940 *
39503941 * Ideally the OTP reset functions should be decoupled from the regular
@@ -3972,6 +3963,7 @@ static void ot_otp_eg_reset_enter(Object *obj, ResetType type)
39723963 s -> keygen -> edn_sched = false;
39733964
39743965 memset (s -> regs , 0 , REGS_COUNT * sizeof (uint32_t ));
3966+ memset (s -> hw_cfg , 0 , sizeof (* s -> hw_cfg ));
39753967
39763968 s -> regs [R_DIRECT_ACCESS_REGWEN ] = 0x1u ;
39773969 s -> regs [R_CHECK_TRIGGER_REGWEN ] = 0x1u ;
@@ -4044,7 +4036,7 @@ static void ot_otp_eg_realize(DeviceState *dev, Error **errp)
40444036
40454037 /*
40464038 * Set the OTP drive's permissions now during realization. We can't leave it
4047- * until reset because QEMU might have `-deamonize `d and changed directory,
4039+ * until reset because QEMU might have `-daemonize `d and changed directory,
40484040 * invalidating the filesystem path to the OTP image.
40494041 */
40504042 if (s -> blk ) {
@@ -4104,7 +4096,6 @@ static void ot_otp_eg_init(Object *obj)
41044096 OT_LC_BROADCAST , OT_OTP_LC_BROADCAST_COUNT );
41054097
41064098 s -> hw_cfg = g_new0 (OtOTPHWCfg , 1u );
4107- s -> entropy_cfg = g_new0 (OtOTPEntropyCfg , 1u );
41084099 s -> tokens = g_new0 (OtOTPTokens , 1u );
41094100 s -> regs = g_new0 (uint32_t , REGS_COUNT );
41104101 s -> dai = g_new0 (OtOTPDAIController , 1u );
@@ -4163,7 +4154,6 @@ static void ot_otp_eg_class_init(ObjectClass *klass, void *data)
41634154
41644155 oc -> get_lc_info = & ot_otp_eg_get_lc_info ;
41654156 oc -> get_hw_cfg = & ot_otp_eg_get_hw_cfg ;
4166- oc -> get_entropy_cfg = & ot_otp_eg_get_entropy_cfg ;
41674157 oc -> get_otp_key = & ot_otp_eg_get_otp_key ;
41684158 oc -> get_keymgr_secret = & ot_otp_eg_get_keymgr_secret ;
41694159 oc -> program_req = & ot_otp_eg_program_req ;
0 commit comments