Commit bf9d4e88 authored by Aaron Liu's avatar Aaron Liu Committed by Alex Deucher
Browse files

drm/amdkfd: add yellow carp KFD support



This patch is to add GFX10 based Yellow Carp KFD support.
We will bypass IOMMU v2.

Signed-off-by: default avatarAaron Liu <aaron.liu@amd.com>
Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 5c462ca9
Loading
Loading
Loading
Loading
+52 −0
Original line number Diff line number Diff line
@@ -746,6 +746,54 @@ static struct kfd_gpu_cache_info beige_goby_cache_info[] = {
	},
};

static struct kfd_gpu_cache_info yellow_carp_cache_info[] = {
	{
		/* TCP L1 Cache per CU */
		.cache_size = 16,
		.cache_level = 1,
		.flags = (CRAT_CACHE_FLAGS_ENABLED |
				CRAT_CACHE_FLAGS_DATA_CACHE |
				CRAT_CACHE_FLAGS_SIMD_CACHE),
		.num_cu_shared = 1,
	},
	{
		/* Scalar L1 Instruction Cache per SQC */
		.cache_size = 32,
		.cache_level = 1,
		.flags = (CRAT_CACHE_FLAGS_ENABLED |
				CRAT_CACHE_FLAGS_INST_CACHE |
				CRAT_CACHE_FLAGS_SIMD_CACHE),
		.num_cu_shared = 2,
	},
	{
		/* Scalar L1 Data Cache per SQC */
		.cache_size = 16,
		.cache_level = 1,
		.flags = (CRAT_CACHE_FLAGS_ENABLED |
				CRAT_CACHE_FLAGS_DATA_CACHE |
				CRAT_CACHE_FLAGS_SIMD_CACHE),
		.num_cu_shared = 2,
	},
	{
		/* GL1 Data Cache per SA */
		.cache_size = 128,
		.cache_level = 1,
		.flags = (CRAT_CACHE_FLAGS_ENABLED |
				CRAT_CACHE_FLAGS_DATA_CACHE |
				CRAT_CACHE_FLAGS_SIMD_CACHE),
		.num_cu_shared = 6,
	},
	{
		/* L2 Data Cache per GPU (Total Tex Cache) */
		.cache_size = 2048,
		.cache_level = 2,
		.flags = (CRAT_CACHE_FLAGS_ENABLED |
				CRAT_CACHE_FLAGS_DATA_CACHE |
				CRAT_CACHE_FLAGS_SIMD_CACHE),
		.num_cu_shared = 6,
	},
};

static void kfd_populated_cu_info_cpu(struct kfd_topology_device *dev,
		struct crat_subtype_computeunit *cu)
{
@@ -1383,6 +1431,10 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
		pcache_info = beige_goby_cache_info;
		num_of_cache_types = ARRAY_SIZE(beige_goby_cache_info);
		break;
	case CHIP_YELLOW_CARP:
		pcache_info = yellow_carp_cache_info;
		num_of_cache_types = ARRAY_SIZE(yellow_carp_cache_info);
		break;
	default:
		return -EINVAL;
	}
+19 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ static const struct kfd2kgd_calls *kfd2kgd_funcs[] = {
	[CHIP_VANGOGH] = &gfx_v10_3_kfd2kgd,
	[CHIP_DIMGREY_CAVEFISH] = &gfx_v10_3_kfd2kgd,
	[CHIP_BEIGE_GOBY] = &gfx_v10_3_kfd2kgd,
	[CHIP_YELLOW_CARP] = &gfx_v10_3_kfd2kgd,
};

#ifdef KFD_SUPPORT_IOMMU_V2
@@ -577,6 +578,23 @@ static const struct kfd_device_info beige_goby_device_info = {
	.num_sdma_queues_per_engine = 8,
};

static const struct kfd_device_info yellow_carp_device_info = {
	.asic_family = CHIP_YELLOW_CARP,
	.asic_name = "yellow_carp",
	.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 = 1,
	.num_xgmi_sdma_engines = 0,
	.num_sdma_queues_per_engine = 2,
};

/* For each entry, [0] is regular and [1] is virtualisation device. */
static const struct kfd_device_info *kfd_supported_devices[][2] = {
@@ -606,6 +624,7 @@ static const struct kfd_device_info *kfd_supported_devices[][2] = {
	[CHIP_VANGOGH] = {&vangogh_device_info, NULL},
	[CHIP_DIMGREY_CAVEFISH] = {&dimgrey_cavefish_device_info, &dimgrey_cavefish_device_info},
	[CHIP_BEIGE_GOBY] = {&beige_goby_device_info, &beige_goby_device_info},
	[CHIP_YELLOW_CARP] = {&yellow_carp_device_info, NULL},
};

static int kfd_gtt_sa_init(struct kfd_dev *kfd, unsigned int buf_size,
+1 −0
Original line number Diff line number Diff line
@@ -1937,6 +1937,7 @@ struct device_queue_manager *device_queue_manager_init(struct kfd_dev *dev)
	case CHIP_VANGOGH:
	case CHIP_DIMGREY_CAVEFISH:
	case CHIP_BEIGE_GOBY:
	case CHIP_YELLOW_CARP:
		device_queue_manager_init_v10_navi10(&dqm->asic_ops);
		break;
	default:
+1 −0
Original line number Diff line number Diff line
@@ -425,6 +425,7 @@ int kfd_init_apertures(struct kfd_process *process)
			case CHIP_VANGOGH:
			case CHIP_DIMGREY_CAVEFISH:
			case CHIP_BEIGE_GOBY:
			case CHIP_YELLOW_CARP:
				kfd_init_apertures_v9(pdd, id);
				break;
			default:
+1 −0
Original line number Diff line number Diff line
@@ -250,6 +250,7 @@ int pm_init(struct packet_manager *pm, struct device_queue_manager *dqm)
	case CHIP_VANGOGH:
	case CHIP_DIMGREY_CAVEFISH:
	case CHIP_BEIGE_GOBY:
	case CHIP_YELLOW_CARP:
		pm->pmf = &kfd_v9_pm_funcs;
		break;
	case CHIP_ALDEBARAN:
Loading