From: =?gb2312?q?=CB=EF=20=B1=F2?= Date: Tue, 15 May 2007 15:12:47 +0800 (CST) Subject: [U-Boot-Users] about "flash extend data" Message-ID: <543552.25247.qm@web15605.mail.cnb.yahoo.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de /******************************************************************************* * 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