2 * Copyright 2019 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
30 * DOC: DMUB interface and operation
32 * DMUB is the interface to the display DMCUB microcontroller on DCN hardware.
33 * It delegates hardware initialization and command submission to the
34 * microcontroller. DMUB is the shortname for DMCUB.
36 * This interface is not thread-safe. Ensure that all access to the interface
37 * is properly synchronized by the caller.
39 * Initialization and usage of the DMUB service should be done in the
42 * 1. dmub_srv_create()
43 * 2. dmub_srv_has_hw_support()
44 * 3. dmub_srv_calc_region_info()
45 * 4. dmub_srv_hw_init()
47 * The call to dmub_srv_create() is required to use the server.
49 * The calls to dmub_srv_has_hw_support() and dmub_srv_calc_region_info()
50 * are helpers to query cache window size and allocate framebuffer(s)
51 * for the cache windows.
53 * The call to dmub_srv_hw_init() programs the DMCUB registers to prepare
54 * for command submission. Commands can be queued via dmub_srv_cmd_queue()
55 * and executed via dmub_srv_cmd_execute().
57 * If the queue is full the dmub_srv_wait_for_idle() call can be used to
58 * wait until the queue has been cleared.
60 * Destroying the DMUB service can be done by calling dmub_srv_destroy().
61 * This does not clear DMUB hardware state, only software state.
63 * The interface is intended to be standalone and should not depend on any
64 * other component within DAL.
67 #include "inc/dmub_cmd.h"
69 #if defined(__cplusplus)
73 /* Forward declarations */
75 struct dmub_srv_common_regs;
76 struct dmub_srv_dcn31_regs;
78 struct dmcub_trace_buf_entry;
80 /* enum dmub_status - return code for dmcub functions */
84 DMUB_STATUS_QUEUE_FULL,
87 DMUB_STATUS_HW_FAILURE,
90 /* enum dmub_asic - dmub asic identifier */
109 /* enum dmub_window_id - dmub window identifier */
110 enum dmub_window_id {
111 DMUB_WINDOW_0_INST_CONST = 0,
113 DMUB_WINDOW_2_BSS_DATA,
115 DMUB_WINDOW_4_MAILBOX,
116 DMUB_WINDOW_5_TRACEBUFF,
117 DMUB_WINDOW_6_FW_STATE,
118 DMUB_WINDOW_7_SCRATCH_MEM,
122 /* enum dmub_notification_type - dmub outbox notification identifier */
123 enum dmub_notification_type {
124 DMUB_NOTIFICATION_NO_DATA = 0,
125 DMUB_NOTIFICATION_AUX_REPLY,
126 DMUB_NOTIFICATION_HPD,
127 DMUB_NOTIFICATION_HPD_IRQ,
128 DMUB_NOTIFICATION_SET_CONFIG_REPLY,
129 DMUB_NOTIFICATION_DPIA_NOTIFICATION,
130 DMUB_NOTIFICATION_MAX
134 * DPIA NOTIFICATION Response Type
136 enum dpia_notify_bw_alloc_status {
138 DPIA_BW_REQ_FAILED = 0,
141 DPIA_BW_ALLOC_CAPS_CHANGED
145 * struct dmub_region - dmub hw memory region
146 * @base: base address for region, must be 256 byte aligned
147 * @top: top address for region
155 * struct dmub_window - dmub hw cache window
156 * @off: offset to the fb memory in gpu address space
157 * @r: region in uc address space for cache window
160 union dmub_addr offset;
161 struct dmub_region region;
165 * struct dmub_fb - defines a dmub framebuffer memory region
166 * @cpu_addr: cpu virtual address for the region, NULL if invalid
167 * @gpu_addr: gpu virtual address for the region, NULL if invalid
168 * @size: size of the region in bytes, zero if invalid
177 * struct dmub_srv_region_params - params used for calculating dmub regions
178 * @inst_const_size: size of the fw inst const section
179 * @bss_data_size: size of the fw bss data section
180 * @vbios_size: size of the vbios data
181 * @fw_bss_data: raw firmware bss data section
183 struct dmub_srv_region_params {
184 uint32_t inst_const_size;
185 uint32_t bss_data_size;
187 const uint8_t *fw_inst_const;
188 const uint8_t *fw_bss_data;
192 * struct dmub_srv_region_info - output region info from the dmub service
193 * @fb_size: required minimum fb size for all regions, aligned to 4096 bytes
194 * @num_regions: number of regions used by the dmub service
195 * @regions: region info
197 * The regions are aligned such that they can be all placed within the
198 * same framebuffer but they can also be placed into different framebuffers.
200 * The size of each region can be calculated by the caller:
201 * size = reg.top - reg.base
203 * Care must be taken when performing custom allocations to ensure that each
204 * region base address is 256 byte aligned.
206 struct dmub_srv_region_info {
209 struct dmub_region regions[DMUB_WINDOW_TOTAL];
213 * struct dmub_srv_fb_params - parameters used for driver fb setup
214 * @region_info: region info calculated by dmub service
215 * @cpu_addr: base cpu address for the framebuffer
216 * @gpu_addr: base gpu virtual address for the framebuffer
218 struct dmub_srv_fb_params {
219 const struct dmub_srv_region_info *region_info;
225 * struct dmub_srv_fb_info - output fb info from the dmub service
226 * @num_fbs: number of required dmub framebuffers
227 * @fbs: fb data for each region
229 * Output from the dmub service helper that can be used by the
230 * driver to prepare dmub_fb that can be passed into the dmub
233 * Assumes that all regions are within the same framebuffer
234 * and have been setup according to the region_info generated
235 * by the dmub service.
237 struct dmub_srv_fb_info {
239 struct dmub_fb fb[DMUB_WINDOW_TOTAL];
243 * struct dmub_srv_hw_params - params for dmub hardware initialization
244 * @fb: framebuffer info for each region
245 * @fb_base: base of the framebuffer aperture
246 * @fb_offset: offset of the framebuffer aperture
247 * @psp_version: psp version to pass for DMCU init
248 * @load_inst_const: true if DMUB should load inst const fw
250 struct dmub_srv_hw_params {
251 struct dmub_fb *fb[DMUB_WINDOW_TOTAL];
254 uint32_t psp_version;
255 bool load_inst_const;
256 bool skip_panel_power_sequence;
258 bool power_optimization;
261 bool usb4_cm_version;
262 bool fw_in_system_memory;
263 bool dpia_hpd_int_enable_supported;
264 bool disable_clock_gate;
265 bool disallow_dispclk_dppclk_ds;
269 * struct dmub_diagnostic_data - Diagnostic data retrieved from DMCUB for
270 * debugging purposes, including logging, crash analysis, etc.
272 struct dmub_diagnostic_data {
273 uint32_t dmcub_version;
274 uint32_t scratch[17];
276 uint32_t undefined_address_fault_addr;
277 uint32_t inst_fetch_fault_addr;
278 uint32_t data_write_fault_addr;
279 uint32_t inbox1_rptr;
280 uint32_t inbox1_wptr;
281 uint32_t inbox1_size;
282 uint32_t inbox0_rptr;
283 uint32_t inbox0_wptr;
284 uint32_t inbox0_size;
285 uint32_t gpint_datain0;
286 uint8_t is_dmcub_enabled : 1;
287 uint8_t is_dmcub_soft_reset : 1;
288 uint8_t is_dmcub_secure_reset : 1;
289 uint8_t is_traceport_en : 1;
290 uint8_t is_cw0_enabled : 1;
291 uint8_t is_cw6_enabled : 1;
295 * struct dmub_srv_base_funcs - Driver specific base callbacks
297 struct dmub_srv_base_funcs {
301 * Hook for reading a register.
303 * Return: The 32-bit register value from the given address.
305 uint32_t (*reg_read)(void *ctx, uint32_t address);
310 * Hook for writing a value to the register specified by address.
312 void (*reg_write)(void *ctx, uint32_t address, uint32_t value);
316 * struct dmub_srv_hw_funcs - hardware sequencer funcs for dmub
318 struct dmub_srv_hw_funcs {
319 /* private: internal use only */
321 void (*init)(struct dmub_srv *dmub);
323 void (*reset)(struct dmub_srv *dmub);
325 void (*reset_release)(struct dmub_srv *dmub);
327 void (*backdoor_load)(struct dmub_srv *dmub,
328 const struct dmub_window *cw0,
329 const struct dmub_window *cw1);
331 void (*backdoor_load_zfb_mode)(struct dmub_srv *dmub,
332 const struct dmub_window *cw0,
333 const struct dmub_window *cw1);
334 void (*setup_windows)(struct dmub_srv *dmub,
335 const struct dmub_window *cw2,
336 const struct dmub_window *cw3,
337 const struct dmub_window *cw4,
338 const struct dmub_window *cw5,
339 const struct dmub_window *cw6);
341 void (*setup_mailbox)(struct dmub_srv *dmub,
342 const struct dmub_region *inbox1);
344 uint32_t (*get_inbox1_wptr)(struct dmub_srv *dmub);
346 uint32_t (*get_inbox1_rptr)(struct dmub_srv *dmub);
348 void (*set_inbox1_wptr)(struct dmub_srv *dmub, uint32_t wptr_offset);
350 void (*setup_out_mailbox)(struct dmub_srv *dmub,
351 const struct dmub_region *outbox1);
353 uint32_t (*get_outbox1_wptr)(struct dmub_srv *dmub);
355 void (*set_outbox1_rptr)(struct dmub_srv *dmub, uint32_t rptr_offset);
357 void (*setup_outbox0)(struct dmub_srv *dmub,
358 const struct dmub_region *outbox0);
360 uint32_t (*get_outbox0_wptr)(struct dmub_srv *dmub);
362 void (*set_outbox0_rptr)(struct dmub_srv *dmub, uint32_t rptr_offset);
364 uint32_t (*emul_get_inbox1_rptr)(struct dmub_srv *dmub);
366 void (*emul_set_inbox1_wptr)(struct dmub_srv *dmub, uint32_t wptr_offset);
368 bool (*is_supported)(struct dmub_srv *dmub);
370 bool (*is_psrsu_supported)(struct dmub_srv *dmub);
372 bool (*is_hw_init)(struct dmub_srv *dmub);
374 void (*enable_dmub_boot_options)(struct dmub_srv *dmub,
375 const struct dmub_srv_hw_params *params);
377 void (*skip_dmub_panel_power_sequence)(struct dmub_srv *dmub, bool skip);
379 union dmub_fw_boot_status (*get_fw_status)(struct dmub_srv *dmub);
382 void (*set_gpint)(struct dmub_srv *dmub,
383 union dmub_gpint_data_register reg);
385 bool (*is_gpint_acked)(struct dmub_srv *dmub,
386 union dmub_gpint_data_register reg);
388 uint32_t (*get_gpint_response)(struct dmub_srv *dmub);
390 uint32_t (*get_gpint_dataout)(struct dmub_srv *dmub);
392 void (*configure_dmub_in_system_memory)(struct dmub_srv *dmub);
393 void (*clear_inbox0_ack_register)(struct dmub_srv *dmub);
394 uint32_t (*read_inbox0_ack_register)(struct dmub_srv *dmub);
395 void (*send_inbox0_cmd)(struct dmub_srv *dmub, union dmub_inbox0_data_register data);
396 uint32_t (*get_current_time)(struct dmub_srv *dmub);
398 void (*get_diagnostic_data)(struct dmub_srv *dmub, struct dmub_diagnostic_data *dmub_oca);
400 bool (*should_detect)(struct dmub_srv *dmub);
404 * struct dmub_srv_create_params - params for dmub service creation
405 * @base_funcs: driver supplied base routines
406 * @hw_funcs: optional overrides for hw funcs
407 * @user_ctx: context data for callback funcs
408 * @asic: driver supplied asic
409 * @fw_version: the current firmware version, if any
410 * @is_virtual: false for hw support only
412 struct dmub_srv_create_params {
413 struct dmub_srv_base_funcs funcs;
414 struct dmub_srv_hw_funcs *hw_funcs;
422 * struct dmub_srv - software state for dmcub
423 * @asic: dmub asic identifier
424 * @user_ctx: user provided context for the dmub_srv
425 * @fw_version: the current firmware version, if any
426 * @is_virtual: false if hardware support only
427 * @fw_state: dmub firmware state pointer
434 struct dmub_fb scratch_mem_fb;
435 volatile const struct dmub_fw_state *fw_state;
437 /* private: internal use only */
438 const struct dmub_srv_common_regs *regs;
439 const struct dmub_srv_dcn31_regs *regs_dcn31;
440 const struct dmub_srv_dcn32_regs *regs_dcn32;
442 struct dmub_srv_base_funcs funcs;
443 struct dmub_srv_hw_funcs hw_funcs;
444 struct dmub_rb inbox1_rb;
445 uint32_t inbox1_last_wptr;
447 * outbox1_rb is accessed without locks (dal & dc)
448 * and to be used only in dmub_srv_stat_get_notification()
450 struct dmub_rb outbox1_rb;
452 struct dmub_rb outbox0_rb;
459 uint32_t psp_version;
461 /* Feature capabilities reported by fw */
462 struct dmub_feature_caps feature_caps;
463 struct dmub_visual_confirm_color visual_confirm_color;
467 * struct dmub_notification - dmub notification data
468 * @type: dmub notification type
469 * @link_index: link index to identify aux connection
470 * @result: USB4 status returned from dmub
471 * @pending_notification: Indicates there are other pending notifications
472 * @aux_reply: aux reply
473 * @hpd_status: hpd status
474 * @bw_alloc_reply: BW Allocation reply from CM/DPIA
476 struct dmub_notification {
477 enum dmub_notification_type type;
480 bool pending_notification;
482 struct aux_reply_data aux_reply;
483 enum dp_hpd_status hpd_status;
484 enum set_config_status sc_status;
486 * DPIA notification command.
488 struct dmub_rb_cmd_dpia_notification dpia_notification;
493 * DMUB firmware version helper macro - useful for checking if the version
494 * of a firmware to know if feature or functionality is supported or present.
496 #define DMUB_FW_VERSION(major, minor, revision) \
497 ((((major) & 0xFF) << 24) | (((minor) & 0xFF) << 16) | (((revision) & 0xFF) << 8))
500 * dmub_srv_create() - creates the DMUB service.
501 * @dmub: the dmub service
502 * @params: creation parameters for the service
505 * DMUB_STATUS_OK - success
506 * DMUB_STATUS_INVALID - unspecified error
508 enum dmub_status dmub_srv_create(struct dmub_srv *dmub,
509 const struct dmub_srv_create_params *params);
512 * dmub_srv_destroy() - destroys the DMUB service.
513 * @dmub: the dmub service
515 void dmub_srv_destroy(struct dmub_srv *dmub);
518 * dmub_srv_calc_region_info() - retreives region info from the dmub service
519 * @dmub: the dmub service
520 * @params: parameters used to calculate region locations
521 * @info_out: the output region info from dmub
523 * Calculates the base and top address for all relevant dmub regions
524 * using the parameters given (if any).
527 * DMUB_STATUS_OK - success
528 * DMUB_STATUS_INVALID - unspecified error
531 dmub_srv_calc_region_info(struct dmub_srv *dmub,
532 const struct dmub_srv_region_params *params,
533 struct dmub_srv_region_info *out);
536 * dmub_srv_calc_region_info() - retreives fb info from the dmub service
537 * @dmub: the dmub service
538 * @params: parameters used to calculate fb locations
539 * @info_out: the output fb info from dmub
541 * Calculates the base and top address for all relevant dmub regions
542 * using the parameters given (if any).
545 * DMUB_STATUS_OK - success
546 * DMUB_STATUS_INVALID - unspecified error
548 enum dmub_status dmub_srv_calc_fb_info(struct dmub_srv *dmub,
549 const struct dmub_srv_fb_params *params,
550 struct dmub_srv_fb_info *out);
553 * dmub_srv_has_hw_support() - returns hw support state for dmcub
554 * @dmub: the dmub service
555 * @is_supported: hw support state
557 * Queries the hardware for DMCUB support and returns the result.
559 * Can be called before dmub_srv_hw_init().
562 * DMUB_STATUS_OK - success
563 * DMUB_STATUS_INVALID - unspecified error
565 enum dmub_status dmub_srv_has_hw_support(struct dmub_srv *dmub,
569 * dmub_srv_is_hw_init() - returns hardware init state
572 * DMUB_STATUS_OK - success
573 * DMUB_STATUS_INVALID - unspecified error
575 enum dmub_status dmub_srv_is_hw_init(struct dmub_srv *dmub, bool *is_hw_init);
578 * dmub_srv_hw_init() - initializes the underlying DMUB hardware
579 * @dmub: the dmub service
580 * @params: params for hardware initialization
582 * Resets the DMUB hardware and performs backdoor loading of the
583 * required cache regions based on the input framebuffer regions.
586 * DMUB_STATUS_OK - success
587 * DMUB_STATUS_NO_CTX - dmcub context not initialized
588 * DMUB_STATUS_INVALID - unspecified error
590 enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,
591 const struct dmub_srv_hw_params *params);
594 * dmub_srv_hw_reset() - puts the DMUB hardware in reset state if initialized
595 * @dmub: the dmub service
597 * Before destroying the DMUB service or releasing the backing framebuffer
598 * memory we'll need to put the DMCUB into reset first.
600 * A subsequent call to dmub_srv_hw_init() will re-enable the DMCUB.
603 * DMUB_STATUS_OK - success
604 * DMUB_STATUS_INVALID - unspecified error
606 enum dmub_status dmub_srv_hw_reset(struct dmub_srv *dmub);
609 * dmub_srv_sync_inbox1() - sync sw state with hw state
610 * @dmub: the dmub service
612 * Sync sw state with hw state when resume from S0i3
615 * DMUB_STATUS_OK - success
616 * DMUB_STATUS_INVALID - unspecified error
618 enum dmub_status dmub_srv_sync_inbox1(struct dmub_srv *dmub);
621 * dmub_srv_cmd_queue() - queues a command to the DMUB
622 * @dmub: the dmub service
623 * @cmd: the command to queue
625 * Queues a command to the DMUB service but does not begin execution
629 * DMUB_STATUS_OK - success
630 * DMUB_STATUS_QUEUE_FULL - no remaining room in queue
631 * DMUB_STATUS_INVALID - unspecified error
633 enum dmub_status dmub_srv_cmd_queue(struct dmub_srv *dmub,
634 const union dmub_rb_cmd *cmd);
637 * dmub_srv_cmd_execute() - Executes a queued sequence to the dmub
638 * @dmub: the dmub service
640 * Begins execution of queued commands on the dmub.
643 * DMUB_STATUS_OK - success
644 * DMUB_STATUS_INVALID - unspecified error
646 enum dmub_status dmub_srv_cmd_execute(struct dmub_srv *dmub);
649 * dmub_srv_wait_for_auto_load() - Waits for firmware auto load to complete
650 * @dmub: the dmub service
651 * @timeout_us: the maximum number of microseconds to wait
653 * Waits until firmware has been autoloaded by the DMCUB. The maximum
654 * wait time is given in microseconds to prevent spinning forever.
656 * On ASICs without firmware autoload support this function will return
660 * DMUB_STATUS_OK - success
661 * DMUB_STATUS_TIMEOUT - wait for phy init timed out
662 * DMUB_STATUS_INVALID - unspecified error
664 enum dmub_status dmub_srv_wait_for_auto_load(struct dmub_srv *dmub,
665 uint32_t timeout_us);
668 * dmub_srv_wait_for_phy_init() - Waits for DMUB PHY init to complete
669 * @dmub: the dmub service
670 * @timeout_us: the maximum number of microseconds to wait
672 * Waits until the PHY has been initialized by the DMUB. The maximum
673 * wait time is given in microseconds to prevent spinning forever.
675 * On ASICs without PHY init support this function will return
679 * DMUB_STATUS_OK - success
680 * DMUB_STATUS_TIMEOUT - wait for phy init timed out
681 * DMUB_STATUS_INVALID - unspecified error
683 enum dmub_status dmub_srv_wait_for_phy_init(struct dmub_srv *dmub,
684 uint32_t timeout_us);
687 * dmub_srv_wait_for_idle() - Waits for the DMUB to be idle
688 * @dmub: the dmub service
689 * @timeout_us: the maximum number of microseconds to wait
691 * Waits until the DMUB buffer is empty and all commands have
692 * finished processing. The maximum wait time is given in
693 * microseconds to prevent spinning forever.
696 * DMUB_STATUS_OK - success
697 * DMUB_STATUS_TIMEOUT - wait for buffer to flush timed out
698 * DMUB_STATUS_INVALID - unspecified error
700 enum dmub_status dmub_srv_wait_for_idle(struct dmub_srv *dmub,
701 uint32_t timeout_us);
704 * dmub_srv_send_gpint_command() - Sends a GPINT based command.
705 * @dmub: the dmub service
706 * @command_code: the command code to send
707 * @param: the command parameter to send
708 * @timeout_us: the maximum number of microseconds to wait
710 * Sends a command via the general purpose interrupt (GPINT).
711 * Waits for the number of microseconds specified by timeout_us
712 * for the command ACK before returning.
714 * Can be called after software initialization.
717 * DMUB_STATUS_OK - success
718 * DMUB_STATUS_TIMEOUT - wait for ACK timed out
719 * DMUB_STATUS_INVALID - unspecified error
722 dmub_srv_send_gpint_command(struct dmub_srv *dmub,
723 enum dmub_gpint_command command_code,
724 uint16_t param, uint32_t timeout_us);
727 * dmub_srv_get_gpint_response() - Queries the GPINT response.
728 * @dmub: the dmub service
729 * @response: the response for the last GPINT
731 * Returns the response code for the last GPINT interrupt.
733 * Can be called after software initialization.
736 * DMUB_STATUS_OK - success
737 * DMUB_STATUS_INVALID - unspecified error
739 enum dmub_status dmub_srv_get_gpint_response(struct dmub_srv *dmub,
743 * dmub_srv_get_gpint_dataout() - Queries the GPINT DATAOUT.
744 * @dmub: the dmub service
745 * @dataout: the data for the GPINT DATAOUT
747 * Returns the response code for the last GPINT DATAOUT interrupt.
749 * Can be called after software initialization.
752 * DMUB_STATUS_OK - success
753 * DMUB_STATUS_INVALID - unspecified error
755 enum dmub_status dmub_srv_get_gpint_dataout(struct dmub_srv *dmub,
759 * dmub_flush_buffer_mem() - Read back entire frame buffer region.
760 * This ensures that the write from x86 has been flushed and will not
762 * @fb: frame buffer to flush
764 * Can be called after software initialization.
766 void dmub_flush_buffer_mem(const struct dmub_fb *fb);
769 * dmub_srv_get_fw_boot_status() - Returns the DMUB boot status bits.
771 * @dmub: the dmub service
772 * @status: out pointer for firmware status
775 * DMUB_STATUS_OK - success
776 * DMUB_STATUS_INVALID - unspecified error, unsupported
778 enum dmub_status dmub_srv_get_fw_boot_status(struct dmub_srv *dmub,
779 union dmub_fw_boot_status *status);
781 enum dmub_status dmub_srv_cmd_with_reply_data(struct dmub_srv *dmub,
782 union dmub_rb_cmd *cmd);
784 bool dmub_srv_get_outbox0_msg(struct dmub_srv *dmub, struct dmcub_trace_buf_entry *entry);
786 bool dmub_srv_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnostic_data *diag_data);
788 bool dmub_srv_should_detect(struct dmub_srv *dmub);
791 * dmub_srv_send_inbox0_cmd() - Send command to DMUB using INBOX0
792 * @dmub: the dmub service
793 * @data: the data to be sent in the INBOX0 command
795 * Send command by writing directly to INBOX0 WPTR
798 * DMUB_STATUS_OK - success
799 * DMUB_STATUS_INVALID - hw_init false or hw function does not exist
801 enum dmub_status dmub_srv_send_inbox0_cmd(struct dmub_srv *dmub, union dmub_inbox0_data_register data);
804 * dmub_srv_wait_for_inbox0_ack() - wait for DMUB to ACK INBOX0 command
805 * @dmub: the dmub service
806 * @timeout_us: the maximum number of microseconds to wait
808 * Wait for DMUB to ACK the INBOX0 message
811 * DMUB_STATUS_OK - success
812 * DMUB_STATUS_INVALID - hw_init false or hw function does not exist
813 * DMUB_STATUS_TIMEOUT - wait for ack timed out
815 enum dmub_status dmub_srv_wait_for_inbox0_ack(struct dmub_srv *dmub, uint32_t timeout_us);
818 * dmub_srv_wait_for_inbox0_ack() - clear ACK register for INBOX0
819 * @dmub: the dmub service
821 * Clear ACK register for INBOX0
824 * DMUB_STATUS_OK - success
825 * DMUB_STATUS_INVALID - hw_init false or hw function does not exist
827 enum dmub_status dmub_srv_clear_inbox0_ack(struct dmub_srv *dmub);
829 #if defined(__cplusplus)
833 #endif /* _DMUB_SRV_H_ */