Lines Matching refs:afu
423 struct ocxl_afu_config *afu) in read_afu_name() argument
433 ptr = (u32 *) &afu->name[i]; in read_afu_name()
436 afu->name[OCXL_AFU_NAME_SZ - 1] = '\0'; /* play safe */ in read_afu_name()
441 struct ocxl_afu_config *afu) in read_afu_mmio() argument
452 afu->global_mmio_bar = EXTRACT_BITS(val, 0, 2); in read_afu_mmio()
453 afu->global_mmio_offset = EXTRACT_BITS(val, 16, 31) << 16; in read_afu_mmio()
458 afu->global_mmio_offset += (u64) val << 32; in read_afu_mmio()
463 afu->global_mmio_size = val; in read_afu_mmio()
471 afu->pp_mmio_bar = EXTRACT_BITS(val, 0, 2); in read_afu_mmio()
472 afu->pp_mmio_offset = EXTRACT_BITS(val, 16, 31) << 16; in read_afu_mmio()
477 afu->pp_mmio_offset += (u64) val << 32; in read_afu_mmio()
482 afu->pp_mmio_stride = val; in read_afu_mmio()
487 static int read_afu_control(struct pci_dev *dev, struct ocxl_afu_config *afu) in read_afu_control() argument
493 pos = find_dvsec_afu_ctrl(dev, afu->idx); in read_afu_control()
496 afu->idx); in read_afu_control()
499 afu->dvsec_afu_control_pos = pos; in read_afu_control()
502 afu->pasid_supported_log = EXTRACT_BITS(val8, 0, 4); in read_afu_control()
505 afu->actag_supported = EXTRACT_BITS(val16, 0, 11); in read_afu_control()
525 static int validate_afu(struct pci_dev *dev, struct ocxl_afu_config *afu) in validate_afu() argument
529 if (!afu->name[0]) { in validate_afu()
534 if (!char_allowed(afu->name[i])) { in validate_afu()
541 if (afu->global_mmio_bar != 0 && in validate_afu()
542 afu->global_mmio_bar != 2 && in validate_afu()
543 afu->global_mmio_bar != 4) { in validate_afu()
547 if (afu->pp_mmio_bar != 0 && in validate_afu()
548 afu->pp_mmio_bar != 2 && in validate_afu()
549 afu->pp_mmio_bar != 4) { in validate_afu()
566 struct ocxl_afu_config *afu) in read_afu_lpc_memory_info() argument
575 afu->lpc_mem_offset = 0; in read_afu_lpc_memory_info()
576 afu->lpc_mem_size = 0; in read_afu_lpc_memory_info()
577 afu->special_purpose_mem_offset = 0; in read_afu_lpc_memory_info()
578 afu->special_purpose_mem_size = 0; in read_afu_lpc_memory_info()
614 afu->lpc_mem_offset = val32; in read_afu_lpc_memory_info()
620 afu->lpc_mem_offset |= (u64) val32 << 32; in read_afu_lpc_memory_info()
641 afu->lpc_mem_size = lpc_mem_size; in read_afu_lpc_memory_info()
644 afu->special_purpose_mem_offset = in read_afu_lpc_memory_info()
645 afu->lpc_mem_offset + lpc_mem_size; in read_afu_lpc_memory_info()
646 afu->special_purpose_mem_size = in read_afu_lpc_memory_info()
653 struct ocxl_afu_config *afu, u8 afu_idx) in ocxl_config_read_afu() argument
663 afu->idx = afu_idx; in ocxl_config_read_afu()
666 afu->idx); in ocxl_config_read_afu()
668 rc = read_afu_name(dev, fn, afu); in ocxl_config_read_afu()
675 afu->version_major = EXTRACT_BITS(val32, 24, 31); in ocxl_config_read_afu()
676 afu->version_minor = EXTRACT_BITS(val32, 16, 23); in ocxl_config_read_afu()
677 afu->afuc_type = EXTRACT_BITS(val32, 14, 15); in ocxl_config_read_afu()
678 afu->afum_type = EXTRACT_BITS(val32, 12, 13); in ocxl_config_read_afu()
679 afu->profile = EXTRACT_BITS(val32, 0, 7); in ocxl_config_read_afu()
681 rc = read_afu_mmio(dev, fn, afu); in ocxl_config_read_afu()
685 rc = read_afu_lpc_memory_info(dev, fn, afu); in ocxl_config_read_afu()
689 rc = read_afu_control(dev, afu); in ocxl_config_read_afu()
694 dev_dbg(&dev->dev, " name = %s\n", afu->name); in ocxl_config_read_afu()
695 dev_dbg(&dev->dev, " version = %d.%d\n", afu->version_major, in ocxl_config_read_afu()
696 afu->version_minor); in ocxl_config_read_afu()
697 dev_dbg(&dev->dev, " global mmio bar = %hhu\n", afu->global_mmio_bar); in ocxl_config_read_afu()
699 afu->global_mmio_offset); in ocxl_config_read_afu()
700 dev_dbg(&dev->dev, " global mmio size = %#x\n", afu->global_mmio_size); in ocxl_config_read_afu()
701 dev_dbg(&dev->dev, " pp mmio bar = %hhu\n", afu->pp_mmio_bar); in ocxl_config_read_afu()
702 dev_dbg(&dev->dev, " pp mmio offset = %#llx\n", afu->pp_mmio_offset); in ocxl_config_read_afu()
703 dev_dbg(&dev->dev, " pp mmio stride = %#x\n", afu->pp_mmio_stride); in ocxl_config_read_afu()
704 dev_dbg(&dev->dev, " lpc_mem offset = %#llx\n", afu->lpc_mem_offset); in ocxl_config_read_afu()
705 dev_dbg(&dev->dev, " lpc_mem size = %#llx\n", afu->lpc_mem_size); in ocxl_config_read_afu()
707 afu->special_purpose_mem_offset); in ocxl_config_read_afu()
709 afu->special_purpose_mem_size); in ocxl_config_read_afu()
711 afu->pasid_supported_log); in ocxl_config_read_afu()
713 afu->actag_supported); in ocxl_config_read_afu()
715 rc = validate_afu(dev, afu); in ocxl_config_read_afu()