Linux BBT 结构

linux内核 专栏收录该内容
3 篇文章 0 订阅

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
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值