0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #include "kfd_device_queue_manager.h"
0026 #include "navi10_enum.h"
0027 #include "gc/gc_10_1_0_offset.h"
0028 #include "gc/gc_10_1_0_sh_mask.h"
0029
0030 static int update_qpd_v10(struct device_queue_manager *dqm,
0031 struct qcm_process_device *qpd);
0032 static void init_sdma_vm_v10(struct device_queue_manager *dqm, struct queue *q,
0033 struct qcm_process_device *qpd);
0034
0035 void device_queue_manager_init_v10_navi10(
0036 struct device_queue_manager_asic_ops *asic_ops)
0037 {
0038 asic_ops->update_qpd = update_qpd_v10;
0039 asic_ops->init_sdma_vm = init_sdma_vm_v10;
0040 asic_ops->mqd_manager_init = mqd_manager_init_v10;
0041 }
0042
0043 static uint32_t compute_sh_mem_bases_64bit(struct kfd_process_device *pdd)
0044 {
0045 uint32_t shared_base = pdd->lds_base >> 48;
0046 uint32_t private_base = pdd->scratch_base >> 48;
0047
0048 return (shared_base << SH_MEM_BASES__SHARED_BASE__SHIFT) |
0049 private_base;
0050 }
0051
0052 static int update_qpd_v10(struct device_queue_manager *dqm,
0053 struct qcm_process_device *qpd)
0054 {
0055 struct kfd_process_device *pdd;
0056
0057 pdd = qpd_to_pdd(qpd);
0058
0059
0060 if (qpd->sh_mem_config == 0) {
0061 qpd->sh_mem_config =
0062 (SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
0063 SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) |
0064 (3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT);
0065 qpd->sh_mem_ape1_limit = 0;
0066 qpd->sh_mem_ape1_base = 0;
0067 }
0068
0069 qpd->sh_mem_bases = compute_sh_mem_bases_64bit(pdd);
0070
0071 pr_debug("sh_mem_bases 0x%X\n", qpd->sh_mem_bases);
0072
0073 return 0;
0074 }
0075
0076 static void init_sdma_vm_v10(struct device_queue_manager *dqm, struct queue *q,
0077 struct qcm_process_device *qpd)
0078 {
0079
0080 q->properties.sdma_vm_addr = 0;
0081 }