[flashrom] [PATCH] Convert chips to block erasers: SST

Michael Karcher flashrom at mkarcher.dialup.fu-berlin.de
Wed Jan 20 13:46:22 CET 2010


Am Mittwoch, den 20.01.2010, 03:55 -0800 schrieb Sean Nelson:
> On 1/20/10 2:16 AM, Michael Karcher wrote:
> >> + .block_erasers =
> >> + {
> >> + {
> >> + .eraseblocks = { {4 * 1024, 64} },
> >> + .block_erase = erase_sector_jedec,
> >> + }, {
> >> + .eraseblocks = { {16 * 1024, 16} },
> >> + .block_erase = erase_block_jedec,
> >> + }, {
> >> + .eraseblocks = { {256 * 1024, 1} },
> >> + .block_erase = erase_chip_block_jedec,
> >> + }
> >> + },
> > This chip supports erase_chip only in A/A mux mode (although the
> > datasheet calls it "parallel". Do we really want to have that listed?
> > This also applies to:
> I don't think we can determine if the chip is in LPC or A/A mux mode.
Is there *any* available chipset that uses A/A mux? I think this mode is
only usable by external programmers, and I also don't think that
flashrom is supporting any external programmer that does A/A mux.

> >> + .block_erasers =
> >> + {
> >> + {
> >> + .eraseblocks = { {4 * 1024, 512} },
> >> + .block_erase = erase_sector_49lfxxxc,
> >> + }, {
> >> + .eraseblocks = {
> >> + {64 * 1024, 31},
> >> + {32 * 1024, 1},
> >> + {8 * 1024, 2},
> >> + {16 * 1024, 1},
> >> + },
> >> + .block_erase = erase_block_49lfxxxc,
> >> + }, {
> >> + .eraseblocks = { {2 * 1024 * 1024, 1} },
> >> + .block_erase = erase_chip_49lfxxxc,
> >> + }
> >> + },
> > erase_chip_49lfxxxc is just calling erase_sector_49lfxxxc. No need to
> > add it as chip erase function.
> erase_chip_49lfxxc is needed to convert to block_eraser(struct flashrom 
> *flash, unsigned int addr, unsigned int size),
> its also needed because of unlocking.

Right. So erase_sector_49lfxxxc and your new erase_block_49lfxxxc don't
work if you don't unlock beforehands. You might try sector erase anyway
(the chip could be unlocked already), but I would add unlocking stuff
into erase_block_49lfxxxc, as unlocking is done on block level. As the
chip-erase has to be emulated by walking either sectors or blocks, I
don't see the point of doing the walk yourself if the generic eraseblock
walker we are trying to use does exactly that. And after adding
blockwise unlock to erase_block_49lfxxxc, you don't need the unlocking
part of erase_49lfxxxc anymore.

And then you can also kill erase_49lfxxxc completely.

Regards,
  Michael Karcher





More information about the flashrom mailing list