Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
0002 /*
0003  * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
0004  * Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc. All rights reserved.
0005  */
0006 #ifndef _ATH11K_PCI_H
0007 #define _ATH11K_PCI_H
0008 
0009 #include <linux/mhi.h>
0010 
0011 #include "core.h"
0012 
0013 #define PCIE_SOC_GLOBAL_RESET           0x3008
0014 #define PCIE_SOC_GLOBAL_RESET_V         1
0015 
0016 #define WLAON_WARM_SW_ENTRY         0x1f80504
0017 #define WLAON_SOC_RESET_CAUSE_REG       0x01f8060c
0018 
0019 #define PCIE_Q6_COOKIE_ADDR         0x01f80500
0020 #define PCIE_Q6_COOKIE_DATA         0xc0000000
0021 
0022 /* register to wake the UMAC from power collapse */
0023 #define PCIE_SCRATCH_0_SOC_PCIE_REG     0x4040
0024 
0025 /* register used for handshake mechanism to validate UMAC is awake */
0026 #define PCIE_SOC_WAKE_PCIE_LOCAL_REG        0x3004
0027 
0028 #define PCIE_PCIE_PARF_LTSSM            0x1e081b0
0029 #define PARM_LTSSM_VALUE            0x111
0030 
0031 #define GCC_GCC_PCIE_HOT_RST            0x1e402bc
0032 #define GCC_GCC_PCIE_HOT_RST_VAL        0x10
0033 
0034 #define PCIE_PCIE_INT_ALL_CLEAR         0x1e08228
0035 #define PCIE_SMLH_REQ_RST_LINK_DOWN     0x2
0036 #define PCIE_INT_CLEAR_ALL          0xffffffff
0037 
0038 #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG(x) \
0039         (ab->hw_params.regs->pcie_qserdes_sysclk_en_sel)
0040 #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_VAL  0x10
0041 #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_MSK  0xffffffff
0042 #define PCIE_PCS_OSC_DTCT_CONFIG1_REG(x) \
0043         (ab->hw_params.regs->pcie_pcs_osc_dtct_config_base)
0044 #define PCIE_PCS_OSC_DTCT_CONFIG1_VAL       0x02
0045 #define PCIE_PCS_OSC_DTCT_CONFIG2_REG(x) \
0046         (ab->hw_params.regs->pcie_pcs_osc_dtct_config_base + 0x4)
0047 #define PCIE_PCS_OSC_DTCT_CONFIG2_VAL       0x52
0048 #define PCIE_PCS_OSC_DTCT_CONFIG4_REG(x) \
0049         (ab->hw_params.regs->pcie_pcs_osc_dtct_config_base + 0xc)
0050 #define PCIE_PCS_OSC_DTCT_CONFIG4_VAL       0xff
0051 #define PCIE_PCS_OSC_DTCT_CONFIG_MSK        0x000000ff
0052 
0053 #define WLAON_QFPROM_PWR_CTRL_REG       0x01f8031c
0054 #define QFPROM_PWR_CTRL_VDD4BLOW_MASK       0x4
0055 
0056 enum ath11k_pci_flags {
0057     ATH11K_PCI_ASPM_RESTORE,
0058 };
0059 
0060 struct ath11k_pci {
0061     struct pci_dev *pdev;
0062     struct ath11k_base *ab;
0063     u16 dev_id;
0064     char amss_path[100];
0065     struct mhi_controller *mhi_ctrl;
0066     const struct ath11k_msi_config *msi_config;
0067     u32 register_window;
0068 
0069     /* protects register_window above */
0070     spinlock_t window_lock;
0071 
0072     /* enum ath11k_pci_flags */
0073     unsigned long flags;
0074     u16 link_ctl;
0075 };
0076 
0077 static inline struct ath11k_pci *ath11k_pci_priv(struct ath11k_base *ab)
0078 {
0079     return (struct ath11k_pci *)ab->drv_priv;
0080 }
0081 
0082 int ath11k_pci_get_msi_irq(struct ath11k_base *ab, unsigned int vector);
0083 #endif