1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
4 * Copyright(c) 2009-2012 Realtek Corporation.
8 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
13 *****************************************************************************/
15 #ifndef __RTL_EFUSE_H_
16 #define __RTL_EFUSE_H_
18 #define EFUSE_IC_ID_OFFSET 506
20 #define EFUSE_MAX_WORD_UNIT 4
22 #define EFUSE_INIT_MAP 0
23 #define EFUSE_MODIFY_MAP 1
25 #define PG_STATE_HEADER 0x01
26 #define PG_STATE_WORD_0 0x02
27 #define PG_STATE_WORD_1 0x04
28 #define PG_STATE_WORD_2 0x08
29 #define PG_STATE_WORD_3 0x10
30 #define PG_STATE_DATA 0x20
32 #define EFUSE_REPEAT_THRESHOLD_ 3
33 #define EFUSE_ERROE_HANDLE 1
48 enum efuse_data_item {
85 void read_efuse_byte(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf);
86 void efuse_initialize(struct ieee80211_hw *hw);
87 u8 efuse_read_1byte(struct ieee80211_hw *hw, u16 address);
88 int efuse_one_byte_read(struct ieee80211_hw *hw, u16 addr, u8 *data);
89 void efuse_write_1byte(struct ieee80211_hw *hw, u16 address, u8 value);
90 void read_efuse(struct ieee80211_hw *hw, u16 _offset,
91 u16 _size_byte, u8 *pbuf);
92 void efuse_shadow_read(struct ieee80211_hw *hw, u8 type,
93 u16 offset, u32 *value);
94 void efuse_shadow_write(struct ieee80211_hw *hw, u8 type,
95 u16 offset, u32 value);
96 bool efuse_shadow_update(struct ieee80211_hw *hw);
97 bool efuse_shadow_update_chk(struct ieee80211_hw *hw);
98 void rtl_efuse_shadow_map_update(struct ieee80211_hw *hw);
99 void efuse_force_write_vendor_id(struct ieee80211_hw *hw);
100 void efuse_re_pg_section(struct ieee80211_hw *hw, u8 section_idx);
101 void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate);
102 int rtl_get_hwinfo(struct ieee80211_hw *hw, struct rtl_priv *rtlpriv,
103 int max_size, u8 *hwinfo, int *params);
104 void rtl_fill_dummy(u8 *pfwbuf, u32 *pfwlen);
105 void rtl_fw_page_write(struct ieee80211_hw *hw, u32 page, const u8 *buffer,
107 void rtl_fw_block_write(struct ieee80211_hw *hw, const u8 *buffer, u32 size);