erase questions
Hi!
I have a couple of questions about mtd_info->erase which isn't covered in the MTD API:
From the MTD API docs, it seems the erase function can only be called erase_info->len == mtd->erasesize. This is obviously not true anymore since there can be multiple erase regions with multiple erase sizes and the user might request an erase on one of the smaller blocks.
So can I assume that I only have to deal (read: allow) with erases where erase_info->addr == START_OF_SOME_BLOCK and erase_info->len == LENGTH_OF_THAT_BLOCK?
So basically it boils down to 2 questions. Is ->addr always equal to the start of a block and is ->len always equal to the size of that block or may ->len span multiple blocks.
If ->len may span multiple blocks, must it be equal to the size of all the blocks (e.g. if you we're to erase a 2x 4k + 3x 8k consecutive blocks, must len be equal to 32k)?
Signature · 15 lines
Regards Abraham Reading is to the mind what exercise is to the body. __________________________________________________________ Abraham vd Merwe - 2d3D, Inc. Device Driver Development, Outsourcing, Embedded Systems Cell: +27 82 565 4451 Snailmail: Tel: +27 21 761 7549 Block C, Antree Park Fax: +27 21 761 7648 Doncaster Road Email: [email protected] Kenilworth, 7700 Http: http://www.2d3d.com South Africa
Quoted 3 lines · [email protected] said:
If ->len may span multiple blocks, must it be equal to the size of
all the blocks (e.g. if you we're to erase a 2x 4k + 3x 8k consecutive blocks, must len be equal to 32k)?
The only constraints are that both <start> and <start+len> must be aligned with erase block boundaries.
If you have a chip with 8*8K erase blocks followed by 15*64K erase blocks, then an erase of length 72K at offset 56K is permitted - you'd erase the last of the small blocks and the first of the big blocks.
--
dwmw2