Beruflich Dokumente
Kultur Dokumente
re-write
write
write
write
write
write
write
X
Eraseblock, 128K
MTD device
MDT device vs Block device
105 erasures.
Drawbacks of MTD partitions
MTD partitions are static now way to change them on-flight
Do not provide wear-leveling for the whole chip
JFFS2
Partition 1 Bad blocks
Partition 2
UBI overview
UBI layer
UBI layer
MTD layer
Physical flash
Logical Volumes
Volume A Volume
Volume
B B Volume C Volume C
Re-size
Delete
Re-size
Create
UBI
volume
and UBI
so volume
onvolume
C
volumeB toto10
B
C
A 40
- logical
logical
size 20eraseblocks
15
10 eraseblock
logical eraseblocks
JFFS2
Advantages of UBI
erase
write
read
Return 0xFFs
StaticVolume
read-only
A data Volume B
UBI layer
PEB 0 PEB 1 PEB 2 PEB 3 PEB 4 PEB 5 PEB 6 PEB 7 PEB 8 PEB 9 PEB 10
Re-map LEB
Move data
Low erase counter
MTD High
device
erase counter
Bad eraseblocks handling
UBI volumes are devoid of bad eraseblocks
UBI does proper error recovery transparently
An UBI volume
Re-map
Write the LEBdata
newcoming to this
to PEB
this PEB
MarkPartially filled
this PEB s bad Bad physical Empty physical
No panic!
Write Recover
error! the data tobecome
The eraseblock
physical eraseblocks a good PEB
bad! eraseblock Eraseblock
UBI interfaces
UBI character devices:
1. /dev/ubi0, /dev/ubi1, UBI devices: volume create, delete,
delete re-size,
re-size
and get device description operations
2. /dev/ubi0_0, /dev/ubi0_1, - UBI volumes: read,
read write,
write update,
update and
get volume description operations
UBI sysfs interface: /sys/class/ubi
UBI in-kernel interface: include/linux/mtd/ubi.h
Volume update operation
Useful for software updates
Volume is in corrupted
corrupted state if update is interrupted
Corrupted volumes are not usable and must be updated
Static and dynamic UBI volumes
Dynamic volumes are read-write
Static volumes are read-only
Static volumes are protected by CRC-32 checksum