[flashrom] [PATCH] Convert SPI block erase to multicommand

Jakob Bornecrantz wallbraker at gmail.com
Sun Jul 12 00:12:57 CEST 2009


On Sat, Jul 11, 2009 at 10:55 PM, Carl-Daniel
Hailfinger<c-d.hailfinger.devel.2006 at gmx.net> wrote:
> Convert SPI block erase to use the multicommand infrastructure.
>
> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Tested it on my EPIA-m700 and it worked nice. Also double checked that
one of the changed functions actually ran.

I do have one comment on the patch which is a really small comment but
I still would like to see fied, see below:

> Index: flashrom-spi_multicommand_blockerase/spi.c
> ===================================================================
> --- flashrom-spi_multicommand_blockerase/spi.c  (Revision 648)
> +++ flashrom-spi_multicommand_blockerase/spi.c  (Arbeitskopie)
> @@ -536,17 +536,30 @@
>
>  int spi_block_erase_52(struct flashchip *flash, unsigned int addr, unsigned int blocklen)
>  {
> -       unsigned char cmd[JEDEC_BE_52_OUTSIZE] = {JEDEC_BE_52, };
>        int result;
> +       struct spi_command spicommands[] = {
> +       {
> +               .writecnt       = JEDEC_WREN_OUTSIZE,
> +               .writearr       = (const unsigned char[]){ JEDEC_WREN },
> +               .readcnt        = 0,
> +               .readarr        = NULL,
> +       }, {
> +               .writecnt       = JEDEC_BE_52_OUTSIZE,
> +               .writearr       = (const unsigned char[]){ JEDEC_BE_52, (addr & 0x00ff0000) >> 16, (addr & 0x0000ff00) >> 8, (addr & 0x000000ff) },



More information about the flashrom mailing list