UnitSizeFactor of != 1 yet?
Vadim Khmelnitsky
VadimK at m-sys.com
Thu Mar 14 18:27:24 EST 2002
Here is how VirtualUnitSize calculated by dformat for DOC2000 or Millennium.
/*originally virtual unit size is equal to erasable unit size*/
unitSizeBits = erasableBlockSizeBits;
/*Calculate No of erasable units on the diskonchip*/
noOfUnits = (unsigned short)(noOfChips /*No of flash devices */ * chipSize
/* size of each flash device */) >>unitSizeBits);
/* Adjust virtual unit size so Media header with BBT fit in one virtual
unit */
while (noOfUnits + SECTOR_SIZE > (1UL << unitSizeBits)) {
unitSizeBits++;
noOfUnits >>= 1;
}
/* Bound number of units to find room in 64 Kbytes Segment */
if( (noOfUnits >= MAX_UNIT_NUM) && (unitSizeBits < MAX_UNIT_SIZE_BITS) ) {
unitSizeBits++;
noOfUnits >>= 1;
} ,
where MAX_UNIT_NUM = 12KB and MAX_UNIT_SIZE_BITS = 15 .
Vadim
-----Original Message-----
From: David Woodhouse [mailto:dwmw2 at infradead.org]
Sent: Tue, March 12, 2002 5:14 PM
To: Mark Meade
Cc: Vadim Khmelnitsky; linux-mtd at lists.infradead.org
Subject: Re: UnitSizeFactor of != 1 yet?
mark at lakeshoremicro.com said:
> Yes, that was the message I got with the latest cvs code, after
> relocating the ReplUnitTable assignment.
> Just to make sure I didn't have something else screwed up, I went back
> to the source in 2.4.18, and added a printk of the UnitSizeFactor. In
> that case, it also said 0.
Eep. OK, if you put a check in just before we deal with UnitSizeFactor,
setting it to 0xFF if it was 0x00 - does that make it work? Don't break the
memcmp with the later MediaHeader - use a local variable of something.
Vadim, is this expected? Is a UnitSizeFactor of zero _always_ going to mean
that the Virtual Unit size matches the physical unit size?
--
dwmw2
More information about the linux-mtd
mailing list