xref: /openbmc/linux/drivers/net/wireless/ath/ath11k/ahb.h (revision 69ccee61)
1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
2 /*
3  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4  * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
5  */
6 #ifndef ATH11K_AHB_H
7 #define ATH11K_AHB_H
8 
9 #include "core.h"
10 
11 #define ATH11K_AHB_RECOVERY_TIMEOUT (3 * HZ)
12 
13 #define ATH11K_AHB_SMP2P_SMEM_MSG		GENMASK(15, 0)
14 #define ATH11K_AHB_SMP2P_SMEM_SEQ_NO		GENMASK(31, 16)
15 #define ATH11K_AHB_SMP2P_SMEM_VALUE_MASK	0xFFFFFFFF
16 
17 enum ath11k_ahb_smp2p_msg_id {
18 	ATH11K_AHB_POWER_SAVE_ENTER = 1,
19 	ATH11K_AHB_POWER_SAVE_EXIT,
20 };
21 
22 struct ath11k_base;
23 
24 struct ath11k_ahb {
25 	struct rproc *tgt_rproc;
26 	struct {
27 		struct device *dev;
28 		struct iommu_domain *iommu_domain;
29 		dma_addr_t msa_paddr;
30 		u32 msa_size;
31 		dma_addr_t ce_paddr;
32 		u32 ce_size;
33 		bool use_tz;
34 	} fw;
35 	struct {
36 		unsigned short seq_no;
37 		unsigned int smem_bit;
38 		struct qcom_smem_state *smem_state;
39 	} smp2p_info;
40 };
41 
ath11k_ahb_priv(struct ath11k_base * ab)42 static inline struct ath11k_ahb *ath11k_ahb_priv(struct ath11k_base *ab)
43 {
44 	return (struct ath11k_ahb *)ab->drv_priv;
45 }
46 #endif
47