All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/42] Navy Flounder support
@ 2020-07-14 18:23 Alex Deucher
  2020-07-14 18:23 ` [PATCH 01/42] drm/amdgpu: expand to add multiple trap event irq id Alex Deucher
                   ` (41 more replies)
  0 siblings, 42 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

This patch set adds initial support for Navy Flounder GPUs.

Bhawanpreet Lakha (1):
  drm/amd/display: add DC support for navy flounder

Boyuan Zhang (5):
  drm/amdgpu: add navy_flounder vcn firmware support
  drm/amdgpu: add vcn ip block for navy_flounder
  drm/amdgpu: enable VCN3.0 PG and CG for navy_flounder
  drm/amdgpu: enable VCN3.0 DPG for navy_flounder
  drm/amdgpu: enable JPEG3.0 PG and CG for navy_flounder

Chengming Gui (2):
  drm/amdkfd: Support navy_flounder KFD
  drm/amdkfd: Add kfd2kgd_funcs for navy_flounder kfd support

Huang Rui (1):
  drm/amdgpu: expand to add multiple trap event irq id

Jiansong Chen (32):
  drm/amdgpu: add navy_flounder asic type
  drm/amdgpu: add navy_flounder gpu info firmware
  drm/amdgpu: set fw load type for navy_flounder
  drm/amdgpu: set asic family and ip blocks for navy_flounder
  drm/amdgpu/gfx10: add support for navy_flounder firmware
  drm/amdgpu/gmc10: add navy_flounder support
  drm/amdgpu/gfx10: add clockgating support for navy_flounder
  drm/amdgpu/soc15: add support for navy_flounder
  drm/amdgpu: initialize IP offset for navy_flounder
  drm/amdgpu: add support on mmhub for navy_flounder
  drm/amdgpu: add common ip block for navy_flounder
  drm/amdgpu: add gmc ip block for navy_flounder
  drm/amdgpu: add ih ip block for navy_flounder
  drm/amdgpu: add gfx ip block for navy_flounder
  drm/amdgpu: add sdma ip block for navy_flounder
  drm/amdgpu: add virtual display support for navy_flounder.
  drm/amdgpu: force pa_sc_tile_steering_override to 0 for navy_flounder
  drm/amdgpu: add gmc cg support for navy_flounder
  drm/amdgpu/powerplay: add smu support for navy_flounder
  drm/amdgpu: add smu block for navy_flounder
  drm/amdgpu: add psp support for navy_flounder
  drm/amdgpu: add psp block for navy_flounder
  drm/amdgpu: use front door firmware loading for navy_flounder
  drm/amdgpu/gfx10: add gc golden setting for navy_flounder
  drm/amdgpu: enable cp_fw_write_wait for navy_flounder
  drm/amdgpu: enable GFX clock gating for navy_flounder
  drm/amdgpu: support athub cg setting for navy_flounder
  drm/amd/powerplay: set VCN1 pg only for sienna_cichlid
  drm/amdgpu: enable athub/mmhub PG for navy_flounder
  drm/amdgpu: enable mc CG and LS for navy_flounder
  drm/amdgpu: enable hdp CG and LS for navy_flounder
  drm/amdgpu: enable ih CG for navy_flounder

Tao Zhou (1):
  drm/amdgpu: configure navy_flounder gfx according to gfx 10.3

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    |  7 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c       |  8 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c     |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c       |  8 ++
 drivers/gpu/drm/amd/amdgpu/athub_v2_1.c       |  1 +
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c        | 76 +++++++++++++++-
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c        | 27 ++++--
 drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c       |  6 ++
 drivers/gpu/drm/amd/amdgpu/navi10_ih.c        |  1 +
 drivers/gpu/drm/amd/amdgpu/nv.c               | 44 ++++++++++
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c        | 12 ++-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c        | 87 +++++++++++++------
 drivers/gpu/drm/amd/amdkfd/kfd_crat.c         |  1 +
 drivers/gpu/drm/amd/amdkfd/kfd_device.c       | 20 +++++
 .../drm/amd/amdkfd/kfd_device_queue_manager.c |  1 +
 drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c  |  1 +
 .../gpu/drm/amd/amdkfd/kfd_packet_manager.c   |  1 +
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c     |  1 +
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  9 +-
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c    |  1 +
 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h |  1 +
 .../drm/amd/powerplay/sienna_cichlid_ppt.c    | 20 +++--
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c     | 15 +++-
 include/drm/amd_asic_type.h                   |  1 +
 24 files changed, 300 insertions(+), 51 deletions(-)

-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [PATCH 01/42] drm/amdgpu: expand to add multiple trap event irq id
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-15  9:21   ` Christian König
  2020-07-14 18:23 ` [PATCH 02/42] drm/amdgpu: add navy_flounder asic type Alex Deucher
                   ` (40 subsequent siblings)
  41 siblings, 1 reply; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Huang Rui

From: Huang Rui <ray.huang@amd.com>

Sienna_cichlid has four sdma instances, but other chips don't.
So we need expand to add multiple trap event irq id in sdma
v5.2.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 67 ++++++++++++++++----------
 1 file changed, 41 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
index 824f3e23c3d9..de8342283fdb 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
@@ -1165,6 +1165,40 @@ static int sdma_v5_2_early_init(void *handle)
 	return 0;
 }
 
+static unsigned sdma_v5_2_seq_to_irq_id(int seq_num)
+{
+	switch (seq_num) {
+	case 0:
+		return SOC15_IH_CLIENTID_SDMA0;
+	case 1:
+		return SOC15_IH_CLIENTID_SDMA1;
+	case 2:
+		return SOC15_IH_CLIENTID_SDMA2;
+	case 3:
+		return SOC15_IH_CLIENTID_SDMA3_Sienna_Cichlid;
+	default:
+		break;
+	}
+	return -EINVAL;
+}
+
+static unsigned sdma_v5_2_seq_to_trap_id(int seq_num)
+{
+	switch (seq_num) {
+	case 0:
+		return SDMA0_5_0__SRCID__SDMA_TRAP;
+	case 1:
+		return SDMA1_5_0__SRCID__SDMA_TRAP;
+	case 2:
+		return SDMA2_5_0__SRCID__SDMA_TRAP;
+	case 3:
+		return SDMA3_5_0__SRCID__SDMA_TRAP;
+	default:
+		break;
+	}
+	return -EINVAL;
+}
+
 static int sdma_v5_2_sw_init(void *handle)
 {
 	struct amdgpu_ring *ring;
@@ -1172,32 +1206,13 @@ static int sdma_v5_2_sw_init(void *handle)
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
 	/* SDMA trap event */
-	r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA0,
-			      SDMA0_5_0__SRCID__SDMA_TRAP,
-			      &adev->sdma.trap_irq);
-	if (r)
-		return r;
-
-	/* SDMA trap event */
-	r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA1,
-			      SDMA1_5_0__SRCID__SDMA_TRAP,
-			      &adev->sdma.trap_irq);
-	if (r)
-		return r;
-
-	/* SDMA trap event */
-	r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA2,
-			      SDMA2_5_0__SRCID__SDMA_TRAP,
-			      &adev->sdma.trap_irq);
-	if (r)
-		return r;
-
-	/* SDMA trap event */
-	r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA3_Sienna_Cichlid,
-			      SDMA3_5_0__SRCID__SDMA_TRAP,
-			      &adev->sdma.trap_irq);
-	if (r)
-		return r;
+	for (i = 0; i < adev->sdma.num_instances; i++) {
+		r = amdgpu_irq_add_id(adev, sdma_v5_2_seq_to_irq_id(i),
+				      sdma_v5_2_seq_to_trap_id(i),
+				      &adev->sdma.trap_irq);
+		if (r)
+			return r;
+	}
 
 	r = sdma_v5_2_init_microcode(adev);
 	if (r) {
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 02/42] drm/amdgpu: add navy_flounder asic type
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
  2020-07-14 18:23 ` [PATCH 01/42] drm/amdgpu: expand to add multiple trap event irq id Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 03/42] drm/amdgpu: add navy_flounder gpu info firmware Alex Deucher
                   ` (39 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 +
 include/drm/amd_asic_type.h                | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 81ca92127c00..724886afb980 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -114,6 +114,7 @@ const char *amdgpu_asic_name[] = {
 	"NAVI14",
 	"NAVI12",
 	"SIENNA_CICHLID",
+	"NAVY_FLOUNDER",
 	"LAST",
 };
 
diff --git a/include/drm/amd_asic_type.h b/include/drm/amd_asic_type.h
index 0c5bd1134460..8712e14991ed 100644
--- a/include/drm/amd_asic_type.h
+++ b/include/drm/amd_asic_type.h
@@ -55,6 +55,7 @@ enum amd_asic_type {
 	CHIP_NAVI14,	/* 26 */
 	CHIP_NAVI12,	/* 27 */
 	CHIP_SIENNA_CICHLID,	/* 28 */
+	CHIP_NAVY_FLOUNDER,	/* 29 */
 	CHIP_LAST,
 };
 
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 03/42] drm/amdgpu: add navy_flounder gpu info firmware
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
  2020-07-14 18:23 ` [PATCH 01/42] drm/amdgpu: expand to add multiple trap event irq id Alex Deucher
  2020-07-14 18:23 ` [PATCH 02/42] drm/amdgpu: add navy_flounder asic type Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 04/42] drm/amdgpu: set fw load type for navy_flounder Alex Deucher
                   ` (38 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 724886afb980..99ed9cbfefcb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -81,6 +81,7 @@ MODULE_FIRMWARE("amdgpu/navi10_gpu_info.bin");
 MODULE_FIRMWARE("amdgpu/navi14_gpu_info.bin");
 MODULE_FIRMWARE("amdgpu/navi12_gpu_info.bin");
 MODULE_FIRMWARE("amdgpu/sienna_cichlid_gpu_info.bin");
+MODULE_FIRMWARE("amdgpu/navy_flounder_gpu_info.bin");
 
 #define AMDGPU_RESUME_MS		2000
 
@@ -1633,6 +1634,9 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
 	case CHIP_SIENNA_CICHLID:
 		chip_name = "sienna_cichlid";
 		break;
+	case CHIP_NAVY_FLOUNDER:
+		chip_name = "navy_flounder";
+		break;
 	}
 
 	snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_gpu_info.bin", chip_name);
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 04/42] drm/amdgpu: set fw load type for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (2 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 03/42] drm/amdgpu: add navy_flounder gpu info firmware Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 05/42] drm/amdgpu: set asic family and ip blocks " Alex Deucher
                   ` (37 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Currently navy_flounder only supports backdoor loading type.
Will switch to psp load type when psp is ready.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
index 744404a05fee..43af71c3202c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
@@ -394,7 +394,8 @@ amdgpu_ucode_get_load_type(struct amdgpu_device *adev, int load_type)
 			return AMDGPU_FW_LOAD_DIRECT;
 		else
 			return AMDGPU_FW_LOAD_PSP;
-
+	case CHIP_NAVY_FLOUNDER:
+		return AMDGPU_FW_LOAD_DIRECT;
 	default:
 		DRM_ERROR("Unknown firmware load type\n");
 	}
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 05/42] drm/amdgpu: set asic family and ip blocks for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (3 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 04/42] drm/amdgpu: set fw load type for navy_flounder Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 06/42] drm/amdgpu/gfx10: add support for navy_flounder firmware Alex Deucher
                   ` (36 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Add the asic family and IP blocks for navy flounder.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 99ed9cbfefcb..3efca05e5d69 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1810,6 +1810,7 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
 	case  CHIP_NAVI14:
 	case  CHIP_NAVI12:
 	case  CHIP_SIENNA_CICHLID:
+	case  CHIP_NAVY_FLOUNDER:
 		adev->family = AMDGPU_FAMILY_NV;
 
 		r = nv_set_ip_blocks(adev);
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 06/42] drm/amdgpu/gfx10: add support for navy_flounder firmware
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (4 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 05/42] drm/amdgpu: set asic family and ip blocks " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 07/42] drm/amdgpu/gmc10: add navy_flounder support Alex Deucher
                   ` (35 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Declare the gfx/compute firmwares.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index ddf6d8128753..60b8da3e7321 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -145,6 +145,13 @@ MODULE_FIRMWARE("amdgpu/sienna_cichlid_mec.bin");
 MODULE_FIRMWARE("amdgpu/sienna_cichlid_mec2.bin");
 MODULE_FIRMWARE("amdgpu/sienna_cichlid_rlc.bin");
 
+MODULE_FIRMWARE("amdgpu/navy_flounder_ce.bin");
+MODULE_FIRMWARE("amdgpu/navy_flounder_pfp.bin");
+MODULE_FIRMWARE("amdgpu/navy_flounder_me.bin");
+MODULE_FIRMWARE("amdgpu/navy_flounder_mec.bin");
+MODULE_FIRMWARE("amdgpu/navy_flounder_mec2.bin");
+MODULE_FIRMWARE("amdgpu/navy_flounder_rlc.bin");
+
 static const struct soc15_reg_golden golden_settings_gc_10_1[] =
 {
 	SOC15_REG_GOLDEN_VALUE(GC, 0, mmCB_HW_CONTROL_4, 0xffffffff, 0x00400014),
@@ -3578,6 +3585,9 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
 	case CHIP_SIENNA_CICHLID:
 		chip_name = "sienna_cichlid";
 		break;
+	case CHIP_NAVY_FLOUNDER:
+		chip_name = "navy_flounder";
+		break;
 	default:
 		BUG();
 	}
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 07/42] drm/amdgpu/gmc10: add navy_flounder support
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (5 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 06/42] drm/amdgpu/gfx10: add support for navy_flounder firmware Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 08/42] drm/amdgpu/gfx10: add clockgating support for navy_flounder Alex Deucher
                   ` (34 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Same as navi10.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
index 8f29f79f820d..2bf112fc8185 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
@@ -753,6 +753,7 @@ static int gmc_v10_0_mc_init(struct amdgpu_device *adev)
 		case CHIP_NAVI14:
 		case CHIP_NAVI12:
 		case CHIP_SIENNA_CICHLID:
+		case CHIP_NAVY_FLOUNDER:
 		default:
 			adev->gmc.gart_size = 512ULL << 20;
 			break;
@@ -847,6 +848,7 @@ static int gmc_v10_0_sw_init(void *handle)
 	case CHIP_NAVI14:
 	case CHIP_NAVI12:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		adev->num_vmhubs = 2;
 		/*
 		 * To fulfill 4-level page support,
@@ -951,6 +953,7 @@ static void gmc_v10_0_init_golden_registers(struct amdgpu_device *adev)
 	case CHIP_NAVI14:
 	case CHIP_NAVI12:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		break;
 	default:
 		break;
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 08/42] drm/amdgpu/gfx10: add clockgating support for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (6 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 07/42] drm/amdgpu/gmc10: add navy_flounder support Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 09/42] drm/amdgpu/soc15: add " Alex Deucher
                   ` (33 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Same as navi10.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 60b8da3e7321..401e9607becc 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -7476,6 +7476,7 @@ static int gfx_v10_0_set_clockgating_state(void *handle,
 	case CHIP_NAVI14:
 	case CHIP_NAVI12:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		gfx_v10_0_update_gfx_clock_gating(adev,
 						 state == AMD_CG_STATE_GATE);
 		break;
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 09/42] drm/amdgpu/soc15: add support for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (7 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 08/42] drm/amdgpu/gfx10: add clockgating support for navy_flounder Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 10/42] drm/amdgpu: initialize IP offset " Alex Deucher
                   ` (32 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Add soc support.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 356849136d1d..7c551dc2ccdc 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -734,6 +734,12 @@ static int nv_common_early_init(void *handle)
 			AMD_PG_SUPPORT_MMHUB;
 		adev->external_rev_id = adev->rev_id + 0x28;
 		break;
+	case CHIP_NAVY_FLOUNDER:
+		adev->cg_flags = 0;
+		adev->pg_flags = 0;
+		adev->external_rev_id = adev->rev_id + 0x32;
+		break;
+
 	default:
 		/* FIXME: not supported yet */
 		return -EINVAL;
@@ -960,6 +966,7 @@ static int nv_common_set_clockgating_state(void *handle,
 	case CHIP_NAVI14:
 	case CHIP_NAVI12:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		adev->nbio.funcs->update_medium_grain_clock_gating(adev,
 				state == AMD_CG_STATE_GATE);
 		adev->nbio.funcs->update_medium_grain_light_sleep(adev,
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 10/42] drm/amdgpu: initialize IP offset for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (8 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 09/42] drm/amdgpu/soc15: add " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 11/42] drm/amdgpu: add support on mmhub " Alex Deucher
                   ` (31 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

since navy_flounder has the same ip offset with sienna_cichlid,
follow sienna_cichlid setting for the moment.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 7c551dc2ccdc..a8260a51432a 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -411,6 +411,7 @@ static int nv_reg_base_init(struct amdgpu_device *adev)
 		navi12_reg_base_init(adev);
 		break;
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		sienna_cichlid_reg_base_init(adev);
 		break;
 	default:
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 11/42] drm/amdgpu: add support on mmhub for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (9 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 10/42] drm/amdgpu: initialize IP offset " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 12/42] drm/amdgpu: add common ip block " Alex Deucher
                   ` (30 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

navy_flounder has the same mmhub IP version with sienna_cichlid,
follow its setting.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
index d820fa02e6e8..5500f9d8d18f 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
@@ -390,6 +390,7 @@ static void mmhub_v2_0_update_medium_grain_clock_gating(struct amdgpu_device *ad
 
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		def  = data  = RREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_MISC_CG_Sienna_Cichlid);
 		def1 = data1 = RREG32_SOC15(MMHUB, 0, mmDAGB0_CNTL_MISC2_Sienna_Cichlid);
 		break;
@@ -422,6 +423,7 @@ static void mmhub_v2_0_update_medium_grain_clock_gating(struct amdgpu_device *ad
 
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		if (def != data)
 			WREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_MISC_CG_Sienna_Cichlid, data);
 		if (def1 != data1)
@@ -443,6 +445,7 @@ static void mmhub_v2_0_update_medium_grain_light_sleep(struct amdgpu_device *ade
 
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		def  = data  = RREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_MISC_CG_Sienna_Cichlid);
 		break;
 	default:
@@ -458,6 +461,7 @@ static void mmhub_v2_0_update_medium_grain_light_sleep(struct amdgpu_device *ade
 	if (def != data) {
 		switch (adev->asic_type) {
 		case CHIP_SIENNA_CICHLID:
+		case CHIP_NAVY_FLOUNDER:
 			WREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_MISC_CG_Sienna_Cichlid, data);
 			break;
 		default:
@@ -499,6 +503,7 @@ void mmhub_v2_0_get_clockgating(struct amdgpu_device *adev, u32 *flags)
 
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		data  = RREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_MISC_CG_Sienna_Cichlid);
 		data1 = RREG32_SOC15(MMHUB, 0, mmDAGB0_CNTL_MISC2_Sienna_Cichlid);
 		break;
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 12/42] drm/amdgpu: add common ip block for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (10 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 11/42] drm/amdgpu: add support on mmhub " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 13/42] drm/amdgpu: add gmc " Alex Deucher
                   ` (29 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index a8260a51432a..91b4d4e27a13 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -508,6 +508,9 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 		if (adev->enable_mes)
 			amdgpu_device_ip_block_add(adev, &mes_v10_1_ip_block);
 		break;
+	case CHIP_NAVY_FLOUNDER:
+		amdgpu_device_ip_block_add(adev, &nv_common_ip_block);
+		break;
 	default:
 		return -EINVAL;
 	}
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 13/42] drm/amdgpu: add gmc ip block for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (11 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 12/42] drm/amdgpu: add common ip block " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 14/42] drm/amdgpu: add ih " Alex Deucher
                   ` (28 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

navy_flounder has similar gc IP version with sienna_cichlid,
follow its setting for the moment.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 18 ++++++++++++------
 drivers/gpu/drm/amd/amdgpu/nv.c        |  1 +
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
index 2bf112fc8185..55fedadd78c6 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
@@ -693,7 +693,8 @@ static void gmc_v10_0_vram_gtt_location(struct amdgpu_device *adev,
 {
 	u64 base = 0;
 
-	if (adev->asic_type == CHIP_SIENNA_CICHLID)
+	if (adev->asic_type == CHIP_SIENNA_CICHLID ||
+	    adev->asic_type == CHIP_NAVY_FLOUNDER)
 		base = gfxhub_v2_1_get_fb_location(adev);
 	else
 		base = gfxhub_v2_0_get_fb_location(adev);
@@ -705,7 +706,8 @@ static void gmc_v10_0_vram_gtt_location(struct amdgpu_device *adev,
 	amdgpu_gmc_gart_location(adev, mc);
 
 	/* base offset of vram pages */
-	if (adev->asic_type == CHIP_SIENNA_CICHLID)
+	if (adev->asic_type == CHIP_SIENNA_CICHLID ||
+	    adev->asic_type == CHIP_NAVY_FLOUNDER)
 		adev->vm_manager.vram_base_offset = gfxhub_v2_1_get_mc_fb_offset(adev);
 	else
 		adev->vm_manager.vram_base_offset = gfxhub_v2_0_get_mc_fb_offset(adev);
@@ -822,7 +824,8 @@ static int gmc_v10_0_sw_init(void *handle)
 	int r, vram_width = 0, vram_type = 0, vram_vendor = 0;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
-	if (adev->asic_type == CHIP_SIENNA_CICHLID)
+	if (adev->asic_type == CHIP_SIENNA_CICHLID ||
+	    adev->asic_type == CHIP_NAVY_FLOUNDER)
 		gfxhub_v2_1_init(adev);
 	else
 		gfxhub_v2_0_init(adev);
@@ -980,7 +983,8 @@ static int gmc_v10_0_gart_enable(struct amdgpu_device *adev)
 	if (r)
 		return r;
 
-	if (adev->asic_type == CHIP_SIENNA_CICHLID)
+	if (adev->asic_type == CHIP_SIENNA_CICHLID ||
+	    adev->asic_type == CHIP_NAVY_FLOUNDER)
 		r = gfxhub_v2_1_gart_enable(adev);
 	else
 		r = gfxhub_v2_0_gart_enable(adev);
@@ -1004,7 +1008,8 @@ static int gmc_v10_0_gart_enable(struct amdgpu_device *adev)
 	value = (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_ALWAYS) ?
 		false : true;
 
-	if (adev->asic_type == CHIP_SIENNA_CICHLID)
+	if (adev->asic_type == CHIP_SIENNA_CICHLID ||
+	    adev->asic_type == CHIP_NAVY_FLOUNDER)
 		gfxhub_v2_1_set_fault_enable_default(adev, value);
 	else
 		gfxhub_v2_0_set_fault_enable_default(adev, value);
@@ -1045,7 +1050,8 @@ static int gmc_v10_0_hw_init(void *handle)
  */
 static void gmc_v10_0_gart_disable(struct amdgpu_device *adev)
 {
-	if (adev->asic_type == CHIP_SIENNA_CICHLID)
+	if (adev->asic_type == CHIP_SIENNA_CICHLID ||
+	    adev->asic_type == CHIP_NAVY_FLOUNDER)
 		gfxhub_v2_1_gart_disable(adev);
 	else
 		gfxhub_v2_0_gart_disable(adev);
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 91b4d4e27a13..bc0181da25d2 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -510,6 +510,7 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 		break;
 	case CHIP_NAVY_FLOUNDER:
 		amdgpu_device_ip_block_add(adev, &nv_common_ip_block);
+		amdgpu_device_ip_block_add(adev, &gmc_v10_0_ip_block);
 		break;
 	default:
 		return -EINVAL;
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 14/42] drm/amdgpu: add ih ip block for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (12 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 13/42] drm/amdgpu: add gmc " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 15/42] drm/amdgpu: add gfx " Alex Deucher
                   ` (27 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

navy_flounder has the same osssys IP verison with
sienna_cichlid, follow its setting.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 1 +
 drivers/gpu/drm/amd/amdgpu/nv.c        | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
index 471dc82fd1aa..fdabaf0db3e6 100644
--- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
@@ -270,6 +270,7 @@ static int navi10_ih_irq_init(struct amdgpu_device *adev)
 		if (ih->use_bus_addr) {
 			switch (adev->asic_type) {
 			case CHIP_SIENNA_CICHLID:
+			case CHIP_NAVY_FLOUNDER:
 				ih_chicken = RREG32_SOC15(OSSSYS, 0, mmIH_CHICKEN_Sienna_Cichlid);
 				ih_chicken = REG_SET_FIELD(ih_chicken,
 						IH_CHICKEN, MC_SPACE_GPA_ENABLE, 1);
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index bc0181da25d2..5990b7b3796f 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -511,6 +511,7 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 	case CHIP_NAVY_FLOUNDER:
 		amdgpu_device_ip_block_add(adev, &nv_common_ip_block);
 		amdgpu_device_ip_block_add(adev, &gmc_v10_0_ip_block);
+		amdgpu_device_ip_block_add(adev, &navi10_ih_ip_block);
 		break;
 	default:
 		return -EINVAL;
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 15/42] drm/amdgpu: add gfx ip block for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (13 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 14/42] drm/amdgpu: add ih " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 16/42] drm/amdgpu: add sdma " Alex Deucher
                   ` (26 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

since navy_flounder has similar gc IP version with
sienna_cichlid, follow its setting for the moment.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <Tao.Zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 ++++
 drivers/gpu/drm/amd/amdgpu/nv.c        | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 401e9607becc..5e24adca964b 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -4118,6 +4118,7 @@ static void gfx_v10_0_gpu_early_init(struct amdgpu_device *adev)
 		gb_addr_config = RREG32_SOC15(GC, 0, mmGB_ADDR_CONFIG);
 		break;
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		adev->gfx.config.max_hw_contexts = 8;
 		adev->gfx.config.sc_prim_fifo_size_frontend = 0x20;
 		adev->gfx.config.sc_prim_fifo_size_backend = 0x100;
@@ -4240,6 +4241,7 @@ static int gfx_v10_0_sw_init(void *handle)
 		adev->gfx.mec.num_queue_per_pipe = 8;
 		break;
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		adev->gfx.me.num_me = 1;
 		adev->gfx.me.num_pipe_per_me = 1;
 		adev->gfx.me.num_queue_per_pipe = 1;
@@ -7081,6 +7083,7 @@ static int gfx_v10_0_early_init(void *handle)
 		adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS_NV1X;
 		break;
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS_Sienna_Cichlid;
 		break;
 	default:
@@ -8578,6 +8581,7 @@ static void gfx_v10_0_set_rlc_funcs(struct amdgpu_device *adev)
 	case CHIP_NAVI10:
 	case CHIP_NAVI14:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		adev->gfx.rlc.funcs = &gfx_v10_0_rlc_funcs;
 		break;
 	case CHIP_NAVI12:
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 5990b7b3796f..693eab81f1d8 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -512,6 +512,7 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 		amdgpu_device_ip_block_add(adev, &nv_common_ip_block);
 		amdgpu_device_ip_block_add(adev, &gmc_v10_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &navi10_ih_ip_block);
+		amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);
 		break;
 	default:
 		return -EINVAL;
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 16/42] drm/amdgpu: add sdma ip block for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (14 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 15/42] drm/amdgpu: add gfx " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 17/42] drm/amdgpu: add virtual display support " Alex Deucher
                   ` (25 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Navy_Flounder has the same sdma IP version with
sienna_cichlid, and it has 2 sdma controllers.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c        |  1 +
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 20 ++++++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 693eab81f1d8..2f5a3e924a39 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -513,6 +513,7 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 		amdgpu_device_ip_block_add(adev, &gmc_v10_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &navi10_ih_ip_block);
 		amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);
+		amdgpu_device_ip_block_add(adev, &sdma_v5_2_ip_block);
 		break;
 	default:
 		return -EINVAL;
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
index de8342283fdb..46a9617fee5f 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
@@ -45,6 +45,7 @@
 #include "sdma_v5_2.h"
 
 MODULE_FIRMWARE("amdgpu/sienna_cichlid_sdma.bin");
+MODULE_FIRMWARE("amdgpu/navy_flounder_sdma.bin");
 
 #define SDMA1_REG_OFFSET 0x600
 #define SDMA3_REG_OFFSET 0x400
@@ -85,6 +86,7 @@ static void sdma_v5_2_init_golden_registers(struct amdgpu_device *adev)
 {
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		break;
 	default:
 		break;
@@ -152,6 +154,9 @@ static int sdma_v5_2_init_microcode(struct amdgpu_device *adev)
 	case CHIP_SIENNA_CICHLID:
 		chip_name = "sienna_cichlid";
 		break;
+	case CHIP_NAVY_FLOUNDER:
+		chip_name = "navy_flounder";
+		break;
 	default:
 		BUG();
 	}
@@ -167,7 +172,8 @@ static int sdma_v5_2_init_microcode(struct amdgpu_device *adev)
 		goto out;
 
 	for (i = 1; i < adev->sdma.num_instances; i++) {
-		if (adev->asic_type == CHIP_SIENNA_CICHLID) {
+		if (adev->asic_type == CHIP_SIENNA_CICHLID ||
+		    adev->asic_type == CHIP_NAVY_FLOUNDER) {
 			memcpy((void*)&adev->sdma.instance[i],
 			       (void*)&adev->sdma.instance[0],
 			       sizeof(struct amdgpu_sdma_instance));
@@ -1155,7 +1161,16 @@ static int sdma_v5_2_early_init(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
-	adev->sdma.num_instances = 4;
+	switch (adev->asic_type) {
+	case CHIP_SIENNA_CICHLID:
+		adev->sdma.num_instances = 4;
+		break;
+	case CHIP_NAVY_FLOUNDER:
+		adev->sdma.num_instances = 2;
+		break;
+	default:
+		break;
+	}
 
 	sdma_v5_2_set_ring_funcs(adev);
 	sdma_v5_2_set_buffer_funcs(adev);
@@ -1548,6 +1563,7 @@ static int sdma_v5_2_set_clockgating_state(void *handle,
 
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		sdma_v5_2_update_medium_grain_clock_gating(adev,
 				state == AMD_CG_STATE_GATE ? true : false);
 		sdma_v5_2_update_medium_grain_light_sleep(adev,
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 17/42] drm/amdgpu: add virtual display support for navy_flounder.
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (15 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 16/42] drm/amdgpu: add sdma " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 18/42] drm/amdgpu: configure navy_flounder gfx according to gfx 10.3 Alex Deucher
                   ` (24 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Virtual display support for bring up and virtualization.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 2f5a3e924a39..46c51e0380e8 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -512,6 +512,8 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 		amdgpu_device_ip_block_add(adev, &nv_common_ip_block);
 		amdgpu_device_ip_block_add(adev, &gmc_v10_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &navi10_ih_ip_block);
+		if (adev->enable_virtual_display || amdgpu_sriov_vf(adev))
+			amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block);
 		amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &sdma_v5_2_ip_block);
 		break;
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 18/42] drm/amdgpu: configure navy_flounder gfx according to gfx 10.3
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (16 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 17/42] drm/amdgpu: add virtual display support " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 19/42] drm/amdgpu: force pa_sc_tile_steering_override to 0 for navy_flounder Alex Deucher
                   ` (23 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Tao Zhou <tao.zhou1@amd.com>

The gfx version of navy_flounder is 10.3, identical to
sienna_cichlid, follow the way of sienna_cichlid.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 5e24adca964b..02645356f96f 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -5720,6 +5720,7 @@ static void gfx_v10_0_cp_gfx_set_doorbell(struct amdgpu_device *adev,
 	WREG32_SOC15(GC, 0, mmCP_RB_DOORBELL_CONTROL, tmp);
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		tmp = REG_SET_FIELD(0, CP_RB_DOORBELL_RANGE_LOWER,
 				    DOORBELL_RANGE_LOWER_Sienna_Cichlid, ring->doorbell_index);
 		WREG32_SOC15(GC, 0, mmCP_RB_DOORBELL_RANGE_LOWER, tmp);
@@ -5852,6 +5853,7 @@ static void gfx_v10_0_cp_compute_enable(struct amdgpu_device *adev, bool enable)
 	if (enable) {
 		switch (adev->asic_type) {
 		case CHIP_SIENNA_CICHLID:
+		case CHIP_NAVY_FLOUNDER:
 			WREG32_SOC15(GC, 0, mmCP_MEC_CNTL_Sienna_Cichlid, 0);
 			break;
 		default:
@@ -5861,6 +5863,7 @@ static void gfx_v10_0_cp_compute_enable(struct amdgpu_device *adev, bool enable)
 	} else {
 		switch (adev->asic_type) {
 		case CHIP_SIENNA_CICHLID:
+		case CHIP_NAVY_FLOUNDER:
 			WREG32_SOC15(GC, 0, mmCP_MEC_CNTL_Sienna_Cichlid,
 				     (CP_MEC_CNTL__MEC_ME1_HALT_MASK |
 				      CP_MEC_CNTL__MEC_ME2_HALT_MASK));
@@ -5954,6 +5957,7 @@ static void gfx_v10_0_kiq_setting(struct amdgpu_ring *ring)
 	/* tell RLC which is KIQ queue */
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		tmp = RREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS_Sienna_Cichlid);
 		tmp &= 0xffffff00;
 		tmp |= (ring->me << 5) | (ring->pipe << 3) | (ring->queue);
@@ -6657,6 +6661,7 @@ static bool gfx_v10_0_check_grbm_cam_remapping(struct amdgpu_device *adev)
 	 * has been remapped to mmVGT_ESGS_RING_SIZE */
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		data = RREG32_SOC15(GC, 0, mmVGT_ESGS_RING_SIZE_Sienna_Cichlid);
 		WREG32_SOC15(GC, 0, mmVGT_ESGS_RING_SIZE_Sienna_Cichlid, 0);
 		WREG32_SOC15(GC, 0, mmVGT_ESGS_RING_SIZE_UMD, pattern);
@@ -6695,6 +6700,7 @@ static void gfx_v10_0_setup_grbm_cam_remapping(struct amdgpu_device *adev)
 
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		/* mmVGT_TF_RING_SIZE_UMD -> mmVGT_TF_RING_SIZE */
 		data = (SOC15_REG_OFFSET(GC, 0, mmVGT_TF_RING_SIZE_UMD) <<
 			GRBM_CAM_DATA__CAM_ADDR__SHIFT) |
@@ -6985,6 +6991,7 @@ static int gfx_v10_0_soft_reset(void *handle)
 	tmp = RREG32_SOC15(GC, 0, mmGRBM_STATUS2);
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		if (REG_GET_FIELD(tmp, GRBM_STATUS2, RLC_BUSY_Sienna_Cichlid))
 			grbm_soft_reset = REG_SET_FIELD(grbm_soft_reset,
 							GRBM_SOFT_RESET,
@@ -7136,6 +7143,7 @@ static void gfx_v10_0_set_safe_mode(struct amdgpu_device *adev)
 
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		WREG32_SOC15(GC, 0, mmRLC_SAFE_MODE_Sienna_Cichlid, data);
 
 		/* wait for RLC_SAFE_MODE */
@@ -7167,6 +7175,7 @@ static void gfx_v10_0_unset_safe_mode(struct amdgpu_device *adev)
 	data = RLC_SAFE_MODE__CMD_MASK;
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		WREG32_SOC15(GC, 0, mmRLC_SAFE_MODE_Sienna_Cichlid, data);
 		break;
 	default:
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 19/42] drm/amdgpu: force pa_sc_tile_steering_override to 0 for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (17 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 18/42] drm/amdgpu: configure navy_flounder gfx according to gfx 10.3 Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 20/42] drm/amdgpu: add gmc cg support " Alex Deucher
                   ` (22 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

pa_sc_tile_steering_override is only programmable for
gfx10.0/10.1/10.2, and navy_flounder has the same gfx10.3 IP
with sienna_cichlid.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 02645356f96f..2957bf780d79 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -4496,7 +4496,8 @@ static u32 gfx_v10_0_init_pa_sc_tile_steering_override(struct amdgpu_device *ade
 
 	/* for ASICs that integrates GFX v10.3
 	 * pa_sc_tile_steering_override should be set to 0 */
-	if (adev->asic_type == CHIP_SIENNA_CICHLID)
+	if (adev->asic_type == CHIP_SIENNA_CICHLID ||
+	    adev->asic_type == CHIP_NAVY_FLOUNDER)
 		return 0;
 
 	/* init num_sc */
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 20/42] drm/amdgpu: add gmc cg support for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (18 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 19/42] drm/amdgpu: force pa_sc_tile_steering_override to 0 for navy_flounder Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 21/42] drm/amdgpu/powerplay: add smu " Alex Deucher
                   ` (21 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

The athub version used for navy_flounder is v2.1.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c  | 6 ++++--
 drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
index 55fedadd78c6..ec90c62078d9 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
@@ -1125,7 +1125,8 @@ static int gmc_v10_0_set_clockgating_state(void *handle,
 	if (r)
 		return r;
 
-	if (adev->asic_type == CHIP_SIENNA_CICHLID)
+	if (adev->asic_type == CHIP_SIENNA_CICHLID ||
+	    adev->asic_type == CHIP_NAVY_FLOUNDER)
 		return athub_v2_1_set_clockgating(adev, state);
 	else
 		return athub_v2_0_set_clockgating(adev, state);
@@ -1137,7 +1138,8 @@ static void gmc_v10_0_get_clockgating_state(void *handle, u32 *flags)
 
 	mmhub_v2_0_get_clockgating(adev, flags);
 
-	if (adev->asic_type == CHIP_SIENNA_CICHLID)
+	if (adev->asic_type == CHIP_SIENNA_CICHLID ||
+	    adev->asic_type == CHIP_NAVY_FLOUNDER)
 		athub_v2_1_get_clockgating(adev, flags);
 	else
 		athub_v2_0_get_clockgating(adev, flags);
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
index 5500f9d8d18f..757fa8e83f5b 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
@@ -482,6 +482,7 @@ int mmhub_v2_0_set_clockgating(struct amdgpu_device *adev,
 	case CHIP_NAVI14:
 	case CHIP_NAVI12:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		mmhub_v2_0_update_medium_grain_clock_gating(adev,
 				state == AMD_CG_STATE_GATE);
 		mmhub_v2_0_update_medium_grain_light_sleep(adev,
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 21/42] drm/amdgpu/powerplay: add smu support for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (19 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 20/42] drm/amdgpu: add gmc cg support " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 22/42] drm/amdgpu: add smu block " Alex Deucher
                   ` (20 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Now navy_flounder will reuse the smu11 driver_if header and ppt
functions for sienna_cichlid. Later navy_flounder can maintain
its own version if the compatibility is broken.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c    |  1 +
 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h |  1 +
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c     | 15 ++++++++++++++-
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index 6839faaab611..b0c2b52e0e2b 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -601,6 +601,7 @@ static int smu_set_funcs(struct amdgpu_device *adev)
 		smu->od_enabled =false;
 		break;
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		sienna_cichlid_set_ppt_funcs(smu);
 		break;
 	case CHIP_RENOIR:
diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h b/drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h
index 1da92f137bdb..95417e35df43 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h
@@ -31,6 +31,7 @@
 #define SMU11_DRIVER_IF_VERSION_NV12 0x33
 #define SMU11_DRIVER_IF_VERSION_NV14 0x36
 #define SMU11_DRIVER_IF_VERSION_Sienna_Cichlid 0x33
+#define SMU11_DRIVER_IF_VERSION_Navy_Flounder 0x2B
 
 /* MP Apertures */
 #define MP0_Public			0x03800000
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 03be59492af1..d7c34f269452 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -60,6 +60,7 @@ MODULE_FIRMWARE("amdgpu/navi10_smc.bin");
 MODULE_FIRMWARE("amdgpu/navi14_smc.bin");
 MODULE_FIRMWARE("amdgpu/navi12_smc.bin");
 MODULE_FIRMWARE("amdgpu/sienna_cichlid_smc.bin");
+MODULE_FIRMWARE("amdgpu/navy_flounder_smc.bin");
 
 #define SMU11_VOLTAGE_SCALE 4
 
@@ -172,6 +173,9 @@ int smu_v11_0_init_microcode(struct smu_context *smu)
 	case CHIP_SIENNA_CICHLID:
 		chip_name = "sienna_cichlid";
 		break;
+	case CHIP_NAVY_FLOUNDER:
+		chip_name = "navy_flounder";
+		break;
 	default:
 		dev_err(adev->dev, "Unsupported ASIC type %d\n", adev->asic_type);
 		return -EINVAL;
@@ -304,6 +308,9 @@ int smu_v11_0_check_fw_version(struct smu_context *smu)
 	case CHIP_SIENNA_CICHLID:
 		smu->smc_driver_if_version = SMU11_DRIVER_IF_VERSION_Sienna_Cichlid;
 		break;
+	case CHIP_NAVY_FLOUNDER:
+		smu->smc_driver_if_version = SMU11_DRIVER_IF_VERSION_Navy_Flounder;
+		break;
 	default:
 		dev_err(smu->adev->dev, "smu unsupported asic type:%d.\n", smu->adev->asic_type);
 		smu->smc_driver_if_version = SMU11_DRIVER_IF_VERSION_INV;
@@ -385,7 +392,8 @@ int smu_v11_0_setup_pptable(struct smu_context *smu)
 	hdr = (const struct smc_firmware_header_v1_0 *) adev->pm.fw->data;
 	version_major = le16_to_cpu(hdr->header.header_version_major);
 	version_minor = le16_to_cpu(hdr->header.header_version_minor);
-	if (version_major == 2 && smu->smu_table.boot_values.pp_table_id > 0) {
+	if ((version_major == 2 && smu->smu_table.boot_values.pp_table_id > 0) ||
+	    adev->asic_type == CHIP_NAVY_FLOUNDER) {
 		dev_info(adev->dev, "use driver provided pptable %d\n", smu->smu_table.boot_values.pp_table_id);
 		switch (version_minor) {
 		case 0:
@@ -817,6 +825,11 @@ int smu_v11_0_set_tool_table_location(struct smu_context *smu)
 int smu_v11_0_init_display_count(struct smu_context *smu, uint32_t count)
 {
 	int ret = 0;
+	struct amdgpu_device *adev = smu->adev;
+
+	/* Navy_Flounder do not support to change display num currently */
+	if (adev->asic_type == CHIP_NAVY_FLOUNDER)
+		return 0;
 
 	if (!smu->pm_enabled)
 		return ret;
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 22/42] drm/amdgpu: add smu block for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (20 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 21/42] drm/amdgpu/powerplay: add smu " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 23/42] drm/amdgpu: add psp support " Alex Deucher
                   ` (19 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Add SMU block for navy_flounder with direct
firmware load type.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 46c51e0380e8..383db88f4995 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -516,6 +516,9 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 			amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block);
 		amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &sdma_v5_2_ip_block);
+		if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
+		    is_support_sw_smu(adev))
+			amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
 		break;
 	default:
 		return -EINVAL;
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 23/42] drm/amdgpu: add psp support for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (21 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 22/42] drm/amdgpu: add smu block " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 24/42] drm/amdgpu: add psp block " Alex Deucher
                   ` (18 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Currently skip ASD FW loading and ih reroute per
sienna_cichlid.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |  8 ++++++--
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c  | 12 ++++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 40706334f7a8..aab5ffc03a6b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -99,6 +99,7 @@ static int psp_early_init(void *handle)
 	case CHIP_NAVI14:
 	case CHIP_NAVI12:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		psp_v11_0_set_psp_funcs(psp);
 		psp->autoload_supported = true;
 		break;
@@ -498,7 +499,9 @@ static int psp_asd_load(struct psp_context *psp)
 	 * add workaround to bypass it for sriov now.
 	 * TODO: add version check to make it common
 	 */
-	if (amdgpu_sriov_vf(psp->adev) || (psp->adev->asic_type == CHIP_SIENNA_CICHLID))
+	if (amdgpu_sriov_vf(psp->adev) ||
+	    (psp->adev->asic_type == CHIP_SIENNA_CICHLID) ||
+	    (psp->adev->asic_type == CHIP_NAVY_FLOUNDER))
 		return 0;
 
 	cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
@@ -1763,7 +1766,8 @@ static int psp_np_fw_load(struct psp_context *psp)
 			continue;
 
 		if (psp->autoload_supported &&
-		    adev->asic_type == CHIP_SIENNA_CICHLID &&
+		    (adev->asic_type == CHIP_SIENNA_CICHLID ||
+		     adev->asic_type == CHIP_NAVY_FLOUNDER) &&
 		    (ucode->ucode_id == AMDGPU_UCODE_ID_SDMA1 ||
 		     ucode->ucode_id == AMDGPU_UCODE_ID_SDMA2 ||
 		     ucode->ucode_id == AMDGPU_UCODE_ID_SDMA3))
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
index 423386272920..77f99811cd85 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
@@ -57,6 +57,8 @@ MODULE_FIRMWARE("amdgpu/arcturus_asd.bin");
 MODULE_FIRMWARE("amdgpu/arcturus_ta.bin");
 MODULE_FIRMWARE("amdgpu/sienna_cichlid_sos.bin");
 MODULE_FIRMWARE("amdgpu/sienna_cichlid_asd.bin");
+MODULE_FIRMWARE("amdgpu/navy_flounder_sos.bin");
+MODULE_FIRMWARE("amdgpu/navy_flounder_asd.bin");
 
 /* address block */
 #define smnMP1_FIRMWARE_FLAGS		0x3010024
@@ -100,6 +102,9 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
 	case CHIP_SIENNA_CICHLID:
 		chip_name = "sienna_cichlid";
 		break;
+	case CHIP_NAVY_FLOUNDER:
+		chip_name = "navy_flounder";
+		break;
 	default:
 		BUG();
 	}
@@ -108,7 +113,8 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
 	if (err)
 		return err;
 
-	if (adev->asic_type != CHIP_SIENNA_CICHLID) {
+	if (adev->asic_type != CHIP_SIENNA_CICHLID &&
+	    adev->asic_type != CHIP_NAVY_FLOUNDER) {
 		err = psp_init_asd_microcode(psp, chip_name);
 		if (err)
 			return err;
@@ -173,6 +179,7 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
 		}
 		break;
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		break;
 	default:
 		BUG();
@@ -397,7 +404,8 @@ static int psp_v11_0_ring_init(struct psp_context *psp,
 	struct amdgpu_device *adev = psp->adev;
 
 	if ((!amdgpu_sriov_vf(adev)) &&
-	    (adev->asic_type != CHIP_SIENNA_CICHLID))
+	    (adev->asic_type != CHIP_SIENNA_CICHLID) &&
+	    (adev->asic_type != CHIP_NAVY_FLOUNDER))
 		psp_v11_0_reroute_ih(psp);
 
 	ring = &psp->km_ring;
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 24/42] drm/amdgpu: add psp block for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (22 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 23/42] drm/amdgpu: add psp support " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 25/42] drm/amdgpu: use front door firmware loading " Alex Deucher
                   ` (17 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Add psp and smu block for navy_flounder with
psp firmware load type.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 383db88f4995..e62426a2a929 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -512,6 +512,11 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 		amdgpu_device_ip_block_add(adev, &nv_common_ip_block);
 		amdgpu_device_ip_block_add(adev, &gmc_v10_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &navi10_ih_ip_block);
+		if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP))
+			amdgpu_device_ip_block_add(adev, &psp_v11_0_ip_block);
+		if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP &&
+		    is_support_sw_smu(adev))
+			amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
 		if (adev->enable_virtual_display || amdgpu_sriov_vf(adev))
 			amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block);
 		amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 25/42] drm/amdgpu: use front door firmware loading for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (23 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 24/42] drm/amdgpu: add psp block " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 26/42] drm/amdkfd: Support navy_flounder KFD Alex Deucher
                   ` (16 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Same as other navi asics.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
index 43af71c3202c..183743c5fb7b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
@@ -390,12 +390,11 @@ amdgpu_ucode_get_load_type(struct amdgpu_device *adev, int load_type)
 	case CHIP_NAVI14:
 	case CHIP_NAVI12:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		if (!load_type)
 			return AMDGPU_FW_LOAD_DIRECT;
 		else
 			return AMDGPU_FW_LOAD_PSP;
-	case CHIP_NAVY_FLOUNDER:
-		return AMDGPU_FW_LOAD_DIRECT;
 	default:
 		DRM_ERROR("Unknown firmware load type\n");
 	}
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 26/42] drm/amdkfd: Support navy_flounder KFD
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (24 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 25/42] drm/amdgpu: use front door firmware loading " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 27/42] drm/amdkfd: Add kfd2kgd_funcs for navy_flounder kfd support Alex Deucher
                   ` (15 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Chengming Gui

From: Chengming Gui <Jack.Gui@amd.com>

Add KFD support for Navy Flounder.

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_crat.c         |  1 +
 drivers/gpu/drm/amd/amdkfd/kfd_device.c       | 19 +++++++++++++++++++
 .../drm/amd/amdkfd/kfd_device_queue_manager.c |  1 +
 drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c  |  1 +
 .../gpu/drm/amd/amdkfd/kfd_packet_manager.c   |  1 +
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c     |  1 +
 6 files changed, 24 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
index 9deadfd8f929..6a250f8fcfb8 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
@@ -679,6 +679,7 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
 	case CHIP_NAVI12:
 	case CHIP_NAVI14:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		pcache_info = navi10_cache_info;
 		num_of_cache_types = ARRAY_SIZE(navi10_cache_info);
 		break;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 50886de3ba0a..82ac1b4886c7 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -478,6 +478,24 @@ static const struct kfd_device_info sienna_cichlid_device_info = {
 	.num_sdma_queues_per_engine = 8,
 };
 
+static const struct kfd_device_info navy_flounder_device_info = {
+	.asic_family = CHIP_NAVY_FLOUNDER,
+	.asic_name = "navy_flounder",
+	.max_pasid_bits = 16,
+	.max_no_of_hqd  = 24,
+	.doorbell_size  = 8,
+	.ih_ring_entry_size = 8 * sizeof(uint32_t),
+	.event_interrupt_class = &event_interrupt_class_v9,
+	.num_of_watch_points = 4,
+	.mqd_size_aligned = MQD_SIZE_ALIGNED,
+	.needs_iommu_device = false,
+	.supports_cwsr = true,
+	.needs_pci_atomics = false,
+	.num_sdma_engines = 2,
+	.num_xgmi_sdma_engines = 0,
+	.num_sdma_queues_per_engine = 8,
+};
+
 /* For each entry, [0] is regular and [1] is virtualisation device. */
 static const struct kfd_device_info *kfd_supported_devices[][2] = {
 #ifdef KFD_SUPPORT_IOMMU_V2
@@ -501,6 +519,7 @@ static const struct kfd_device_info *kfd_supported_devices[][2] = {
 	[CHIP_NAVI12] = {&navi12_device_info, &navi12_device_info},
 	[CHIP_NAVI14] = {&navi14_device_info, NULL},
 	[CHIP_SIENNA_CICHLID] = {&sienna_cichlid_device_info, &sienna_cichlid_device_info},
+	[CHIP_NAVY_FLOUNDER] = {&navy_flounder_device_info, &navy_flounder_device_info},
 };
 
 static int kfd_gtt_sa_init(struct kfd_dev *kfd, unsigned int buf_size,
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index dd550025d1c1..e0e60b0d0669 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -1939,6 +1939,7 @@ struct device_queue_manager *device_queue_manager_init(struct kfd_dev *dev)
 	case CHIP_NAVI12:
 	case CHIP_NAVI14:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		device_queue_manager_init_v10_navi10(&dqm->asic_ops);
 		break;
 	default:
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c b/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
index b4674cf73132..c1166c40ac15 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
@@ -416,6 +416,7 @@ int kfd_init_apertures(struct kfd_process *process)
 			case CHIP_NAVI12:
 			case CHIP_NAVI14:
 			case CHIP_SIENNA_CICHLID:
+			case CHIP_NAVY_FLOUNDER:
 				kfd_init_apertures_v9(pdd, id);
 				break;
 			default:
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
index 89d7f08d749f..47ee40fbbd86 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
@@ -246,6 +246,7 @@ int pm_init(struct packet_manager *pm, struct device_queue_manager *dqm)
 	case CHIP_NAVI12:
 	case CHIP_NAVI14:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		pm->pmf = &kfd_v9_pm_funcs;
 		break;
 	default:
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index cd18baf62727..f185f6cbc05c 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -1374,6 +1374,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
 	case CHIP_NAVI12:
 	case CHIP_NAVI14:
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		dev->node_props.capability |= ((HSA_CAP_DOORBELL_TYPE_2_0 <<
 			HSA_CAP_DOORBELL_TYPE_TOTALBITS_SHIFT) &
 			HSA_CAP_DOORBELL_TYPE_TOTALBITS_MASK);
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 27/42] drm/amdkfd: Add kfd2kgd_funcs for navy_flounder kfd support
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (25 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 26/42] drm/amdkfd: Support navy_flounder KFD Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 28/42] drm/amdgpu/gfx10: add gc golden setting for navy_flounder Alex Deucher
                   ` (14 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Chengming Gui

From: Chengming Gui <Jack.Gui@amd.com>

Add callbacks to KGD for navy flounder.

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 82ac1b4886c7..4bfedaab183f 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -74,6 +74,7 @@ static const struct kfd2kgd_calls *kfd2kgd_funcs[] = {
 	[CHIP_NAVI12] = &gfx_v10_kfd2kgd,
 	[CHIP_NAVI14] = &gfx_v10_kfd2kgd,
 	[CHIP_SIENNA_CICHLID] = &gfx_v10_3_kfd2kgd,
+	[CHIP_NAVY_FLOUNDER] = &gfx_v10_3_kfd2kgd,
 };
 
 #ifdef KFD_SUPPORT_IOMMU_V2
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 28/42] drm/amdgpu/gfx10: add gc golden setting for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (26 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 27/42] drm/amdkfd: Add kfd2kgd_funcs for navy_flounder kfd support Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 29/42] drm/amdgpu: add navy_flounder vcn firmware support Alex Deucher
                   ` (13 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Add gc golden setting for navy_flounder

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 48 ++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 2957bf780d79..ad9b5969c3b6 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -3121,6 +3121,48 @@ static const struct soc15_reg_golden golden_settings_gc_10_3_sienna_cichlid[] =
 	/* Pending on emulation bring up */
 };
 
+static const struct soc15_reg_golden golden_settings_gc_10_3_2[] =
+{
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmCGTT_SPI_PS_CLK_CTRL, 0xff7f0fff, 0x78000100),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmCGTT_SPI_RA0_CLK_CTRL, 0xff7f0fff, 0x30000100),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmCGTT_SPI_RA1_CLK_CTRL, 0xff7f0fff, 0x7e000100),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmCPF_GCR_CNTL, 0x0007ffff, 0x0000c000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG3, 0xffffffff, 0x00000200),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG4, 0xffffffff, 0x00800000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_EXCEPTION_CONTROL, 0x7fff0f1f, 0x00b80000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGCR_GENERAL_CNTL_Sienna_Cichlid, 0x1ff1ffff, 0x00000500),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGE_PC_CNTL, 0x003fffff, 0x00280400),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2A_ADDR_MATCH_MASK, 0xffffffff, 0xffffffcf),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2C_ADDR_MATCH_MASK, 0xffffffff, 0xffffffcf),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2C_CM_CTRL1, 0xff8fff0f, 0x580f1008),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2C_CTRL3, 0xf7ffffff, 0x00f80988),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmPA_CL_ENHANCE, 0xf17fffff, 0x01200007),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmPA_SC_BINNER_TIMEOUT_COUNTER, 0xffffffff, 0x00000800),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmPA_SC_ENHANCE_2, 0xffffffbf, 0x00000820),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSPI_CONFIG_CNTL_1, 0xffffffff, 0x00070104),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSPI_START_PHASE, 0x000000ff, 0x00000004),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_CONFIG, 0xe07df47f, 0x00180070),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER0_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER1_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER10_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER11_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER12_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER13_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER14_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER15_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER2_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER3_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER4_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER5_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER6_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER7_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER8_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER9_SELECT, 0xf0f001ff, 0x00000000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmTA_CNTL_AUX, 0xffffffff, 0x010b0000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmUTCL1_CTRL, 0xffbfffff, 0x00a00000),
+	SOC15_REG_GOLDEN_VALUE(GC, 0, mmVGT_GS_MAX_WAVE_ID, 0x00000fff, 0x000003ff)
+};
+
 #define DEFAULT_SH_MEM_CONFIG \
 	((SH_MEM_ADDRESS_MODE_64 << SH_MEM_CONFIG__ADDRESS_MODE__SHIFT) | \
 	 (SH_MEM_ALIGNMENT_MODE_UNALIGNED << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
@@ -3309,6 +3351,12 @@ static void gfx_v10_0_init_golden_registers(struct amdgpu_device *adev)
 						golden_settings_gc_10_3_sienna_cichlid,
 						(const u32)ARRAY_SIZE(golden_settings_gc_10_3_sienna_cichlid));
 		break;
+	case CHIP_NAVY_FLOUNDER:
+		soc15_program_register_sequence(adev,
+						golden_settings_gc_10_3_2,
+						(const u32)ARRAY_SIZE(golden_settings_gc_10_3_2));
+		break;
+
 	default:
 		break;
 	}
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 29/42] drm/amdgpu: add navy_flounder vcn firmware support
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (27 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 28/42] drm/amdgpu/gfx10: add gc golden setting for navy_flounder Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 30/42] drm/amdgpu: add vcn ip block for navy_flounder Alex Deucher
                   ` (12 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Boyuan Zhang, Leo Liu

From: Boyuan Zhang <boyuan.zhang@amd.com>

Add navy_flounder to vcn family

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 15ff30c53e24..dff3d3640c42 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -43,6 +43,7 @@
 #define FIRMWARE_NAVI14 	"amdgpu/navi14_vcn.bin"
 #define FIRMWARE_NAVI12 	"amdgpu/navi12_vcn.bin"
 #define FIRMWARE_SIENNA_CICHLID 	"amdgpu/sienna_cichlid_vcn.bin"
+#define FIRMWARE_NAVY_FLOUNDER 	"amdgpu/navy_flounder_vcn.bin"
 
 MODULE_FIRMWARE(FIRMWARE_RAVEN);
 MODULE_FIRMWARE(FIRMWARE_PICASSO);
@@ -53,6 +54,7 @@ MODULE_FIRMWARE(FIRMWARE_NAVI10);
 MODULE_FIRMWARE(FIRMWARE_NAVI14);
 MODULE_FIRMWARE(FIRMWARE_NAVI12);
 MODULE_FIRMWARE(FIRMWARE_SIENNA_CICHLID);
+MODULE_FIRMWARE(FIRMWARE_NAVY_FLOUNDER);
 
 static void amdgpu_vcn_idle_work_handler(struct work_struct *work);
 
@@ -115,6 +117,12 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
 		    (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG))
 			adev->vcn.indirect_sram = true;
 		break;
+	case CHIP_NAVY_FLOUNDER:
+		fw_name = FIRMWARE_NAVY_FLOUNDER;
+		if ((adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) &&
+		    (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG))
+			adev->vcn.indirect_sram = true;
+		break;
 	default:
 		return -EINVAL;
 	}
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 30/42] drm/amdgpu: add vcn ip block for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (28 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 29/42] drm/amdgpu: add navy_flounder vcn firmware support Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 31/42] drm/amdgpu: enable cp_fw_write_wait " Alex Deucher
                   ` (11 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Boyuan Zhang, Leo Liu

From: Boyuan Zhang <boyuan.zhang@amd.com>

Add vcn3.0 and jpeg3.0 ip blocks for navy_flounder

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index e62426a2a929..0f567b4b94b1 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -521,6 +521,8 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 			amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block);
 		amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &sdma_v5_2_ip_block);
+		amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
+		amdgpu_device_ip_block_add(adev, &jpeg_v3_0_ip_block);
 		if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
 		    is_support_sw_smu(adev))
 			amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 31/42] drm/amdgpu: enable cp_fw_write_wait for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (29 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 30/42] drm/amdgpu: add vcn ip block for navy_flounder Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 32/42] drm/amdgpu: enable VCN3.0 PG and CG " Alex Deucher
                   ` (10 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

It's the same with sienna_cichlid, cp fw for navy_flounder
can support WAIT_REG_MEM packet.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index ad9b5969c3b6..3f189348cee7 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -3538,6 +3538,7 @@ static void gfx_v10_0_check_fw_write_wait(struct amdgpu_device *adev)
 			adev->gfx.cp_fw_write_wait = true;
 		break;
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		adev->gfx.cp_fw_write_wait = true;
 		break;
 	default:
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 32/42] drm/amdgpu: enable VCN3.0 PG and CG for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (30 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 31/42] drm/amdgpu: enable cp_fw_write_wait " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 33/42] drm/amdgpu: enable VCN3.0 DPG " Alex Deucher
                   ` (9 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Boyuan Zhang, Leo Liu

From: Boyuan Zhang <boyuan.zhang@amd.com>

Enable VCN3.0 PG and CG for navy_flounder by setting up the flags to the ASIC

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 0f567b4b94b1..5f8fa4994c97 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -755,8 +755,8 @@ static int nv_common_early_init(void *handle)
 		adev->external_rev_id = adev->rev_id + 0x28;
 		break;
 	case CHIP_NAVY_FLOUNDER:
-		adev->cg_flags = 0;
-		adev->pg_flags = 0;
+		adev->cg_flags = AMD_CG_SUPPORT_VCN_MGCG;
+		adev->pg_flags = AMD_PG_SUPPORT_VCN;
 		adev->external_rev_id = adev->rev_id + 0x32;
 		break;
 
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 33/42] drm/amdgpu: enable VCN3.0 DPG for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (31 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 32/42] drm/amdgpu: enable VCN3.0 PG and CG " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 34/42] drm/amdgpu: enable JPEG3.0 PG and CG " Alex Deucher
                   ` (8 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Boyuan Zhang, Leo Liu

From: Boyuan Zhang <boyuan.zhang@amd.com>

Enable VCN3.0 DPG for navy_flounder by setting up the flag to the ASIC

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 5f8fa4994c97..2af335b2edec 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -756,7 +756,8 @@ static int nv_common_early_init(void *handle)
 		break;
 	case CHIP_NAVY_FLOUNDER:
 		adev->cg_flags = AMD_CG_SUPPORT_VCN_MGCG;
-		adev->pg_flags = AMD_PG_SUPPORT_VCN;
+		adev->pg_flags = AMD_PG_SUPPORT_VCN |
+			AMD_PG_SUPPORT_VCN_DPG;
 		adev->external_rev_id = adev->rev_id + 0x32;
 		break;
 
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 34/42] drm/amdgpu: enable JPEG3.0 PG and CG for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (32 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 33/42] drm/amdgpu: enable VCN3.0 DPG " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 35/42] drm/amdgpu: enable GFX clock gating " Alex Deucher
                   ` (7 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Boyuan Zhang, Leo Liu

From: Boyuan Zhang <boyuan.zhang@amd.com>

Enable JPEG3.0 PG and CG for navy_flounder by setting up the flags to the ASIC

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 2af335b2edec..34f4e636b30d 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -755,9 +755,11 @@ static int nv_common_early_init(void *handle)
 		adev->external_rev_id = adev->rev_id + 0x28;
 		break;
 	case CHIP_NAVY_FLOUNDER:
-		adev->cg_flags = AMD_CG_SUPPORT_VCN_MGCG;
+		adev->cg_flags = AMD_CG_SUPPORT_VCN_MGCG |
+			AMD_CG_SUPPORT_JPEG_MGCG;
 		adev->pg_flags = AMD_PG_SUPPORT_VCN |
-			AMD_PG_SUPPORT_VCN_DPG;
+			AMD_PG_SUPPORT_VCN_DPG |
+			AMD_PG_SUPPORT_JPEG;
 		adev->external_rev_id = adev->rev_id + 0x32;
 		break;
 
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 35/42] drm/amdgpu: enable GFX clock gating for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (33 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 34/42] drm/amdgpu: enable JPEG3.0 PG and CG " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 36/42] drm/amdgpu: support athub cg setting " Alex Deucher
                   ` (6 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Enable GFX MGCG, CGCG and 3DCG for navy_flounder.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 34f4e636b30d..0fa1e561c2cc 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -755,7 +755,10 @@ static int nv_common_early_init(void *handle)
 		adev->external_rev_id = adev->rev_id + 0x28;
 		break;
 	case CHIP_NAVY_FLOUNDER:
-		adev->cg_flags = AMD_CG_SUPPORT_VCN_MGCG |
+		adev->cg_flags = AMD_CG_SUPPORT_GFX_MGCG |
+			AMD_CG_SUPPORT_GFX_CGCG |
+			AMD_CG_SUPPORT_GFX_3D_CGCG |
+			AMD_CG_SUPPORT_VCN_MGCG |
 			AMD_CG_SUPPORT_JPEG_MGCG;
 		adev->pg_flags = AMD_PG_SUPPORT_VCN |
 			AMD_PG_SUPPORT_VCN_DPG |
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 36/42] drm/amdgpu: support athub cg setting for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (34 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 35/42] drm/amdgpu: enable GFX clock gating " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 37/42] drm/amd/display: add DC support for navy flounder Alex Deucher
                   ` (5 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Tao Zhou, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

navy_flounder has athub ip v2.1.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/athub_v2_1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/athub_v2_1.c b/drivers/gpu/drm/amd/amdgpu/athub_v2_1.c
index 0219bd6ce1b2..939eca63b094 100644
--- a/drivers/gpu/drm/amd/amdgpu/athub_v2_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/athub_v2_1.c
@@ -73,6 +73,7 @@ int athub_v2_1_set_clockgating(struct amdgpu_device *adev,
 
 	switch (adev->asic_type) {
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		athub_v2_1_update_medium_grain_clock_gating(adev,
 				state == AMD_CG_STATE_GATE ? true : false);
 		athub_v2_1_update_medium_grain_light_sleep(adev,
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 37/42] drm/amd/display: add DC support for navy flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (35 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 36/42] drm/amdgpu: support athub cg setting " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 38/42] drm/amd/powerplay: set VCN1 pg only for sienna_cichlid Alex Deucher
                   ` (4 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Bhawanpreet Lakha

From: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>

Plumb DC support for navy flounder through.

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c        | 1 +
 drivers/gpu/drm/amd/amdgpu/nv.c                   | 4 ++++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +++++++--
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 3efca05e5d69..84c8fbd3d030 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2808,6 +2808,7 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type)
 #endif
 #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 #endif
 		return amdgpu_dc != 0;
 #endif
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 0fa1e561c2cc..31e4036b110c 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -519,6 +519,10 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 			amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
 		if (adev->enable_virtual_display || amdgpu_sriov_vf(adev))
 			amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block);
+#if defined(CONFIG_DRM_AMD_DC)
+		else if (amdgpu_device_has_dc_support(adev))
+			amdgpu_device_ip_block_add(adev, &dm_ip_block);
+#endif
 		amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &sdma_v5_2_ip_block);
 		amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 4c033952eb01..0bc333798cd6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1085,6 +1085,7 @@ static int load_dmcu_fw(struct amdgpu_device *adev)
 	case CHIP_RENOIR:
 #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 #endif
 		return 0;
 	case CHIP_NAVI12:
@@ -1184,6 +1185,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
 		break;
 #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 		dmub_asic = DMUB_ASIC_DCN30;
 		fw_name_dmub = FIRMWARE_SIENNA_CICHLID_DMUB;
 		break;
@@ -3230,6 +3232,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 	case CHIP_RENOIR:
 #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 #endif
 		if (dcn10_register_irq_handlers(dm->adev)) {
 			DRM_ERROR("DM: Failed to initialize IRQ\n");
@@ -3460,6 +3463,7 @@ static int dm_early_init(void *handle)
 	case CHIP_NAVI12:
 #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
 	case CHIP_SIENNA_CICHLID:
+	case CHIP_NAVY_FLOUNDER:
 #endif
 		adev->mode_info.num_crtc = 6;
 		adev->mode_info.num_hpd = 6;
@@ -3783,6 +3787,7 @@ fill_plane_buffer_attributes(struct amdgpu_device *adev,
 	    adev->asic_type == CHIP_NAVI12 ||
 #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
 		adev->asic_type == CHIP_SIENNA_CICHLID ||
+		adev->asic_type == CHIP_NAVY_FLOUNDER ||
 #endif
 	    adev->asic_type == CHIP_RENOIR ||
 	    adev->asic_type == CHIP_RAVEN) {
@@ -3804,9 +3809,9 @@ fill_plane_buffer_attributes(struct amdgpu_device *adev,
 		tiling_info->gfx9.shaderEnable = 1;
 
 #ifdef CONFIG_DRM_AMD_DC_DCN3_0
-		if (adev->asic_type == CHIP_SIENNA_CICHLID)
+		if (adev->asic_type == CHIP_SIENNA_CICHLID ||
+		    adev->asic_type == CHIP_NAVY_FLOUNDER)
 			tiling_info->gfx9.num_pkrs = adev->gfx.config.gb_addr_config_fields.num_pkrs;
-
 #endif
 		ret = fill_plane_dcc_attributes(adev, afb, format, rotation,
 						plane_size, tiling_info,
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 38/42] drm/amd/powerplay: set VCN1 pg only for sienna_cichlid
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (36 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 37/42] drm/amd/display: add DC support for navy flounder Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 39/42] drm/amdgpu: enable athub/mmhub PG for navy_flounder Alex Deucher
                   ` (3 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Kenneth Feng, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

navy_flounder has one VCN instance, and the work around
is to avoid smu reponse error when setting VCN1 pg for
the chip. It is preferred VCN0 and VCN1 are separated
for the pg setting so better power efficiency can be
achieved.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 .../drm/amd/powerplay/sienna_cichlid_ppt.c    | 20 +++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c
index 79d7159a871e..c74c4e866859 100644
--- a/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c
@@ -644,6 +644,8 @@ static int sienna_cichlid_dpm_set_vcn_enable(struct smu_context *smu, bool enabl
 {
 	struct smu_power_context *smu_power = &smu->smu_power;
 	struct smu_power_gate *power_gate = &smu_power->power_gate;
+	struct amdgpu_device *adev = smu->adev;
+
 	int ret = 0;
 
 	if (enable) {
@@ -652,9 +654,12 @@ static int sienna_cichlid_dpm_set_vcn_enable(struct smu_context *smu, bool enabl
 			ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerUpVcn, 0, NULL);
 			if (ret)
 				return ret;
-			ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerUpVcn, 0x10000, NULL);
-			if (ret)
-				return ret;
+			if (adev->asic_type == CHIP_SIENNA_CICHLID) {
+				ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerUpVcn,
+								  0x10000, NULL);
+				if (ret)
+					return ret;
+			}
 		}
 		power_gate->vcn_gated = false;
 	} else {
@@ -662,9 +667,12 @@ static int sienna_cichlid_dpm_set_vcn_enable(struct smu_context *smu, bool enabl
 			ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerDownVcn, 0, NULL);
 			if (ret)
 				return ret;
-			ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerDownVcn, 0x10000, NULL);
-			if (ret)
-				return ret;
+			if (adev->asic_type == CHIP_SIENNA_CICHLID) {
+				ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerDownVcn,
+								  0x10000, NULL);
+				if (ret)
+					return ret;
+			}
 		}
 		power_gate->vcn_gated = true;
 	}
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 39/42] drm/amdgpu: enable athub/mmhub PG for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (37 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 38/42] drm/amd/powerplay: set VCN1 pg only for sienna_cichlid Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 40/42] drm/amdgpu: enable mc CG and LS " Alex Deucher
                   ` (2 subsequent siblings)
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Kenneth Feng, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Enable athub/mmhub PG by setting the corresponding flags.
Actually the enablement is exercised by PMFW.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 31e4036b110c..1260d7d138ea 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -766,7 +766,9 @@ static int nv_common_early_init(void *handle)
 			AMD_CG_SUPPORT_JPEG_MGCG;
 		adev->pg_flags = AMD_PG_SUPPORT_VCN |
 			AMD_PG_SUPPORT_VCN_DPG |
-			AMD_PG_SUPPORT_JPEG;
+			AMD_PG_SUPPORT_JPEG |
+			AMD_PG_SUPPORT_ATHUB |
+			AMD_PG_SUPPORT_MMHUB;
 		adev->external_rev_id = adev->rev_id + 0x32;
 		break;
 
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 40/42] drm/amdgpu: enable mc CG and LS for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (38 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 39/42] drm/amdgpu: enable athub/mmhub PG for navy_flounder Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 41/42] drm/amdgpu: enable hdp " Alex Deucher
  2020-07-14 18:23 ` [PATCH 42/42] drm/amdgpu: enable ih CG " Alex Deucher
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Kenneth Feng, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Enable mc CG and LS by setting the corresponding flags.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 1260d7d138ea..add0698df3fe 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -763,7 +763,9 @@ static int nv_common_early_init(void *handle)
 			AMD_CG_SUPPORT_GFX_CGCG |
 			AMD_CG_SUPPORT_GFX_3D_CGCG |
 			AMD_CG_SUPPORT_VCN_MGCG |
-			AMD_CG_SUPPORT_JPEG_MGCG;
+			AMD_CG_SUPPORT_JPEG_MGCG |
+			AMD_CG_SUPPORT_MC_MGCG |
+			AMD_CG_SUPPORT_MC_LS;
 		adev->pg_flags = AMD_PG_SUPPORT_VCN |
 			AMD_PG_SUPPORT_VCN_DPG |
 			AMD_PG_SUPPORT_JPEG |
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 41/42] drm/amdgpu: enable hdp CG and LS for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (39 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 40/42] drm/amdgpu: enable mc CG and LS " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  2020-07-14 18:23 ` [PATCH 42/42] drm/amdgpu: enable ih CG " Alex Deucher
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Kenneth Feng, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Enable hdp CG and LS by setting the corresponding flags.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index add0698df3fe..dedc13b74b1a 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -765,7 +765,9 @@ static int nv_common_early_init(void *handle)
 			AMD_CG_SUPPORT_VCN_MGCG |
 			AMD_CG_SUPPORT_JPEG_MGCG |
 			AMD_CG_SUPPORT_MC_MGCG |
-			AMD_CG_SUPPORT_MC_LS;
+			AMD_CG_SUPPORT_MC_LS |
+			AMD_CG_SUPPORT_HDP_MGCG |
+			AMD_CG_SUPPORT_HDP_LS;
 		adev->pg_flags = AMD_PG_SUPPORT_VCN |
 			AMD_PG_SUPPORT_VCN_DPG |
 			AMD_PG_SUPPORT_JPEG |
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH 42/42] drm/amdgpu: enable ih CG for navy_flounder
  2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
                   ` (40 preceding siblings ...)
  2020-07-14 18:23 ` [PATCH 41/42] drm/amdgpu: enable hdp " Alex Deucher
@ 2020-07-14 18:23 ` Alex Deucher
  41 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-14 18:23 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Kenneth Feng, Jiansong Chen

From: Jiansong Chen <Jiansong.Chen@amd.com>

Enable ih CG by setting the corresponding flag.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index dedc13b74b1a..3b26ddf6e7d7 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -767,7 +767,8 @@ static int nv_common_early_init(void *handle)
 			AMD_CG_SUPPORT_MC_MGCG |
 			AMD_CG_SUPPORT_MC_LS |
 			AMD_CG_SUPPORT_HDP_MGCG |
-			AMD_CG_SUPPORT_HDP_LS;
+			AMD_CG_SUPPORT_HDP_LS |
+			AMD_CG_SUPPORT_IH_CG;
 		adev->pg_flags = AMD_PG_SUPPORT_VCN |
 			AMD_PG_SUPPORT_VCN_DPG |
 			AMD_PG_SUPPORT_JPEG |
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [PATCH 01/42] drm/amdgpu: expand to add multiple trap event irq id
  2020-07-14 18:23 ` [PATCH 01/42] drm/amdgpu: expand to add multiple trap event irq id Alex Deucher
@ 2020-07-15  9:21   ` Christian König
  2020-07-15 13:24     ` Alex Deucher
  0 siblings, 1 reply; 46+ messages in thread
From: Christian König @ 2020-07-15  9:21 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx; +Cc: Alex Deucher, Huang Rui

Am 14.07.20 um 20:23 schrieb Alex Deucher:
> From: Huang Rui <ray.huang@amd.com>
>
> Sienna_cichlid has four sdma instances, but other chips don't.
> So we need expand to add multiple trap event irq id in sdma
> v5.2.
>
> Signed-off-by: Huang Rui <ray.huang@amd.com>
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

But side question why do we have the _Sienna_Cichlid postfix on the define?

Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 67 ++++++++++++++++----------
>   1 file changed, 41 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> index 824f3e23c3d9..de8342283fdb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> @@ -1165,6 +1165,40 @@ static int sdma_v5_2_early_init(void *handle)
>   	return 0;
>   }
>   
> +static unsigned sdma_v5_2_seq_to_irq_id(int seq_num)
> +{
> +	switch (seq_num) {
> +	case 0:
> +		return SOC15_IH_CLIENTID_SDMA0;
> +	case 1:
> +		return SOC15_IH_CLIENTID_SDMA1;
> +	case 2:
> +		return SOC15_IH_CLIENTID_SDMA2;
> +	case 3:
> +		return SOC15_IH_CLIENTID_SDMA3_Sienna_Cichlid;
> +	default:
> +		break;
> +	}
> +	return -EINVAL;
> +}
> +
> +static unsigned sdma_v5_2_seq_to_trap_id(int seq_num)
> +{
> +	switch (seq_num) {
> +	case 0:
> +		return SDMA0_5_0__SRCID__SDMA_TRAP;
> +	case 1:
> +		return SDMA1_5_0__SRCID__SDMA_TRAP;
> +	case 2:
> +		return SDMA2_5_0__SRCID__SDMA_TRAP;
> +	case 3:
> +		return SDMA3_5_0__SRCID__SDMA_TRAP;
> +	default:
> +		break;
> +	}
> +	return -EINVAL;
> +}
> +
>   static int sdma_v5_2_sw_init(void *handle)
>   {
>   	struct amdgpu_ring *ring;
> @@ -1172,32 +1206,13 @@ static int sdma_v5_2_sw_init(void *handle)
>   	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>   
>   	/* SDMA trap event */
> -	r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA0,
> -			      SDMA0_5_0__SRCID__SDMA_TRAP,
> -			      &adev->sdma.trap_irq);
> -	if (r)
> -		return r;
> -
> -	/* SDMA trap event */
> -	r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA1,
> -			      SDMA1_5_0__SRCID__SDMA_TRAP,
> -			      &adev->sdma.trap_irq);
> -	if (r)
> -		return r;
> -
> -	/* SDMA trap event */
> -	r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA2,
> -			      SDMA2_5_0__SRCID__SDMA_TRAP,
> -			      &adev->sdma.trap_irq);
> -	if (r)
> -		return r;
> -
> -	/* SDMA trap event */
> -	r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA3_Sienna_Cichlid,
> -			      SDMA3_5_0__SRCID__SDMA_TRAP,
> -			      &adev->sdma.trap_irq);
> -	if (r)
> -		return r;
> +	for (i = 0; i < adev->sdma.num_instances; i++) {
> +		r = amdgpu_irq_add_id(adev, sdma_v5_2_seq_to_irq_id(i),
> +				      sdma_v5_2_seq_to_trap_id(i),
> +				      &adev->sdma.trap_irq);
> +		if (r)
> +			return r;
> +	}
>   
>   	r = sdma_v5_2_init_microcode(adev);
>   	if (r) {

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 01/42] drm/amdgpu: expand to add multiple trap event irq id
  2020-07-15  9:21   ` Christian König
@ 2020-07-15 13:24     ` Alex Deucher
  2020-07-15 16:20       ` Alex Deucher
  0 siblings, 1 reply; 46+ messages in thread
From: Alex Deucher @ 2020-07-15 13:24 UTC (permalink / raw)
  To: Christian Koenig; +Cc: Alex Deucher, Huang Rui, amd-gfx list

On Wed, Jul 15, 2020 at 5:21 AM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Am 14.07.20 um 20:23 schrieb Alex Deucher:
> > From: Huang Rui <ray.huang@amd.com>
> >
> > Sienna_cichlid has four sdma instances, but other chips don't.
> > So we need expand to add multiple trap event irq id in sdma
> > v5.2.
> >
> > Signed-off-by: Huang Rui <ray.huang@amd.com>
> > Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> But side question why do we have the _Sienna_Cichlid postfix on the define?

I suspect when it was originally added it was specific to sienna
cichlid, but it should be dropped since it's generic.

Alex


>
> Christian.
>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 67 ++++++++++++++++----------
> >   1 file changed, 41 insertions(+), 26 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> > index 824f3e23c3d9..de8342283fdb 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> > @@ -1165,6 +1165,40 @@ static int sdma_v5_2_early_init(void *handle)
> >       return 0;
> >   }
> >
> > +static unsigned sdma_v5_2_seq_to_irq_id(int seq_num)
> > +{
> > +     switch (seq_num) {
> > +     case 0:
> > +             return SOC15_IH_CLIENTID_SDMA0;
> > +     case 1:
> > +             return SOC15_IH_CLIENTID_SDMA1;
> > +     case 2:
> > +             return SOC15_IH_CLIENTID_SDMA2;
> > +     case 3:
> > +             return SOC15_IH_CLIENTID_SDMA3_Sienna_Cichlid;
> > +     default:
> > +             break;
> > +     }
> > +     return -EINVAL;
> > +}
> > +
> > +static unsigned sdma_v5_2_seq_to_trap_id(int seq_num)
> > +{
> > +     switch (seq_num) {
> > +     case 0:
> > +             return SDMA0_5_0__SRCID__SDMA_TRAP;
> > +     case 1:
> > +             return SDMA1_5_0__SRCID__SDMA_TRAP;
> > +     case 2:
> > +             return SDMA2_5_0__SRCID__SDMA_TRAP;
> > +     case 3:
> > +             return SDMA3_5_0__SRCID__SDMA_TRAP;
> > +     default:
> > +             break;
> > +     }
> > +     return -EINVAL;
> > +}
> > +
> >   static int sdma_v5_2_sw_init(void *handle)
> >   {
> >       struct amdgpu_ring *ring;
> > @@ -1172,32 +1206,13 @@ static int sdma_v5_2_sw_init(void *handle)
> >       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> >
> >       /* SDMA trap event */
> > -     r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA0,
> > -                           SDMA0_5_0__SRCID__SDMA_TRAP,
> > -                           &adev->sdma.trap_irq);
> > -     if (r)
> > -             return r;
> > -
> > -     /* SDMA trap event */
> > -     r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA1,
> > -                           SDMA1_5_0__SRCID__SDMA_TRAP,
> > -                           &adev->sdma.trap_irq);
> > -     if (r)
> > -             return r;
> > -
> > -     /* SDMA trap event */
> > -     r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA2,
> > -                           SDMA2_5_0__SRCID__SDMA_TRAP,
> > -                           &adev->sdma.trap_irq);
> > -     if (r)
> > -             return r;
> > -
> > -     /* SDMA trap event */
> > -     r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA3_Sienna_Cichlid,
> > -                           SDMA3_5_0__SRCID__SDMA_TRAP,
> > -                           &adev->sdma.trap_irq);
> > -     if (r)
> > -             return r;
> > +     for (i = 0; i < adev->sdma.num_instances; i++) {
> > +             r = amdgpu_irq_add_id(adev, sdma_v5_2_seq_to_irq_id(i),
> > +                                   sdma_v5_2_seq_to_trap_id(i),
> > +                                   &adev->sdma.trap_irq);
> > +             if (r)
> > +                     return r;
> > +     }
> >
> >       r = sdma_v5_2_init_microcode(adev);
> >       if (r) {
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH 01/42] drm/amdgpu: expand to add multiple trap event irq id
  2020-07-15 13:24     ` Alex Deucher
@ 2020-07-15 16:20       ` Alex Deucher
  0 siblings, 0 replies; 46+ messages in thread
From: Alex Deucher @ 2020-07-15 16:20 UTC (permalink / raw)
  To: Christian Koenig; +Cc: Alex Deucher, Huang Rui, amd-gfx list

On Wed, Jul 15, 2020 at 9:24 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Wed, Jul 15, 2020 at 5:21 AM Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
> >
> > Am 14.07.20 um 20:23 schrieb Alex Deucher:
> > > From: Huang Rui <ray.huang@amd.com>
> > >
> > > Sienna_cichlid has four sdma instances, but other chips don't.
> > > So we need expand to add multiple trap event irq id in sdma
> > > v5.2.
> > >
> > > Signed-off-by: Huang Rui <ray.huang@amd.com>
> > > Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> >
> > Reviewed-by: Christian König <christian.koenig@amd.com>
> >
> > But side question why do we have the _Sienna_Cichlid postfix on the define?
>
> I suspect when it was originally added it was specific to sienna
> cichlid, but it should be dropped since it's generic.

Just checked and it's specific to this family of asics.  Other asics
use a different client id for SDMA3.  See soc15_ih_clientid.h.

Alex

>
> Alex
>
>
> >
> > Christian.
> >
> > > ---
> > >   drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 67 ++++++++++++++++----------
> > >   1 file changed, 41 insertions(+), 26 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> > > index 824f3e23c3d9..de8342283fdb 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> > > @@ -1165,6 +1165,40 @@ static int sdma_v5_2_early_init(void *handle)
> > >       return 0;
> > >   }
> > >
> > > +static unsigned sdma_v5_2_seq_to_irq_id(int seq_num)
> > > +{
> > > +     switch (seq_num) {
> > > +     case 0:
> > > +             return SOC15_IH_CLIENTID_SDMA0;
> > > +     case 1:
> > > +             return SOC15_IH_CLIENTID_SDMA1;
> > > +     case 2:
> > > +             return SOC15_IH_CLIENTID_SDMA2;
> > > +     case 3:
> > > +             return SOC15_IH_CLIENTID_SDMA3_Sienna_Cichlid;
> > > +     default:
> > > +             break;
> > > +     }
> > > +     return -EINVAL;
> > > +}
> > > +
> > > +static unsigned sdma_v5_2_seq_to_trap_id(int seq_num)
> > > +{
> > > +     switch (seq_num) {
> > > +     case 0:
> > > +             return SDMA0_5_0__SRCID__SDMA_TRAP;
> > > +     case 1:
> > > +             return SDMA1_5_0__SRCID__SDMA_TRAP;
> > > +     case 2:
> > > +             return SDMA2_5_0__SRCID__SDMA_TRAP;
> > > +     case 3:
> > > +             return SDMA3_5_0__SRCID__SDMA_TRAP;
> > > +     default:
> > > +             break;
> > > +     }
> > > +     return -EINVAL;
> > > +}
> > > +
> > >   static int sdma_v5_2_sw_init(void *handle)
> > >   {
> > >       struct amdgpu_ring *ring;
> > > @@ -1172,32 +1206,13 @@ static int sdma_v5_2_sw_init(void *handle)
> > >       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> > >
> > >       /* SDMA trap event */
> > > -     r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA0,
> > > -                           SDMA0_5_0__SRCID__SDMA_TRAP,
> > > -                           &adev->sdma.trap_irq);
> > > -     if (r)
> > > -             return r;
> > > -
> > > -     /* SDMA trap event */
> > > -     r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA1,
> > > -                           SDMA1_5_0__SRCID__SDMA_TRAP,
> > > -                           &adev->sdma.trap_irq);
> > > -     if (r)
> > > -             return r;
> > > -
> > > -     /* SDMA trap event */
> > > -     r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA2,
> > > -                           SDMA2_5_0__SRCID__SDMA_TRAP,
> > > -                           &adev->sdma.trap_irq);
> > > -     if (r)
> > > -             return r;
> > > -
> > > -     /* SDMA trap event */
> > > -     r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_SDMA3_Sienna_Cichlid,
> > > -                           SDMA3_5_0__SRCID__SDMA_TRAP,
> > > -                           &adev->sdma.trap_irq);
> > > -     if (r)
> > > -             return r;
> > > +     for (i = 0; i < adev->sdma.num_instances; i++) {
> > > +             r = amdgpu_irq_add_id(adev, sdma_v5_2_seq_to_irq_id(i),
> > > +                                   sdma_v5_2_seq_to_trap_id(i),
> > > +                                   &adev->sdma.trap_irq);
> > > +             if (r)
> > > +                     return r;
> > > +     }
> > >
> > >       r = sdma_v5_2_init_microcode(adev);
> > >       if (r) {
> >
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2020-07-15 16:21 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14 18:23 [PATCH 00/42] Navy Flounder support Alex Deucher
2020-07-14 18:23 ` [PATCH 01/42] drm/amdgpu: expand to add multiple trap event irq id Alex Deucher
2020-07-15  9:21   ` Christian König
2020-07-15 13:24     ` Alex Deucher
2020-07-15 16:20       ` Alex Deucher
2020-07-14 18:23 ` [PATCH 02/42] drm/amdgpu: add navy_flounder asic type Alex Deucher
2020-07-14 18:23 ` [PATCH 03/42] drm/amdgpu: add navy_flounder gpu info firmware Alex Deucher
2020-07-14 18:23 ` [PATCH 04/42] drm/amdgpu: set fw load type for navy_flounder Alex Deucher
2020-07-14 18:23 ` [PATCH 05/42] drm/amdgpu: set asic family and ip blocks " Alex Deucher
2020-07-14 18:23 ` [PATCH 06/42] drm/amdgpu/gfx10: add support for navy_flounder firmware Alex Deucher
2020-07-14 18:23 ` [PATCH 07/42] drm/amdgpu/gmc10: add navy_flounder support Alex Deucher
2020-07-14 18:23 ` [PATCH 08/42] drm/amdgpu/gfx10: add clockgating support for navy_flounder Alex Deucher
2020-07-14 18:23 ` [PATCH 09/42] drm/amdgpu/soc15: add " Alex Deucher
2020-07-14 18:23 ` [PATCH 10/42] drm/amdgpu: initialize IP offset " Alex Deucher
2020-07-14 18:23 ` [PATCH 11/42] drm/amdgpu: add support on mmhub " Alex Deucher
2020-07-14 18:23 ` [PATCH 12/42] drm/amdgpu: add common ip block " Alex Deucher
2020-07-14 18:23 ` [PATCH 13/42] drm/amdgpu: add gmc " Alex Deucher
2020-07-14 18:23 ` [PATCH 14/42] drm/amdgpu: add ih " Alex Deucher
2020-07-14 18:23 ` [PATCH 15/42] drm/amdgpu: add gfx " Alex Deucher
2020-07-14 18:23 ` [PATCH 16/42] drm/amdgpu: add sdma " Alex Deucher
2020-07-14 18:23 ` [PATCH 17/42] drm/amdgpu: add virtual display support " Alex Deucher
2020-07-14 18:23 ` [PATCH 18/42] drm/amdgpu: configure navy_flounder gfx according to gfx 10.3 Alex Deucher
2020-07-14 18:23 ` [PATCH 19/42] drm/amdgpu: force pa_sc_tile_steering_override to 0 for navy_flounder Alex Deucher
2020-07-14 18:23 ` [PATCH 20/42] drm/amdgpu: add gmc cg support " Alex Deucher
2020-07-14 18:23 ` [PATCH 21/42] drm/amdgpu/powerplay: add smu " Alex Deucher
2020-07-14 18:23 ` [PATCH 22/42] drm/amdgpu: add smu block " Alex Deucher
2020-07-14 18:23 ` [PATCH 23/42] drm/amdgpu: add psp support " Alex Deucher
2020-07-14 18:23 ` [PATCH 24/42] drm/amdgpu: add psp block " Alex Deucher
2020-07-14 18:23 ` [PATCH 25/42] drm/amdgpu: use front door firmware loading " Alex Deucher
2020-07-14 18:23 ` [PATCH 26/42] drm/amdkfd: Support navy_flounder KFD Alex Deucher
2020-07-14 18:23 ` [PATCH 27/42] drm/amdkfd: Add kfd2kgd_funcs for navy_flounder kfd support Alex Deucher
2020-07-14 18:23 ` [PATCH 28/42] drm/amdgpu/gfx10: add gc golden setting for navy_flounder Alex Deucher
2020-07-14 18:23 ` [PATCH 29/42] drm/amdgpu: add navy_flounder vcn firmware support Alex Deucher
2020-07-14 18:23 ` [PATCH 30/42] drm/amdgpu: add vcn ip block for navy_flounder Alex Deucher
2020-07-14 18:23 ` [PATCH 31/42] drm/amdgpu: enable cp_fw_write_wait " Alex Deucher
2020-07-14 18:23 ` [PATCH 32/42] drm/amdgpu: enable VCN3.0 PG and CG " Alex Deucher
2020-07-14 18:23 ` [PATCH 33/42] drm/amdgpu: enable VCN3.0 DPG " Alex Deucher
2020-07-14 18:23 ` [PATCH 34/42] drm/amdgpu: enable JPEG3.0 PG and CG " Alex Deucher
2020-07-14 18:23 ` [PATCH 35/42] drm/amdgpu: enable GFX clock gating " Alex Deucher
2020-07-14 18:23 ` [PATCH 36/42] drm/amdgpu: support athub cg setting " Alex Deucher
2020-07-14 18:23 ` [PATCH 37/42] drm/amd/display: add DC support for navy flounder Alex Deucher
2020-07-14 18:23 ` [PATCH 38/42] drm/amd/powerplay: set VCN1 pg only for sienna_cichlid Alex Deucher
2020-07-14 18:23 ` [PATCH 39/42] drm/amdgpu: enable athub/mmhub PG for navy_flounder Alex Deucher
2020-07-14 18:23 ` [PATCH 40/42] drm/amdgpu: enable mc CG and LS " Alex Deucher
2020-07-14 18:23 ` [PATCH 41/42] drm/amdgpu: enable hdp " Alex Deucher
2020-07-14 18:23 ` [PATCH 42/42] drm/amdgpu: enable ih CG " Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.