[U-Boot-Users] about "flash extend data"
孙 彬
hziee_sun at yahoo.com.cn
Tue May 15 09:12:47 CEST 2007
/*******************************************************************************
* flashDataExt - Extend Data.
* DESCRIPTION:
* Should be used only for FLASH CFI command sequence.
*
* Prepare the Data according to the Flash Width and Bus Width.
* If flash width = 2 and bus width = 1 data = 0x55 -> data = 0x55
* If flash width = 2 and bus width = 4 data = 0x55 -> data = 0x550055
* If flash width = 1 and bus width = 4 data = 0x55 -> data = 0x55555555
*
* INPUT:
* data - Data to be expended.
* pFlash - flash information.
*
* OUTPUT:
* None
*
* RETURN:
* MV_U32 - Data after extension.
* OxFFFFFFFF if pFlash is Null
*
*******************************************************************************/
MV_U32 flashDataExt( MV_FLASH_INFO *pFlash, MV_U32 data)
{
MV_U32 i;
if(NULL == pFlash)
return 0xFFFFFFFF;
for(i = 0; i < pFlash->busWidth ; i+= pFlash->devWidth)
{
data |= data << 8*i;
}
return data;
}
This is the code of flash initialization in u-boot,i am not sure what's use of the extend data.
regards
sun
---------------------------------
抢注雅虎免费邮箱3.5G容量,20M附件!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070515/baedd8bd/attachment.htm
More information about the U-Boot
mailing list