sdhci-pci.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #ifndef __SDHCI_PCI_H
  2. #define __SDHCI_PCI_H
  3. /*
  4. * PCI device IDs
  5. */
  6. #define PCI_DEVICE_ID_INTEL_PCH_SDIO0 0x8809
  7. #define PCI_DEVICE_ID_INTEL_PCH_SDIO1 0x880a
  8. #define PCI_DEVICE_ID_INTEL_BYT_EMMC 0x0f14
  9. #define PCI_DEVICE_ID_INTEL_BYT_SDIO 0x0f15
  10. #define PCI_DEVICE_ID_INTEL_BYT_SD 0x0f16
  11. #define PCI_DEVICE_ID_INTEL_BYT_EMMC2 0x0f50
  12. #define PCI_DEVICE_ID_INTEL_BSW_EMMC 0x2294
  13. #define PCI_DEVICE_ID_INTEL_BSW_SDIO 0x2295
  14. #define PCI_DEVICE_ID_INTEL_BSW_SD 0x2296
  15. #define PCI_DEVICE_ID_INTEL_MRFLD_MMC 0x1190
  16. #define PCI_DEVICE_ID_INTEL_CLV_SDIO0 0x08f9
  17. #define PCI_DEVICE_ID_INTEL_CLV_SDIO1 0x08fa
  18. #define PCI_DEVICE_ID_INTEL_CLV_SDIO2 0x08fb
  19. #define PCI_DEVICE_ID_INTEL_CLV_EMMC0 0x08e5
  20. #define PCI_DEVICE_ID_INTEL_CLV_EMMC1 0x08e6
  21. #define PCI_DEVICE_ID_INTEL_QRK_SD 0x08A7
  22. #define PCI_DEVICE_ID_INTEL_SPT_EMMC 0x9d2b
  23. #define PCI_DEVICE_ID_INTEL_SPT_SDIO 0x9d2c
  24. #define PCI_DEVICE_ID_INTEL_SPT_SD 0x9d2d
  25. #define PCI_DEVICE_ID_INTEL_DNV_EMMC 0x19db
  26. #define PCI_DEVICE_ID_INTEL_BXT_SD 0x0aca
  27. #define PCI_DEVICE_ID_INTEL_BXT_EMMC 0x0acc
  28. #define PCI_DEVICE_ID_INTEL_BXT_SDIO 0x0ad0
  29. #define PCI_DEVICE_ID_INTEL_BXTM_SD 0x1aca
  30. #define PCI_DEVICE_ID_INTEL_BXTM_EMMC 0x1acc
  31. #define PCI_DEVICE_ID_INTEL_BXTM_SDIO 0x1ad0
  32. #define PCI_DEVICE_ID_INTEL_APL_SD 0x5aca
  33. #define PCI_DEVICE_ID_INTEL_APL_EMMC 0x5acc
  34. #define PCI_DEVICE_ID_INTEL_APL_SDIO 0x5ad0
  35. #define PCI_DEVICE_ID_INTEL_GLK_SD 0x31ca
  36. #define PCI_DEVICE_ID_INTEL_GLK_EMMC 0x31cc
  37. #define PCI_DEVICE_ID_INTEL_GLK_SDIO 0x31d0
  38. /*
  39. * PCI registers
  40. */
  41. #define PCI_SDHCI_IFPIO 0x00
  42. #define PCI_SDHCI_IFDMA 0x01
  43. #define PCI_SDHCI_IFVENDOR 0x02
  44. #define PCI_SLOT_INFO 0x40 /* 8 bits */
  45. #define PCI_SLOT_INFO_SLOTS(x) ((x >> 4) & 7)
  46. #define PCI_SLOT_INFO_FIRST_BAR_MASK 0x07
  47. #define MAX_SLOTS 8
  48. struct sdhci_pci_chip;
  49. struct sdhci_pci_slot;
  50. struct sdhci_pci_fixes {
  51. unsigned int quirks;
  52. unsigned int quirks2;
  53. bool allow_runtime_pm;
  54. bool own_cd_for_runtime_pm;
  55. int (*probe) (struct sdhci_pci_chip *);
  56. int (*probe_slot) (struct sdhci_pci_slot *);
  57. int (*add_host) (struct sdhci_pci_slot *);
  58. void (*remove_slot) (struct sdhci_pci_slot *, int);
  59. #ifdef CONFIG_PM_SLEEP
  60. int (*suspend) (struct sdhci_pci_chip *);
  61. int (*resume) (struct sdhci_pci_chip *);
  62. #endif
  63. #ifdef CONFIG_PM
  64. int (*runtime_suspend) (struct sdhci_pci_chip *);
  65. int (*runtime_resume) (struct sdhci_pci_chip *);
  66. #endif
  67. const struct sdhci_ops *ops;
  68. size_t priv_size;
  69. };
  70. struct sdhci_pci_slot {
  71. struct sdhci_pci_chip *chip;
  72. struct sdhci_host *host;
  73. struct sdhci_pci_data *data;
  74. int rst_n_gpio;
  75. int cd_gpio;
  76. int cd_irq;
  77. int cd_idx;
  78. bool cd_override_level;
  79. void (*hw_reset)(struct sdhci_host *host);
  80. unsigned long private[0] ____cacheline_aligned;
  81. };
  82. struct sdhci_pci_chip {
  83. struct pci_dev *pdev;
  84. unsigned int quirks;
  85. unsigned int quirks2;
  86. bool allow_runtime_pm;
  87. bool pm_retune;
  88. bool rpm_retune;
  89. const struct sdhci_pci_fixes *fixes;
  90. int num_slots; /* Slots on controller */
  91. struct sdhci_pci_slot *slots[MAX_SLOTS]; /* Pointers to host slots */
  92. };
  93. static inline void *sdhci_pci_priv(struct sdhci_pci_slot *slot)
  94. {
  95. return (void *)slot->private;
  96. }
  97. #ifdef CONFIG_PM_SLEEP
  98. int sdhci_pci_resume_host(struct sdhci_pci_chip *chip);
  99. #endif
  100. #endif /* __SDHCI_PCI_H */