Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2020 Advanced Micro Devices, Inc.
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  *
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0017  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0020  * OTHER DEALINGS IN THE SOFTWARE.
0021  *
0022  * Authors: AMD
0023  */
0024 
0025 #include "dc.h"
0026 #include "dc_dmub_srv.h"
0027 #include "dmub_outbox.h"
0028 #include "dmub/inc/dmub_cmd.h"
0029 
0030 /*
0031  *  Function: dmub_enable_outbox_notification
0032  *
0033  *  @brief
0034  *      Sends inbox cmd to dmub for enabling outbox notifications to x86.
0035  *
0036  *  @param
0037  *      [in] dmub_srv: dmub_srv structure
0038  */
0039 void dmub_enable_outbox_notification(struct dc_dmub_srv *dmub_srv)
0040 {
0041     union dmub_rb_cmd cmd;
0042 
0043     memset(&cmd, 0x0, sizeof(cmd));
0044     cmd.outbox1_enable.header.type = DMUB_CMD__OUTBOX1_ENABLE;
0045     cmd.outbox1_enable.header.sub_type = 0;
0046     cmd.outbox1_enable.header.payload_bytes =
0047         sizeof(cmd.outbox1_enable) -
0048         sizeof(cmd.outbox1_enable.header);
0049     cmd.outbox1_enable.enable = true;
0050 
0051     dc_dmub_srv_cmd_queue(dmub_srv, &cmd);
0052     dc_dmub_srv_cmd_execute(dmub_srv);
0053     dc_dmub_srv_wait_idle(dmub_srv);
0054 }