cptpf.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) 2016 Cavium, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of version 2 of the GNU General Public License
  6. * as published by the Free Software Foundation.
  7. */
  8. #ifndef __CPTPF_H
  9. #define __CPTPF_H
  10. #include "cpt_common.h"
  11. #define CSR_DELAY 30
  12. #define CPT_MAX_CORE_GROUPS 8
  13. #define CPT_MAX_SE_CORES 10
  14. #define CPT_MAX_AE_CORES 6
  15. #define CPT_MAX_TOTAL_CORES (CPT_MAX_SE_CORES + CPT_MAX_AE_CORES)
  16. #define CPT_MAX_VF_NUM 16
  17. #define CPT_PF_MSIX_VECTORS 3
  18. #define CPT_PF_INT_VEC_E_MBOXX(a) (0x02 + (a))
  19. #define CPT_UCODE_VERSION_SZ 32
  20. struct cpt_device;
  21. struct microcode {
  22. u8 is_mc_valid;
  23. u8 is_ae;
  24. u8 group;
  25. u8 num_cores;
  26. u32 code_size;
  27. u64 core_mask;
  28. u8 version[CPT_UCODE_VERSION_SZ];
  29. /* Base info */
  30. dma_addr_t phys_base;
  31. void *code;
  32. };
  33. struct cpt_vf_info {
  34. u8 state;
  35. u8 priority;
  36. u8 id;
  37. u32 qlen;
  38. };
  39. /**
  40. * cpt device structure
  41. */
  42. struct cpt_device {
  43. u16 flags; /* Flags to hold device status bits */
  44. u8 num_vf_en; /* Number of VFs enabled (0...CPT_MAX_VF_NUM) */
  45. struct cpt_vf_info vfinfo[CPT_MAX_VF_NUM]; /* Per VF info */
  46. void __iomem *reg_base; /* Register start address */
  47. struct pci_dev *pdev; /* pci device handle */
  48. struct microcode mcode[CPT_MAX_CORE_GROUPS];
  49. u8 next_mc_idx; /* next microcode index */
  50. u8 next_group;
  51. u8 max_se_cores;
  52. u8 max_ae_cores;
  53. };
  54. void cpt_mbox_intr_handler(struct cpt_device *cpt, int mbx);
  55. #endif /* __CPTPF_H */