hw-ish.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * H/W layer of ISHTP provider device (ISH)
  3. *
  4. * Copyright (c) 2014-2016, Intel Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. */
  15. #ifndef _ISHTP_HW_ISH_H_
  16. #define _ISHTP_HW_ISH_H_
  17. #include <linux/pci.h>
  18. #include <linux/interrupt.h>
  19. #include "hw-ish-regs.h"
  20. #include "ishtp-dev.h"
  21. #define CHV_DEVICE_ID 0x22D8
  22. #define BXT_Ax_DEVICE_ID 0x0AA2
  23. #define BXT_Bx_DEVICE_ID 0x1AA2
  24. #define APL_Ax_DEVICE_ID 0x5AA2
  25. #define SPT_Ax_DEVICE_ID 0x9D35
  26. #define REVISION_ID_CHT_A0 0x6
  27. #define REVISION_ID_CHT_Ax_SI 0x0
  28. #define REVISION_ID_CHT_Bx_SI 0x10
  29. #define REVISION_ID_CHT_Kx_SI 0x20
  30. #define REVISION_ID_CHT_Dx_SI 0x30
  31. #define REVISION_ID_CHT_B0 0xB0
  32. #define REVISION_ID_SI_MASK 0x70
  33. struct ipc_rst_payload_type {
  34. uint16_t reset_id;
  35. uint16_t reserved;
  36. };
  37. struct time_sync_format {
  38. uint8_t ts1_source;
  39. uint8_t ts2_source;
  40. uint16_t reserved;
  41. } __packed;
  42. struct ipc_time_update_msg {
  43. uint64_t primary_host_time;
  44. struct time_sync_format sync_info;
  45. uint64_t secondary_host_time;
  46. } __packed;
  47. enum {
  48. HOST_UTC_TIME_USEC = 0,
  49. HOST_SYSTEM_TIME_USEC = 1
  50. };
  51. struct ish_hw {
  52. void __iomem *mem_addr;
  53. };
  54. #define to_ish_hw(dev) (struct ish_hw *)((dev)->hw)
  55. irqreturn_t ish_irq_handler(int irq, void *dev_id);
  56. struct ishtp_device *ish_dev_init(struct pci_dev *pdev);
  57. int ish_hw_start(struct ishtp_device *dev);
  58. void ish_device_disable(struct ishtp_device *dev);
  59. #endif /* _ISHTP_HW_ISH_H_ */