Linux BBT 结构

NewSTO NAND Flash BBT Specification

1.    Location

Then whole NAND is partitioned as below table.

 

      Block

Offset

Description

Size

Dec

Hex

0

0x0000000

RESERVED for NAND booting

128K

0x20000

1

0x0020000

RESERVED for NAND booting

128K

0x20000

2

0x0040000

RESERVED for NAND booting

128K

0x20000

3

0x0060000

RESERVED for NAND booting

128K

0x20000

4 - 29

0x0080000

BOOTLOADER secured area

3.2M

0x340000

30 - 53

0x03C0000

BOOT DATA secured area

3M

0x300000

54 - 75

0x06C0000

RAW DATA secured area

2.8M

0x2C0000

76 - 111

0x0980000

File system containing Linux Kernel and static file system in one single file

4.5M

0x480000

112 - 249

0x0E00000

Root file system

17.25M

0x1140000

250 - 537

0x1F40000

Runtime File system

36M

0x2400000

538 - 999

0x4340000

User data File system

57.75M

0x39C0000

1000 - 1023

0x7D00000

Bad block table

3M

0x300000

 

The BBT is aligned withlinux BBT specification.

Block 1000~1023 is reservedfor storing BBT. The BBT is stored in last block of NAND chip. There are twoBBTs in total: one primary BBT and one mirror BBT.

Usually primary BBT isstored in block 1023. Mirror BBT is stored in block 1022. If block 1023 or 1022is bad, BBT should be stored in 1021,1020, etc.   Generally speaking, find good blocks inreverse order from 1023 to 1000.

2.  Structure

Every block consumes 2 bitsto indicate whether it is bad.

Good Block

2’b11

Bad Block

2’b10

All the 1024 blocks need a256 bytes table in total.  Every BBT has identificationand a version number in corresponding OOB area.

The identification is storedin byte 8~11 area of oob area. The version number is stored in byte 12 of oobarea.

Their identification isshown as below table.

Primary BBT

Bbt0

Mirror BBT

1tbB

The version number is increased1 by nand flash driver after every update. For initial creation please set thisversion number to 1.

 

3. Example

 

Suppose all nand blocks are good except block 1.  The first byte of BBT should be 0xfb. That is11111011 in binarary code. Indicate block 1 is bad.


The content of BBTdata area


Primary BBT’s oobarea


Mirror BBT’s oob area

4. ECC consideration

For imagine hardware ECC is enabled in NAND driver.  So offline nand write should adopt the sameecc checksum algorithm as driver does. The ecc’s layout of NAND is shown asbelow. Note that only offset 8, 24, 40, 56 are valid.


 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值