1 /******************************************************************************
3 * Copyright(c) 2009-2012 Realtek Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * The full GNU General Public License is included in this distribution in the
15 * file called LICENSE.
17 * Contact Information:
18 * wlanfae <wlanfae@realtek.com>
19 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20 * Hsinchu 300, Taiwan.
22 * Larry Finger <Larry.Finger@lwfinger.net>
24 *****************************************************************************/
26 #ifndef __RTL_EFUSE_H_
27 #define __RTL_EFUSE_H_
29 #define EFUSE_IC_ID_OFFSET 506
31 #define EFUSE_MAX_WORD_UNIT 4
33 #define EFUSE_INIT_MAP 0
34 #define EFUSE_MODIFY_MAP 1
36 #define PG_STATE_HEADER 0x01
37 #define PG_STATE_WORD_0 0x02
38 #define PG_STATE_WORD_1 0x04
39 #define PG_STATE_WORD_2 0x08
40 #define PG_STATE_WORD_3 0x10
41 #define PG_STATE_DATA 0x20
43 #define PG_SWBYTE_H 0x01
44 #define PG_SWBYTE_L 0x02
46 #define _POWERON_DELAY_
47 #define _PRE_EXECUTE_READ_CMD_
49 #define EFUSE_REPEAT_THRESHOLD_ 3
50 #define EFUSE_ERROE_HANDLE 1
65 enum efuse_data_item
{
102 void read_efuse_byte(struct ieee80211_hw
*hw
, u16 _offset
, u8
*pbuf
);
103 void efuse_initialize(struct ieee80211_hw
*hw
);
104 u8
efuse_read_1byte(struct ieee80211_hw
*hw
, u16 address
);
105 int efuse_one_byte_read(struct ieee80211_hw
*hw
, u16 addr
, u8
*data
);
106 void efuse_write_1byte(struct ieee80211_hw
*hw
, u16 address
, u8 value
);
107 void read_efuse(struct ieee80211_hw
*hw
, u16 _offset
,
108 u16 _size_byte
, u8
*pbuf
);
109 void efuse_shadow_read(struct ieee80211_hw
*hw
, u8 type
,
110 u16 offset
, u32
*value
);
111 void efuse_shadow_write(struct ieee80211_hw
*hw
, u8 type
,
112 u16 offset
, u32 value
);
113 bool efuse_shadow_update(struct ieee80211_hw
*hw
);
114 bool efuse_shadow_update_chk(struct ieee80211_hw
*hw
);
115 void rtl_efuse_shadow_map_update(struct ieee80211_hw
*hw
);
116 void efuse_force_write_vendor_Id(struct ieee80211_hw
*hw
);
117 void efuse_re_pg_section(struct ieee80211_hw
*hw
, u8 section_idx
);