dmub->debug.inbox0_size = REG_READ(DMCUB_INBOX0_SIZE);
REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
- dmub->debug.is_dmcub_enabled = is_dmub_enabled;
+ ASSERT(is_dmub_enabled <= 0xFF);
+ dmub->debug.is_dmcub_enabled = (uint8_t)is_dmub_enabled;
REG_GET(DMCUB_CNTL, DMCUB_SOFT_RESET, &is_soft_reset);
- dmub->debug.is_dmcub_soft_reset = is_soft_reset;
+ ASSERT(is_soft_reset <= 0xFF);
+ dmub->debug.is_dmcub_soft_reset = (uint8_t)is_soft_reset;
REG_GET(DMCUB_SEC_CNTL, DMCUB_SEC_RESET_STATUS, &is_sec_reset);
- dmub->debug.is_dmcub_secure_reset = is_sec_reset;
+ ASSERT(is_sec_reset <= 0xFF);
+ dmub->debug.is_dmcub_secure_reset = (uint8_t)is_sec_reset;
REG_GET(DMCUB_CNTL, DMCUB_TRACEPORT_EN, &is_traceport_enabled);
- dmub->debug.is_traceport_en = is_traceport_enabled;
+ ASSERT(is_traceport_enabled <= 0xFF);
+ dmub->debug.is_traceport_en = (uint8_t)is_traceport_enabled;
REG_GET(DMCUB_REGION3_CW0_TOP_ADDRESS, DMCUB_REGION3_CW0_ENABLE, &is_cw0_enabled);
- dmub->debug.is_cw0_enabled = is_cw0_enabled;
+ ASSERT(is_cw0_enabled <= 0xFF);
+ dmub->debug.is_cw0_enabled = (uint8_t)is_cw0_enabled;
REG_GET(DMCUB_REGION3_CW6_TOP_ADDRESS, DMCUB_REGION3_CW6_ENABLE, &is_cw6_enabled);
- dmub->debug.is_cw6_enabled = is_cw6_enabled;
+ ASSERT(is_cw6_enabled <= 0xFF);
+ dmub->debug.is_cw6_enabled = (uint8_t)is_cw6_enabled;
}
dmub->debug.outbox1_size = REG_READ(DMCUB_OUTBOX1_SIZE);
REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
- dmub->debug.is_dmcub_enabled = is_dmub_enabled;
+ ASSERT(is_dmub_enabled <= 0xFF);
+ dmub->debug.is_dmcub_enabled = (uint8_t)is_dmub_enabled;
REG_GET(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS, &is_pwait);
- dmub->debug.is_pwait = is_pwait;
+ ASSERT(is_pwait <= 0xFF);
+ dmub->debug.is_pwait = (uint8_t)is_pwait;
REG_GET(DMCUB_CNTL2, DMCUB_SOFT_RESET, &is_soft_reset);
- dmub->debug.is_dmcub_soft_reset = is_soft_reset;
+ ASSERT(is_soft_reset <= 0xFF);
+ dmub->debug.is_dmcub_soft_reset = (uint8_t)is_soft_reset;
REG_GET(DMCUB_SEC_CNTL, DMCUB_SEC_RESET_STATUS, &is_sec_reset);
- dmub->debug.is_dmcub_secure_reset = is_sec_reset;
+ ASSERT(is_sec_reset <= 0xFF);
+ dmub->debug.is_dmcub_secure_reset = (uint8_t)is_sec_reset;
REG_GET(DMCUB_CNTL, DMCUB_TRACEPORT_EN, &is_traceport_enabled);
- dmub->debug.is_traceport_en = is_traceport_enabled;
+ ASSERT(is_traceport_enabled <= 0xFF);
+ dmub->debug.is_traceport_en = (uint8_t)is_traceport_enabled;
REG_GET(DMCUB_REGION3_CW0_TOP_ADDRESS, DMCUB_REGION3_CW0_ENABLE, &is_cw0_enabled);
- dmub->debug.is_cw0_enabled = is_cw0_enabled;
+ ASSERT(is_cw0_enabled <= 0xFF);
+ dmub->debug.is_cw0_enabled = (uint8_t)is_cw0_enabled;
REG_GET(DMCUB_REGION3_CW6_TOP_ADDRESS, DMCUB_REGION3_CW6_ENABLE, &is_cw6_enabled);
- dmub->debug.is_cw6_enabled = is_cw6_enabled;
+ ASSERT(is_cw6_enabled <= 0xFF);
+ dmub->debug.is_cw6_enabled = (uint8_t)is_cw6_enabled;
}
bool dmub_dcn31_should_detect(struct dmub_srv *dmub)
dmub->debug.outbox1_size = REG_READ(DMCUB_OUTBOX1_SIZE);
REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
- dmub->debug.is_dmcub_enabled = is_dmub_enabled;
+ ASSERT(is_dmub_enabled <= 0xFF);
+ dmub->debug.is_dmcub_enabled = (uint8_t)is_dmub_enabled;
REG_GET(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS, &is_pwait);
- dmub->debug.is_pwait = is_pwait;
+ ASSERT(is_pwait <= 0xFF);
+ dmub->debug.is_pwait = (uint8_t)is_pwait;
REG_GET(DMCUB_CNTL2, DMCUB_SOFT_RESET, &is_soft_reset);
- dmub->debug.is_dmcub_soft_reset = is_soft_reset;
+ ASSERT(is_soft_reset <= 0xFF);
+ dmub->debug.is_dmcub_soft_reset = (uint8_t)is_soft_reset;
REG_GET(DMCUB_CNTL, DMCUB_TRACEPORT_EN, &is_traceport_enabled);
- dmub->debug.is_traceport_en = is_traceport_enabled;
+ ASSERT(is_traceport_enabled <= 0xFF);
+ dmub->debug.is_traceport_en = (uint8_t)is_traceport_enabled;
REG_GET(DMCUB_REGION3_CW6_TOP_ADDRESS, DMCUB_REGION3_CW6_ENABLE, &is_cw6_enabled);
- dmub->debug.is_cw6_enabled = is_cw6_enabled;
+ ASSERT(is_cw6_enabled <= 0xFF);
+ dmub->debug.is_cw6_enabled = (uint8_t)is_cw6_enabled;
dmub->debug.gpint_datain0 = REG_READ(DMCUB_GPINT_DATAIN0);
}
union dmub_fw_boot_options boot_options = {0};
if (!dmub->dpia_supported) {
- dmub->dpia_supported = dmub_dcn35_get_fw_boot_option(dmub).bits.enable_dpia;
+ dmub->dpia_supported = dmub_dcn35_get_fw_boot_option(dmub).bits.enable_dpia != 0;
}
boot_options.bits.z10_disable = params->disable_z10;
dmub->debug.outbox1_size = REG_READ(DMCUB_OUTBOX1_SIZE);
REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
- dmub->debug.is_dmcub_enabled = is_dmub_enabled;
+ ASSERT(is_dmub_enabled <= 0xFF);
+ dmub->debug.is_dmcub_enabled = (uint8_t)is_dmub_enabled;
REG_GET(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS, &is_pwait);
- dmub->debug.is_pwait = is_pwait;
+ ASSERT(is_pwait <= 0xFF);
+ dmub->debug.is_pwait = (uint8_t)is_pwait;
REG_GET(DMCUB_CNTL2, DMCUB_SOFT_RESET, &is_soft_reset);
- dmub->debug.is_dmcub_soft_reset = is_soft_reset;
+ ASSERT(is_soft_reset <= 0xFF);
+ dmub->debug.is_dmcub_soft_reset = (uint8_t)is_soft_reset;
REG_GET(DMCUB_CNTL, DMCUB_TRACEPORT_EN, &is_traceport_enabled);
- dmub->debug.is_traceport_en = is_traceport_enabled;
+ ASSERT(is_traceport_enabled <= 0xFF);
+ dmub->debug.is_traceport_en = (uint8_t)is_traceport_enabled;
REG_GET(DMCUB_REGION3_CW6_TOP_ADDRESS, DMCUB_REGION3_CW6_ENABLE, &is_cw6_enabled);
- dmub->debug.is_cw6_enabled = is_cw6_enabled;
+ ASSERT(is_cw6_enabled <= 0xFF);
+ dmub->debug.is_cw6_enabled = (uint8_t)is_cw6_enabled;
dmub->debug.gpint_datain0 = REG_READ(DMCUB_GPINT_DATAIN0);
}
dmub->debug.outbox1_size = REG_READ(DMCUB_OUTBOX1_SIZE);
REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
- dmub->debug.is_dmcub_enabled = is_dmub_enabled;
+ ASSERT(is_dmub_enabled <= 0xFF);
+ dmub->debug.is_dmcub_enabled = (uint8_t)is_dmub_enabled;
REG_GET(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS, &is_pwait);
- dmub->debug.is_pwait = is_pwait;
+ ASSERT(is_pwait <= 0xFF);
+ dmub->debug.is_pwait = (uint8_t)is_pwait;
REG_GET(DMCUB_CNTL2, DMCUB_SOFT_RESET, &is_soft_reset);
- dmub->debug.is_dmcub_soft_reset = is_soft_reset;
+ ASSERT(is_soft_reset <= 0xFF);
+ dmub->debug.is_dmcub_soft_reset = (uint8_t)is_soft_reset;
REG_GET(DMCUB_SEC_CNTL, DMCUB_SEC_RESET_STATUS, &is_sec_reset);
- dmub->debug.is_dmcub_secure_reset = is_sec_reset;
+ ASSERT(is_sec_reset <= 0xFF);
+ dmub->debug.is_dmcub_secure_reset = (uint8_t)is_sec_reset;
REG_GET(DMCUB_CNTL, DMCUB_TRACEPORT_EN, &is_traceport_enabled);
- dmub->debug.is_traceport_en = is_traceport_enabled;
+ ASSERT(is_traceport_enabled <= 0xFF);
+ dmub->debug.is_traceport_en = (uint8_t)is_traceport_enabled;
REG_GET(DMCUB_REGION3_CW0_TOP_ADDRESS, DMCUB_REGION3_CW0_ENABLE, &is_cw0_enabled);
- dmub->debug.is_cw0_enabled = is_cw0_enabled;
+ ASSERT(is_cw0_enabled <= 0xFF);
+ dmub->debug.is_cw0_enabled = (uint8_t)is_cw0_enabled;
REG_GET(DMCUB_REGION3_CW6_TOP_ADDRESS, DMCUB_REGION3_CW6_ENABLE, &is_cw6_enabled);
- dmub->debug.is_cw6_enabled = is_cw6_enabled;
+ ASSERT(is_cw6_enabled <= 0xFF);
+ dmub->debug.is_cw6_enabled = (uint8_t)is_cw6_enabled;
dmub->debug.gpint_datain0 = REG_READ(DMCUB_GPINT_DATAIN0);
}
union dmub_fw_boot_options boot_options = {0};
if (!dmub->dpia_supported) {
- dmub->dpia_supported = dmub_dcn42_get_fw_boot_option(dmub).bits.enable_dpia;
+ dmub->dpia_supported = dmub_dcn42_get_fw_boot_option(dmub).bits.enable_dpia != 0;
}
boot_options.bits.z10_disable = params->disable_z10;
dmub->debug.outbox1_size = REG_READ(DMCUB_OUTBOX1_SIZE);
REG_GET(DMCUB_CNTL, DMCUB_ENABLE, &is_dmub_enabled);
- dmub->debug.is_dmcub_enabled = is_dmub_enabled;
+ ASSERT(is_dmub_enabled <= 0xFF);
+ dmub->debug.is_dmcub_enabled = (uint8_t)is_dmub_enabled;
REG_GET(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS, &is_pwait);
- dmub->debug.is_pwait = is_pwait;
+ ASSERT(is_pwait <= 0xFF);
+ dmub->debug.is_pwait = (uint8_t)is_pwait;
REG_GET(DMCUB_CNTL2, DMCUB_SOFT_RESET, &is_soft_reset);
- dmub->debug.is_dmcub_soft_reset = is_soft_reset;
+ ASSERT(is_soft_reset <= 0xFF);
+ dmub->debug.is_dmcub_soft_reset = (uint8_t)is_soft_reset;
REG_GET(DMCUB_SEC_CNTL, DMCUB_SEC_RESET_STATUS, &is_sec_reset);
- dmub->debug.is_dmcub_secure_reset = is_sec_reset;
+ ASSERT(is_sec_reset <= 0xFF);
+ dmub->debug.is_dmcub_secure_reset = (uint8_t)is_sec_reset;
REG_GET(DMCUB_CNTL, DMCUB_TRACEPORT_EN, &is_traceport_enabled);
- dmub->debug.is_traceport_en = is_traceport_enabled;
+ ASSERT(is_traceport_enabled <= 0xFF);
+ dmub->debug.is_traceport_en = (uint8_t)is_traceport_enabled;
REG_GET(DMCUB_REGION3_CW0_TOP_ADDRESS, DMCUB_REGION3_CW0_ENABLE, &is_cw0_enabled);
- dmub->debug.is_cw0_enabled = is_cw0_enabled;
+ ASSERT(is_cw0_enabled <= 0xFF);
+ dmub->debug.is_cw0_enabled = (uint8_t)is_cw0_enabled;
REG_GET(DMCUB_REGION3_CW6_TOP_ADDRESS, DMCUB_REGION3_CW6_ENABLE, &is_cw6_enabled);
- dmub->debug.is_cw6_enabled = is_cw6_enabled;
+ ASSERT(is_cw6_enabled <= 0xFF);
+ dmub->debug.is_cw6_enabled = (uint8_t)is_cw6_enabled;
dmub->debug.gpint_datain0 = REG_READ(DMCUB_GPINT_DATAIN0);
}
mask = va_arg(ap, uint32_t);
field_value = va_arg(ap, uint32_t);
+ ASSERT(shift <= 0xFF);
set_reg_field_value_masks(field_value_mask, field_value, mask,
- shift);
+ (uint8_t)shift);
i++;
}
}
static void dmub_srv_update_reg_inbox0_status(struct dmub_srv *dmub)
{
if (dmub->reg_inbox0.is_pending) {
- dmub->reg_inbox0.is_pending = dmub->hw_funcs.read_reg_inbox0_rsp_int_status &&
- !dmub->hw_funcs.read_reg_inbox0_rsp_int_status(dmub);
+ dmub->reg_inbox0.is_pending = (dmub->hw_funcs.read_reg_inbox0_rsp_int_status &&
+ !dmub->hw_funcs.read_reg_inbox0_rsp_int_status(dmub)) != 0;
if (!dmub->reg_inbox0.is_pending) {
/* ack the rsp interrupt */
enum dmub_status dmub_srv_reg_cmd_execute(struct dmub_srv *dmub, union dmub_rb_cmd *cmd)
{
- uint32_t num_pending = 0;
+ uint64_t num_pending = 0;
if (!dmub->hw_init)
return DMUB_STATUS_INVALID;
dmub->reg_inbox0.num_submitted++;
dmub->reg_inbox0.is_pending = true;
- dmub->reg_inbox0.is_multi_pending = cmd->cmd_common.header.multi_cmd_pending;
+ dmub->reg_inbox0.is_multi_pending = cmd->cmd_common.header.multi_cmd_pending != 0;
return DMUB_STATUS_OK;
}