Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Add DCN401 dependant changes for DMCUB

Update for DCN 4.0.1.

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Aurabindo Pillai and committed by
Alex Deucher
08502ceb a64a5212

+349 -25
+36 -8
drivers/gpu/drm/amd/display/dmub/dmub_srv.h
··· 67 67 #include "inc/dmub_cmd.h" 68 68 #include "dc/dc_types.h" 69 69 70 - #if defined(__cplusplus) 71 - extern "C" { 72 - #endif 73 - 74 70 #define DMUB_PC_SNAPSHOT_COUNT 10 75 71 76 72 /* Forward declarations */ ··· 111 115 DMUB_ASIC_DCN321, 112 116 DMUB_ASIC_DCN35, 113 117 DMUB_ASIC_DCN351, 118 + DMUB_ASIC_DCN401, 114 119 DMUB_ASIC_MAX, 115 120 }; 116 121 ··· 297 300 bool ips_sequential_ono; 298 301 enum dmub_memory_access_type mem_access_type; 299 302 enum dmub_ips_disable_type disable_ips; 303 + bool disallow_phy_access; 300 304 }; 301 305 302 306 /** ··· 451 453 void (*init_reg_offsets)(struct dmub_srv *dmub, struct dc_context *ctx); 452 454 453 455 void (*subvp_save_surf_addr)(struct dmub_srv *dmub, const struct dc_plane_address *addr, uint8_t subvp_index); 456 + void (*send_reg_inbox0_cmd_msg)(struct dmub_srv *dmub, 457 + union dmub_rb_cmd *cmd); 458 + uint32_t (*read_reg_inbox0_rsp_int_status)(struct dmub_srv *dmub); 459 + void (*read_reg_inbox0_cmd_rsp)(struct dmub_srv *dmub, 460 + union dmub_rb_cmd *cmd); 461 + void (*write_reg_inbox0_rsp_int_ack)(struct dmub_srv *dmub); 462 + uint32_t (*read_reg_outbox0_rdy_int_status)(struct dmub_srv *dmub); 463 + void (*write_reg_outbox0_rdy_int_ack)(struct dmub_srv *dmub); 464 + void (*read_reg_outbox0_msg)(struct dmub_srv *dmub, uint32_t *msg); 465 + void (*write_reg_outbox0_rsp)(struct dmub_srv *dmub, uint32_t *rsp); 466 + uint32_t (*read_reg_outbox0_rsp_int_status)(struct dmub_srv *dmub); 467 + void (*enable_reg_inbox0_rsp_int)(struct dmub_srv *dmub, bool enable); 468 + void (*enable_reg_outbox0_rdy_int)(struct dmub_srv *dmub, bool enable); 454 469 }; 455 470 456 471 /** ··· 507 496 const struct dmub_srv_dcn31_regs *regs_dcn31; 508 497 struct dmub_srv_dcn32_regs *regs_dcn32; 509 498 struct dmub_srv_dcn35_regs *regs_dcn35; 499 + const struct dmub_srv_dcn401_regs *regs_dcn401; 510 500 511 501 struct dmub_srv_base_funcs funcs; 512 502 struct dmub_srv_hw_funcs hw_funcs; ··· 939 927 void dmub_srv_subvp_save_surf_addr(struct dmub_srv *dmub, const struct dc_plane_address *addr, uint8_t subvp_index); 940 928 941 929 /** 930 + * dmub_srv_send_reg_inbox0_cmd() - send a dmub command and wait for the command 931 + * being processed by DMUB. 932 + * @dmub: The dmub service 933 + * @cmd: The dmub command being sent. If with_replay is true, the function will 934 + * update cmd with replied data. 935 + * @with_reply: true if DMUB reply needs to be copied back to cmd. false if the 936 + * cmd doesn't need to be replied. 937 + * @timeout_us: timeout in microseconds. 938 + * 939 + * Return: 940 + * DMUB_STATUS_OK - success 941 + * DMUB_STATUS_TIMEOUT - DMUB fails to process the command within the timeout 942 + * interval. 943 + */ 944 + enum dmub_status dmub_srv_send_reg_inbox0_cmd( 945 + struct dmub_srv *dmub, 946 + union dmub_rb_cmd *cmd, 947 + bool with_reply, uint32_t timeout_us); 948 + 949 + /** 942 950 * dmub_srv_set_power_state() - Track DC power state in dmub_srv 943 951 * @dmub: The dmub service 944 952 * @power_state: DC power state setting ··· 969 937 * void 970 938 */ 971 939 void dmub_srv_set_power_state(struct dmub_srv *dmub, enum dmub_srv_power_state_type dmub_srv_power_state); 972 - 973 - #if defined(__cplusplus) 974 - } 975 - #endif 976 940 977 941 #endif /* _DMUB_SRV_H_ */
+225 -16
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
··· 150 150 #define dmub_memset(dest, val, bytes) memset((dest), (val), (bytes)) 151 151 #endif 152 152 153 - #if defined(__cplusplus) 154 - extern "C" { 155 - #endif 156 - 157 153 /** 158 154 * OS/FW agnostic udelay 159 155 */ ··· 482 486 uint16_t color_b_cb; 483 487 uint16_t panel_inst; 484 488 }; 485 - 486 - #if defined(__cplusplus) 487 - } 488 - #endif 489 489 490 490 //============================================================================== 491 491 //</DMUB_TYPES>================================================================= ··· 1574 1582 struct dmub_cmd_fw_assisted_mclk_switch_config_v2 config_data; 1575 1583 }; 1576 1584 1585 + struct dmub_flip_addr_info { 1586 + uint32_t surf_addr_lo; 1587 + uint32_t surf_addr_c_lo; 1588 + uint32_t meta_addr_lo; 1589 + uint32_t meta_addr_c_lo; 1590 + uint16_t surf_addr_hi; 1591 + uint16_t surf_addr_c_hi; 1592 + uint16_t meta_addr_hi; 1593 + uint16_t meta_addr_c_hi; 1594 + }; 1595 + 1596 + struct dmub_fams2_flip_info { 1597 + union { 1598 + struct { 1599 + uint8_t is_immediate: 1; 1600 + } bits; 1601 + uint8_t all; 1602 + } config; 1603 + uint8_t otg_inst; 1604 + uint8_t pipe_mask; 1605 + uint8_t pad; 1606 + struct dmub_flip_addr_info addr_info; 1607 + }; 1608 + 1609 + struct dmub_rb_cmd_fams2_flip { 1610 + struct dmub_cmd_header header; 1611 + struct dmub_fams2_flip_info flip_info; 1612 + }; 1613 + 1614 + struct dmub_optc_state_v2 { 1615 + uint32_t v_total_min; 1616 + uint32_t v_total_max; 1617 + uint32_t v_total_mid; 1618 + uint32_t v_total_mid_frame_num; 1619 + uint8_t program_manual_trigger; 1620 + uint8_t tg_inst; 1621 + uint8_t pad[2]; 1622 + }; 1623 + 1624 + struct dmub_optc_position { 1625 + uint32_t vpos; 1626 + uint32_t hpos; 1627 + uint32_t frame; 1628 + }; 1629 + 1630 + struct dmub_rb_cmd_fams2_drr_update { 1631 + struct dmub_cmd_header header; 1632 + struct dmub_optc_state_v2 dmub_optc_state_req; 1633 + }; 1634 + 1635 + /* HW and FW global configuration data for FAMS2 */ 1636 + /* FAMS2 types and structs */ 1637 + enum fams2_stream_type { 1638 + FAMS2_STREAM_TYPE_NONE = 0, 1639 + FAMS2_STREAM_TYPE_VBLANK = 1, 1640 + FAMS2_STREAM_TYPE_VACTIVE = 2, 1641 + FAMS2_STREAM_TYPE_DRR = 3, 1642 + FAMS2_STREAM_TYPE_SUBVP = 4, 1643 + }; 1644 + 1645 + /* dynamic stream state */ 1646 + struct dmub_fams2_legacy_stream_dynamic_state { 1647 + uint8_t force_allow_at_vblank; 1648 + uint8_t pad[3]; 1649 + }; 1650 + 1651 + struct dmub_fams2_subvp_stream_dynamic_state { 1652 + uint16_t viewport_start_hubp_vline; 1653 + uint16_t viewport_height_hubp_vlines; 1654 + uint16_t viewport_start_c_hubp_vline; 1655 + uint16_t viewport_height_c_hubp_vlines; 1656 + uint16_t phantom_viewport_height_hubp_vlines; 1657 + uint16_t phantom_viewport_height_c_hubp_vlines; 1658 + uint16_t microschedule_start_otg_vline; 1659 + uint16_t mall_start_otg_vline; 1660 + uint16_t mall_start_hubp_vline; 1661 + uint16_t mall_start_c_hubp_vline; 1662 + uint8_t force_allow_at_vblank_only; 1663 + uint8_t pad[3]; 1664 + }; 1665 + 1666 + struct dmub_fams2_drr_stream_dynamic_state { 1667 + uint16_t stretched_vtotal; 1668 + uint8_t use_cur_vtotal; 1669 + uint8_t pad; 1670 + }; 1671 + 1672 + struct dmub_fams2_stream_dynamic_state { 1673 + uint64_t ref_tick; 1674 + uint32_t cur_vtotal; 1675 + uint16_t adjusted_allow_end_otg_vline; 1676 + uint8_t pad[2]; 1677 + struct dmub_optc_position ref_otg_pos; 1678 + struct dmub_optc_position target_otg_pos; 1679 + union { 1680 + struct dmub_fams2_legacy_stream_dynamic_state legacy; 1681 + struct dmub_fams2_subvp_stream_dynamic_state subvp; 1682 + struct dmub_fams2_drr_stream_dynamic_state drr; 1683 + } sub_state; 1684 + }; 1685 + 1686 + /* static stream state */ 1687 + struct dmub_fams2_legacy_stream_static_state { 1688 + uint8_t vactive_det_fill_delay_otg_vlines; 1689 + uint8_t programming_delay_otg_vlines; 1690 + }; 1691 + 1692 + struct dmub_fams2_subvp_stream_static_state { 1693 + uint16_t vratio_numerator; 1694 + uint16_t vratio_denominator; 1695 + uint16_t phantom_vtotal; 1696 + uint16_t phantom_vactive; 1697 + union { 1698 + struct { 1699 + uint8_t is_multi_planar : 1; 1700 + uint8_t is_yuv420 : 1; 1701 + } bits; 1702 + uint8_t all; 1703 + } config; 1704 + uint8_t programming_delay_otg_vlines; 1705 + uint8_t prefetch_to_mall_otg_vlines; 1706 + uint8_t phantom_otg_inst; 1707 + uint8_t phantom_pipe_mask; 1708 + uint8_t phantom_plane_pipe_masks[DMUB_MAX_PHANTOM_PLANES]; // phantom pipe mask per plane (for flip passthrough) 1709 + }; 1710 + 1711 + struct dmub_fams2_drr_stream_static_state { 1712 + uint16_t nom_stretched_vtotal; 1713 + uint8_t programming_delay_otg_vlines; 1714 + uint8_t only_stretch_if_required; 1715 + uint8_t pad[2]; 1716 + }; 1717 + 1718 + struct dmub_fams2_stream_static_state { 1719 + enum fams2_stream_type type; 1720 + uint32_t otg_vline_time_ns; 1721 + uint32_t otg_vline_time_ticks; 1722 + uint16_t htotal; 1723 + uint16_t vtotal; // nominal vtotal 1724 + uint16_t vblank_start; 1725 + uint16_t vblank_end; 1726 + uint16_t max_vtotal; 1727 + uint16_t allow_start_otg_vline; 1728 + uint16_t allow_end_otg_vline; 1729 + uint16_t drr_keepout_otg_vline; // after this vline, vtotal cannot be changed 1730 + uint8_t scheduling_delay_otg_vlines; // min time to budget for ready to microschedule start 1731 + uint8_t contention_delay_otg_vlines; // time to budget for contention on execution 1732 + uint8_t vline_int_ack_delay_otg_vlines; // min time to budget for vertical interrupt firing 1733 + uint8_t allow_to_target_delay_otg_vlines; // time from allow vline to target vline 1734 + union { 1735 + struct { 1736 + uint8_t is_drr: 1; // stream is DRR enabled 1737 + uint8_t clamp_vtotal_min: 1; // clamp vtotal to min instead of nominal 1738 + uint8_t min_ttu_vblank_usable: 1; // if min ttu vblank is above wm, no force pstate is needed in blank 1739 + } bits; 1740 + uint8_t all; 1741 + } config; 1742 + uint8_t otg_inst; 1743 + uint8_t pipe_mask; // pipe mask for the whole config 1744 + uint8_t num_planes; 1745 + uint8_t plane_pipe_masks[DMUB_MAX_PLANES]; // pipe mask per plane (for flip passthrough) 1746 + uint8_t pad[DMUB_MAX_PLANES % 4]; 1747 + union { 1748 + struct dmub_fams2_legacy_stream_static_state legacy; 1749 + struct dmub_fams2_subvp_stream_static_state subvp; 1750 + struct dmub_fams2_drr_stream_static_state drr; 1751 + } sub_state; 1752 + }; 1753 + 1754 + /** 1755 + * enum dmub_fams2_allow_delay_check_mode - macroscheduler mode for breaking on excessive 1756 + * p-state request to allow latency 1757 + */ 1758 + enum dmub_fams2_allow_delay_check_mode { 1759 + /* No check for request to allow delay */ 1760 + FAMS2_ALLOW_DELAY_CHECK_NONE = 0, 1761 + /* Check for request to allow delay */ 1762 + FAMS2_ALLOW_DELAY_CHECK_FROM_START = 1, 1763 + /* Check for prepare to allow delay */ 1764 + FAMS2_ALLOW_DELAY_CHECK_FROM_PREPARE = 2, 1765 + }; 1766 + 1767 + union dmub_fams2_global_feature_config { 1768 + struct { 1769 + uint32_t enable: 1; 1770 + uint32_t enable_ppt_check: 1; 1771 + uint32_t enable_stall_recovery: 1; 1772 + uint32_t enable_debug: 1; 1773 + uint32_t enable_offload_flip: 1; 1774 + uint32_t enable_visual_confirm: 1; 1775 + uint32_t allow_delay_check_mode: 2; 1776 + uint32_t reserved: 24; 1777 + } bits; 1778 + uint32_t all; 1779 + }; 1780 + 1781 + struct dmub_cmd_fams2_global_config { 1782 + uint32_t max_allow_delay_us; // max delay to assert allow from uclk change begin 1783 + uint32_t lock_wait_time_us; // time to forecast acquisition of lock 1784 + uint32_t num_streams; 1785 + union dmub_fams2_global_feature_config features; 1786 + uint8_t pad[3]; 1787 + }; 1788 + 1789 + union dmub_cmd_fams2_config { 1790 + struct dmub_cmd_fams2_global_config global; 1791 + struct dmub_fams2_stream_static_state stream; 1792 + }; 1793 + 1794 + /** 1795 + * DMUB rb command definition for FAMS2 (merged SubVP, FPO, Legacy) 1796 + */ 1797 + struct dmub_rb_cmd_fams2 { 1798 + struct dmub_cmd_header header; 1799 + union dmub_cmd_fams2_config config; 1800 + }; 1801 + 1577 1802 /** 1578 1803 * enum dmub_cmd_idle_opt_type - Idle optimization command type. 1579 1804 */ ··· 2472 2263 * on (for any SubVP cases that use a DRR display) 2473 2264 */ 2474 2265 DMUB_CMD__FAMS_SET_MANUAL_TRIGGER = 3, 2266 + DMUB_CMD__FAMS2_CONFIG = 4, 2267 + DMUB_CMD__FAMS2_DRR_UPDATE = 5, 2268 + DMUB_CMD__FAMS2_FLIP = 6, 2475 2269 }; 2476 2270 2477 2271 /** ··· 3759 3547 * Replay is the client of HW Lock Manager. 3760 3548 */ 3761 3549 HW_LOCK_CLIENT_REPLAY = 4, 3550 + HW_LOCK_CLIENT_FAMS2 = 5, 3762 3551 /** 3763 3552 * Invalid client. 3764 3553 */ ··· 4935 4722 * Definition of a DMUB_CMD__PSP_ASSR_ENABLE command. 4936 4723 */ 4937 4724 struct dmub_rb_cmd_assr_enable assr_enable; 4725 + struct dmub_rb_cmd_fams2 fams2_config; 4938 4726 4727 + struct dmub_rb_cmd_fams2_drr_update fams2_drr_update; 4728 + 4729 + struct dmub_rb_cmd_fams2_flip fams2_flip; 4939 4730 }; 4940 4731 4941 4732 /** ··· 4975 4758 //============================================================================== 4976 4759 //< DMUB_RB>==================================================================== 4977 4760 //============================================================================== 4978 - 4979 - #if defined(__cplusplus) 4980 - extern "C" { 4981 - #endif 4982 4761 4983 4762 /** 4984 4763 * struct dmub_rb_init_params - Initialization params for DMUB ringbuffer ··· 5251 5038 5252 5039 dmub_memcpy(cmd, rd_ptr, DMUB_RB_CMD_SIZE); 5253 5040 } 5254 - 5255 - #if defined(__cplusplus) 5256 - } 5257 - #endif 5258 5041 5259 5042 //============================================================================== 5260 5043 //</DMUB_RB>====================================================================
+1
drivers/gpu/drm/amd/display/dmub/src/Makefile
··· 26 26 DMUB += dmub_dcn32.o 27 27 DMUB += dmub_dcn35.o 28 28 DMUB += dmub_dcn351.o 29 + DMUB += dmub_dcn401.o 29 30 30 31 AMD_DAL_DMUB = $(addprefix $(AMDDALPATH)/dmub/src/,$(DMUB)) 31 32
-1
drivers/gpu/drm/amd/display/dmub/src/dmub_reg.h
··· 108 108 FN(reg, f4), v4) 109 109 110 110 /* Register field getting. */ 111 - 112 111 #define REG_GET(reg_name, field, val) \ 113 112 dmub_reg_get(CTX, REG(reg_name), FN(reg_name, field), val) 114 113
+87
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
··· 38 38 #include "dmub_dcn32.h" 39 39 #include "dmub_dcn35.h" 40 40 #include "dmub_dcn351.h" 41 + #include "dmub_dcn401.h" 41 42 #include "os_types.h" 42 43 /* 43 44 * Note: the DMUB service is standalone. No additional headers should be ··· 361 360 funcs->should_detect = dmub_dcn35_should_detect; 362 361 break; 363 362 363 + case DMUB_ASIC_DCN401: 364 + dmub->regs_dcn401 = &dmub_srv_dcn401_regs; 365 + funcs->configure_dmub_in_system_memory = dmub_dcn401_configure_dmub_in_system_memory; 366 + funcs->send_inbox0_cmd = dmub_dcn401_send_inbox0_cmd; 367 + funcs->clear_inbox0_ack_register = dmub_dcn401_clear_inbox0_ack_register; 368 + funcs->read_inbox0_ack_register = dmub_dcn401_read_inbox0_ack_register; 369 + funcs->reset = dmub_dcn401_reset; 370 + funcs->reset_release = dmub_dcn401_reset_release; 371 + funcs->backdoor_load = dmub_dcn401_backdoor_load; 372 + funcs->backdoor_load_zfb_mode = dmub_dcn401_backdoor_load_zfb_mode; 373 + funcs->setup_windows = dmub_dcn401_setup_windows; 374 + funcs->setup_mailbox = dmub_dcn401_setup_mailbox; 375 + funcs->get_inbox1_wptr = dmub_dcn401_get_inbox1_wptr; 376 + funcs->get_inbox1_rptr = dmub_dcn401_get_inbox1_rptr; 377 + funcs->set_inbox1_wptr = dmub_dcn401_set_inbox1_wptr; 378 + funcs->setup_out_mailbox = dmub_dcn401_setup_out_mailbox; 379 + funcs->get_outbox1_wptr = dmub_dcn401_get_outbox1_wptr; 380 + funcs->set_outbox1_rptr = dmub_dcn401_set_outbox1_rptr; 381 + funcs->is_supported = dmub_dcn401_is_supported; 382 + funcs->is_hw_init = dmub_dcn401_is_hw_init; 383 + funcs->set_gpint = dmub_dcn401_set_gpint; 384 + funcs->is_gpint_acked = dmub_dcn401_is_gpint_acked; 385 + funcs->get_gpint_response = dmub_dcn401_get_gpint_response; 386 + funcs->get_gpint_dataout = dmub_dcn401_get_gpint_dataout; 387 + funcs->get_fw_status = dmub_dcn401_get_fw_boot_status; 388 + funcs->enable_dmub_boot_options = dmub_dcn401_enable_dmub_boot_options; 389 + funcs->skip_dmub_panel_power_sequence = dmub_dcn401_skip_dmub_panel_power_sequence; 390 + //outbox0 call stacks 391 + funcs->setup_outbox0 = dmub_dcn401_setup_outbox0; 392 + funcs->get_outbox0_wptr = dmub_dcn401_get_outbox0_wptr; 393 + funcs->set_outbox0_rptr = dmub_dcn401_set_outbox0_rptr; 394 + 395 + funcs->get_current_time = dmub_dcn401_get_current_time; 396 + funcs->get_diagnostic_data = dmub_dcn401_get_diagnostic_data; 397 + funcs->send_reg_inbox0_cmd_msg = dmub_dcn401_send_reg_inbox0_cmd_msg; 398 + funcs->read_reg_inbox0_rsp_int_status = dmub_dcn401_read_reg_inbox0_rsp_int_status; 399 + funcs->read_reg_inbox0_cmd_rsp = dmub_dcn401_read_reg_inbox0_cmd_rsp; 400 + funcs->write_reg_inbox0_rsp_int_ack = dmub_dcn401_write_reg_inbox0_rsp_int_ack; 401 + funcs->write_reg_outbox0_rdy_int_ack = dmub_dcn401_write_reg_outbox0_rdy_int_ack; 402 + funcs->read_reg_outbox0_msg = dmub_dcn401_read_reg_outbox0_msg; 403 + funcs->write_reg_outbox0_rsp = dmub_dcn401_write_reg_outbox0_rsp; 404 + funcs->read_reg_outbox0_rdy_int_status = dmub_dcn401_read_reg_outbox0_rdy_int_status; 405 + funcs->read_reg_outbox0_rsp_int_status = dmub_dcn401_read_reg_outbox0_rsp_int_status; 406 + funcs->enable_reg_inbox0_rsp_int = dmub_dcn401_enable_reg_inbox0_rsp_int; 407 + funcs->enable_reg_outbox0_rdy_int = dmub_dcn401_enable_reg_outbox0_rdy_int; 408 + break; 364 409 default: 365 410 return false; 366 411 } ··· 724 677 dmub->hw_funcs.setup_mailbox(dmub, &inbox1); 725 678 if (dmub->hw_funcs.setup_out_mailbox) 726 679 dmub->hw_funcs.setup_out_mailbox(dmub, &outbox1); 680 + if (dmub->hw_funcs.enable_reg_inbox0_rsp_int) 681 + dmub->hw_funcs.enable_reg_inbox0_rsp_int(dmub, true); 682 + if (dmub->hw_funcs.enable_reg_outbox0_rdy_int) 683 + dmub->hw_funcs.enable_reg_outbox0_rdy_int(dmub, true); 727 684 728 685 dmub_memset(&rb_params, 0, sizeof(rb_params)); 729 686 rb_params.ctx = dmub; ··· 1154 1103 addr, 1155 1104 subvp_index); 1156 1105 } 1106 + } 1107 + 1108 + enum dmub_status dmub_srv_send_reg_inbox0_cmd( 1109 + struct dmub_srv *dmub, 1110 + union dmub_rb_cmd *cmd, 1111 + bool with_reply, uint32_t timeout_us) 1112 + { 1113 + uint32_t rsp_ready = 0; 1114 + uint32_t i; 1115 + 1116 + dmub->hw_funcs.send_reg_inbox0_cmd_msg(dmub, cmd); 1117 + 1118 + for (i = 0; i < timeout_us; i++) { 1119 + rsp_ready = dmub->hw_funcs.read_reg_inbox0_rsp_int_status(dmub); 1120 + if (rsp_ready) 1121 + break; 1122 + udelay(1); 1123 + } 1124 + if (rsp_ready == 0) 1125 + return DMUB_STATUS_TIMEOUT; 1126 + 1127 + if (with_reply) 1128 + dmub->hw_funcs.read_reg_inbox0_cmd_rsp(dmub, cmd); 1129 + 1130 + dmub->hw_funcs.write_reg_inbox0_rsp_int_ack(dmub); 1131 + 1132 + /* wait for rsp int status is cleared to initial state before exit */ 1133 + for (; i <= timeout_us; i++) { 1134 + rsp_ready = dmub->hw_funcs.read_reg_inbox0_rsp_int_status(dmub); 1135 + if (rsp_ready == 0) 1136 + break; 1137 + udelay(1); 1138 + } 1139 + ASSERT(rsp_ready == 0); 1140 + 1141 + return DMUB_STATUS_OK; 1157 1142 } 1158 1143 1159 1144 void dmub_srv_set_power_state(struct dmub_srv *dmub, enum dmub_srv_power_state_type dmub_srv_power_state)