partitions and erase regions

Kári Davíðsson kd at flaga.is
Fri Mar 30 17:56:46 EST 2001



> -----Original Message-----
> From: Nicolas Pitre [mailto:nico at cam.org]
> Sent: 30. mars 2001 17:53
> To: Kári Davíðsson
> Cc: mtd at infradead.org
> Subject: RE: partitions and erase regions
> 
> 
> 
> 
> On Fri, 30 Mar 2001, Kári Davíðsson wrote:
> 
> > Since there was no protest I just went ahead and commited 
> the "virtual"
> > erase region
> > patch to mtdpart.
> 
> Sorry, I apparently missed your original post.
> 
> > > Hi,
> > >
> > > I am implementing a "virtual" erase regions for partitions.
> > > It looks to me that should be enough to create them in
> > > add_mtd_partition().
> > >
> > > This would make it easyer to manage partitions that cross 
> erase region
> > > boundaries.

For my chip I have to fit bootrom in the first 0x20000 kb.
The first 0x10000 are 8 0x2000 sized sectors while the next 0x10000 
is one sector of size 0x10000. Because of the "stupid" way of reporting
the chip with only one sectorsize (mtd.erasesize) I am  unable to erase
and otherwaise manage this part of the chip.
The natural solution to me is to make the first part of the chip a
partition
with two erase regions, i.e. the first with erase size 0x2000 and 8
sectors
and the next with erase size 0x10000 and 1 sector.

> 
> Why do you want to have partitions that cross erase region in 
> the first
> place?

Well for the reason above. I do not have much chance.

> 
> The primary goal of partitions is to easily _preserve_ some 
> parts of the
> flash while allowing free access to others.  If a writable, 
> ence eraseable,

I am not giving that up.

> partition can start/end up in the middle of an erase region, you will
> potentially trash part of a contigous partition that was ment to be
> read-only.  Even if you preserve the erased content of the contigous
> partition to write it back afterwards, you still have the 
> risk of a power
> failure at the right time that would rander your read-only partition
> corrupted.
> 
> 
> Nicolas

What I think people are misundrestanding something here.

I am not making up erase regions of arbitrary size, but rather make 
the slave->mtd (in mtdpart.c) reflect what sectors and sizes are part
of the partition through erase regions. These "virtual" regions will
always have the same boundaries as the physical sectors and same 
erase size as the physical erase regions but the number of sectors in
each erase region is different from the physical number.

Regards,

K.D.

> 
> 
> 
> To unsubscribe, send "unsubscribe mtd" to majordomo at infradead.org
> 


To unsubscribe, send "unsubscribe mtd" to majordomo at infradead.org



More information about the linux-mtd mailing list