Skip to contentSkip to conversation

m28w640fst flash: quarduple words write method

DISCUSSION Dmitry 1 participant 1 message Jan 18, 2007 Memory technology devices (MTD)

lore
Share & tools
lore

Dmitry

author
#0 lore raw

Hi, All

Kernel: linux-sh4-2.6.11.12_stm20-33
flash:  m28w640fst

This flash is CFI compatible, but it doesn't support buffer write method (CFI command - 0xe8). Flash support single (CFI command - 0x10 or 0x40), double (CFI command - 0x30) and quadruple (CFI command - 0x56) words write method. MTD supports only single word write method for this flash.
I have implemented double words write method. It works fine.
But I have problem with quadruple word write method implementation.

Part of function:
static int __xipram do_write_quadrupleword(
struct map_info *map,
struct flchip *chip,
unsigned long adr,
const u_char *buf,
int len)
{
<...skip...>

        XIP_INVAL_CACHED_RANGE(map, adr, map_bankwidth(map));
        ENABLE_VPP(map);
        xip_disable(map, chip, adr);
        map_write(map, CMD(0x56), adr);

        datum = map_word_ff(map);

        datum = map_word_load(map, buf);
        map_write(map, datum, adr);

        datum = map_word_load(map, buf+2);
        map_write(map, datum, adr+2);

        datum = map_word_load(map, buf+4);
        map_write(map, datum, adr+4);

        datum = map_word_load(map, buf+6);
        map_write(map, datum, adr+6);

        map_write(map,CMD(0x70),adr);
        status = map_read(map, adr);
        printk("--> %s: status %X\n", __FUNCTION__, status);

<...skip...>

Several fist status is 0x80 ('OK'), then function gets status 0x92 ('Program Error' and 'Program/Erase on protected Block, Abort').

Does anybody implement this write method or know what wrong? Thank you.