SectorInfo

来源:互联网 发布:人工智能 自动控制 编辑:程序博客网 时间:2024/05/17 02:14

This structure emulates the typical physical layout of the actual extra area of flash. The FAL portion of the NAND flash block driver supplied by Microsoft makes use of 8 bytes of the Sector Extra Info area. The file public/COMMON/oak/drivers/block/msflashfmd/inc/fmd.h has the SectorInfo definition:

typedef struct _SectorInfo{
   DWORD dwReserved1;
   BYTE bOEMReserved;
   BYTE bBadBlock;
   WORD wReserved2;
}SectorInfo, *PSectorInfo;
Members
dwReserved1
Reserved. Used by the FAL to hold the logical to physical sector mapping information.
bOEMReserved
For use by OEM. One of the following (2 bits are recognized by the FAL):
#define OEM_BLOCK_RESERVED 0x01
#define OEM_BLOCK_READONLY 0x02
Any sectors that the OEM does not want the FAL to touch should have both of these bits set. This includes the sectors including the boot loader and any other flash data that sits before the MBR. Note also that because only full blocks can be erased, all sectors within a block should have the same values for these fields.

bBadBlock
Indicates if block is BAD.
wReserved2
Reserved. Used by the FAL to maintain state information about the sector.
Remarks
The SectorInfo data structure was designed to emulate the typical physical layout of the actual extra area of flash. Specifically, most NAND flash manufacturers (Samsung and Toshiba most notably) set byte 5 (the 6th byte) to 0 to indicate if a block has shipped BAD from the factory.

The following is a typical representation of how the extra area is utilized:

- - - - - - - - - - - - - - - -

|R|R|R|R|O|V|R|R|E|E|E|E|E|E|E|E|

- - - - - - - - - - - - - - - -

The following table describes each element.

Element Description
R reserved bytes used by the FAL
O byte for use by the OEM
V byte indicating if the block is valid (a.k.a. bad)
E bytes typically used for by the FMD for ECC

See Also
TFAT on NAND for Smartphone

 

 

 

 

;plateform.reg----------
see HKEY_LOCAL_MACHINE/init
see if have  #include
see xipregion DEFAULT_REGISTRY
;-----------------------

in Bootloader:
see sectorinfo if write right

原创粉丝点击