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

drm/amd/display: Update dmub code

There is a delta in the dmub code
- add boot options
- add boot status
- remove unused auto_load_is_done func pointer

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Bhawanpreet Lakha and committed by
Alex Deucher
5fe6b98a b3fcde18

+70 -21
+19 -1
drivers/gpu/drm/amd/display/dmub/dmub_srv.h
··· 265 265 bool (*is_hw_init)(struct dmub_srv *dmub); 266 266 267 267 bool (*is_phy_init)(struct dmub_srv *dmub); 268 + void (*enable_dmub_boot_options)(struct dmub_srv *dmub); 268 269 269 - bool (*is_auto_load_done)(struct dmub_srv *dmub); 270 + void (*skip_dmub_panel_power_sequence)(struct dmub_srv *dmub, bool skip); 271 + 272 + union dmub_fw_boot_status (*get_fw_status)(struct dmub_srv *dmub); 273 + 270 274 271 275 void (*set_gpint)(struct dmub_srv *dmub, 272 276 union dmub_gpint_data_register reg); ··· 313 309 uint64_t fb_offset; 314 310 uint32_t psp_version; 315 311 bool load_inst_const; 312 + bool skip_panel_power_sequence; 316 313 }; 317 314 318 315 /** ··· 594 589 * Can be called after software initialization. 595 590 */ 596 591 void dmub_flush_buffer_mem(const struct dmub_fb *fb); 592 + 593 + /** 594 + * dmub_srv_get_fw_boot_status() - Returns the DMUB boot status bits. 595 + * 596 + * @dmub: the dmub service 597 + * @status: out pointer for firmware status 598 + * 599 + * Return: 600 + * DMUB_STATUS_OK - success 601 + * DMUB_STATUS_INVALID - unspecified error, unsupported 602 + */ 603 + enum dmub_status dmub_srv_get_fw_boot_status(struct dmub_srv *dmub, 604 + union dmub_fw_boot_status *status); 597 605 598 606 #if defined(__cplusplus) 599 607 }
+2 -1
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
··· 191 191 uint32_t optimized_init : 1; 192 192 uint32_t skip_phy_access : 1; 193 193 uint32_t disable_clk_gate: 1; 194 - uint32_t reserved : 27; 194 + uint32_t skip_phy_init_panel_sequence: 1; 195 + uint32_t reserved : 26; 195 196 } bits; 196 197 uint32_t all; 197 198 };
+23
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c
··· 312 312 { 313 313 return REG_READ(DMCUB_SCRATCH7); 314 314 } 315 + 316 + union dmub_fw_boot_status dmub_dcn20_get_fw_boot_status(struct dmub_srv *dmub) 317 + { 318 + union dmub_fw_boot_status status; 319 + 320 + status.all = REG_READ(DMCUB_SCRATCH0); 321 + return status; 322 + } 323 + 324 + void dmub_dcn20_enable_dmub_boot_options(struct dmub_srv *dmub) 325 + { 326 + union dmub_fw_boot_options boot_options = {0}; 327 + 328 + REG_WRITE(DMCUB_SCRATCH14, boot_options.all); 329 + } 330 + 331 + void dmub_dcn20_skip_dmub_panel_power_sequence(struct dmub_srv *dmub, bool skip) 332 + { 333 + union dmub_fw_boot_options boot_options; 334 + boot_options.all = REG_READ(DMCUB_SCRATCH14); 335 + boot_options.bits.skip_phy_init_panel_sequence = skip; 336 + REG_WRITE(DMCUB_SCRATCH14, boot_options.all); 337 + }
+6
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.h
··· 192 192 193 193 uint32_t dmub_dcn20_get_gpint_response(struct dmub_srv *dmub); 194 194 195 + void dmub_dcn20_enable_dmub_boot_options(struct dmub_srv *dmub); 196 + 197 + void dmub_dcn20_skip_dmub_panel_power_sequence(struct dmub_srv *dmub, bool skip); 198 + 199 + union dmub_fw_boot_status dmub_dcn20_get_fw_boot_status(struct dmub_srv *dmub); 200 + 195 201 #endif /* _DMUB_DCN20_H_ */
-5
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn21.c
··· 53 53 54 54 /* Shared functions. */ 55 55 56 - bool dmub_dcn21_is_auto_load_done(struct dmub_srv *dmub) 57 - { 58 - return (REG_READ(DMCUB_SCRATCH0) == 3); 59 - } 60 - 61 56 bool dmub_dcn21_is_phy_init(struct dmub_srv *dmub) 62 57 { 63 58 return REG_READ(DMCUB_SCRATCH10) == 0;
-2
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn21.h
··· 34 34 35 35 /* Hardware functions. */ 36 36 37 - bool dmub_dcn21_is_auto_load_done(struct dmub_srv *dmub); 38 - 39 37 bool dmub_dcn21_is_phy_init(struct dmub_srv *dmub); 40 38 41 39 #endif /* _DMUB_DCN21_H_ */
-5
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn30.c
··· 188 188 DMCUB_REGION3_CW6_TOP_ADDRESS, cw6->region.top, 189 189 DMCUB_REGION3_CW6_ENABLE, 1); 190 190 } 191 - 192 - bool dmub_dcn30_is_auto_load_done(struct dmub_srv *dmub) 193 - { 194 - return (REG_READ(DMCUB_SCRATCH0) > 0); 195 - }
-1
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn30.h
··· 45 45 const struct dmub_window *cw5, 46 46 const struct dmub_window *cw6); 47 47 48 - bool dmub_dcn30_is_auto_load_done(struct dmub_srv *dmub); 49 48 50 49 #endif /* _DMUB_DCN30_H_ */
+20 -6
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
··· 153 153 funcs->set_gpint = dmub_dcn20_set_gpint; 154 154 funcs->is_gpint_acked = dmub_dcn20_is_gpint_acked; 155 155 funcs->get_gpint_response = dmub_dcn20_get_gpint_response; 156 + funcs->get_fw_status = dmub_dcn20_get_fw_boot_status; 157 + funcs->enable_dmub_boot_options = dmub_dcn20_enable_dmub_boot_options; 158 + funcs->skip_dmub_panel_power_sequence = dmub_dcn20_skip_dmub_panel_power_sequence; 156 159 157 160 if (asic == DMUB_ASIC_DCN21) { 158 161 dmub->regs = &dmub_srv_dcn21_regs; 159 162 160 - funcs->is_auto_load_done = dmub_dcn21_is_auto_load_done; 161 163 funcs->is_phy_init = dmub_dcn21_is_phy_init; 162 164 } 163 165 if (asic == DMUB_ASIC_DCN30) { 164 166 dmub->regs = &dmub_srv_dcn30_regs; 165 167 166 - funcs->is_auto_load_done = dmub_dcn30_is_auto_load_done; 167 168 funcs->backdoor_load = dmub_dcn30_backdoor_load; 168 169 funcs->setup_windows = dmub_dcn30_setup_windows; 169 170 } ··· 536 535 if (!dmub->hw_init) 537 536 return DMUB_STATUS_INVALID; 538 537 539 - if (!dmub->hw_funcs.is_auto_load_done) 540 - return DMUB_STATUS_OK; 541 - 542 538 for (i = 0; i <= timeout_us; i += 100) { 543 - if (dmub->hw_funcs.is_auto_load_done(dmub)) 539 + union dmub_fw_boot_status status = dmub->hw_funcs.get_fw_status(dmub); 540 + 541 + if (status.bits.dal_fw && status.bits.mailbox_rdy) 544 542 return DMUB_STATUS_OK; 545 543 546 544 udelay(100); ··· 631 631 return DMUB_STATUS_INVALID; 632 632 633 633 *response = dmub->hw_funcs.get_gpint_response(dmub); 634 + 635 + return DMUB_STATUS_OK; 636 + } 637 + 638 + enum dmub_status dmub_srv_get_fw_boot_status(struct dmub_srv *dmub, 639 + union dmub_fw_boot_status *status) 640 + { 641 + status->all = 0; 642 + 643 + if (!dmub->sw_init) 644 + return DMUB_STATUS_INVALID; 645 + 646 + if (dmub->hw_funcs.get_fw_status) 647 + *status = dmub->hw_funcs.get_fw_status(dmub); 634 648 635 649 return DMUB_STATUS_OK; 636 650 }