Commit 6c3162d0 authored by Cruise Hung's avatar Cruise Hung Committed by Alex Deucher
Browse files

drm/amd/display: Add helpers to get DMUB FW boot options



[Why & How]
To query the bits and print them out for debug purposes.

Reviewed-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Acked-by: default avatarAlan Liu <haoping.liu@amd.com>
Signed-off-by: default avatarCruise Hung <cruise.hung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 65e9d632
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -378,6 +378,7 @@ struct dmub_srv_hw_funcs {

	union dmub_fw_boot_status (*get_fw_status)(struct dmub_srv *dmub);

	union dmub_fw_boot_options (*get_fw_boot_option)(struct dmub_srv *dmub);

	void (*set_gpint)(struct dmub_srv *dmub,
			  union dmub_gpint_data_register reg);
@@ -778,6 +779,9 @@ void dmub_flush_buffer_mem(const struct dmub_fb *fb);
enum dmub_status dmub_srv_get_fw_boot_status(struct dmub_srv *dmub,
					     union dmub_fw_boot_status *status);

enum dmub_status dmub_srv_get_fw_boot_option(struct dmub_srv *dmub,
					     union dmub_fw_boot_options *option);

enum dmub_status dmub_srv_cmd_with_reply_data(struct dmub_srv *dmub,
					      union dmub_rb_cmd *cmd);

+8 −0
Original line number Diff line number Diff line
@@ -352,6 +352,14 @@ union dmub_fw_boot_status dmub_dcn31_get_fw_boot_status(struct dmub_srv *dmub)
	return status;
}

union dmub_fw_boot_options dmub_dcn31_get_fw_boot_option(struct dmub_srv *dmub)
{
	union dmub_fw_boot_options option;

	option.all = REG_READ(DMCUB_SCRATCH14);
	return option;
}

void dmub_dcn31_enable_dmub_boot_options(struct dmub_srv *dmub, const struct dmub_srv_hw_params *params)
{
	union dmub_fw_boot_options boot_options = {0};
+2 −0
Original line number Diff line number Diff line
@@ -239,6 +239,8 @@ void dmub_dcn31_skip_dmub_panel_power_sequence(struct dmub_srv *dmub, bool skip)

union dmub_fw_boot_status dmub_dcn31_get_fw_boot_status(struct dmub_srv *dmub);

union dmub_fw_boot_options dmub_dcn31_get_fw_boot_option(struct dmub_srv *dmub);

void dmub_dcn31_setup_outbox0(struct dmub_srv *dmub,
			      const struct dmub_region *outbox0);

+15 −0
Original line number Diff line number Diff line
@@ -255,6 +255,7 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic)
		funcs->get_gpint_response = dmub_dcn31_get_gpint_response;
		funcs->get_gpint_dataout = dmub_dcn31_get_gpint_dataout;
		funcs->get_fw_status = dmub_dcn31_get_fw_boot_status;
		funcs->get_fw_boot_option = dmub_dcn31_get_fw_boot_option;
		funcs->enable_dmub_boot_options = dmub_dcn31_enable_dmub_boot_options;
		funcs->skip_dmub_panel_power_sequence = dmub_dcn31_skip_dmub_panel_power_sequence;
		//outbox0 call stacks
@@ -846,6 +847,20 @@ enum dmub_status dmub_srv_get_fw_boot_status(struct dmub_srv *dmub,
	return DMUB_STATUS_OK;
}

enum dmub_status dmub_srv_get_fw_boot_option(struct dmub_srv *dmub,
					     union dmub_fw_boot_options *option)
{
	option->all = 0;

	if (!dmub->sw_init)
		return DMUB_STATUS_INVALID;

	if (dmub->hw_funcs.get_fw_boot_option)
		*option = dmub->hw_funcs.get_fw_boot_option(dmub);

	return DMUB_STATUS_OK;
}

enum dmub_status dmub_srv_cmd_with_reply_data(struct dmub_srv *dmub,
					      union dmub_rb_cmd *cmd)
{