hw-txe.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2013-2016, Intel Corporation. All rights reserved.
  4. * Intel Management Engine Interface (Intel MEI) Linux driver
  5. */
  6. #ifndef _MEI_HW_TXE_H_
  7. #define _MEI_HW_TXE_H_
  8. #include <linux/irqreturn.h>
  9. #include "hw.h"
  10. #include "hw-txe-regs.h"
  11. #define MEI_TXI_RPM_TIMEOUT 500 /* ms */
  12. /* Flatten Hierarchy interrupt cause */
  13. #define TXE_INTR_READINESS_BIT 0 /* HISR_INT_0_STS */
  14. #define TXE_INTR_READINESS HISR_INT_0_STS
  15. #define TXE_INTR_ALIVENESS_BIT 1 /* HISR_INT_1_STS */
  16. #define TXE_INTR_ALIVENESS HISR_INT_1_STS
  17. #define TXE_INTR_OUT_DB_BIT 2 /* HISR_INT_2_STS */
  18. #define TXE_INTR_OUT_DB HISR_INT_2_STS
  19. #define TXE_INTR_IN_READY_BIT 8 /* beyond HISR */
  20. #define TXE_INTR_IN_READY BIT(8)
  21. /**
  22. * struct mei_txe_hw - txe hardware specifics
  23. *
  24. * @mem_addr: SeC and BRIDGE bars
  25. * @aliveness: aliveness (power gating) state of the hardware
  26. * @readiness: readiness state of the hardware
  27. * @slots: number of empty slots
  28. * @wait_aliveness_resp: aliveness wait queue
  29. * @intr_cause: translated interrupt cause
  30. */
  31. struct mei_txe_hw {
  32. void __iomem * const *mem_addr;
  33. u32 aliveness;
  34. u32 readiness;
  35. u32 slots;
  36. wait_queue_head_t wait_aliveness_resp;
  37. unsigned long intr_cause;
  38. };
  39. #define to_txe_hw(dev) (struct mei_txe_hw *)((dev)->hw)
  40. static inline struct mei_device *hw_txe_to_mei(struct mei_txe_hw *hw)
  41. {
  42. return container_of((void *)hw, struct mei_device, hw);
  43. }
  44. struct mei_device *mei_txe_dev_init(struct pci_dev *pdev);
  45. irqreturn_t mei_txe_irq_quick_handler(int irq, void *dev_id);
  46. irqreturn_t mei_txe_irq_thread_handler(int irq, void *dev_id);
  47. int mei_txe_aliveness_set_sync(struct mei_device *dev, u32 req);
  48. int mei_txe_setup_satt2(struct mei_device *dev, phys_addr_t addr, u32 range);
  49. #endif /* _MEI_HW_TXE_H_ */