On 19.01.2010 09:01, Sean Nelson wrote:
This should be the last-last revision of this patch.
Convert ST to block erasers: ST M25P05-A ST M25P05.RES ST M25P10-A ST M25P10.RES ST M25P20 ST M25P40 ST M25P40-old ST M25P80 ST M25P16 ST M25P32 ST M25P64 ST M25P128 ST M29F002B ST M29F002T/NT ST M29F040B ST M29F400BT ST M29W010B ST M29W040B ST M50FLW040A ST M50FLW040B ST M50FLW080A ST M50FLW080B ST M50FW002 ST M50FW016 ST M50FW040 ST M50FW080 ST M50LPW116
Add erase_chip_stm50flw0x0x to stm50flw0x0x.c Add copyright to stm50flw0x0x.c Fix block sizes and counts Omit M50FLW0x0x mixed sector/block eraser Convert the used 82802ab functions to their stm50flw0x0x equivalents Fix incorrect sizes as found by Carl-Daniel. Add back M50FLW0x0x mixed sector/block eraser sans function pointer.
Signed-off-by: Sean Nelson audiohacked@gmail.com
Acked-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
{ .vendor = "ST", .name = "M50FLW040A", .bustype = CHIP_BUSTYPE_FWH|CHIP_BUSTYPE_LPC, /* A/A Mux */ .manufacture_id = ST_ID, .model_id = ST_M50FLW040A, .total_size = 512, .page_size = 64 * 1024, .feature_bits = FEATURE_REGISTERMAP, .tested = TEST_UNTESTED, .probe = probe_jedec, .probe_timing = TIMING_FIXME,
.erase = erase_stm50flw0x0x,
.erase = NULL,
.block_erasers =
{
{
.eraseblocks = {
{4 * 1024, 16}, /* sector */
{64 * 1024, 5}, /* block */
{4 * 1024, 16}, /* sector */
{4 * 1024, 16}, /* sector */
},
.block_erase = NULL,
Not exactly what I had in mind (I thought about specifying the function and not the blocks), but flashrom can deal with this as well.
It might be a good idea to change the line
{64 * 1024, 5},
to
{320 * 1024, -1},
once flashrom can deal with negative sizes and interpret them as "function does not apply to this area". Or we create a special erase function which does different things based on eraseblock size/location.
Your code is OK right now (please don't follow my suggestion right now), and I just wanted to discuss further development options.
}, {
.eraseblocks = { {64 * 1024, 8}, },
.block_erase = erase_block_stm50flw0x0x,
}, {
.eraseblocks = { {512 * 1024, 1} },
.block_erase = erase_chip_stm50flw0x0x,
}
.write = write_stm50flw0x0x, .read = read_memmapped, },},
Regards, Carl-Daniel