Commit 091aec0b authored by Andrey Grodzovsky's avatar Andrey Grodzovsky Committed by Alex Deucher

drm/amd: Use newly added interrupt source defs for VI v3.

v2: Rebase
v3: Use defines for CP_SQ and CP_ECC_ERROR interrupts.
Signed-off-by: default avatarAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 530e7a66
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#include "gmc/gmc_8_1_d.h" #include "gmc/gmc_8_1_d.h"
#include "gmc/gmc_8_1_sh_mask.h" #include "gmc/gmc_8_1_sh_mask.h"
#include "ivsrcid/ivsrcid_vislands30.h"
static void dce_v10_0_set_display_funcs(struct amdgpu_device *adev); static void dce_v10_0_set_display_funcs(struct amdgpu_device *adev);
static void dce_v10_0_set_irq_funcs(struct amdgpu_device *adev); static void dce_v10_0_set_irq_funcs(struct amdgpu_device *adev);
...@@ -2737,14 +2739,14 @@ static int dce_v10_0_sw_init(void *handle) ...@@ -2737,14 +2739,14 @@ static int dce_v10_0_sw_init(void *handle)
return r; return r;
} }
for (i = 8; i < 20; i += 2) { for (i = VISLANDS30_IV_SRCID_D1_GRPH_PFLIP; i < 20; i += 2) {
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, i, &adev->pageflip_irq); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, i, &adev->pageflip_irq);
if (r) if (r)
return r; return r;
} }
/* HPD hotplug */ /* HPD hotplug */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 42, &adev->hpd_irq); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_HOTPLUG_DETECT_A, &adev->hpd_irq);
if (r) if (r)
return r; return r;
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#include "gmc/gmc_8_1_d.h" #include "gmc/gmc_8_1_d.h"
#include "gmc/gmc_8_1_sh_mask.h" #include "gmc/gmc_8_1_sh_mask.h"
#include "ivsrcid/ivsrcid_vislands30.h"
static void dce_v11_0_set_display_funcs(struct amdgpu_device *adev); static void dce_v11_0_set_display_funcs(struct amdgpu_device *adev);
static void dce_v11_0_set_irq_funcs(struct amdgpu_device *adev); static void dce_v11_0_set_irq_funcs(struct amdgpu_device *adev);
...@@ -2858,14 +2860,14 @@ static int dce_v11_0_sw_init(void *handle) ...@@ -2858,14 +2860,14 @@ static int dce_v11_0_sw_init(void *handle)
return r; return r;
} }
for (i = 8; i < 20; i += 2) { for (i = VISLANDS30_IV_SRCID_D1_GRPH_PFLIP; i < 20; i += 2) {
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, i, &adev->pageflip_irq); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, i, &adev->pageflip_irq);
if (r) if (r)
return r; return r;
} }
/* HPD hotplug */ /* HPD hotplug */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 42, &adev->hpd_irq); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_HOTPLUG_DETECT_A, &adev->hpd_irq);
if (r) if (r)
return r; return r;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "dce_v10_0.h" #include "dce_v10_0.h"
#include "dce_v11_0.h" #include "dce_v11_0.h"
#include "dce_virtual.h" #include "dce_virtual.h"
#include "ivsrcid/ivsrcid_vislands30.h"
#define DCE_VIRTUAL_VBLANK_PERIOD 16666666 #define DCE_VIRTUAL_VBLANK_PERIOD 16666666
...@@ -378,7 +379,7 @@ static int dce_virtual_sw_init(void *handle) ...@@ -378,7 +379,7 @@ static int dce_virtual_sw_init(void *handle)
int r, i; int r, i;
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 229, &adev->crtc_irq); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_SMU_DISP_TIMER2_TRIGGER, &adev->crtc_irq);
if (r) if (r)
return r; return r;
......
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
#include "smu/smu_7_1_3_d.h" #include "smu/smu_7_1_3_d.h"
#include "ivsrcid/ivsrcid_vislands30.h"
#define GFX8_NUM_GFX_RINGS 1 #define GFX8_NUM_GFX_RINGS 1
#define GFX8_MEC_HPD_SIZE 2048 #define GFX8_MEC_HPD_SIZE 2048
...@@ -2047,35 +2049,35 @@ static int gfx_v8_0_sw_init(void *handle) ...@@ -2047,35 +2049,35 @@ static int gfx_v8_0_sw_init(void *handle)
adev->gfx.mec.num_queue_per_pipe = 8; adev->gfx.mec.num_queue_per_pipe = 8;
/* KIQ event */ /* KIQ event */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 178, &adev->gfx.kiq.irq); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_CP_INT_IB2, &adev->gfx.kiq.irq);
if (r) if (r)
return r; return r;
/* EOP Event */ /* EOP Event */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 181, &adev->gfx.eop_irq); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_CP_END_OF_PIPE, &adev->gfx.eop_irq);
if (r) if (r)
return r; return r;
/* Privileged reg */ /* Privileged reg */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 184, r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_CP_PRIV_REG_FAULT,
&adev->gfx.priv_reg_irq); &adev->gfx.priv_reg_irq);
if (r) if (r)
return r; return r;
/* Privileged inst */ /* Privileged inst */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 185, r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_CP_PRIV_INSTR_FAULT,
&adev->gfx.priv_inst_irq); &adev->gfx.priv_inst_irq);
if (r) if (r)
return r; return r;
/* Add CP EDC/ECC irq */ /* Add CP EDC/ECC irq */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 197, r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_CP_ECC_ERROR,
&adev->gfx.cp_ecc_error_irq); &adev->gfx.cp_ecc_error_irq);
if (r) if (r)
return r; return r;
/* SQ interrupts. */ /* SQ interrupts. */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 239, r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_SQ_INTERRUPT_MSG,
&adev->gfx.sq_irq); &adev->gfx.sq_irq);
if (r) { if (r) {
DRM_ERROR("amdgpu_irq_add() for SQ failed: %d\n", r); DRM_ERROR("amdgpu_irq_add() for SQ failed: %d\n", r);
......
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
#include "amdgpu_atombios.h" #include "amdgpu_atombios.h"
#include "ivsrcid/ivsrcid_vislands30.h"
static void gmc_v7_0_set_gmc_funcs(struct amdgpu_device *adev); static void gmc_v7_0_set_gmc_funcs(struct amdgpu_device *adev);
static void gmc_v7_0_set_irq_funcs(struct amdgpu_device *adev); static void gmc_v7_0_set_irq_funcs(struct amdgpu_device *adev);
static int gmc_v7_0_wait_for_idle(void *handle); static int gmc_v7_0_wait_for_idle(void *handle);
...@@ -996,11 +998,11 @@ static int gmc_v7_0_sw_init(void *handle) ...@@ -996,11 +998,11 @@ static int gmc_v7_0_sw_init(void *handle)
adev->gmc.vram_type = gmc_v7_0_convert_vram_type(tmp); adev->gmc.vram_type = gmc_v7_0_convert_vram_type(tmp);
} }
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 146, &adev->gmc.vm_fault); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_GFX_PAGE_INV_FAULT, &adev->gmc.vm_fault);
if (r) if (r)
return r; return r;
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 147, &adev->gmc.vm_fault); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_GFX_MEM_PROT_FAULT, &adev->gmc.vm_fault);
if (r) if (r)
return r; return r;
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#include "amdgpu_atombios.h" #include "amdgpu_atombios.h"
#include "ivsrcid/ivsrcid_vislands30.h"
static void gmc_v8_0_set_gmc_funcs(struct amdgpu_device *adev); static void gmc_v8_0_set_gmc_funcs(struct amdgpu_device *adev);
static void gmc_v8_0_set_irq_funcs(struct amdgpu_device *adev); static void gmc_v8_0_set_irq_funcs(struct amdgpu_device *adev);
static int gmc_v8_0_wait_for_idle(void *handle); static int gmc_v8_0_wait_for_idle(void *handle);
...@@ -1100,11 +1102,11 @@ static int gmc_v8_0_sw_init(void *handle) ...@@ -1100,11 +1102,11 @@ static int gmc_v8_0_sw_init(void *handle)
adev->gmc.vram_type = gmc_v8_0_convert_vram_type(tmp); adev->gmc.vram_type = gmc_v8_0_convert_vram_type(tmp);
} }
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 146, &adev->gmc.vm_fault); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_GFX_PAGE_INV_FAULT, &adev->gmc.vm_fault);
if (r) if (r)
return r; return r;
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 147, &adev->gmc.vm_fault); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_GFX_MEM_PROT_FAULT, &adev->gmc.vm_fault);
if (r) if (r)
return r; return r;
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#include "iceland_sdma_pkt_open.h" #include "iceland_sdma_pkt_open.h"
#include "ivsrcid/ivsrcid_vislands30.h"
static void sdma_v2_4_set_ring_funcs(struct amdgpu_device *adev); static void sdma_v2_4_set_ring_funcs(struct amdgpu_device *adev);
static void sdma_v2_4_set_buffer_funcs(struct amdgpu_device *adev); static void sdma_v2_4_set_buffer_funcs(struct amdgpu_device *adev);
static void sdma_v2_4_set_vm_pte_funcs(struct amdgpu_device *adev); static void sdma_v2_4_set_vm_pte_funcs(struct amdgpu_device *adev);
...@@ -896,7 +898,7 @@ static int sdma_v2_4_sw_init(void *handle) ...@@ -896,7 +898,7 @@ static int sdma_v2_4_sw_init(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
/* SDMA trap event */ /* SDMA trap event */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 224, r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_SDMA_TRAP,
&adev->sdma.trap_irq); &adev->sdma.trap_irq);
if (r) if (r)
return r; return r;
...@@ -908,7 +910,7 @@ static int sdma_v2_4_sw_init(void *handle) ...@@ -908,7 +910,7 @@ static int sdma_v2_4_sw_init(void *handle)
return r; return r;
/* SDMA Privileged inst */ /* SDMA Privileged inst */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 247, r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_SDMA_SRBM_WRITE,
&adev->sdma.illegal_inst_irq); &adev->sdma.illegal_inst_irq);
if (r) if (r)
return r; return r;
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#include "tonga_sdma_pkt_open.h" #include "tonga_sdma_pkt_open.h"
#include "ivsrcid/ivsrcid_vislands30.h"
static void sdma_v3_0_set_ring_funcs(struct amdgpu_device *adev); static void sdma_v3_0_set_ring_funcs(struct amdgpu_device *adev);
static void sdma_v3_0_set_buffer_funcs(struct amdgpu_device *adev); static void sdma_v3_0_set_buffer_funcs(struct amdgpu_device *adev);
static void sdma_v3_0_set_vm_pte_funcs(struct amdgpu_device *adev); static void sdma_v3_0_set_vm_pte_funcs(struct amdgpu_device *adev);
...@@ -1175,7 +1177,7 @@ static int sdma_v3_0_sw_init(void *handle) ...@@ -1175,7 +1177,7 @@ static int sdma_v3_0_sw_init(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
/* SDMA trap event */ /* SDMA trap event */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 224, r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_SDMA_TRAP,
&adev->sdma.trap_irq); &adev->sdma.trap_irq);
if (r) if (r)
return r; return r;
...@@ -1187,7 +1189,7 @@ static int sdma_v3_0_sw_init(void *handle) ...@@ -1187,7 +1189,7 @@ static int sdma_v3_0_sw_init(void *handle)
return r; return r;
/* SDMA Privileged inst */ /* SDMA Privileged inst */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 247, r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_SDMA_SRBM_WRITE,
&adev->sdma.illegal_inst_irq); &adev->sdma.illegal_inst_irq);
if (r) if (r)
return r; return r;
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "vi.h" #include "vi.h"
#include "smu/smu_7_1_2_d.h" #include "smu/smu_7_1_2_d.h"
#include "smu/smu_7_1_2_sh_mask.h" #include "smu/smu_7_1_2_sh_mask.h"
#include "ivsrcid/ivsrcid_vislands30.h"
static void uvd_v5_0_set_ring_funcs(struct amdgpu_device *adev); static void uvd_v5_0_set_ring_funcs(struct amdgpu_device *adev);
static void uvd_v5_0_set_irq_funcs(struct amdgpu_device *adev); static void uvd_v5_0_set_irq_funcs(struct amdgpu_device *adev);
...@@ -104,7 +105,7 @@ static int uvd_v5_0_sw_init(void *handle) ...@@ -104,7 +105,7 @@ static int uvd_v5_0_sw_init(void *handle)
int r; int r;
/* UVD TRAP */ /* UVD TRAP */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 124, &adev->uvd.inst->irq); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_UVD_SYSTEM_MESSAGE, &adev->uvd.inst->irq);
if (r) if (r)
return r; return r;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "bif/bif_5_1_d.h" #include "bif/bif_5_1_d.h"
#include "gmc/gmc_8_1_d.h" #include "gmc/gmc_8_1_d.h"
#include "vi.h" #include "vi.h"
#include "ivsrcid/ivsrcid_vislands30.h"
/* Polaris10/11/12 firmware version */ /* Polaris10/11/12 firmware version */
#define FW_1_130_16 ((1 << 24) | (130 << 16) | (16 << 8)) #define FW_1_130_16 ((1 << 24) | (130 << 16) | (16 << 8))
...@@ -400,14 +401,14 @@ static int uvd_v6_0_sw_init(void *handle) ...@@ -400,14 +401,14 @@ static int uvd_v6_0_sw_init(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
/* UVD TRAP */ /* UVD TRAP */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 124, &adev->uvd.inst->irq); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_UVD_SYSTEM_MESSAGE, &adev->uvd.inst->irq);
if (r) if (r)
return r; return r;
/* UVD ENC TRAP */ /* UVD ENC TRAP */
if (uvd_v6_0_enc_support(adev)) { if (uvd_v6_0_enc_support(adev)) {
for (i = 0; i < adev->uvd.num_enc_rings; ++i) { for (i = 0; i < adev->uvd.num_enc_rings; ++i) {
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, i + 119, &adev->uvd.inst->irq); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, i + VISLANDS30_IV_SRCID_UVD_ENC_GEN_PURP, &adev->uvd.inst->irq);
if (r) if (r)
return r; return r;
} }
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "smu/smu_7_1_2_sh_mask.h" #include "smu/smu_7_1_2_sh_mask.h"
#include "gca/gfx_8_0_d.h" #include "gca/gfx_8_0_d.h"
#include "gca/gfx_8_0_sh_mask.h" #include "gca/gfx_8_0_sh_mask.h"
#include "ivsrcid/ivsrcid_vislands30.h"
#define GRBM_GFX_INDEX__VCE_INSTANCE__SHIFT 0x04 #define GRBM_GFX_INDEX__VCE_INSTANCE__SHIFT 0x04
...@@ -422,7 +423,7 @@ static int vce_v3_0_sw_init(void *handle) ...@@ -422,7 +423,7 @@ static int vce_v3_0_sw_init(void *handle)
int r, i; int r, i;
/* VCE */ /* VCE */
r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 167, &adev->vce.irq); r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, VISLANDS30_IV_SRCID_VCE_TRAP, &adev->vce.irq);
if (r) if (r)
return r; return r;
......
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
#include "processpptables.h" #include "processpptables.h"
#include "pp_thermal.h" #include "pp_thermal.h"
#include "ivsrcid/ivsrcid_vislands30.h"
#define MC_CG_ARB_FREQ_F0 0x0a #define MC_CG_ARB_FREQ_F0 0x0a
#define MC_CG_ARB_FREQ_F1 0x0b #define MC_CG_ARB_FREQ_F1 0x0b
#define MC_CG_ARB_FREQ_F2 0x0c #define MC_CG_ARB_FREQ_F2 0x0c
...@@ -4105,17 +4107,17 @@ static int smu7_register_irq_handlers(struct pp_hwmgr *hwmgr) ...@@ -4105,17 +4107,17 @@ static int smu7_register_irq_handlers(struct pp_hwmgr *hwmgr)
amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev), amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev),
AMDGPU_IH_CLIENTID_LEGACY, AMDGPU_IH_CLIENTID_LEGACY,
230, VISLANDS30_IV_SRCID_CG_TSS_THERMAL_LOW_TO_HIGH,
source); source);
amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev), amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev),
AMDGPU_IH_CLIENTID_LEGACY, AMDGPU_IH_CLIENTID_LEGACY,
231, VISLANDS30_IV_SRCID_CG_TSS_THERMAL_HIGH_TO_LOW,
source); source);
/* Register CTF(GPIO_19) interrupt */ /* Register CTF(GPIO_19) interrupt */
amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev), amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev),
AMDGPU_IH_CLIENTID_LEGACY, AMDGPU_IH_CLIENTID_LEGACY,
83, VISLANDS30_IV_SRCID_GPIO_19,
source); source);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment