aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLikun Gao <Likun.Gao@amd.com>2018-07-10 08:29:12 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-09-14 10:35:24 -0400
commit501a580ae6a4087ed7c8e4fdcf3de7a5ca56bdd1 (patch)
tree10451a32629d320de4ba6a1593c2fe70b045791a
parente21f561ad52a6c909c64d2856a3ad03a4042a5df (diff)
drm/amdgpu: add picasso support for gfx_v9_0
Add gfx support to picasso Signed-off-by: Likun Gao <Likun.Gao@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 3594704a6f9b..ad20747bace8 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -80,6 +80,13 @@ MODULE_FIRMWARE("amdgpu/raven_mec.bin");
80MODULE_FIRMWARE("amdgpu/raven_mec2.bin"); 80MODULE_FIRMWARE("amdgpu/raven_mec2.bin");
81MODULE_FIRMWARE("amdgpu/raven_rlc.bin"); 81MODULE_FIRMWARE("amdgpu/raven_rlc.bin");
82 82
83MODULE_FIRMWARE("amdgpu/picasso_ce.bin");
84MODULE_FIRMWARE("amdgpu/picasso_pfp.bin");
85MODULE_FIRMWARE("amdgpu/picasso_me.bin");
86MODULE_FIRMWARE("amdgpu/picasso_mec.bin");
87MODULE_FIRMWARE("amdgpu/picasso_mec2.bin");
88MODULE_FIRMWARE("amdgpu/picasso_rlc.bin");
89
83static const struct soc15_reg_golden golden_settings_gc_9_0[] = 90static const struct soc15_reg_golden golden_settings_gc_9_0[] =
84{ 91{
85 SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG2, 0xf00fffff, 0x00000400), 92 SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG2, 0xf00fffff, 0x00000400),
@@ -240,6 +247,7 @@ static const u32 GFX_RLC_SRM_INDEX_CNTL_DATA_OFFSETS[] =
240#define VEGA10_GB_ADDR_CONFIG_GOLDEN 0x2a114042 247#define VEGA10_GB_ADDR_CONFIG_GOLDEN 0x2a114042
241#define VEGA12_GB_ADDR_CONFIG_GOLDEN 0x24104041 248#define VEGA12_GB_ADDR_CONFIG_GOLDEN 0x24104041
242#define RAVEN_GB_ADDR_CONFIG_GOLDEN 0x24000042 249#define RAVEN_GB_ADDR_CONFIG_GOLDEN 0x24000042
250#define PICASSO_GB_ADDR_CONFIG_GOLDEN 0x24000042
243 251
244static void gfx_v9_0_set_ring_funcs(struct amdgpu_device *adev); 252static void gfx_v9_0_set_ring_funcs(struct amdgpu_device *adev);
245static void gfx_v9_0_set_irq_funcs(struct amdgpu_device *adev); 253static void gfx_v9_0_set_irq_funcs(struct amdgpu_device *adev);
@@ -279,6 +287,7 @@ static void gfx_v9_0_init_golden_registers(struct amdgpu_device *adev)
279 ARRAY_SIZE(golden_settings_gc_9_0_vg20)); 287 ARRAY_SIZE(golden_settings_gc_9_0_vg20));
280 break; 288 break;
281 case CHIP_RAVEN: 289 case CHIP_RAVEN:
290 case CHIP_PICASSO:
282 soc15_program_register_sequence(adev, 291 soc15_program_register_sequence(adev,
283 golden_settings_gc_9_1, 292 golden_settings_gc_9_1,
284 ARRAY_SIZE(golden_settings_gc_9_1)); 293 ARRAY_SIZE(golden_settings_gc_9_1));
@@ -566,6 +575,9 @@ static int gfx_v9_0_init_microcode(struct amdgpu_device *adev)
566 case CHIP_RAVEN: 575 case CHIP_RAVEN:
567 chip_name = "raven"; 576 chip_name = "raven";
568 break; 577 break;
578 case CHIP_PICASSO:
579 chip_name = "picasso";
580 break;
569 default: 581 default:
570 BUG(); 582 BUG();
571 } 583 }
@@ -1019,7 +1031,7 @@ static int gfx_v9_0_rlc_init(struct amdgpu_device *adev)
1019 amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj); 1031 amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
1020 } 1032 }
1021 1033
1022 if (adev->asic_type == CHIP_RAVEN) { 1034 if (adev->asic_type == CHIP_RAVEN || adev->asic_type == CHIP_PICASSO) {
1023 /* TODO: double check the cp_table_size for RV */ 1035 /* TODO: double check the cp_table_size for RV */
1024 adev->gfx.rlc.cp_table_size = ALIGN(96 * 5 * 4, 2048) + (64 * 1024); /* JT + GDS */ 1036 adev->gfx.rlc.cp_table_size = ALIGN(96 * 5 * 4, 2048) + (64 * 1024); /* JT + GDS */
1025 r = amdgpu_bo_create_reserved(adev, adev->gfx.rlc.cp_table_size, 1037 r = amdgpu_bo_create_reserved(adev, adev->gfx.rlc.cp_table_size,
@@ -1268,6 +1280,14 @@ static int gfx_v9_0_gpu_early_init(struct amdgpu_device *adev)
1268 adev->gfx.config.sc_earlyz_tile_fifo_size = 0x4C0; 1280 adev->gfx.config.sc_earlyz_tile_fifo_size = 0x4C0;
1269 gb_addr_config = RAVEN_GB_ADDR_CONFIG_GOLDEN; 1281 gb_addr_config = RAVEN_GB_ADDR_CONFIG_GOLDEN;
1270 break; 1282 break;
1283 case CHIP_PICASSO:
1284 adev->gfx.config.max_hw_contexts = 8;
1285 adev->gfx.config.sc_prim_fifo_size_frontend = 0x20;
1286 adev->gfx.config.sc_prim_fifo_size_backend = 0x100;
1287 adev->gfx.config.sc_hiz_tile_fifo_size = 0x30;
1288 adev->gfx.config.sc_earlyz_tile_fifo_size = 0x4C0;
1289 gb_addr_config = PICASSO_GB_ADDR_CONFIG_GOLDEN;
1290 break;
1271 default: 1291 default:
1272 BUG(); 1292 BUG();
1273 break; 1293 break;
@@ -1546,6 +1566,7 @@ static int gfx_v9_0_sw_init(void *handle)
1546 case CHIP_VEGA12: 1566 case CHIP_VEGA12:
1547 case CHIP_VEGA20: 1567 case CHIP_VEGA20:
1548 case CHIP_RAVEN: 1568 case CHIP_RAVEN:
1569 case CHIP_PICASSO:
1549 adev->gfx.mec.num_mec = 2; 1570 adev->gfx.mec.num_mec = 2;
1550 break; 1571 break;
1551 default: 1572 default:
@@ -1707,7 +1728,7 @@ static int gfx_v9_0_sw_fini(void *handle)
1707 amdgpu_bo_free_kernel(&adev->gfx.rlc.clear_state_obj, 1728 amdgpu_bo_free_kernel(&adev->gfx.rlc.clear_state_obj,
1708 &adev->gfx.rlc.clear_state_gpu_addr, 1729 &adev->gfx.rlc.clear_state_gpu_addr,
1709 (void **)&adev->gfx.rlc.cs_ptr); 1730 (void **)&adev->gfx.rlc.cs_ptr);
1710 if (adev->asic_type == CHIP_RAVEN) { 1731 if ((adev->asic_type == CHIP_RAVEN) || (adev->asic_type == CHIP_PICASSO)) {
1711 amdgpu_bo_free_kernel(&adev->gfx.rlc.cp_table_obj, 1732 amdgpu_bo_free_kernel(&adev->gfx.rlc.cp_table_obj,
1712 &adev->gfx.rlc.cp_table_gpu_addr, 1733 &adev->gfx.rlc.cp_table_gpu_addr,
1713 (void **)&adev->gfx.rlc.cp_table_ptr); 1734 (void **)&adev->gfx.rlc.cp_table_ptr);
@@ -2373,7 +2394,7 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev)
2373 return r; 2394 return r;
2374 } 2395 }
2375 2396
2376 if (adev->asic_type == CHIP_RAVEN) { 2397 if (adev->asic_type == CHIP_RAVEN || adev->asic_type == CHIP_PICASSO) {
2377 if (amdgpu_lbpw != 0) 2398 if (amdgpu_lbpw != 0)
2378 gfx_v9_0_enable_lbpw(adev, true); 2399 gfx_v9_0_enable_lbpw(adev, true);
2379 else 2400 else
@@ -3777,6 +3798,7 @@ static int gfx_v9_0_set_powergating_state(void *handle,
3777 3798
3778 switch (adev->asic_type) { 3799 switch (adev->asic_type) {
3779 case CHIP_RAVEN: 3800 case CHIP_RAVEN:
3801 case CHIP_PICASSO:
3780 if (!enable) { 3802 if (!enable) {
3781 amdgpu_gfx_off_ctrl(adev, false); 3803 amdgpu_gfx_off_ctrl(adev, false);
3782 cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work); 3804 cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work);
@@ -3831,6 +3853,7 @@ static int gfx_v9_0_set_clockgating_state(void *handle,
3831 case CHIP_VEGA12: 3853 case CHIP_VEGA12:
3832 case CHIP_VEGA20: 3854 case CHIP_VEGA20:
3833 case CHIP_RAVEN: 3855 case CHIP_RAVEN:
3856 case CHIP_PICASSO:
3834 gfx_v9_0_update_gfx_clock_gating(adev, 3857 gfx_v9_0_update_gfx_clock_gating(adev,
3835 state == AMD_CG_STATE_GATE ? true : false); 3858 state == AMD_CG_STATE_GATE ? true : false);
3836 break; 3859 break;
@@ -4840,6 +4863,7 @@ static void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev)
4840 case CHIP_VEGA12: 4863 case CHIP_VEGA12:
4841 case CHIP_VEGA20: 4864 case CHIP_VEGA20:
4842 case CHIP_RAVEN: 4865 case CHIP_RAVEN:
4866 case CHIP_PICASSO:
4843 adev->gfx.rlc.funcs = &gfx_v9_0_rlc_funcs; 4867 adev->gfx.rlc.funcs = &gfx_v9_0_rlc_funcs;
4844 break; 4868 break;
4845 default: 4869 default: