| 1 |
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ |
| 2 |
/* Copyright(c) 2019-2020 Realtek Corporation |
| 3 |
*/ |
| 4 |
|
| 5 |
#ifndef __RTW89_EFUSE_H__ |
| 6 |
#define __RTW89_EFUSE_H__ |
| 7 |
|
| 8 |
#include "core.h" |
| 9 |
|
| 10 |
#define RTW89_EFUSE_BLOCK_ID_MASK GENMASK(31, 16) |
| 11 |
#define RTW89_EFUSE_BLOCK_SIZE_MASK GENMASK(15, 0) |
| 12 |
#define RTW89_EFUSE_MAX_BLOCK_SIZE 0x10000 |
| 13 |
|
| 14 |
#define EF_FV_OFSET 0x5EA |
| 15 |
#define EF_FV_OFSET_BE_V1 0x17CA |
| 16 |
#define EF_CV_MASK GENMASK(7, 4) |
| 17 |
#define EF_CV_INV 15 |
| 18 |
|
| 19 |
struct rtw89_efuse_block_cfg { |
| 20 |
u32 offset; |
| 21 |
u32 size; |
| 22 |
}; |
| 23 |
|
| 24 |
int rtw89_parse_efuse_map_ax(struct rtw89_dev *rtwdev); |
| 25 |
int rtw89_parse_phycap_map_ax(struct rtw89_dev *rtwdev); |
| 26 |
int rtw89_cnv_efuse_state_ax(struct rtw89_dev *rtwdev, bool idle); |
| 27 |
int rtw89_parse_efuse_map_be(struct rtw89_dev *rtwdev); |
| 28 |
int rtw89_parse_phycap_map_be(struct rtw89_dev *rtwdev); |
| 29 |
int rtw89_cnv_efuse_state_be(struct rtw89_dev *rtwdev, bool idle); |
| 30 |
int rtw89_read_efuse_ver(struct rtw89_dev *rtwdev, u8 *efv); |
| 31 |
int rtw89_efuse_recognize_mss_info_v1(struct rtw89_dev *rtwdev, u8 b1, u8 b2); |
| 32 |
int rtw89_efuse_read_fw_secure_ax(struct rtw89_dev *rtwdev); |
| 33 |
int rtw89_efuse_read_fw_secure_be(struct rtw89_dev *rtwdev); |
| 34 |
int rtw89_efuse_read_ecv_be(struct rtw89_dev *rtwdev); |
| 35 |
|
| 36 |
#endif |