]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blob - drivers/scsi/cxlflash/ocxl_hw.h
09fa94c73501e2e360cb2b04c83e813261c4d88c
[mirror_ubuntu-focal-kernel.git] / drivers / scsi / cxlflash / ocxl_hw.h
1 /*
2 * CXL Flash Device Driver
3 *
4 * Written by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>, IBM Corporation
5 * Uma Krishnan <ukrishn@linux.vnet.ibm.com>, IBM Corporation
6 *
7 * Copyright (C) 2018 IBM Corporation
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14
15 /* OCXL hardware AFU associated with the host */
16 struct ocxl_hw_afu {
17 struct ocxlflash_context *ocxl_ctx; /* Host context */
18 struct pci_dev *pdev; /* PCI device */
19 struct device *dev; /* Generic device */
20 bool perst_same_image; /* Same image loaded on perst */
21
22 struct ocxl_fn_config fcfg; /* DVSEC config of the function */
23 struct ocxl_afu_config acfg; /* AFU configuration data */
24
25 int fn_actag_base; /* Function acTag base */
26 int fn_actag_enabled; /* Function acTag number enabled */
27 int afu_actag_base; /* AFU acTag base */
28 int afu_actag_enabled; /* AFU acTag number enabled */
29
30 phys_addr_t ppmmio_phys; /* Per process MMIO space */
31 phys_addr_t gmmio_phys; /* Global AFU MMIO space */
32 void __iomem *gmmio_virt; /* Global MMIO map */
33
34 void *link_token; /* Link token for the SPA */
35 struct idr idr; /* IDR to manage contexts */
36 int max_pasid; /* Maximum number of contexts */
37 bool is_present; /* Function has AFUs defined */
38 };
39
40 struct ocxlflash_context {
41 struct ocxl_hw_afu *hw_afu; /* HW AFU back pointer */
42 struct address_space *mapping; /* Mapping for pseudo filesystem */
43 bool master; /* Whether this is a master context */
44 int pe; /* Process element */
45
46 phys_addr_t psn_phys; /* Process mapping */
47 u64 psn_size; /* Process mapping size */
48 };