Lines Matching defs:cxl
21 #include <misc/cxl-base.h>
23 #include <misc/cxl.h>
24 #include <uapi/misc/cxl.h>
443 #define to_cxl_adapter(d) container_of(d, struct cxl, dev)
488 struct cxl *adapter;
537 * This is a cxl context. If the PSL is in dedicated mode, there will be one
596 * external_pe is the PE shown outside of cxl.
600 * of cxl.
628 int (*adapter_regs_init)(struct cxl *adapter, struct pci_dev *dev);
629 int (*invalidate_all)(struct cxl *adapter);
640 void (*debugfs_add_adapter_regs)(struct cxl *adapter, struct dentry *dir);
643 void (*err_irq_dump_registers)(struct cxl *adapter);
644 void (*debugfs_stop_trace)(struct cxl *adapter);
645 void (*write_timebase_ctrl)(struct cxl *adapter);
646 u64 (*timebase_read)(struct cxl *adapter);
678 struct cxl {
714 int cxl_pci_alloc_one_irq(struct cxl *adapter);
715 void cxl_pci_release_one_irq(struct cxl *adapter, int hwirq);
716 int cxl_pci_alloc_irq_ranges(struct cxl_irq_ranges *irqs, struct cxl *adapter, unsigned int num);
717 void cxl_pci_release_irq_ranges(struct cxl_irq_ranges *irqs, struct cxl *adapter);
718 int cxl_pci_setup_irq(struct cxl *adapter, unsigned int hwirq, unsigned int virq);
719 int cxl_update_image_control(struct cxl *adapter);
720 int cxl_pci_reset(struct cxl *adapter);
722 ssize_t cxl_pci_read_adapter_vpd(struct cxl *adapter, void *buf, size_t len);
765 static inline bool cxl_adapter_link_ok(struct cxl *cxl, struct cxl_afu *afu)
770 pdev = to_pci_dev(cxl->dev.parent);
776 static inline void __iomem *_cxl_p1_addr(struct cxl *cxl, cxl_p1_reg_t reg)
779 return cxl->native->p1_mmio + cxl_reg_off(reg);
782 static inline void cxl_p1_write(struct cxl *cxl, cxl_p1_reg_t reg, u64 val)
784 if (likely(cxl_adapter_link_ok(cxl, NULL)))
785 out_be64(_cxl_p1_addr(cxl, reg), val);
788 static inline u64 cxl_p1_read(struct cxl *cxl, cxl_p1_reg_t reg)
790 if (likely(cxl_adapter_link_ok(cxl, NULL)))
791 return in_be64(_cxl_p1_addr(cxl, reg));
863 void cxl_remove_adapter_nr(struct cxl *adapter);
870 int cxl_register_adapter(struct cxl *adapter);
881 int cxl_sysfs_adapter_add(struct cxl *adapter);
882 void cxl_sysfs_adapter_remove(struct cxl *adapter);
888 struct cxl *cxl_alloc_adapter(void);
889 struct cxl_afu *cxl_alloc_afu(struct cxl *adapter, int slice);
894 int cxl_native_register_psl_err_irq(struct cxl *adapter);
895 void cxl_native_release_psl_err_irq(struct cxl *adapter);
915 void cxl_debugfs_adapter_add(struct cxl *adapter);
916 void cxl_debugfs_adapter_remove(struct cxl *adapter);
919 void cxl_debugfs_add_adapter_regs_psl9(struct cxl *adapter, struct dentry *dir);
920 void cxl_debugfs_add_adapter_regs_psl8(struct cxl *adapter, struct dentry *dir);
934 static inline void cxl_debugfs_adapter_add(struct cxl *adapter)
938 static inline void cxl_debugfs_adapter_remove(struct cxl *adapter)
950 static inline void cxl_debugfs_add_adapter_regs_psl9(struct cxl *adapter,
955 static inline void cxl_debugfs_add_adapter_regs_psl8(struct cxl *adapter,
974 struct cxl *get_cxl_adapter(int num);
986 unsigned int cxl_map_irq(struct cxl *adapter, irq_hw_number_t hwirq,
1010 int cxl_invalidate_all_psl9(struct cxl *adapter);
1011 int cxl_invalidate_all_psl8(struct cxl *adapter);
1015 int cxl_register_one_irq(struct cxl *adapter, irq_handler_t handler,
1021 int cxl_data_cache_flush(struct cxl *adapter);
1032 void cxl_native_err_irq_dump_regs_psl8(struct cxl *adapter);
1033 void cxl_native_err_irq_dump_regs_psl9(struct cxl *adapter);
1050 struct cxl *cxl_guest_init_adapter(struct device_node *np, struct platform_device *dev);
1051 void cxl_guest_remove_adapter(struct cxl *adapter);
1052 int cxl_of_read_adapter_handle(struct cxl *adapter, struct device_node *np);
1053 int cxl_of_read_adapter_properties(struct cxl *adapter, struct device_node *np);
1054 ssize_t cxl_guest_read_adapter_vpd(struct cxl *adapter, void *buf, size_t len);
1056 int cxl_guest_init_afu(struct cxl *adapter, int slice, struct device_node *afu_np);
1060 int cxl_guest_add_chardev(struct cxl *adapter);
1061 void cxl_guest_remove_chardev(struct cxl *adapter);
1062 void cxl_guest_reload_module(struct cxl *adapter);
1067 int (*adapter_reset)(struct cxl *adapter);
1068 int (*alloc_one_irq)(struct cxl *adapter);
1069 void (*release_one_irq)(struct cxl *adapter, int hwirq);
1071 struct cxl *adapter, unsigned int num);
1073 struct cxl *adapter);
1074 int (*setup_irq)(struct cxl *adapter, unsigned int hwirq,
1086 bool (*link_ok)(struct cxl *cxl, struct cxl_afu *afu);
1101 ssize_t (*read_adapter_vpd)(struct cxl *adapter, void *buf, size_t count);
1107 /* check if the given pci_dev is on the cxl vphb bus */
1117 int cxl_adapter_context_get(struct cxl *adapter);
1120 void cxl_adapter_context_put(struct cxl *adapter);
1123 int cxl_adapter_context_lock(struct cxl *adapter);
1126 void cxl_adapter_context_unlock(struct cxl *adapter);