Skip to content

Commit

Permalink
modify S25FL512S smart update issue
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jun 25, 2018
1 parent b619552 commit 40bb62e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 25 deletions.
23 changes: 2 additions & 21 deletions ChipInfoDb.dedicfg
Original file line number Diff line number Diff line change
Expand Up @@ -2804,6 +2804,7 @@
AddrWidth="4"
IDNumber="3"
RDIDCommand="0x9F"/>

<Chip TypeName="S25FL512Sxxxxxx1x(Secure)"
Class="S25FLxxx_Large"
UniqueID="0x010220"
Expand All @@ -2812,27 +2813,7 @@
ManufactureUrl="www.spansion.com"
Voltage="3.3V"
Clock="104MHz"
Timeout="480"
ManufactureID="0x01"
JedecDeviceID="0x010220"
ChipSizeInKByte="65536"
SectorSizeInByte="262144"
PageSizeInByte="512"
VppSupport="0"
ProgramIOMethod="SPQD_RQWSW"
AddrWidth="4"
IDNumber="3"
RDIDCommand="0x9F"/>
<Chip TypeName="S25FL512Sxxxxxx1x(Secure)"
Class="S25FLxxx_Large"
UniqueID="0x010220"
Description="512 Megabit CMOS 3.0 Volt Flash Memory with 104-MHz SPI Bus"
Manufacturer="Spansion"
ManufactureUrl="www.spansion.com"
Voltage="3.3V"
Clock="104MHz"
Timeout="480"

Timeout="480"
ManufactureID="0x01"
JedecDeviceID="0x010220"
ChipSizeInKByte="65536"
Expand Down
48 changes: 45 additions & 3 deletions SerialFlash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,46 @@ bool CN25Qxxx_MutipleDIe_LargeWREAR(unsigned char cSR, int Index)
FlashCommand_TransceiveOut(v,2,false,Index);
return true;
}


bool CS25FLxx_LargeEnable4ByteAddrMode(bool Enable4Byte,int Index)
{
if((strstr(Chip_Info.TypeName,"S25FL512Sxxxxxx1x")!=NULL)||
(strstr(Chip_Info.TypeName,"S25FL512Sxxxxxx1x(Secure)")!=NULL))
{
SerialFlash_waitForWEL(Index);
if(Enable4Byte)
{
unsigned char v[2];
v[0]=0x17;
v[1]=0x80;
FlashCommand_TransceiveOut(&v,2,false,Index);
}
else
{
unsigned char v[2];
v[0]=0x17;
v[1]=0x00;
FlashCommand_TransceiveOut(&v,2,false,Index);
}
}
else
{
if(Enable4Byte)
{
unsigned char v= EN4B;
FlashCommand_TransceiveOut(&v,1,false,Index);
return true;
}
else
{
unsigned char v= EXIT4B;
FlashCommand_TransceiveOut(&v,1,false,Index);
return true;
}
}
return true;

}
bool CN25Qxxx_LargeEnable4ByteAddrMode(bool Enable4Byte,int Index)
{
#if 0
Expand Down Expand Up @@ -1644,13 +1683,16 @@ int S70FSxxx_Large_Enable4ByteAddrMode(int Enable4Byte,int Index)
//Simon: unused ???
int SerialFlash_Enable4ByteAddrMode(int bEnable,int Index)
{
if(strstr(Chip_Info.Class,SUPPORT_EON_EN25QHxx_Large) != NULL || strstr(Chip_Info.Class,SUPPORT_MACRONIX_MX25Lxxx_Large) != NULL
|| strstr(Chip_Info.Class,SUPPORT_WINBOND_W25Pxx_Large) != NULL)
if(strstr(Chip_Info.Class,SUPPORT_EON_EN25QHxx_Large) != NULL ||
strstr(Chip_Info.Class,SUPPORT_MACRONIX_MX25Lxxx_Large) != NULL ||
strstr(Chip_Info.Class,SUPPORT_WINBOND_W25Pxx_Large) != NULL)
return CEN25QHxx_LargeEnable4ByteAddrMode(bEnable,Index);
else if(strstr(Chip_Info.Class,SUPPORT_SPANSION_S70FSxx_Large)!= NULL)
return S70FSxxx_Large_Enable4ByteAddrMode(bEnable,Index);
else if(strstr(Chip_Info.Class,SUPPORT_NUMONYX_N25Qxxx_Large) != NULL)
return CN25Qxxx_LargeEnable4ByteAddrMode(bEnable, Index);
else if(strstr(Chip_Info.Class,SUPPORT_SPANSION_S25FLxx_Large)!=NULL)
return CS25FLxx_LargeEnable4ByteAddrMode(bEnable, Index);
return SerialFlash_TRUE;
}

Expand Down
2 changes: 1 addition & 1 deletion SerialFlash.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ bool CN25Qxxx_Large_doRDVCR(unsigned char *ucVCR,int Index);
bool CN25Qxxx_Large_doWRVCR(unsigned char ucVCR,int Index);
bool CN25Qxxx_Large_doRDENVCR(unsigned char *ucENVCR,int Index);
bool CN25Qxxx_Large_doWRENVCR(unsigned char ucENVCR,int Index);

bool CS25FLxx_LargeEnable4ByteAddrMode(bool Enable4Byte,int Index);
size_t GetChipSize(void);
size_t GetPageSize(void);
bool SerialFlash_StartofOperation(int Index);
Expand Down

0 comments on commit 40bb62e

Please sign in to comment.