Commit 5cc86f28 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman

Staging: rt2870: add eFuse support

rt3070:
* remove unused bEEPROMFile field from RTMP_ADAPTER

rt2870:
* propagate eFuse support from rt3070
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 30d36c28
...@@ -291,8 +291,7 @@ VOID RTMP_EEPROM_WRITE16( ...@@ -291,8 +291,7 @@ VOID RTMP_EEPROM_WRITE16(
#endif #endif
} }
//2008/09/11:KH add to support efuse<-- #ifdef RT2870
#ifdef RT30xx
/* /*
======================================================================== ========================================================================
...@@ -1485,6 +1484,4 @@ NTSTATUS eFuseWriteRegistersFromBin( ...@@ -1485,6 +1484,4 @@ NTSTATUS eFuseWriteRegistersFromBin(
return TRUE; return TRUE;
} }
#endif
#endif // RT30xx //
//2008/09/11:KH add to support efuse-->
...@@ -2186,10 +2186,8 @@ NDIS_STATUS NICInitializeAsic( ...@@ -2186,10 +2186,8 @@ NDIS_STATUS NICInitializeAsic(
UINT32 MacCsr0 = 0; UINT32 MacCsr0 = 0;
NTSTATUS Status; NTSTATUS Status;
UCHAR Value = 0xff; UCHAR Value = 0xff;
#endif // RT2870 //
#ifdef RT30xx
UINT32 eFuseCtrl; UINT32 eFuseCtrl;
#endif // RT30xx // #endif
USHORT KeyIdx; USHORT KeyIdx;
INT i,apidx; INT i,apidx;
...@@ -2501,8 +2499,7 @@ NDIS_STATUS NICInitializeAsic( ...@@ -2501,8 +2499,7 @@ NDIS_STATUS NICInitializeAsic(
Counter&=0xffffff00; Counter&=0xffffff00;
Counter|=0x000001e; Counter|=0x000001e;
RTMP_IO_WRITE32(pAd, USB_CYC_CFG, Counter); RTMP_IO_WRITE32(pAd, USB_CYC_CFG, Counter);
#endif // RT2870 //
#ifdef RT30xx
pAd->bUseEfuse=FALSE; pAd->bUseEfuse=FALSE;
RTMP_IO_READ32(pAd, EFUSE_CTRL, &eFuseCtrl); RTMP_IO_READ32(pAd, EFUSE_CTRL, &eFuseCtrl);
pAd->bUseEfuse = ( (eFuseCtrl & 0x80000000) == 0x80000000) ? 1 : 0; pAd->bUseEfuse = ( (eFuseCtrl & 0x80000000) == 0x80000000) ? 1 : 0;
...@@ -2513,9 +2510,8 @@ NDIS_STATUS NICInitializeAsic( ...@@ -2513,9 +2510,8 @@ NDIS_STATUS NICInitializeAsic(
else else
{ {
DBGPRINT(RT_DEBUG_TRACE, ("NVM is EEPROM\n")); DBGPRINT(RT_DEBUG_TRACE, ("NVM is EEPROM\n"));
} }
#endif // RT30xx // #endif
{ {
// for rt2860E and after, init TXOP_CTRL_CFG with 0x583f. This is for extension channel overlapping IOT. // for rt2860E and after, init TXOP_CTRL_CFG with 0x583f. This is for extension channel overlapping IOT.
......
...@@ -2938,12 +2938,9 @@ typedef struct _RTMP_ADAPTER ...@@ -2938,12 +2938,9 @@ typedef struct _RTMP_ADAPTER
UINT8 PM_FlgSuspend; UINT8 PM_FlgSuspend;
#ifdef RT30xx #ifdef RT2870
//======efuse
BOOLEAN bUseEfuse; BOOLEAN bUseEfuse;
BOOLEAN bEEPROMFile; #endif
#endif // RT30xx //
} RTMP_ADAPTER, *PRTMP_ADAPTER; } RTMP_ADAPTER, *PRTMP_ADAPTER;
// //
......
...@@ -229,13 +229,11 @@ static struct { ...@@ -229,13 +229,11 @@ static struct {
{"ForceGF", Set_ForceGF_Proc}, {"ForceGF", Set_ForceGF_Proc},
{"LongRetry", Set_LongRetryLimit_Proc}, {"LongRetry", Set_LongRetryLimit_Proc},
{"ShortRetry", Set_ShortRetryLimit_Proc}, {"ShortRetry", Set_ShortRetryLimit_Proc},
//2008/09/11:KH add to support efuse<-- #ifdef RT2870
#ifdef RT30xx
{"efuseFreeNumber", set_eFuseGetFreeBlockCount_Proc}, {"efuseFreeNumber", set_eFuseGetFreeBlockCount_Proc},
{"efuseDump", set_eFusedump_Proc}, {"efuseDump", set_eFusedump_Proc},
{"efuseLoadFromBin", set_eFuseLoadFromBin_Proc}, {"efuseLoadFromBin", set_eFuseLoadFromBin_Proc},
#endif // RT30xx // #endif
//2008/09/11:KH add to support efuse-->
{NULL,} {NULL,}
}; };
......
...@@ -803,13 +803,9 @@ NTSTATUS RTUSBReadEEPROM( ...@@ -803,13 +803,9 @@ NTSTATUS RTUSBReadEEPROM(
{ {
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
#ifdef RT30xx
if(pAd->bUseEfuse) if(pAd->bUseEfuse)
{
Status =eFuseRead(pAd, Offset, pData, length); Status =eFuseRead(pAd, Offset, pData, length);
}
else else
#endif // RT30xx //
{ {
Status = RTUSB_VendorRequest( Status = RTUSB_VendorRequest(
pAd, pAd,
...@@ -848,13 +844,9 @@ NTSTATUS RTUSBWriteEEPROM( ...@@ -848,13 +844,9 @@ NTSTATUS RTUSBWriteEEPROM(
{ {
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
#ifdef RT30xx
if(pAd->bUseEfuse) if(pAd->bUseEfuse)
{
Status = eFuseWrite(pAd, Offset, pData, length); Status = eFuseWrite(pAd, Offset, pData, length);
}
else else
#endif // RT30xx //
{ {
Status = RTUSB_VendorRequest( Status = RTUSB_VendorRequest(
pAd, pAd,
......
...@@ -135,7 +135,6 @@ typedef struct _MGMT_STRUC { ...@@ -135,7 +135,6 @@ typedef struct _MGMT_STRUC {
/* ----------------- EEPROM Related MACRO ----------------- */ /* ----------------- EEPROM Related MACRO ----------------- */
#ifdef RT30xx
#define RT28xx_EEPROM_READ16(pAd, offset, var) \ #define RT28xx_EEPROM_READ16(pAd, offset, var) \
do { \ do { \
RTUSBReadEEPROM(pAd, offset, (PUCHAR)&(var), 2); \ RTUSBReadEEPROM(pAd, offset, (PUCHAR)&(var), 2); \
...@@ -150,21 +149,6 @@ typedef struct _MGMT_STRUC { ...@@ -150,21 +149,6 @@ typedef struct _MGMT_STRUC {
_tmpVar = cpu2le16(var); \ _tmpVar = cpu2le16(var); \
RTUSBWriteEEPROM(pAd, offset, (PUCHAR)&(_tmpVar), 2); \ RTUSBWriteEEPROM(pAd, offset, (PUCHAR)&(_tmpVar), 2); \
}while(0) }while(0)
#endif // RT30xx //
#ifndef RT30xx
#define RT28xx_EEPROM_READ16(pAd, offset, var) \
do { \
RTUSBReadEEPROM(pAd, offset, (PUCHAR)&(var), 2); \
var = le2cpu16(var); \
}while(0)
#define RT28xx_EEPROM_WRITE16(pAd, offset, var) \
do{ \
USHORT _tmpVar; \
_tmpVar = cpu2le16(var); \
RTUSBWriteEEPROM(pAd, offset, (PUCHAR)&(_tmpVar), 2); \
}while(0)
#endif // RT30xx //
/* ----------------- TASK/THREAD Related MACRO ----------------- */ /* ----------------- TASK/THREAD Related MACRO ----------------- */
#define RT28XX_TASK_THREAD_INIT(pAd, Status) \ #define RT28XX_TASK_THREAD_INIT(pAd, Status) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment