<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.msipheader251902e5, li.msipheader251902e5, div.msipheader251902e5
        {mso-style-name:msipheader251902e5;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal-compose;
        font-family:"Arial",sans-serif;
        color:#317100;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="msipheader251902e5" style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#317100">[AMD Public Use]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The register offset of IH_RB_RING1|RING2 register group is the major differences between osssys 4.0 and osssys 4.2. Other than that, 4.2 share the same registers as 4.0. So just centralize ih ring1 and ring2 related functions into a separated
 file, and invoke ih ring1 and ring2 function from vega10_ih function call for Arcturus.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Hawking<o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org>
<b>On Behalf Of </b>Deucher, Alexander<br>
<b>Sent:</b> Thursday, March 19, 2020 09:35<br>
<b>To:</b> Kuehling, Felix <Felix.Kuehling@amd.com>; Sierra Guiza, Alejandro (Alex) <Alex.Sierra@amd.com>; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH 2/8] drm/amdgpu: create new files for arcturus ih<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:15.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#317100">[AMD Public Use]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">if we have been using vega10_ih all along for arcturus, presumably the register map is close enough.  I'd suggest either adding whatever new stuff you need to vega10_ih.c or navi10_ih.c.  No need
 to add a completely new one for a small change like this.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Alex<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>> on behalf of Felix Kuehling <<a href="mailto:felix.kuehling@amd.com">felix.kuehling@amd.com</a>><br>
<b>Sent:</b> Wednesday, March 18, 2020 7:33 PM<br>
<b>To:</b> Sierra Guiza, Alejandro (Alex) <<a href="mailto:Alex.Sierra@amd.com">Alex.Sierra@amd.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a> <<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>><br>
<b>Subject:</b> Re: [PATCH 2/8] drm/amdgpu: create new files for arcturus ih</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">How much overlap is there between arcturus_ih and nave10_ih? Given that
<br>
they both use the same register map, could they share the same driver <br>
code with only minor differences?<br>
<br>
If they're almost the same, maybe you could rename navi10_ih.[ch] to <br>
osssys_v5_0.[ch] and use it for both navi10 and arcturus.<br>
<br>
Regards,<br>
   Felix<br>
<br>
On 2020-03-18 18:51, Alex Sierra wrote:<br>
> [Why]<br>
> Arcturus uses osssys v4.2. This shares the same register map as<br>
> osssys v5.0.<br>
><br>
> [How]<br>
> Copy vega10_ih into new arcturus_ih source and header files.<br>
> Replace osssys include file with v5.0.0 on arcturus_ih.c source.<br>
><br>
> Change-Id: I5215f32f477adb6a30acef6e8add9f8e5bb041ef<br>
> Signed-off-by: Alex Sierra <<a href="mailto:alex.sierra@amd.com">alex.sierra@amd.com</a>><br>
> ---<br>
>   drivers/gpu/drm/amd/amdgpu/arcturus_ih.c | 766 +++++++++++++++++++++++<br>
>   drivers/gpu/drm/amd/amdgpu/arcturus_ih.h |  30 +<br>
>   2 files changed, 796 insertions(+)<br>
>   create mode 100644 drivers/gpu/drm/amd/amdgpu/arcturus_ih.c<br>
>   create mode 100644 drivers/gpu/drm/amd/amdgpu/arcturus_ih.h<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/arcturus_ih.c b/drivers/gpu/drm/amd/amdgpu/arcturus_ih.c<br>
> new file mode 100644<br>
> index 000000000000..21bb5be40921<br>
> --- /dev/null<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/arcturus_ih.c<br>
> @@ -0,0 +1,766 @@<br>
> +/*<br>
> + * Copyright 2020 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a<br>
> + * copy of this software and associated documentation files (the "Software"),<br>
> + * to deal in the Software without restriction, including without limitation<br>
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
> + * and/or sell copies of the Software, and to permit persons to whom the<br>
> + * Software is furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice shall be included in<br>
> + * all copies or substantial portions of the Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR<br>
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,<br>
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR<br>
> + * OTHER DEALINGS IN THE SOFTWARE.<br>
> + *<br>
> + */<br>
> +<br>
> +#include <linux/pci.h><br>
> +<br>
> +#include "amdgpu.h"<br>
> +#include "amdgpu_ih.h"<br>
> +#include "soc15.h"<br>
> +<br>
> +#include "oss/osssys_5_0_0_offset.h"<br>
> +#include "oss/osssys_5_0_0_sh_mask.h"<br>
> +<br>
> +#include "soc15_common.h"<br>
> +#include "arcturus_ih.h"<br>
> +<br>
> +#define MAX_REARM_RETRY 10<br>
> +<br>
> +static void vega10_ih_set_interrupt_funcs(struct amdgpu_device *adev);<br>
> +<br>
> +/**<br>
> + * vega10_ih_enable_interrupts - Enable the interrupt ring buffer<br>
> + *<br>
> + * @adev: amdgpu_device pointer<br>
> + *<br>
> + * Enable the interrupt ring buffer (VEGA10).<br>
> + */<br>
> +static void vega10_ih_enable_interrupts(struct amdgpu_device *adev)<br>
> +{<br>
> +     u32 ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL);<br>
> +<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 1);<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR, 1);<br>
> +     if (amdgpu_sriov_vf(adev)) {<br>
> +             if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL, ih_rb_cntl)) {<br>
> +                     DRM_ERROR("PSP program IH_RB_CNTL failed!\n");<br>
> +                     return;<br>
> +             }<br>
> +     } else {<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL, ih_rb_cntl);<br>
> +     }<br>
> +     adev->irq.ih.enabled = true;<br>
> +<br>
> +     if (adev->irq.ih1.ring_size) {<br>
> +             ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);<br>
> +             ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,<br>
> +                                        RB_ENABLE, 1);<br>
> +             if (amdgpu_sriov_vf(adev)) {<br>
> +                     if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING1,<br>
> +                                             ih_rb_cntl)) {<br>
> +                             DRM_ERROR("program IH_RB_CNTL_RING1 failed!\n");<br>
> +                             return;<br>
> +                     }<br>
> +             } else {<br>
> +                     WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1, ih_rb_cntl);<br>
> +             }<br>
> +             adev->irq.ih1.enabled = true;<br>
> +     }<br>
> +<br>
> +     if (adev->irq.ih2.ring_size) {<br>
> +             ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);<br>
> +             ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,<br>
> +                                        RB_ENABLE, 1);<br>
> +             if (amdgpu_sriov_vf(adev)) {<br>
> +                     if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING2,<br>
> +                                             ih_rb_cntl)) {<br>
> +                             DRM_ERROR("program IH_RB_CNTL_RING2 failed!\n");<br>
> +                             return;<br>
> +                     }<br>
> +             } else {<br>
> +                     WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2, ih_rb_cntl);<br>
> +             }<br>
> +             adev->irq.ih2.enabled = true;<br>
> +     }<br>
> +}<br>
> +<br>
> +/**<br>
> + * vega10_ih_disable_interrupts - Disable the interrupt ring buffer<br>
> + *<br>
> + * @adev: amdgpu_device pointer<br>
> + *<br>
> + * Disable the interrupt ring buffer (VEGA10).<br>
> + */<br>
> +static void vega10_ih_disable_interrupts(struct amdgpu_device *adev)<br>
> +{<br>
> +     u32 ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL);<br>
> +<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_ENABLE, 0);<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, ENABLE_INTR, 0);<br>
> +     if (amdgpu_sriov_vf(adev)) {<br>
> +             if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL, ih_rb_cntl)) {<br>
> +                     DRM_ERROR("PSP program IH_RB_CNTL failed!\n");<br>
> +                     return;<br>
> +             }<br>
> +     } else {<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL, ih_rb_cntl);<br>
> +     }<br>
> +<br>
> +     /* set rptr, wptr to 0 */<br>
> +     WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR, 0);<br>
> +     WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR, 0);<br>
> +     adev->irq.ih.enabled = false;<br>
> +     adev->irq.ih.rptr = 0;<br>
> +<br>
> +     if (adev->irq.ih1.ring_size) {<br>
> +             ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);<br>
> +             ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING1,<br>
> +                                        RB_ENABLE, 0);<br>
> +             if (amdgpu_sriov_vf(adev)) {<br>
> +                     if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING1,<br>
> +                                             ih_rb_cntl)) {<br>
> +                             DRM_ERROR("program IH_RB_CNTL_RING1 failed!\n");<br>
> +                             return;<br>
> +                     }<br>
> +             } else {<br>
> +                     WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1, ih_rb_cntl);<br>
> +             }<br>
> +             /* set rptr, wptr to 0 */<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING1, 0);<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_RING1, 0);<br>
> +             adev->irq.ih1.enabled = false;<br>
> +             adev->irq.ih1.rptr = 0;<br>
> +     }<br>
> +<br>
> +     if (adev->irq.ih2.ring_size) {<br>
> +             ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);<br>
> +             ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL_RING2,<br>
> +                                        RB_ENABLE, 0);<br>
> +             if (amdgpu_sriov_vf(adev)) {<br>
> +                     if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING2,<br>
> +                                             ih_rb_cntl)) {<br>
> +                             DRM_ERROR("program IH_RB_CNTL_RING2 failed!\n");<br>
> +                             return;<br>
> +                     }<br>
> +             } else {<br>
> +                     WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2, ih_rb_cntl);<br>
> +             }<br>
> +<br>
> +             /* set rptr, wptr to 0 */<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING2, 0);<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_RING2, 0);<br>
> +             adev->irq.ih2.enabled = false;<br>
> +             adev->irq.ih2.rptr = 0;<br>
> +     }<br>
> +}<br>
> +<br>
> +static uint32_t vega10_ih_rb_cntl(struct amdgpu_ih_ring *ih, uint32_t ih_rb_cntl)<br>
> +{<br>
> +     int rb_bufsz = order_base_2(ih->ring_size / 4);<br>
> +<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,<br>
> +                                MC_SPACE, ih->use_bus_addr ? 1 : 4);<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,<br>
> +                                WPTR_OVERFLOW_CLEAR, 1);<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,<br>
> +                                WPTR_OVERFLOW_ENABLE, 1);<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RB_SIZE, rb_bufsz);<br>
> +     /* Ring Buffer write pointer writeback. If enabled, IH_RB_WPTR register<br>
> +      * value is written to memory<br>
> +      */<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,<br>
> +                                WPTR_WRITEBACK_ENABLE, 1);<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, MC_SNOOP, 1);<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, MC_RO, 0);<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, MC_VMID, 0);<br>
> +<br>
> +     return ih_rb_cntl;<br>
> +}<br>
> +<br>
> +static uint32_t vega10_ih_doorbell_rptr(struct amdgpu_ih_ring *ih)<br>
> +{<br>
> +     u32 ih_doorbell_rtpr = 0;<br>
> +<br>
> +     if (ih->use_doorbell) {<br>
> +             ih_doorbell_rtpr = REG_SET_FIELD(ih_doorbell_rtpr,<br>
> +                                              IH_DOORBELL_RPTR, OFFSET,<br>
> +                                              ih->doorbell_index);<br>
> +             ih_doorbell_rtpr = REG_SET_FIELD(ih_doorbell_rtpr,<br>
> +                                              IH_DOORBELL_RPTR,<br>
> +                                              ENABLE, 1);<br>
> +     } else {<br>
> +             ih_doorbell_rtpr = REG_SET_FIELD(ih_doorbell_rtpr,<br>
> +                                              IH_DOORBELL_RPTR,<br>
> +                                              ENABLE, 0);<br>
> +     }<br>
> +     return ih_doorbell_rtpr;<br>
> +}<br>
> +<br>
> +/**<br>
> + * vega10_ih_irq_init - init and enable the interrupt ring<br>
> + *<br>
> + * @adev: amdgpu_device pointer<br>
> + *<br>
> + * Allocate a ring buffer for the interrupt controller,<br>
> + * enable the RLC, disable interrupts, enable the IH<br>
> + * ring buffer and enable it (VI).<br>
> + * Called at device load and reume.<br>
> + * Returns 0 for success, errors for failure.<br>
> + */<br>
> +static int vega10_ih_irq_init(struct amdgpu_device *adev)<br>
> +{<br>
> +     struct amdgpu_ih_ring *ih;<br>
> +     u32 ih_rb_cntl, ih_chicken;<br>
> +     int ret = 0;<br>
> +     u32 tmp;<br>
> +<br>
> +     /* disable irqs */<br>
> +     vega10_ih_disable_interrupts(adev);<br>
> +<br>
> +     adev->nbio.funcs->ih_control(adev);<br>
> +<br>
> +     ih = &adev->irq.ih;<br>
> +     /* Ring Buffer base. [39:8] of 40-bit address of the beginning of the ring buffer*/<br>
> +     WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE, ih->gpu_addr >> 8);<br>
> +     WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE_HI, (ih->gpu_addr >> 40) & 0xff);<br>
> +<br>
> +     ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL);<br>
> +     ih_rb_cntl = vega10_ih_rb_cntl(ih, ih_rb_cntl);<br>
> +     ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, RPTR_REARM,<br>
> +                                !!adev->irq.msi_enabled);<br>
> +     if (amdgpu_sriov_vf(adev)) {<br>
> +             if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL, ih_rb_cntl)) {<br>
> +                     DRM_ERROR("PSP program IH_RB_CNTL failed!\n");<br>
> +                     return -ETIMEDOUT;<br>
> +             }<br>
> +     } else {<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL, ih_rb_cntl);<br>
> +     }<br>
> +<br>
> +     if ((adev->asic_type == CHIP_ARCTURUS &&<br>
> +          adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) ||<br>
> +         adev->asic_type == CHIP_RENOIR) {<br>
> +             ih_chicken = RREG32_SOC15(OSSSYS, 0, mmIH_CHICKEN);<br>
> +             if (adev->irq.ih.use_bus_addr) {<br>
> +                     ih_chicken = REG_SET_FIELD(ih_chicken, IH_CHICKEN,<br>
> +                                                MC_SPACE_GPA_ENABLE, 1);<br>
> +             } else {<br>
> +                     ih_chicken = REG_SET_FIELD(ih_chicken, IH_CHICKEN,<br>
> +                                                MC_SPACE_FBPA_ENABLE, 1);<br>
> +             }<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_CHICKEN, ih_chicken);<br>
> +     }<br>
> +<br>
> +     /* set the writeback address whether it's enabled or not */<br>
> +     WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_ADDR_LO,<br>
> +                  lower_32_bits(ih->wptr_addr));<br>
> +     WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_ADDR_HI,<br>
> +                  upper_32_bits(ih->wptr_addr) & 0xFFFF);<br>
> +<br>
> +     /* set rptr, wptr to 0 */<br>
> +     WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR, 0);<br>
> +     WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR, 0);<br>
> +<br>
> +     WREG32_SOC15(OSSSYS, 0, mmIH_DOORBELL_RPTR,<br>
> +                  vega10_ih_doorbell_rptr(ih));<br>
> +<br>
> +     ih = &adev->irq.ih1;<br>
> +     if (ih->ring_size) {<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE_RING1, ih->gpu_addr >> 8);<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE_HI_RING1,<br>
> +                          (ih->gpu_addr >> 40) & 0xff);<br>
> +<br>
> +             ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1);<br>
> +             ih_rb_cntl = vega10_ih_rb_cntl(ih, ih_rb_cntl);<br>
> +             ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,<br>
> +                                        WPTR_OVERFLOW_ENABLE, 0);<br>
> +             ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL,<br>
> +                                        RB_FULL_DRAIN_ENABLE, 1);<br>
> +             if (amdgpu_sriov_vf(adev)) {<br>
> +                     if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING1,<br>
> +                                             ih_rb_cntl)) {<br>
> +                             DRM_ERROR("program IH_RB_CNTL_RING1 failed!\n");<br>
> +                             return -ETIMEDOUT;<br>
> +                     }<br>
> +             } else {<br>
> +                     WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING1, ih_rb_cntl);<br>
> +             }<br>
> +<br>
> +             /* set rptr, wptr to 0 */<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_RING1, 0);<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING1, 0);<br>
> +<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_DOORBELL_RPTR_RING1,<br>
> +                          vega10_ih_doorbell_rptr(ih));<br>
> +     }<br>
> +<br>
> +     ih = &adev->irq.ih2;<br>
> +     if (ih->ring_size) {<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE_RING2, ih->gpu_addr >> 8);<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_BASE_HI_RING2,<br>
> +                          (ih->gpu_addr >> 40) & 0xff);<br>
> +<br>
> +             ih_rb_cntl = RREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2);<br>
> +             ih_rb_cntl = vega10_ih_rb_cntl(ih, ih_rb_cntl);<br>
> +<br>
> +             if (amdgpu_sriov_vf(adev)) {<br>
> +                     if (psp_reg_program(&adev->psp, PSP_REG_IH_RB_CNTL_RING2,<br>
> +                                             ih_rb_cntl)) {<br>
> +                             DRM_ERROR("program IH_RB_CNTL_RING2 failed!\n");<br>
> +                             return -ETIMEDOUT;<br>
> +                     }<br>
> +             } else {<br>
> +                     WREG32_SOC15(OSSSYS, 0, mmIH_RB_CNTL_RING2, ih_rb_cntl);<br>
> +             }<br>
> +<br>
> +             /* set rptr, wptr to 0 */<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_RING2, 0);<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING2, 0);<br>
> +<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_DOORBELL_RPTR_RING2,<br>
> +                          vega10_ih_doorbell_rptr(ih));<br>
> +     }<br>
> +<br>
> +     tmp = RREG32_SOC15(OSSSYS, 0, mmIH_STORM_CLIENT_LIST_CNTL);<br>
> +     tmp = REG_SET_FIELD(tmp, IH_STORM_CLIENT_LIST_CNTL,<br>
> +                         CLIENT18_IS_STORM_CLIENT, 1);<br>
> +     WREG32_SOC15(OSSSYS, 0, mmIH_STORM_CLIENT_LIST_CNTL, tmp);<br>
> +<br>
> +     tmp = RREG32_SOC15(OSSSYS, 0, mmIH_INT_FLOOD_CNTL);<br>
> +     tmp = REG_SET_FIELD(tmp, IH_INT_FLOOD_CNTL, FLOOD_CNTL_ENABLE, 1);<br>
> +     WREG32_SOC15(OSSSYS, 0, mmIH_INT_FLOOD_CNTL, tmp);<br>
> +<br>
> +     pci_set_master(adev->pdev);<br>
> +<br>
> +     /* enable interrupts */<br>
> +     vega10_ih_enable_interrupts(adev);<br>
> +<br>
> +     return ret;<br>
> +}<br>
> +<br>
> +/**<br>
> + * vega10_ih_irq_disable - disable interrupts<br>
> + *<br>
> + * @adev: amdgpu_device pointer<br>
> + *<br>
> + * Disable interrupts on the hw (VEGA10).<br>
> + */<br>
> +static void vega10_ih_irq_disable(struct amdgpu_device *adev)<br>
> +{<br>
> +     vega10_ih_disable_interrupts(adev);<br>
> +<br>
> +     /* Wait and acknowledge irq */<br>
> +     mdelay(1);<br>
> +}<br>
> +<br>
> +/**<br>
> + * vega10_ih_get_wptr - get the IH ring buffer wptr<br>
> + *<br>
> + * @adev: amdgpu_device pointer<br>
> + *<br>
> + * Get the IH ring buffer wptr from either the register<br>
> + * or the writeback memory buffer (VEGA10).  Also check for<br>
> + * ring buffer overflow and deal with it.<br>
> + * Returns the value of the wptr.<br>
> + */<br>
> +static u32 vega10_ih_get_wptr(struct amdgpu_device *adev,<br>
> +                           struct amdgpu_ih_ring *ih)<br>
> +{<br>
> +     u32 wptr, reg, tmp;<br>
> +<br>
> +     wptr = le32_to_cpu(*ih->wptr_cpu);<br>
> +<br>
> +     if (!REG_GET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW))<br>
> +             goto out;<br>
> +<br>
> +     /* Double check that the overflow wasn't already cleared. */<br>
> +<br>
> +     if (ih == &adev->irq.ih)<br>
> +             reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_WPTR);<br>
> +     else if (ih == &adev->irq.ih1)<br>
> +             reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_WPTR_RING1);<br>
> +     else if (ih == &adev->irq.ih2)<br>
> +             reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_WPTR_RING2);<br>
> +     else<br>
> +             BUG();<br>
> +<br>
> +     wptr = RREG32_NO_KIQ(reg);<br>
> +     if (!REG_GET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW))<br>
> +             goto out;<br>
> +<br>
> +     wptr = REG_SET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW, 0);<br>
> +<br>
> +     /* When a ring buffer overflow happen start parsing interrupt<br>
> +      * from the last not overwritten vector (wptr + 32). Hopefully<br>
> +      * this should allow us to catchup.<br>
> +      */<br>
> +     tmp = (wptr + 32) & ih->ptr_mask;<br>
> +     dev_warn(adev->dev, "IH ring buffer overflow "<br>
> +              "(0x%08X, 0x%08X, 0x%08X)\n",<br>
> +              wptr, ih->rptr, tmp);<br>
> +     ih->rptr = tmp;<br>
> +<br>
> +     if (ih == &adev->irq.ih)<br>
> +             reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_CNTL);<br>
> +     else if (ih == &adev->irq.ih1)<br>
> +             reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_CNTL_RING1);<br>
> +     else if (ih == &adev->irq.ih2)<br>
> +             reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_CNTL_RING2);<br>
> +     else<br>
> +             BUG();<br>
> +<br>
> +     tmp = RREG32_NO_KIQ(reg);<br>
> +     tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);<br>
> +     WREG32_NO_KIQ(reg, tmp);<br>
> +<br>
> +out:<br>
> +     return (wptr & ih->ptr_mask);<br>
> +}<br>
> +<br>
> +/**<br>
> + * vega10_ih_decode_iv - decode an interrupt vector<br>
> + *<br>
> + * @adev: amdgpu_device pointer<br>
> + *<br>
> + * Decodes the interrupt vector at the current rptr<br>
> + * position and also advance the position.<br>
> + */<br>
> +static void vega10_ih_decode_iv(struct amdgpu_device *adev,<br>
> +                             struct amdgpu_ih_ring *ih,<br>
> +                             struct amdgpu_iv_entry *entry)<br>
> +{<br>
> +     /* wptr/rptr are in bytes! */<br>
> +     u32 ring_index = ih->rptr >> 2;<br>
> +     uint32_t dw[8];<br>
> +<br>
> +     dw[0] = le32_to_cpu(ih->ring[ring_index + 0]);<br>
> +     dw[1] = le32_to_cpu(ih->ring[ring_index + 1]);<br>
> +     dw[2] = le32_to_cpu(ih->ring[ring_index + 2]);<br>
> +     dw[3] = le32_to_cpu(ih->ring[ring_index + 3]);<br>
> +     dw[4] = le32_to_cpu(ih->ring[ring_index + 4]);<br>
> +     dw[5] = le32_to_cpu(ih->ring[ring_index + 5]);<br>
> +     dw[6] = le32_to_cpu(ih->ring[ring_index + 6]);<br>
> +     dw[7] = le32_to_cpu(ih->ring[ring_index + 7]);<br>
> +<br>
> +     entry->client_id = dw[0] & 0xff;<br>
> +     entry->src_id = (dw[0] >> 8) & 0xff;<br>
> +     entry->ring_id = (dw[0] >> 16) & 0xff;<br>
> +     entry->vmid = (dw[0] >> 24) & 0xf;<br>
> +     entry->vmid_src = (dw[0] >> 31);<br>
> +     entry->timestamp = dw[1] | ((u64)(dw[2] & 0xffff) << 32);<br>
> +     entry->timestamp_src = dw[2] >> 31;<br>
> +     entry->pasid = dw[3] & 0xffff;<br>
> +     entry->pasid_src = dw[3] >> 31;<br>
> +     entry->src_data[0] = dw[4];<br>
> +     entry->src_data[1] = dw[5];<br>
> +     entry->src_data[2] = dw[6];<br>
> +     entry->src_data[3] = dw[7];<br>
> +<br>
> +     /* wptr/rptr are in bytes! */<br>
> +     ih->rptr += 32;<br>
> +}<br>
> +<br>
> +/**<br>
> + * vega10_ih_irq_rearm - rearm IRQ if lost<br>
> + *<br>
> + * @adev: amdgpu_device pointer<br>
> + *<br>
> + */<br>
> +static void vega10_ih_irq_rearm(struct amdgpu_device *adev,<br>
> +                            struct amdgpu_ih_ring *ih)<br>
> +{<br>
> +     uint32_t reg_rptr = 0;<br>
> +     uint32_t v = 0;<br>
> +     uint32_t i = 0;<br>
> +<br>
> +     if (ih == &adev->irq.ih)<br>
> +             reg_rptr = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_RPTR);<br>
> +     else if (ih == &adev->irq.ih1)<br>
> +             reg_rptr = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_RPTR_RING1);<br>
> +     else if (ih == &adev->irq.ih2)<br>
> +             reg_rptr = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_RPTR_RING2);<br>
> +     else<br>
> +             return;<br>
> +<br>
> +     /* Rearm IRQ / re-wwrite doorbell if doorbell write is lost */<br>
> +     for (i = 0; i < MAX_REARM_RETRY; i++) {<br>
> +             v = RREG32_NO_KIQ(reg_rptr);<br>
> +             if ((v < ih->ring_size) && (v != ih->rptr))<br>
> +                     WDOORBELL32(ih->doorbell_index, ih->rptr);<br>
> +             else<br>
> +                     break;<br>
> +     }<br>
> +}<br>
> +<br>
> +/**<br>
> + * vega10_ih_set_rptr - set the IH ring buffer rptr<br>
> + *<br>
> + * @adev: amdgpu_device pointer<br>
> + *<br>
> + * Set the IH ring buffer rptr.<br>
> + */<br>
> +static void vega10_ih_set_rptr(struct amdgpu_device *adev,<br>
> +                            struct amdgpu_ih_ring *ih)<br>
> +{<br>
> +     if (ih->use_doorbell) {<br>
> +             /* XXX check if swapping is necessary on BE */<br>
> +             *ih->rptr_cpu = ih->rptr;<br>
> +             WDOORBELL32(ih->doorbell_index, ih->rptr);<br>
> +<br>
> +             if (amdgpu_sriov_vf(adev))<br>
> +                     vega10_ih_irq_rearm(adev, ih);<br>
> +     } else if (ih == &adev->irq.ih) {<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR, ih->rptr);<br>
> +     } else if (ih == &adev->irq.ih1) {<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING1, ih->rptr);<br>
> +     } else if (ih == &adev->irq.ih2) {<br>
> +             WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR_RING2, ih->rptr);<br>
> +     }<br>
> +}<br>
> +<br>
> +/**<br>
> + * vega10_ih_self_irq - dispatch work for ring 1 and 2<br>
> + *<br>
> + * @adev: amdgpu_device pointer<br>
> + * @source: irq source<br>
> + * @entry: IV with WPTR update<br>
> + *<br>
> + * Update the WPTR from the IV and schedule work to handle the entries.<br>
> + */<br>
> +static int vega10_ih_self_irq(struct amdgpu_device *adev,<br>
> +                           struct amdgpu_irq_src *source,<br>
> +                           struct amdgpu_iv_entry *entry)<br>
> +{<br>
> +     uint32_t wptr = cpu_to_le32(entry->src_data[0]);<br>
> +<br>
> +     switch (entry->ring_id) {<br>
> +     case 1:<br>
> +             *adev->irq.ih1.wptr_cpu = wptr;<br>
> +             schedule_work(&adev->irq.ih1_work);<br>
> +             break;<br>
> +     case 2:<br>
> +             *adev->irq.ih2.wptr_cpu = wptr;<br>
> +             schedule_work(&adev->irq.ih2_work);<br>
> +             break;<br>
> +     default:<br>
> +             break;<br>
> +     }<br>
> +     return 0;<br>
> +}<br>
> +<br>
> +static const struct amdgpu_irq_src_funcs vega10_ih_self_irq_funcs = {<br>
> +     .process = vega10_ih_self_irq,<br>
> +};<br>
> +<br>
> +static void vega10_ih_set_self_irq_funcs(struct amdgpu_device *adev)<br>
> +{<br>
> +     adev->irq.self_irq.num_types = 0;<br>
> +     adev->irq.self_irq.funcs = &vega10_ih_self_irq_funcs;<br>
> +}<br>
> +<br>
> +static int vega10_ih_early_init(void *handle)<br>
> +{<br>
> +     struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
> +<br>
> +     vega10_ih_set_interrupt_funcs(adev);<br>
> +     vega10_ih_set_self_irq_funcs(adev);<br>
> +     return 0;<br>
> +}<br>
> +<br>
> +static int vega10_ih_sw_init(void *handle)<br>
> +{<br>
> +     struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
> +     int r;<br>
> +<br>
> +     r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_IH, 0,<br>
> +                           &adev->irq.self_irq);<br>
> +     if (r)<br>
> +             return r;<br>
> +<br>
> +     r = amdgpu_ih_ring_init(adev, &adev->irq.ih, 256 * 1024, true);<br>
> +     if (r)<br>
> +             return r;<br>
> +<br>
> +     adev->irq.ih.use_doorbell = true;<br>
> +     adev->irq.ih.doorbell_index = adev->doorbell_index.ih << 1;<br>
> +<br>
> +     r = amdgpu_ih_ring_init(adev, &adev->irq.ih1, PAGE_SIZE, true);<br>
> +     if (r)<br>
> +             return r;<br>
> +<br>
> +     adev->irq.ih1.use_doorbell = true;<br>
> +     adev->irq.ih1.doorbell_index = (adev->doorbell_index.ih + 1) << 1;<br>
> +<br>
> +     r = amdgpu_ih_ring_init(adev, &adev->irq.ih2, PAGE_SIZE, true);<br>
> +     if (r)<br>
> +             return r;<br>
> +<br>
> +     adev->irq.ih2.use_doorbell = true;<br>
> +     adev->irq.ih2.doorbell_index = (adev->doorbell_index.ih + 2) << 1;<br>
> +<br>
> +     r = amdgpu_irq_init(adev);<br>
> +<br>
> +     return r;<br>
> +}<br>
> +<br>
> +static int vega10_ih_sw_fini(void *handle)<br>
> +{<br>
> +     struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
> +<br>
> +     amdgpu_irq_fini(adev);<br>
> +     amdgpu_ih_ring_fini(adev, &adev->irq.ih2);<br>
> +     amdgpu_ih_ring_fini(adev, &adev->irq.ih1);<br>
> +     amdgpu_ih_ring_fini(adev, &adev->irq.ih);<br>
> +<br>
> +     return 0;<br>
> +}<br>
> +<br>
> +static int vega10_ih_hw_init(void *handle)<br>
> +{<br>
> +     int r;<br>
> +     struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
> +<br>
> +     r = vega10_ih_irq_init(adev);<br>
> +     if (r)<br>
> +             return r;<br>
> +<br>
> +     return 0;<br>
> +}<br>
> +<br>
> +static int vega10_ih_hw_fini(void *handle)<br>
> +{<br>
> +     struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
> +<br>
> +     vega10_ih_irq_disable(adev);<br>
> +<br>
> +     return 0;<br>
> +}<br>
> +<br>
> +static int vega10_ih_suspend(void *handle)<br>
> +{<br>
> +     struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
> +<br>
> +     return vega10_ih_hw_fini(adev);<br>
> +}<br>
> +<br>
> +static int vega10_ih_resume(void *handle)<br>
> +{<br>
> +     struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
> +<br>
> +     return vega10_ih_hw_init(adev);<br>
> +}<br>
> +<br>
> +static bool vega10_ih_is_idle(void *handle)<br>
> +{<br>
> +     /* todo */<br>
> +     return true;<br>
> +}<br>
> +<br>
> +static int vega10_ih_wait_for_idle(void *handle)<br>
> +{<br>
> +     /* todo */<br>
> +     return -ETIMEDOUT;<br>
> +}<br>
> +<br>
> +static int vega10_ih_soft_reset(void *handle)<br>
> +{<br>
> +     /* todo */<br>
> +<br>
> +     return 0;<br>
> +}<br>
> +<br>
> +static void vega10_ih_update_clockgating_state(struct amdgpu_device *adev,<br>
> +                                            bool enable)<br>
> +{<br>
> +     uint32_t data, def, field_val;<br>
> +<br>
> +     if (adev->cg_flags & AMD_CG_SUPPORT_IH_CG) {<br>
> +             def = data = RREG32_SOC15(OSSSYS, 0, mmIH_CLK_CTRL);<br>
> +             field_val = enable ? 0 : 1;<br>
> +             /**<br>
> +              * Vega10 does not have IH_RETRY_INT_CAM_MEM_CLK_SOFT_OVERRIDE<br>
> +              * and IH_BUFFER_MEM_CLK_SOFT_OVERRIDE field.<br>
> +              */<br>
> +             if (adev->asic_type > CHIP_VEGA10) {<br>
> +                     data = REG_SET_FIELD(data, IH_CLK_CTRL,<br>
> +                                  IH_RETRY_INT_CAM_MEM_CLK_SOFT_OVERRIDE, field_val);<br>
> +                     data = REG_SET_FIELD(data, IH_CLK_CTRL,<br>
> +                                  IH_BUFFER_MEM_CLK_SOFT_OVERRIDE, field_val);<br>
> +             }<br>
> +<br>
> +             data = REG_SET_FIELD(data, IH_CLK_CTRL,<br>
> +                                  DBUS_MUX_CLK_SOFT_OVERRIDE, field_val);<br>
> +             data = REG_SET_FIELD(data, IH_CLK_CTRL,<br>
> +                                  OSSSYS_SHARE_CLK_SOFT_OVERRIDE, field_val);<br>
> +             data = REG_SET_FIELD(data, IH_CLK_CTRL,<br>
> +                                  LIMIT_SMN_CLK_SOFT_OVERRIDE, field_val);<br>
> +             data = REG_SET_FIELD(data, IH_CLK_CTRL,<br>
> +                                  DYN_CLK_SOFT_OVERRIDE, field_val);<br>
> +             data = REG_SET_FIELD(data, IH_CLK_CTRL,<br>
> +                                  REG_CLK_SOFT_OVERRIDE, field_val);<br>
> +             if (def != data)<br>
> +                     WREG32_SOC15(OSSSYS, 0, mmIH_CLK_CTRL, data);<br>
> +     }<br>
> +}<br>
> +<br>
> +static int vega10_ih_set_clockgating_state(void *handle,<br>
> +                                       enum amd_clockgating_state state)<br>
> +{<br>
> +     struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
> +<br>
> +     vega10_ih_update_clockgating_state(adev,<br>
> +                             state == AMD_CG_STATE_GATE);<br>
> +     return 0;<br>
> +<br>
> +}<br>
> +<br>
> +static int vega10_ih_set_powergating_state(void *handle,<br>
> +                                       enum amd_powergating_state state)<br>
> +{<br>
> +     return 0;<br>
> +}<br>
> +<br>
> +const struct amd_ip_funcs vega10_ih_ip_funcs = {<br>
> +     .name = "vega10_ih",<br>
> +     .early_init = vega10_ih_early_init,<br>
> +     .late_init = NULL,<br>
> +     .sw_init = vega10_ih_sw_init,<br>
> +     .sw_fini = vega10_ih_sw_fini,<br>
> +     .hw_init = vega10_ih_hw_init,<br>
> +     .hw_fini = vega10_ih_hw_fini,<br>
> +     .suspend = vega10_ih_suspend,<br>
> +     .resume = vega10_ih_resume,<br>
> +     .is_idle = vega10_ih_is_idle,<br>
> +     .wait_for_idle = vega10_ih_wait_for_idle,<br>
> +     .soft_reset = vega10_ih_soft_reset,<br>
> +     .set_clockgating_state = vega10_ih_set_clockgating_state,<br>
> +     .set_powergating_state = vega10_ih_set_powergating_state,<br>
> +};<br>
> +<br>
> +static const struct amdgpu_ih_funcs vega10_ih_funcs = {<br>
> +     .get_wptr = vega10_ih_get_wptr,<br>
> +     .decode_iv = vega10_ih_decode_iv,<br>
> +     .set_rptr = vega10_ih_set_rptr<br>
> +};<br>
> +<br>
> +static void vega10_ih_set_interrupt_funcs(struct amdgpu_device *adev)<br>
> +{<br>
> +     adev->irq.ih_funcs = &vega10_ih_funcs;<br>
> +}<br>
> +<br>
> +const struct amdgpu_ip_block_version vega10_ih_ip_block = {<br>
> +     .type = AMD_IP_BLOCK_TYPE_IH,<br>
> +     .major = 4,<br>
> +     .minor = 0,<br>
> +     .rev = 0,<br>
> +     .funcs = &vega10_ih_ip_funcs,<br>
> +};<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/arcturus_ih.h b/drivers/gpu/drm/amd/amdgpu/arcturus_ih.h<br>
> new file mode 100644<br>
> index 000000000000..54daf8cf6ff3<br>
> --- /dev/null<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/arcturus_ih.h<br>
> @@ -0,0 +1,30 @@<br>
> +/*<br>
> + * Copyright 2020 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a<br>
> + * copy of this software and associated documentation files (the "Software"),<br>
> + * to deal in the Software without restriction, including without limitation<br>
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
> + * and/or sell copies of the Software, and to permit persons to whom the<br>
> + * Software is furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice shall be included in<br>
> + * all copies or substantial portions of the Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR<br>
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,<br>
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR<br>
> + * OTHER DEALINGS IN THE SOFTWARE.<br>
> + *<br>
> + */<br>
> +<br>
> +#ifndef __VEGA10_IH_H__<br>
> +#define __VEGA10_IH_H__<br>
> +<br>
> +extern const struct amd_ip_funcs vega10_ih_ip_funcs;<br>
> +extern const struct amdgpu_ip_block_version vega10_ih_ip_block;<br>
> +<br>
> +#endif<br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Chawking.zhang%40amd.com%7Cd2c1351802c1460154ae08d7cba5bfe3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637201785086924150&sdata=Zvu33NFtbbE%2FtMRqll%2BeaayRdTAx6MYEysSdMPrIEgU%3D&reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Calexander.deucher%40amd.com%7Ca1fe681c257644a9727c08d7cb94d5f5%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637201712448085102&amp;sdata=M8SSL1wFhDgmkyFd36kMHmuPzAqp%2BU0QHwttrz0rOzo%3D&amp;reserved=0</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>