drm/amdgpu: extend HWIP_MAX_INSTANCE to 28
Subsystems (3)
Alex Deucher
maintainerPATCH 1/4 drm/amdgpu: extend HWIP_MAX_INSTANCE to 28
From: Hawking Zhang <[email protected]>
more ip instances are available
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
@@ -678,7 +678,7 @@ enum amd_hw_ip_block_type { MAX_HWIP }; -#define HWIP_MAX_INSTANCE 11 +#define HWIP_MAX_INSTANCE 28#define HW_ID_MAX 300#define IP_VERSION (mj, mn, rv) (((mj) << 16) | ((mn) << 8) | (rv))
Signature · 1 line
2.37.3
Alex Deucher
maintainerPATCH 2/4 drm/amdgpu: update psp_fw_type enum in amdgpu_ucode header
From: Hawking Zhang <[email protected]>
To match with the definition in psp firmware
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +1 -0
@@ -125,6 +125,7 @@ enum psp_fw_type {PSP_FW_TYPE_PSP_INTF_DRV ,PSP_FW_TYPE_PSP_DBG_DRV ,PSP_FW_TYPE_PSP_RAS_DRV , + PSP_FW_TYPE_MAX_INDEX, };/* version_major=2, version_minor=0 */
Signature · 1 line
2.37.3
Alex Deucher
maintainerPATCH 3/4 drm/amdgpu: convert vega20_ih.c to IP version checks
In reply to Alex DeucherFor consistency with newer asics.
--- drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/vega20_ih.c +3 -3
@@ -267,7 +267,7 @@ static void vega20_ih_reroute_ih(struct amdgpu_device *adev)/* vega20 ih reroute will go through psp this * function is used for newer asics starting arcturus */ -if (adev->asic_type >=CHIP_ARCTURUS ) { +if (adev->ip_versions[OSSSYS_HWIP ][0 ] >=IP_VERSION (4 ,2 ,1 )) {/* Reroute to IH ring 1 for VMC */ WREG32_SOC15 (OSSSYS ,0 , mmIH_CLIENT_CFG_INDEX,0x12 ); tmp =RREG32_SOC15 (OSSSYS ,0 , mmIH_CLIENT_CFG_DATA);
@@ -308,7 +308,7 @@ static int vega20_ih_irq_init(struct amdgpu_device *adev) adev->nbio.funcs->ih_control (adev); -if (adev->asic_type ==CHIP_ARCTURUS && +if ((adev->ip_versions[OSSSYS_HWIP ][0 ] ==IP_VERSION (4 ,2 ,1 )) && adev->firmware.load_type ==AMDGPU_FW_LOAD_DIRECT ) { ih_chicken =RREG32_SOC15 (OSSSYS ,0 , mmIH_CHICKEN);if (adev->irq.ih.use_bus_addr) {
@@ -321,7 +321,7 @@ static int vega20_ih_irq_init(struct amdgpu_device *adev)/* psp firmware won't program IH_CHICKEN for aldebaran * driver needs to program it properly according to * MC_SPACE type in IH_RB_CNTL */ -if (adev->asic_type ==CHIP_ALDEBARAN ) { +if (adev->ip_versions[OSSSYS_HWIP ][0 ] ==IP_VERSION (4 ,4 ,0 )) { ih_chicken =RREG32_SOC15 (OSSSYS ,0 , mmIH_CHICKEN_ALDEBARAN);if (adev->irq.ih.use_bus_addr) { ih_chicken = REG_SET_FIELD(ih_chicken, IH_CHICKEN,
Signature · 1 line
2.37.3
RE: [PATCH 3/4] drm/amdgpu: convert vega20_ih.c to IP version checks
Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, October 12, 2022 04:56
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 3/4] drm/amdgpu: convert vega20_ih.c to IP version checks
For consistency with newer asics.
--- drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/vega20_ih.c +1 -1
@@ -267,7 +267,7 @@ static void vega20_ih_reroute_ih(struct amdgpu_device *adev)/* vega20 ih reroute will go through psp this * function is used for newer asics starting arcturus */ -if (adev->asic_type >=CHIP_ARCTURUS ) { +if (adev->ip_versions[OSSSYS_HWIP ][0 ] >=IP_VERSION (4 ,2 ,1 )) {/* Reroute to IH ring 1 for VMC */ WREG32_SOC15 (OSSSYS ,0 , mmIH_CLIENT_CFG_INDEX,0x12 ); tmp = RREG32_SOC15(OSSSYS, 0, mmIH_CLIENT_CFG_DATA); @@ -308,7 +308,7 @@ static int vega20_ih_irq_init(struct amdgpu_device *adev)
adev->nbio.funcs->ih_control(adev);
- if (adev->asic_type == CHIP_ARCTURUS &&
+ if ((adev->ip_versions[OSSSYS_HWIP][0] == IP_VERSION(4, 2, 1)) &&
adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) {
ih_chicken = RREG32_SOC15(OSSSYS, 0, mmIH_CHICKEN); if (adev->irq.ih.use_bus_addr) {
@@ -321,7 +321,7 @@ static int vega20_ih_irq_init(struct amdgpu_device *adev)
/* psp firmware won't program IH_CHICKEN for aldebaran
* driver needs to program it properly according to
* MC_SPACE type in IH_RB_CNTL */
- if (adev->asic_type == CHIP_ALDEBARAN) {
+ if (adev->ip_versions[OSSSYS_HWIP][0] == IP_VERSION(4, 4, 0)) {
ih_chicken = RREG32_SOC15(OSSSYS, 0, mmIH_CHICKEN_ALDEBARAN); if (adev->irq.ih.use_bus_addr) {
ih_chicken = REG_SET_FIELD(ih_chicken, IH_CHICKEN,
--
2.37.3
Alex Deucher
maintainerPATCH 4/4 drm/amdgpu: convert amdgpu_amdkfd_gpuvm.c to IP version checks
In reply to Alex DeucherFor consistency with the rest of the code.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +4 -4
@@ -418,9 +418,9 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem)if (mem->alloc_flags &KFD_IOC_ALLOC_MEM_FLAGS_EXECUTABLE ) mapping_flags |=AMDGPU_VM_PAGE_EXECUTABLE ; -switch (adev->asic_type) { -case CHIP_ARCTURUS : -case CHIP_ALDEBARAN : +switch (adev->ip_versions[GC_HWIP ][0 ]) { +case IP_VERSION (9 ,4 ,1 ): +case IP_VERSION (9 ,4 ,2 ):if (mem->alloc_flags &KFD_IOC_ALLOC_MEM_FLAGS_VRAM ) {if (bo_adev == adev) {if (uncached)
@@ -429,7 +429,7 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem) mapping_flags |=AMDGPU_VM_MTYPE_CC ; else mapping_flags |= AMDGPU_VM_MTYPE_RW; -if (adev->asic_type ==CHIP_ALDEBARAN && +if ((adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (9 ,4 ,2 )) && adev->gmc.xgmi.connected_to_cpu) snoop = true; }else {
Signature · 1 line
2.37.3
RE: [PATCH 4/4] drm/amdgpu: convert amdgpu_amdkfd_gpuvm.c to IP version checks
Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, October 12, 2022 04:56
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 4/4] drm/amdgpu: convert amdgpu_amdkfd_gpuvm.c to IP version checks
For consistency with the rest of the code.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +4 -4
@@ -418,9 +418,9 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem)if (mem->alloc_flags &KFD_IOC_ALLOC_MEM_FLAGS_EXECUTABLE ) mapping_flags |=AMDGPU_VM_PAGE_EXECUTABLE ; -switch (adev->asic_type) { -case CHIP_ARCTURUS : -case CHIP_ALDEBARAN : +switch (adev->ip_versions[GC_HWIP ][0 ]) { +case IP_VERSION (9 ,4 ,1 ): +case IP_VERSION (9 ,4 ,2 ):if (mem->alloc_flags &KFD_IOC_ALLOC_MEM_FLAGS_VRAM ) {if (bo_adev == adev) {if (uncached)
@@ -429,7 +429,7 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem) mapping_flags |=AMDGPU_VM_MTYPE_CC ; else mapping_flags |= AMDGPU_VM_MTYPE_RW; -if (adev->asic_type ==CHIP_ALDEBARAN && +if ((adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (9 ,4 ,2 )) && adev->gmc.xgmi.connected_to_cpu) snoop = true; }else {
Signature · 1 line
2.37.3
Am 11.10.22 um 22:56 schrieb Alex Deucher:
Quoted 6 lines
From: Hawking Zhang <[email protected]>
more ip instances are available
Signed-off-by Hawking Zhang <[email protected]>Signed-off-by Alex Deucher <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +1
-1@@ -678,7 +678,7 @@ enum amd_hw_ip_block_type { MAX_HWIP }; -#define HWIP_MAX_INSTANCE 11 +#define HWIP_MAX_INSTANCE 28#define HW_ID_MAX 300#define IP_VERSION (mj, mn, rv) (((mj) << 16) | ((mn) << 8) | (rv))