Path: blob/main/sys/contrib/dev/athk/ath10k/swap.h
48375 views
/* SPDX-License-Identifier: ISC */1/*2* Copyright (c) 2015-2016 Qualcomm Atheros, Inc.3*/45#ifndef _SWAP_H_6#define _SWAP_H_78#define ATH10K_SWAP_CODE_SEG_BIN_LEN_MAX (512 * 1024)9#define ATH10K_SWAP_CODE_SEG_MAGIC_BYTES_SZ 1210#define ATH10K_SWAP_CODE_SEG_NUM_MAX 1611/* Currently only one swap segment is supported */12#define ATH10K_SWAP_CODE_SEG_NUM_SUPPORTED 11314struct ath10k_fw_file;1516struct ath10k_swap_code_seg_tlv {17__le32 address;18__le32 length;19u8 data[];20} __packed;2122struct ath10k_swap_code_seg_tail {23u8 magic_signature[ATH10K_SWAP_CODE_SEG_MAGIC_BYTES_SZ];24__le32 bmi_write_addr;25} __packed;2627union ath10k_swap_code_seg_item {28struct ath10k_swap_code_seg_tlv tlv;29struct ath10k_swap_code_seg_tail tail;30} __packed;3132struct ath10k_swap_code_seg_hw_info {33/* Swap binary image size */34__le32 swap_size;35__le32 num_segs;3637/* Swap data size */38__le32 size;39__le32 size_log2;40__le32 bus_addr[ATH10K_SWAP_CODE_SEG_NUM_MAX];41__le64 reserved[ATH10K_SWAP_CODE_SEG_NUM_MAX];42} __packed;4344struct ath10k_swap_code_seg_info {45struct ath10k_swap_code_seg_hw_info seg_hw_info;46void *virt_address[ATH10K_SWAP_CODE_SEG_NUM_SUPPORTED];47u32 target_addr;48dma_addr_t paddr[ATH10K_SWAP_CODE_SEG_NUM_SUPPORTED];49};5051int ath10k_swap_code_seg_configure(struct ath10k *ar,52const struct ath10k_fw_file *fw_file);53void ath10k_swap_code_seg_release(struct ath10k *ar,54struct ath10k_fw_file *fw_file);55int ath10k_swap_code_seg_init(struct ath10k *ar,56struct ath10k_fw_file *fw_file);5758#endif596061