xref: /linux/drivers/net/wireless/ath/ath10k/snoc.h (revision 9a6b55ac)
1 /* SPDX-License-Identifier: ISC */
2 /*
3  * Copyright (c) 2018 The Linux Foundation. All rights reserved.
4  */
5 
6 #ifndef _SNOC_H_
7 #define _SNOC_H_
8 
9 #include "hw.h"
10 #include "ce.h"
11 #include "qmi.h"
12 
13 struct ath10k_snoc_drv_priv {
14 	enum ath10k_hw_rev hw_rev;
15 	u64 dma_mask;
16 	u32 msa_size;
17 };
18 
19 struct snoc_state {
20 	u32 pipe_cfg_addr;
21 	u32 svc_to_pipe_map;
22 };
23 
24 struct ath10k_snoc_pipe {
25 	struct ath10k_ce_pipe *ce_hdl;
26 	u8 pipe_num;
27 	struct ath10k *hif_ce_state;
28 	size_t buf_sz;
29 	/* protect ce info */
30 	spinlock_t pipe_lock;
31 	struct ath10k_snoc *ar_snoc;
32 };
33 
34 struct ath10k_snoc_target_info {
35 	u32 target_version;
36 	u32 target_type;
37 	u32 target_revision;
38 	u32 soc_version;
39 };
40 
41 struct ath10k_snoc_ce_irq {
42 	u32 irq_line;
43 };
44 
45 enum ath10k_snoc_flags {
46 	ATH10K_SNOC_FLAG_REGISTERED,
47 	ATH10K_SNOC_FLAG_UNREGISTERING,
48 	ATH10K_SNOC_FLAG_RECOVERY,
49 	ATH10K_SNOC_FLAG_8BIT_HOST_CAP_QUIRK,
50 };
51 
52 struct clk_bulk_data;
53 struct regulator_bulk_data;
54 
55 struct ath10k_snoc {
56 	struct platform_device *dev;
57 	struct ath10k *ar;
58 	void __iomem *mem;
59 	dma_addr_t mem_pa;
60 	struct ath10k_snoc_target_info target_info;
61 	size_t mem_len;
62 	struct ath10k_snoc_pipe pipe_info[CE_COUNT_MAX];
63 	struct ath10k_snoc_ce_irq ce_irqs[CE_COUNT_MAX];
64 	struct ath10k_ce ce;
65 	struct timer_list rx_post_retry;
66 	struct regulator_bulk_data *vregs;
67 	size_t num_vregs;
68 	struct clk_bulk_data *clks;
69 	size_t num_clks;
70 	struct ath10k_qmi *qmi;
71 	unsigned long flags;
72 	bool xo_cal_supported;
73 	u32 xo_cal_data;
74 };
75 
76 static inline struct ath10k_snoc *ath10k_snoc_priv(struct ath10k *ar)
77 {
78 	return (struct ath10k_snoc *)ar->drv_priv;
79 }
80 
81 int ath10k_snoc_fw_indication(struct ath10k *ar, u64 type);
82 void ath10k_snoc_fw_crashed_dump(struct ath10k *ar);
83 
84 #endif /* _SNOC_H_ */
85