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