Lines Matching refs:ip

526 static int amdgpu_discovery_validate_ip(const struct ip_v4 *ip)  in amdgpu_discovery_validate_ip()  argument
528 if (ip->instance_number >= HWIP_MAX_INSTANCE) { in amdgpu_discovery_validate_ip()
530 ip->instance_number); in amdgpu_discovery_validate_ip()
533 if (le16_to_cpu(ip->hw_id) >= HW_ID_MAX) { in amdgpu_discovery_validate_ip()
535 le16_to_cpu(ip->hw_id)); in amdgpu_discovery_validate_ip()
548 struct ip_v4 *ip; in amdgpu_discovery_read_harvest_bit_per_ip() local
565 ip = (struct ip_v4 *)(adev->mman.discovery_bin + ip_offset); in amdgpu_discovery_read_harvest_bit_per_ip()
567 if (amdgpu_discovery_validate_ip(ip)) in amdgpu_discovery_read_harvest_bit_per_ip()
570 if (le16_to_cpu(ip->variant) == 1) { in amdgpu_discovery_read_harvest_bit_per_ip()
571 switch (le16_to_cpu(ip->hw_id)) { in amdgpu_discovery_read_harvest_bit_per_ip()
574 if (ip->instance_number == 0) { in amdgpu_discovery_read_harvest_bit_per_ip()
597 ip_offset += struct_size(ip, base_address_64, ip->num_base_address); in amdgpu_discovery_read_harvest_bit_per_ip()
599 ip_offset += struct_size(ip, base_address, ip->num_base_address); in amdgpu_discovery_read_harvest_bit_per_ip()
963 struct ip_v4 *ip; in amdgpu_discovery_sysfs_ips() local
966 ip = (struct ip_v4 *)(adev->mman.discovery_bin + ip_offset); in amdgpu_discovery_sysfs_ips()
967 if (amdgpu_discovery_validate_ip(ip) || in amdgpu_discovery_sysfs_ips()
968 le16_to_cpu(ip->hw_id) != ii) in amdgpu_discovery_sysfs_ips()
1007 ip->num_base_address), in amdgpu_discovery_sysfs_ips()
1013 ip_hw_instance->hw_id = le16_to_cpu(ip->hw_id); /* == ii */ in amdgpu_discovery_sysfs_ips()
1014 ip_hw_instance->num_instance = ip->instance_number; in amdgpu_discovery_sysfs_ips()
1015 ip_hw_instance->major = ip->major; in amdgpu_discovery_sysfs_ips()
1016 ip_hw_instance->minor = ip->minor; in amdgpu_discovery_sysfs_ips()
1017 ip_hw_instance->revision = ip->revision; in amdgpu_discovery_sysfs_ips()
1022 ip_hw_instance->num_base_addresses = ip->num_base_address; in amdgpu_discovery_sysfs_ips()
1027 lower_32_bits(le64_to_cpu(ip->base_address_64[kk])) & 0x3FFFFFFF; in amdgpu_discovery_sysfs_ips()
1029 ip_hw_instance->base_addr[kk] = ip->base_address[kk]; in amdgpu_discovery_sysfs_ips()
1038 ip_offset += struct_size(ip, base_address_64, in amdgpu_discovery_sysfs_ips()
1039 ip->num_base_address); in amdgpu_discovery_sysfs_ips()
1041 ip_offset += struct_size(ip, base_address, in amdgpu_discovery_sysfs_ips()
1042 ip->num_base_address); in amdgpu_discovery_sysfs_ips()
1209 struct ip_v4 *ip; in amdgpu_discovery_reg_base_init() local
1252 ip = (struct ip_v4 *)(adev->mman.discovery_bin + ip_offset); in amdgpu_discovery_reg_base_init()
1254 if (amdgpu_discovery_validate_ip(ip)) in amdgpu_discovery_reg_base_init()
1257 num_base_address = ip->num_base_address; in amdgpu_discovery_reg_base_init()
1260 hw_id_names[le16_to_cpu(ip->hw_id)], in amdgpu_discovery_reg_base_init()
1261 le16_to_cpu(ip->hw_id), in amdgpu_discovery_reg_base_init()
1262 ip->instance_number, in amdgpu_discovery_reg_base_init()
1263 ip->major, ip->minor, in amdgpu_discovery_reg_base_init()
1264 ip->revision); in amdgpu_discovery_reg_base_init()
1266 if (le16_to_cpu(ip->hw_id) == VCN_HWID) { in amdgpu_discovery_reg_base_init()
1276 ip->revision & 0xc0; in amdgpu_discovery_reg_base_init()
1279 (1U << ip->instance_number); in amdgpu_discovery_reg_base_init()
1281 (1U << ip->instance_number); in amdgpu_discovery_reg_base_init()
1287 ip->revision &= ~0xc0; in amdgpu_discovery_reg_base_init()
1289 if (le16_to_cpu(ip->hw_id) == SDMA0_HWID || in amdgpu_discovery_reg_base_init()
1290 le16_to_cpu(ip->hw_id) == SDMA1_HWID || in amdgpu_discovery_reg_base_init()
1291 le16_to_cpu(ip->hw_id) == SDMA2_HWID || in amdgpu_discovery_reg_base_init()
1292 le16_to_cpu(ip->hw_id) == SDMA3_HWID) { in amdgpu_discovery_reg_base_init()
1297 (1U << ip->instance_number); in amdgpu_discovery_reg_base_init()
1305 if (le16_to_cpu(ip->hw_id) == UMC_HWID) { in amdgpu_discovery_reg_base_init()
1310 if (le16_to_cpu(ip->hw_id) == GC_HWID) in amdgpu_discovery_reg_base_init()
1312 (1U << ip->instance_number); in amdgpu_discovery_reg_base_init()
1329 ip->base_address[k] = in amdgpu_discovery_reg_base_init()
1330 lower_32_bits(le64_to_cpu(ip->base_address_64[k])) & 0x3FFFFFFF; in amdgpu_discovery_reg_base_init()
1332 ip->base_address[k] = le32_to_cpu(ip->base_address[k]); in amdgpu_discovery_reg_base_init()
1333 DRM_DEBUG("\t0x%08x\n", ip->base_address[k]); in amdgpu_discovery_reg_base_init()
1337 if (hw_id_map[hw_ip] == le16_to_cpu(ip->hw_id) && in amdgpu_discovery_reg_base_init()
1340 hw_id_names[le16_to_cpu(ip->hw_id)]); in amdgpu_discovery_reg_base_init()
1341 adev->reg_offset[hw_ip][ip->instance_number] = in amdgpu_discovery_reg_base_init()
1342 ip->base_address; in amdgpu_discovery_reg_base_init()
1352 adev->ip_versions[hw_ip][ip->instance_number] = in amdgpu_discovery_reg_base_init()
1353 IP_VERSION(ip->major, ip->minor, ip->revision); in amdgpu_discovery_reg_base_init()
1359 ip_offset += struct_size(ip, base_address_64, ip->num_base_address); in amdgpu_discovery_reg_base_init()
1361 ip_offset += struct_size(ip, base_address, ip->num_base_address); in amdgpu_discovery_reg_base_init()