1 /******************************************************************************
2 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
4 * Based on the r8180 driver, which is:
5 * Copyright 2004-2005 Andrea Merello <andreamrl@tiscali.it>, et al.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 * The full GNU General Public License is included in this distribution in the
20 * file called LICENSE.
22 * Contact Information:
23 * wlanfae <wlanfae@realtek.com>
24 ******************************************************************************/
29 #define EFUSE_FOR_92SU 1
31 #define EFUSE_MAC_LEN 0x200
32 #define EFUSE_REAL_CONTENT_LEN 512
33 #define EFUSE_MAP_LEN 128
34 #define EFUSE_MAX_SECTION 16
35 #define EFUSE_MAX_WORD_UNIT 4
37 #define EFUSE_INIT_MAP 0
38 #define EFUSE_MODIFY_MAP 1
40 #define EFUSE_CLK_CTRL EFUSE_CTRL
41 #define EFUSE_BIT(x) (1 << (x))
43 #define PG_STATE_HEADER 0x01
44 #define PG_STATE_WORD_0 0x02
45 #define PG_STATE_WORD_1 0x04
46 #define PG_STATE_WORD_2 0x08
47 #define PG_STATE_WORD_3 0x10
48 #define PG_STATE_DATA 0x20
50 #define PG_SWBYTE_H 0x01
51 #define PG_SWBYTE_L 0x02
54 EFUSE_Initialize(struct net_device* dev);
56 EFUSE_Read1Byte(struct net_device* dev,u16 Address);
58 EFUSE_Write1Byte(struct net_device* dev,u16 Address,u8 Value);
62 ReadEFuse(struct net_device* dev,u16 _offset,u16 _size_byte,u8* pbuf);
64 ReadEFuseByte(struct net_device* dev,u16 _offset,u8 *pbuf);
68 EFUSE_ShadowRead(struct net_device* dev,unsigned char Type,unsigned short Offset,u32 *Value);
70 EFUSE_ShadowWrite(struct net_device* dev,unsigned char Type,unsigned short Offset,u32 Value);
72 EFUSE_ShadowUpdate(struct net_device* dev);
74 EFUSE_ShadowMapUpdate(struct net_device* dev);
77 EFUSE_ProgramMap(struct net_device* dev,char* pFileName, u8 TableType); // 0=Shadow 1=Real Efuse