Lines Matching defs:cxl
21 #include <misc/cxl-base.h>
23 #include <misc/cxl.h>
24 #include <uapi/misc/cxl.h>
441 #define to_cxl_adapter(d) container_of(d, struct cxl, dev)
486 struct cxl *adapter;
535 * This is a cxl context. If the PSL is in dedicated mode, there will be one
594 * external_pe is the PE shown outside of cxl.
598 * of cxl.
626 int (*adapter_regs_init)(struct cxl *adapter, struct pci_dev *dev);
627 int (*invalidate_all)(struct cxl *adapter);
638 void (*debugfs_add_adapter_regs)(struct cxl *adapter, struct dentry *dir);
641 void (*err_irq_dump_registers)(struct cxl *adapter);
642 void (*debugfs_stop_trace)(struct cxl *adapter);
643 void (*write_timebase_ctrl)(struct cxl *adapter);
644 u64 (*timebase_read)(struct cxl *adapter);
676 struct cxl {
712 int cxl_pci_alloc_one_irq(struct cxl *adapter);
713 void cxl_pci_release_one_irq(struct cxl *adapter, int hwirq);
714 int cxl_pci_alloc_irq_ranges(struct cxl_irq_ranges *irqs, struct cxl *adapter, unsigned int num);
715 void cxl_pci_release_irq_ranges(struct cxl_irq_ranges *irqs, struct cxl *adapter);
716 int cxl_pci_setup_irq(struct cxl *adapter, unsigned int hwirq, unsigned int virq);
717 int cxl_update_image_control(struct cxl *adapter);
718 int cxl_pci_reset(struct cxl *adapter);
720 ssize_t cxl_pci_read_adapter_vpd(struct cxl *adapter, void *buf, size_t len);
763 static inline bool cxl_adapter_link_ok(struct cxl *cxl, struct cxl_afu *afu)
768 pdev = to_pci_dev(cxl->dev.parent);
774 static inline void __iomem *_cxl_p1_addr(struct cxl *cxl, cxl_p1_reg_t reg)
777 return cxl->native->p1_mmio + cxl_reg_off(reg);
780 static inline void cxl_p1_write(struct cxl *cxl, cxl_p1_reg_t reg, u64 val)
782 if (likely(cxl_adapter_link_ok(cxl, NULL)))
783 out_be64(_cxl_p1_addr(cxl, reg), val);
786 static inline u64 cxl_p1_read(struct cxl *cxl, cxl_p1_reg_t reg)
788 if (likely(cxl_adapter_link_ok(cxl, NULL)))
789 return in_be64(_cxl_p1_addr(cxl, reg));
861 void cxl_remove_adapter_nr(struct cxl *adapter);
868 int cxl_register_adapter(struct cxl *adapter);
879 int cxl_sysfs_adapter_add(struct cxl *adapter);
880 void cxl_sysfs_adapter_remove(struct cxl *adapter);
886 struct cxl *cxl_alloc_adapter(void);
887 struct cxl_afu *cxl_alloc_afu(struct cxl *adapter, int slice);
892 int cxl_native_register_psl_err_irq(struct cxl *adapter);
893 void cxl_native_release_psl_err_irq(struct cxl *adapter);
913 void cxl_debugfs_adapter_add(struct cxl *adapter);
914 void cxl_debugfs_adapter_remove(struct cxl *adapter);
917 void cxl_debugfs_add_adapter_regs_psl9(struct cxl *adapter, struct dentry *dir);
918 void cxl_debugfs_add_adapter_regs_psl8(struct cxl *adapter, struct dentry *dir);
932 static inline void cxl_debugfs_adapter_add(struct cxl *adapter)
936 static inline void cxl_debugfs_adapter_remove(struct cxl *adapter)
948 static inline void cxl_debugfs_add_adapter_regs_psl9(struct cxl *adapter,
953 static inline void cxl_debugfs_add_adapter_regs_psl8(struct cxl *adapter,
972 struct cxl *get_cxl_adapter(int num);
984 unsigned int cxl_map_irq(struct cxl *adapter, irq_hw_number_t hwirq,
1008 int cxl_invalidate_all_psl9(struct cxl *adapter);
1009 int cxl_invalidate_all_psl8(struct cxl *adapter);
1013 int cxl_register_one_irq(struct cxl *adapter, irq_handler_t handler,
1019 int cxl_data_cache_flush(struct cxl *adapter);
1030 void cxl_native_err_irq_dump_regs_psl8(struct cxl *adapter);
1031 void cxl_native_err_irq_dump_regs_psl9(struct cxl *adapter);
1048 struct cxl *cxl_guest_init_adapter(struct device_node *np, struct platform_device *dev);
1049 void cxl_guest_remove_adapter(struct cxl *adapter);
1050 int cxl_of_read_adapter_handle(struct cxl *adapter, struct device_node *np);
1051 int cxl_of_read_adapter_properties(struct cxl *adapter, struct device_node *np);
1052 ssize_t cxl_guest_read_adapter_vpd(struct cxl *adapter, void *buf, size_t len);
1054 int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_np);
1058 int cxl_guest_add_chardev(struct cxl *adapter);
1059 void cxl_guest_remove_chardev(struct cxl *adapter);
1060 void cxl_guest_reload_module(struct cxl *adapter);
1065 int (*adapter_reset)(struct cxl *adapter);
1066 int (*alloc_one_irq)(struct cxl *adapter);
1067 void (*release_one_irq)(struct cxl *adapter, int hwirq);
1069 struct cxl *adapter, unsigned int num);
1071 struct cxl *adapter);
1072 int (*setup_irq)(struct cxl *adapter, unsigned int hwirq,
1084 bool (*link_ok)(struct cxl *cxl, struct cxl_afu *afu);
1099 ssize_t (*read_adapter_vpd)(struct cxl *adapter, void *buf, size_t count);
1105 /* check if the given pci_dev is on the the cxl vphb bus */
1115 int cxl_adapter_context_get(struct cxl *adapter);
1118 void cxl_adapter_context_put(struct cxl *adapter);
1121 int cxl_adapter_context_lock(struct cxl *adapter);
1124 void cxl_adapter_context_unlock(struct cxl *adapter);