pci.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* SPDX-License-Identifier: BSD-3-Clause-Clear */
  2. /*
  3. * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _ATH11K_PCI_H
  7. #define _ATH11K_PCI_H
  8. #include <linux/mhi.h>
  9. #include "core.h"
  10. #define PCIE_SOC_GLOBAL_RESET 0x3008
  11. #define PCIE_SOC_GLOBAL_RESET_V 1
  12. #define WLAON_WARM_SW_ENTRY 0x1f80504
  13. #define WLAON_SOC_RESET_CAUSE_REG 0x01f8060c
  14. #define PCIE_Q6_COOKIE_ADDR 0x01f80500
  15. #define PCIE_Q6_COOKIE_DATA 0xc0000000
  16. /* register to wake the UMAC from power collapse */
  17. #define PCIE_SCRATCH_0_SOC_PCIE_REG 0x4040
  18. /* register used for handshake mechanism to validate UMAC is awake */
  19. #define PCIE_SOC_WAKE_PCIE_LOCAL_REG 0x3004
  20. #define PCIE_PCIE_PARF_LTSSM 0x1e081b0
  21. #define PARM_LTSSM_VALUE 0x111
  22. #define GCC_GCC_PCIE_HOT_RST 0x1e402bc
  23. #define GCC_GCC_PCIE_HOT_RST_VAL 0x10
  24. #define PCIE_PCIE_INT_ALL_CLEAR 0x1e08228
  25. #define PCIE_SMLH_REQ_RST_LINK_DOWN 0x2
  26. #define PCIE_INT_CLEAR_ALL 0xffffffff
  27. #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG(x) \
  28. (ab->hw_params.regs->pcie_qserdes_sysclk_en_sel)
  29. #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_VAL 0x10
  30. #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_MSK 0xffffffff
  31. #define PCIE_PCS_OSC_DTCT_CONFIG1_REG(x) \
  32. (ab->hw_params.regs->pcie_pcs_osc_dtct_config_base)
  33. #define PCIE_PCS_OSC_DTCT_CONFIG1_VAL 0x02
  34. #define PCIE_PCS_OSC_DTCT_CONFIG2_REG(x) \
  35. (ab->hw_params.regs->pcie_pcs_osc_dtct_config_base + 0x4)
  36. #define PCIE_PCS_OSC_DTCT_CONFIG2_VAL 0x52
  37. #define PCIE_PCS_OSC_DTCT_CONFIG4_REG(x) \
  38. (ab->hw_params.regs->pcie_pcs_osc_dtct_config_base + 0xc)
  39. #define PCIE_PCS_OSC_DTCT_CONFIG4_VAL 0xff
  40. #define PCIE_PCS_OSC_DTCT_CONFIG_MSK 0x000000ff
  41. #define WLAON_QFPROM_PWR_CTRL_REG 0x01f8031c
  42. #define QFPROM_PWR_CTRL_VDD4BLOW_MASK 0x4
  43. enum ath11k_pci_flags {
  44. ATH11K_PCI_ASPM_RESTORE,
  45. };
  46. struct ath11k_pci {
  47. struct pci_dev *pdev;
  48. struct ath11k_base *ab;
  49. u16 dev_id;
  50. char amss_path[100];
  51. struct mhi_controller *mhi_ctrl;
  52. const struct ath11k_msi_config *msi_config;
  53. u32 register_window;
  54. /* protects register_window above */
  55. spinlock_t window_lock;
  56. /* enum ath11k_pci_flags */
  57. unsigned long flags;
  58. u16 link_ctl;
  59. };
  60. static inline struct ath11k_pci *ath11k_pci_priv(struct ath11k_base *ab)
  61. {
  62. return (struct ath11k_pci *)ab->drv_priv;
  63. }
  64. int ath11k_pci_get_msi_irq(struct ath11k_base *ab, unsigned int vector);
  65. #endif