xrp_internal.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Internal XRP structures definition.
  3. *
  4. * Copyright (c) 2015 - 2017 Cadence Design Systems, Inc.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining
  7. * a copy of this software and associated documentation files (the
  8. * "Software"), to deal in the Software without restriction, including
  9. * without limitation the rights to use, copy, modify, merge, publish,
  10. * distribute, sublicense, and/or sell copies of the Software, and to
  11. * permit persons to whom the Software is furnished to do so, subject to
  12. * the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included
  15. * in all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  18. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  20. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  21. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  22. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  23. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  24. *
  25. * Alternatively you can use and distribute this file under the terms of
  26. * the GNU General Public License version 2 or later.
  27. */
  28. #ifndef XRP_INTERNAL_H
  29. #define XRP_INTERNAL_H
  30. #include <linux/completion.h>
  31. #include <linux/proc_fs.h>
  32. #include <linux/miscdevice.h>
  33. #include <linux/mutex.h>
  34. #include <linux/types.h>
  35. #include "xrp_address_map.h"
  36. #include "xrp_kernel_report.h"
  37. struct device;
  38. struct firmware;
  39. struct xrp_hw_ops;
  40. struct xrp_allocation_pool;
  41. struct xrp_dma_buf_list;
  42. struct xrp_panic_log ;
  43. struct xrp_comm {
  44. struct mutex lock;
  45. void __iomem *comm;
  46. struct completion completion;
  47. u32 priority;
  48. };
  49. struct xvp {
  50. struct device *dev;
  51. const char *firmware_name;
  52. const struct firmware *firmware;
  53. struct miscdevice miscdev;
  54. const struct xrp_hw_ops *hw_ops;
  55. void *hw_arg;
  56. unsigned n_queues;
  57. u32 *queue_priority;
  58. struct xrp_comm *queue;
  59. struct xrp_comm **queue_ordered;
  60. void __iomem *comm;
  61. phys_addr_t pmem;
  62. phys_addr_t comm_phys;
  63. phys_addr_t shared_size;
  64. atomic_t reboot_cycle;
  65. atomic_t reboot_cycle_complete;
  66. struct xrp_address_map address_map;
  67. bool host_irq_mode;
  68. struct xrp_allocation_pool *pool;
  69. bool off;
  70. int nodeid;
  71. struct xrp_reporter *reporter;
  72. struct list_head dma_buf_list;
  73. struct proc_dir_entry *proc_dir;
  74. void __iomem *panic;
  75. phys_addr_t panic_phy;
  76. phys_addr_t panic_size;
  77. struct xrp_panic_log *panic_log;
  78. // struct xrp_dsp_debug_info debug_info;
  79. };
  80. #endif