Lines Matching refs:afu
405 struct ocxl_afu_config *afu) in read_afu_name() argument
415 ptr = (u32 *) &afu->name[i]; in read_afu_name()
418 afu->name[OCXL_AFU_NAME_SZ - 1] = '\0'; /* play safe */ in read_afu_name()
423 struct ocxl_afu_config *afu) in read_afu_mmio() argument
434 afu->global_mmio_bar = EXTRACT_BITS(val, 0, 2); in read_afu_mmio()
435 afu->global_mmio_offset = EXTRACT_BITS(val, 16, 31) << 16; in read_afu_mmio()
440 afu->global_mmio_offset += (u64) val << 32; in read_afu_mmio()
445 afu->global_mmio_size = val; in read_afu_mmio()
453 afu->pp_mmio_bar = EXTRACT_BITS(val, 0, 2); in read_afu_mmio()
454 afu->pp_mmio_offset = EXTRACT_BITS(val, 16, 31) << 16; in read_afu_mmio()
459 afu->pp_mmio_offset += (u64) val << 32; in read_afu_mmio()
464 afu->pp_mmio_stride = val; in read_afu_mmio()
469 static int read_afu_control(struct pci_dev *dev, struct ocxl_afu_config *afu) in read_afu_control() argument
475 pos = find_dvsec_afu_ctrl(dev, afu->idx); in read_afu_control()
478 afu->idx); in read_afu_control()
481 afu->dvsec_afu_control_pos = pos; in read_afu_control()
484 afu->pasid_supported_log = EXTRACT_BITS(val8, 0, 4); in read_afu_control()
487 afu->actag_supported = EXTRACT_BITS(val16, 0, 11); in read_afu_control()
507 static int validate_afu(struct pci_dev *dev, struct ocxl_afu_config *afu) in validate_afu() argument
511 if (!afu->name[0]) { in validate_afu()
516 if (!char_allowed(afu->name[i])) { in validate_afu()
523 if (afu->global_mmio_bar != 0 && in validate_afu()
524 afu->global_mmio_bar != 2 && in validate_afu()
525 afu->global_mmio_bar != 4) { in validate_afu()
529 if (afu->pp_mmio_bar != 0 && in validate_afu()
530 afu->pp_mmio_bar != 2 && in validate_afu()
531 afu->pp_mmio_bar != 4) { in validate_afu()
548 struct ocxl_afu_config *afu) in read_afu_lpc_memory_info() argument
557 afu->lpc_mem_offset = 0; in read_afu_lpc_memory_info()
558 afu->lpc_mem_size = 0; in read_afu_lpc_memory_info()
559 afu->special_purpose_mem_offset = 0; in read_afu_lpc_memory_info()
560 afu->special_purpose_mem_size = 0; in read_afu_lpc_memory_info()
596 afu->lpc_mem_offset = val32; in read_afu_lpc_memory_info()
602 afu->lpc_mem_offset |= (u64) val32 << 32; in read_afu_lpc_memory_info()
623 afu->lpc_mem_size = lpc_mem_size; in read_afu_lpc_memory_info()
626 afu->special_purpose_mem_offset = in read_afu_lpc_memory_info()
627 afu->lpc_mem_offset + lpc_mem_size; in read_afu_lpc_memory_info()
628 afu->special_purpose_mem_size = in read_afu_lpc_memory_info()
635 struct ocxl_afu_config *afu, u8 afu_idx) in ocxl_config_read_afu() argument
645 afu->idx = afu_idx; in ocxl_config_read_afu()
648 afu->idx); in ocxl_config_read_afu()
650 rc = read_afu_name(dev, fn, afu); in ocxl_config_read_afu()
657 afu->version_major = EXTRACT_BITS(val32, 24, 31); in ocxl_config_read_afu()
658 afu->version_minor = EXTRACT_BITS(val32, 16, 23); in ocxl_config_read_afu()
659 afu->afuc_type = EXTRACT_BITS(val32, 14, 15); in ocxl_config_read_afu()
660 afu->afum_type = EXTRACT_BITS(val32, 12, 13); in ocxl_config_read_afu()
661 afu->profile = EXTRACT_BITS(val32, 0, 7); in ocxl_config_read_afu()
663 rc = read_afu_mmio(dev, fn, afu); in ocxl_config_read_afu()
667 rc = read_afu_lpc_memory_info(dev, fn, afu); in ocxl_config_read_afu()
671 rc = read_afu_control(dev, afu); in ocxl_config_read_afu()
676 dev_dbg(&dev->dev, " name = %s\n", afu->name); in ocxl_config_read_afu()
677 dev_dbg(&dev->dev, " version = %d.%d\n", afu->version_major, in ocxl_config_read_afu()
678 afu->version_minor); in ocxl_config_read_afu()
679 dev_dbg(&dev->dev, " global mmio bar = %hhu\n", afu->global_mmio_bar); in ocxl_config_read_afu()
681 afu->global_mmio_offset); in ocxl_config_read_afu()
682 dev_dbg(&dev->dev, " global mmio size = %#x\n", afu->global_mmio_size); in ocxl_config_read_afu()
683 dev_dbg(&dev->dev, " pp mmio bar = %hhu\n", afu->pp_mmio_bar); in ocxl_config_read_afu()
684 dev_dbg(&dev->dev, " pp mmio offset = %#llx\n", afu->pp_mmio_offset); in ocxl_config_read_afu()
685 dev_dbg(&dev->dev, " pp mmio stride = %#x\n", afu->pp_mmio_stride); in ocxl_config_read_afu()
686 dev_dbg(&dev->dev, " lpc_mem offset = %#llx\n", afu->lpc_mem_offset); in ocxl_config_read_afu()
687 dev_dbg(&dev->dev, " lpc_mem size = %#llx\n", afu->lpc_mem_size); in ocxl_config_read_afu()
689 afu->special_purpose_mem_offset); in ocxl_config_read_afu()
691 afu->special_purpose_mem_size); in ocxl_config_read_afu()
693 afu->pasid_supported_log); in ocxl_config_read_afu()
695 afu->actag_supported); in ocxl_config_read_afu()
697 rc = validate_afu(dev, afu); in ocxl_config_read_afu()