hw-ish.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 CNL_Ax_DEVICE_ID 0x9DFC
  27. #define GLK_Ax_DEVICE_ID 0x31A2
  28. #define CNL_H_DEVICE_ID 0xA37C
  29. #define ICL_MOBILE_DEVICE_ID 0x34FC
  30. #define SPT_H_DEVICE_ID 0xA135
  31. #define REVISION_ID_CHT_A0 0x6
  32. #define REVISION_ID_CHT_Ax_SI 0x0
  33. #define REVISION_ID_CHT_Bx_SI 0x10
  34. #define REVISION_ID_CHT_Kx_SI 0x20
  35. #define REVISION_ID_CHT_Dx_SI 0x30
  36. #define REVISION_ID_CHT_B0 0xB0
  37. #define REVISION_ID_SI_MASK 0x70
  38. struct ipc_rst_payload_type {
  39. uint16_t reset_id;
  40. uint16_t reserved;
  41. };
  42. struct time_sync_format {
  43. uint8_t ts1_source;
  44. uint8_t ts2_source;
  45. uint16_t reserved;
  46. } __packed;
  47. struct ipc_time_update_msg {
  48. uint64_t primary_host_time;
  49. struct time_sync_format sync_info;
  50. uint64_t secondary_host_time;
  51. } __packed;
  52. enum {
  53. HOST_UTC_TIME_USEC = 0,
  54. HOST_SYSTEM_TIME_USEC = 1
  55. };
  56. struct ish_hw {
  57. void __iomem *mem_addr;
  58. };
  59. /*
  60. * ISH FW status type
  61. */
  62. enum {
  63. FWSTS_AFTER_RESET = 0,
  64. FWSTS_WAIT_FOR_HOST = 4,
  65. FWSTS_START_KERNEL_DMA = 5,
  66. FWSTS_FW_IS_RUNNING = 7,
  67. FWSTS_SENSOR_APP_LOADED = 8,
  68. FWSTS_SENSOR_APP_RUNNING = 15
  69. };
  70. #define to_ish_hw(dev) (struct ish_hw *)((dev)->hw)
  71. irqreturn_t ish_irq_handler(int irq, void *dev_id);
  72. struct ishtp_device *ish_dev_init(struct pci_dev *pdev);
  73. int ish_hw_start(struct ishtp_device *dev);
  74. void ish_device_disable(struct ishtp_device *dev);
  75. #endif /* _ISHTP_HW_ISH_H_ */