Path: blob/main/sys/contrib/dev/athk/ath11k/pci.h
107769 views
/* SPDX-License-Identifier: BSD-3-Clause-Clear */1/*2* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.3* Copyright (c) 2021-2022,2024 Qualcomm Innovation Center, Inc. All rights reserved.4*/5#ifndef _ATH11K_PCI_H6#define _ATH11K_PCI_H78#include <linux/mhi.h>910#include "core.h"1112#define PCIE_SOC_GLOBAL_RESET 0x300813#define PCIE_SOC_GLOBAL_RESET_V 11415#define WLAON_WARM_SW_ENTRY 0x1f8050416#define WLAON_SOC_RESET_CAUSE_REG 0x01f8060c1718#define PCIE_Q6_COOKIE_ADDR 0x01f8050019#define PCIE_Q6_COOKIE_DATA 0xc00000002021/* register to wake the UMAC from power collapse */22#define PCIE_SCRATCH_0_SOC_PCIE_REG 0x40402324/* register used for handshake mechanism to validate UMAC is awake */25#define PCIE_SOC_WAKE_PCIE_LOCAL_REG 0x30042627#define PCIE_PCIE_PARF_LTSSM 0x1e081b028#define PARM_LTSSM_VALUE 0x1112930#define GCC_GCC_PCIE_HOT_RST 0x1e402bc31#define GCC_GCC_PCIE_HOT_RST_VAL 0x103233#define PCIE_PCIE_INT_ALL_CLEAR 0x1e0822834#define PCIE_SMLH_REQ_RST_LINK_DOWN 0x235#define PCIE_INT_CLEAR_ALL 0xffffffff3637#define PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG(x) \38(ab->hw_params.regs->pcie_qserdes_sysclk_en_sel)39#define PCIE_QSERDES_COM_SYSCLK_EN_SEL_VAL 0x1040#define PCIE_QSERDES_COM_SYSCLK_EN_SEL_MSK 0xffffffff41#define PCIE_PCS_OSC_DTCT_CONFIG1_REG(x) \42(ab->hw_params.regs->pcie_pcs_osc_dtct_config_base)43#define PCIE_PCS_OSC_DTCT_CONFIG1_VAL 0x0244#define PCIE_PCS_OSC_DTCT_CONFIG2_REG(x) \45(ab->hw_params.regs->pcie_pcs_osc_dtct_config_base + 0x4)46#define PCIE_PCS_OSC_DTCT_CONFIG2_VAL 0x5247#define PCIE_PCS_OSC_DTCT_CONFIG4_REG(x) \48(ab->hw_params.regs->pcie_pcs_osc_dtct_config_base + 0xc)49#define PCIE_PCS_OSC_DTCT_CONFIG4_VAL 0xff50#define PCIE_PCS_OSC_DTCT_CONFIG_MSK 0x000000ff5152#define WLAON_QFPROM_PWR_CTRL_REG 0x01f8031c53#define QFPROM_PWR_CTRL_VDD4BLOW_MASK 0x45455enum ath11k_pci_flags {56ATH11K_PCI_ASPM_RESTORE,57};5859struct ath11k_pci {60struct pci_dev *pdev;61struct ath11k_base *ab;62u16 dev_id;63char amss_path[100];64struct mhi_controller *mhi_ctrl;65const struct ath11k_msi_config *msi_config;66enum mhi_callback mhi_pre_cb;67u32 register_window;6869/* protects register_window above */70spinlock_t window_lock;7172/* enum ath11k_pci_flags */73unsigned long flags;74u16 link_ctl;75u64 dma_mask;76};7778static inline struct ath11k_pci *ath11k_pci_priv(struct ath11k_base *ab)79{80return (struct ath11k_pci *)ab->drv_priv;81}8283int ath11k_pci_get_msi_irq(struct ath11k_base *ab, unsigned int vector);84#endif858687